#line 2 "src/scan-gram.c"
#line 4 "src/scan-gram.c"
#define YY_INT_ALIGNED short int
/* A lexical scanner generated by flex */
/* %not-for-header */
/* %if-c-only */
/* %if-not-reentrant */
#define yy_create_buffer gram__create_buffer
#define yy_delete_buffer gram__delete_buffer
#define yy_flex_debug gram__flex_debug
#define yy_init_buffer gram__init_buffer
#define yy_flush_buffer gram__flush_buffer
#define yy_load_buffer_state gram__load_buffer_state
#define yy_switch_to_buffer gram__switch_to_buffer
#define yyin gram_in
#define yyleng gram_leng
#define yylex gram_lex
#define yylineno gram_lineno
#define yyout gram_out
#define yyrestart gram_restart
#define yytext gram_text
#define yywrap gram_wrap
#define yyalloc gram_alloc
#define yyrealloc gram_realloc
#define yyfree gram_free
/* %endif */
/* %endif */
/* %ok-for-header */
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 37
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
/* %if-c++-only */
/* %endif */
/* %if-c-only */
/* %endif */
/* %if-c-only */
/* %endif */
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
/* %if-c-only */
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
/* %endif */
/* %if-tables-serialization */
/* %endif */
/* end standard C headers. */
/* %if-c-or-c++ */
/* flex integer type definitions */
#ifndef FLEXINT_H
#define FLEXINT_H
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
* if you want the limit (max/min) macros for int types.
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
#endif
#include <inttypes.h>
typedef int8_t flex_int8_t;
typedef uint8_t flex_uint8_t;
typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
/* Limits of integral types. */
#ifndef INT8_MIN
#define INT8_MIN (-128)
#endif
#ifndef INT16_MIN
#define INT16_MIN (-32767-1)
#endif
#ifndef INT32_MIN
#define INT32_MIN (-2147483647-1)
#endif
#ifndef INT8_MAX
#define INT8_MAX (127)
#endif
#ifndef INT16_MAX
#define INT16_MAX (32767)
#endif
#ifndef INT32_MAX
#define INT32_MAX (2147483647)
#endif
#ifndef UINT8_MAX
#define UINT8_MAX (255U)
#endif
#ifndef UINT16_MAX
#define UINT16_MAX (65535U)
#endif
#ifndef UINT32_MAX
#define UINT32_MAX (4294967295U)
#endif
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
/* %endif */
/* %if-c++-only */
/* %endif */
#ifdef __cplusplus
/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST
#else /* ! __cplusplus */
/* C99 requires __STDC__ to be defined as 1. */
#if defined (__STDC__)
#define YY_USE_CONST
#endif /* defined (__STDC__) */
#endif /* ! __cplusplus */
#ifdef YY_USE_CONST
#define yyconst const
#else
#define yyconst
#endif
/* %not-for-header */
/* Returned upon end-of-file. */
#define YY_NULL 0
/* %ok-for-header */
/* %not-for-header */
/* Promotes a possibly negative, possibly signed char to an unsigned
* integer for use as an array index. If the signed char is negative,
* we want to instead treat it as an 8-bit unsigned char, hence the
* double cast.
*/
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
/* %ok-for-header */
/* %if-reentrant */
/* %endif */
/* %if-not-reentrant */
/* %endif */
/* Enter a start condition. This macro really ought to take a parameter,
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN.
*/
#define BEGIN (yy_start) = 1 + 2 *
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
#define YY_START (((yy_start) - 1) / 2)
#define YYSTATE YY_START
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
/* Special action meaning "start processing a new file". */
#define YY_NEW_FILE gram_restart(gram_in )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
#define YY_BUF_SIZE 16384
#endif
/* The state buf must be large enough to hold one state per character in the main buffer.
*/
#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
#define YY_TYPEDEF_YY_BUFFER_STATE
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif
/* %if-not-reentrant */
extern yy_size_t gram_leng;
/* %endif */
/* %if-c-only */
/* %if-not-reentrant */
extern FILE *gram_in, *gram_out;
/* %endif */
/* %endif */
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
#define YY_LESS_LINENO(n)
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
{ \
/* Undo effects of setting up gram_text. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
*yy_cp = (yy_hold_char); \
YY_RESTORE_YY_MORE_OFFSET \
(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
YY_DO_BEFORE_ACTION; /* set up gram_text again */ \
} \
while ( 0 )
#define unput(c) yyunput( c, (yytext_ptr) )
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
{
/* %if-c-only */
FILE *yy_input_file;
/* %endif */
/* %if-c++-only */
/* %endif */
char *yy_ch_buf; /* input buffer */
char *yy_buf_pos; /* current position in input buffer */
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
yy_size_t yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
yy_size_t yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
* delete it.
*/
int yy_is_our_buffer;
/* Whether this is an "interactive" input source; if so, and
* if we're using stdio for input, then we want to use getc()
* instead of fread(), to make sure we stop fetching input after
* each newline.
*/
int yy_is_interactive;
/* Whether we're considered to be at the beginning of a line.
* If so, '^' rules will be active on the next match, otherwise
* not.
*/
int yy_at_bol;
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
int yy_fill_buffer;
int yy_buffer_status;
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
/* When an EOF's been seen but there's still some text to process
* then we mark the buffer as YY_EOF_PENDING, to indicate that we
* shouldn't try reading from the input source any more. We might
* still have a bunch of tokens to match, though, because of
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
* (via gram_restart()), so that the user can continue scanning by
* just pointing gram_in at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
/* %if-c-only Standard (non-C++) definition */
/* %not-for-header */
/* %if-not-reentrant */
/* Stack of input buffers. */
static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
/* %endif */
/* %ok-for-header */
/* %endif */
/* We provide macros for accessing buffer states in case in the
* future we want to put the buffer states in a more general
* "scanner state".
*
* Returns the top of the stack, or NULL.
*/
#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
? (yy_buffer_stack)[(yy_buffer_stack_top)] \
: NULL)
/* Same as previous macro, but useful when we know that the buffer stack is not
* NULL or when we need an lvalue. For internal use only.
*/
#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
/* %if-c-only Standard (non-C++) definition */
/* %if-not-reentrant */
/* %not-for-header */
/* yy_hold_char holds the character lost when gram_text is formed. */
static char yy_hold_char;
static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
yy_size_t gram_leng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
static int yy_init = 0; /* whether we need to initialize */
static int yy_start = 0; /* start state number */
/* Flag which is used to allow gram_wrap()'s to do buffer switches
* instead of setting up a fresh gram_in. A bit of a hack ...
*/
static int yy_did_buffer_switch_on_eof;
/* %ok-for-header */
/* %endif */
void gram_restart (FILE *input_file );
void gram__switch_to_buffer (YY_BUFFER_STATE new_buffer );
YY_BUFFER_STATE gram__create_buffer (FILE *file,int size );
void gram__delete_buffer (YY_BUFFER_STATE b );
void gram__flush_buffer (YY_BUFFER_STATE b );
void gram_push_buffer_state (YY_BUFFER_STATE new_buffer );
void gram_pop_buffer_state (void );
static void gram_ensure_buffer_stack (void );
static void gram__load_buffer_state (void );
static void gram__init_buffer (YY_BUFFER_STATE b,FILE *file );
#define YY_FLUSH_BUFFER gram__flush_buffer(YY_CURRENT_BUFFER )
YY_BUFFER_STATE gram__scan_buffer (char *base,yy_size_t size );
YY_BUFFER_STATE gram__scan_string (yyconst char *yy_str );
YY_BUFFER_STATE gram__scan_bytes (yyconst char *bytes,yy_size_t len );
/* %endif */
void *gram_alloc (yy_size_t );
void *gram_realloc (void *,yy_size_t );
void gram_free (void * );
#define yy_new_buffer gram__create_buffer
#define yy_set_interactive(is_interactive) \
{ \
if ( ! YY_CURRENT_BUFFER ){ \
gram_ensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \
gram__create_buffer(gram_in,YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
#define yy_set_bol(at_bol) \
{ \
if ( ! YY_CURRENT_BUFFER ){\
gram_ensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \
gram__create_buffer(gram_in,YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
/* %% [1.0] gram_text/gram_in/gram_out/yy_state_type/gram_lineno etc. def's & init go here */
/* Begin user sect3 */
#define gram_wrap() 1
#define YY_SKIP_YYWRAP
#define FLEX_DEBUG
typedef unsigned char YY_CHAR;
FILE *gram_in = (FILE *) 0, *gram_out = (FILE *) 0;
typedef int yy_state_type;
extern int gram_lineno;
int gram_lineno = 1;
extern char *gram_text;
#define yytext_ptr gram_text
/* %if-c-only Standard (non-C++) definition */
static yy_state_type yy_get_previous_state (void );
static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
static int yy_get_next_buffer (void );
static void yy_fatal_error (yyconst char msg[] );
/* %endif */
/* Done after the current pattern has been matched and before the
* corresponding action - sets up gram_text.
*/
#define YY_DO_BEFORE_ACTION \
(yytext_ptr) = yy_bp; \
/* %% [2.0] code to fiddle gram_text and gram_leng for yymore() goes here \ */\
gram_leng = (size_t) (yy_cp - yy_bp); \
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
/* %% [3.0] code to copy yytext_ptr to gram_text[] goes here, if %array \ */\
(yy_c_buf_p) = yy_cp;
/* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
#define YY_NUM_RULES 130
#define YY_END_OF_BUFFER 131
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
{
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
static yyconst flex_int16_t yy_accept[579] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 93, 93, 113, 113, 113, 113, 0, 0,
0, 0, 131, 80, 2, 2, 71, 80, 70, 80,
1, 66, 80, 67, 67, 65, 77, 63, 66, 79,
73, 64, 80, 90, 90, 128, 95, 94, 128, 81,
97, 96, 84, 2, 1, 84, 83, 82, 84, 99,
99, 100, 98, 81, 129, 119, 128, 118, 128, 128,
128, 122, 125, 126, 128, 92, 128, 117, 116, 128,
115, 114, 87, 2, 1, 85, 87, 87, 86, 87,
88, 2, 1, 88, 88, 80, 78, 62, 0, 62,
62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
62, 62, 62, 62, 62, 62, 62, 72, 66, 66,
4, 3, 69, 67, 69, 0, 76, 0, 89, 112,
110, 101, 112, 103, 104, 105, 106, 107, 108, 112,
109, 112, 99, 99, 100, 127, 120, 121, 0, 123,
0, 122, 124, 0, 91, 0, 0, 93, 113, 113,
113, 113, 87, 85, 62, 0, 74, 62, 62, 62,
62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
62, 62, 62, 62, 62, 62, 62, 62, 3, 69,
68, 75, 0, 101, 0, 0, 102, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
62, 62, 62, 62, 62, 62, 62, 62, 0, 101,
0, 0, 62, 7, 62, 62, 62, 62, 62, 62,
62, 62, 62, 62, 62, 62, 62, 23, 62, 62,
62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
62, 62, 36, 62, 62, 62, 62, 62, 62, 44,
62, 47, 62, 62, 50, 0, 0, 0, 62, 8,
62, 62, 62, 13, 14, 62, 62, 62, 62, 62,
62, 62, 62, 62, 26, 62, 62, 62, 62, 62,
62, 62, 62, 32, 62, 34, 62, 62, 62, 62,
62, 62, 41, 62, 43, 45, 48, 62, 0, 0,
111, 6, 62, 10, 62, 62, 62, 16, 62, 62,
62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
62, 62, 62, 62, 33, 62, 62, 62, 62, 62,
62, 62, 62, 62, 62, 0, 62, 11, 62, 62,
62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
62, 62, 62, 62, 62, 62, 62, 62, 62, 0,
59, 62, 62, 38, 62, 62, 40, 62, 62, 62,
49, 5, 0, 62, 62, 62, 62, 62, 62, 62,
62, 62, 62, 62, 62, 22, 62, 62, 62, 62,
62, 29, 62, 58, 30, 62, 62, 62, 62, 62,
42, 62, 62, 0, 62, 62, 62, 62, 62, 17,
53, 62, 62, 62, 62, 62, 24, 25, 62, 62,
62, 62, 62, 62, 62, 62, 62, 62, 62, 0,
0, 62, 62, 12, 62, 62, 62, 62, 62, 21,
62, 62, 62, 62, 62, 62, 62, 37, 62, 62,
62, 62, 62, 62, 62, 62, 18, 62, 62, 62,
27, 56, 62, 62, 62, 35, 39, 60, 46, 61,
9, 51, 62, 62, 0, 54, 62, 62, 62, 0,
56, 62, 62, 62, 15, 52, 62, 62, 62, 62,
62, 62, 62, 62, 20, 62, 62, 62, 62, 62,
28, 57, 62, 62, 62, 62, 62, 62, 62, 19,
55, 62, 62, 62, 62, 62, 31, 0
} ;
static yyconst flex_int32_t yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
2, 2, 4, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 5, 1, 6, 7, 1, 8, 1, 9, 1,
1, 10, 1, 11, 12, 13, 14, 15, 16, 16,
16, 16, 16, 16, 16, 17, 17, 18, 19, 20,
21, 22, 23, 1, 24, 24, 24, 24, 24, 24,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
25, 25, 25, 25, 26, 25, 25, 27, 25, 25,
28, 29, 30, 1, 31, 1, 32, 33, 34, 35,
36, 37, 38, 39, 40, 25, 41, 42, 43, 44,
45, 46, 47, 48, 49, 50, 51, 52, 25, 53,
54, 25, 55, 56, 57, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1
} ;
static yyconst flex_int32_t yy_meta[59] =
{ 0,
1, 2, 3, 1, 2, 4, 1, 4, 4, 4,
4, 5, 6, 2, 7, 7, 7, 1, 4, 8,
4, 8, 1, 7, 9, 9, 9, 10, 1, 11,
9, 7, 7, 7, 7, 7, 7, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 4, 4, 4, 1
} ;
static yyconst flex_int16_t yy_base[605] =
{ 0,
0, 1001, 997, 996, 56, 57, 58, 61, 63, 90,
76, 87, 70, 97, 117, 121, 66, 130, 140, 144,
79, 107, 99, 109, 153, 159, 148, 152, 201, 998,
182, 258, 1004, 0, 1009, 1009, 1009, 265, 1009, 1009,
1009, 320, 153, 313, 153, 1009, 61, 1009, 330, 1009,
1009, 1009, 961, 1009, 988, 1009, 1009, 1009, 383, 1009,
1009, 1009, 1009, 1009, 1009, 161, 1009, 1009, 959, 988,
110, 979, 1009, 986, 1009, 1009, 940, 1009, 169, 144,
254, 1009, 1009, 1009, 250, 1009, 187, 1009, 1009, 265,
1009, 1009, 0, 1009, 0, 0, 261, 1009, 1009, 954,
1009, 1009, 1009, 266, 953, 0, 1009, 0, 320, 954,
948, 241, 293, 952, 949, 946, 250, 953, 294, 937,
303, 245, 150, 311, 943, 950, 953, 1009, 436, 0,
1009, 0, 0, 346, 480, 962, 1009, 943, 1009, 1009,
1009, 342, 0, 1009, 1009, 1009, 1009, 1009, 1009, 0,
1009, 0, 970, 330, 961, 1009, 1009, 1009, 365, 1009,
369, 1009, 1009, 374, 1009, 378, 382, 951, 1009, 388,
950, 392, 0, 0, 0, 398, 1009, 934, 942, 374,
928, 929, 926, 927, 360, 924, 931, 926, 368, 935,
920, 924, 398, 930, 915, 916, 333, 915, 915, 923,
924, 927, 910, 916, 910, 915, 906, 919, 0, 0,
0, 1009, 908, 402, 0, 0, 0, 423, 431, 453,
410, 459, 443, 465, 390, 471, 475, 479, 483, 379,
919, 914, 898, 81, 898, 911, 896, 900, 908, 907,
906, 929, 890, 901, 888, 925, 904, 897, 898, 415,
448, 412, 885, 886, 420, 897, 886, 893, 877, 888,
884, 877, 881, 887, 886, 876, 887, 885, 882, 1009,
0, 0, 869, 0, 878, 864, 870, 865, 878, 857,
862, 875, 896, 872, 860, 865, 853, 0, 857, 852,
865, 333, 864, 859, 862, 857, 847, 859, 851, 842,
849, 855, 854, 839, 467, 848, 837, 850, 835, 0,
840, 0, 839, 837, 0, 876, 0, 0, 826, 0,
837, 842, 826, 0, 0, 475, 826, 829, 477, 842,
841, 840, 839, 830, 0, 823, 822, 830, 822, 828,
820, 814, 812, 0, 811, 0, 848, 824, 822, 811,
810, 807, 0, 804, 0, 479, 0, 804, 484, 0,
1009, 0, 802, 802, 816, 797, 796, 480, 799, 801,
800, 796, 801, 804, 793, 795, 791, 790, 805, 800,
803, 798, 788, 796, 516, 785, 794, 781, 796, 795,
790, 780, 774, 773, 786, 519, 495, 0, 771, 784,
783, 770, 769, 780, 764, 763, 764, 800, 775, 778,
765, 772, 771, 755, 756, 753, 754, 768, 753, 525,
1009, 768, 755, 0, 750, 749, 0, 752, 763, 762,
0, 1009, 787, 746, 745, 745, 741, 740, 739, 738,
748, 734, 733, 746, 749, 0, 737, 730, 741, 740,
734, 0, 733, 0, 0, 731, 725, 738, 722, 721,
0, 736, 735, 761, 718, 717, 716, 730, 729, 0,
0, 721, 714, 713, 710, 723, 0, 0, 716, 715,
704, 703, 712, 719, 714, 705, 701, 683, 679, 710,
499, 675, 673, 0, 663, 660, 651, 639, 619, 0,
616, 611, 607, 511, 513, 615, 615, 0, 607, 606,
617, 616, 615, 614, 598, 540, 536, 538, 537, 546,
545, 549, 539, 538, 543, 0, 0, 0, 0, 0,
0, 0, 546, 545, 556, 1009, 531, 533, 535, 569,
1009, 531, 530, 527, 0, 0, 538, 532, 524, 531,
529, 513, 516, 515, 0, 499, 498, 491, 467, 461,
0, 0, 459, 439, 435, 434, 389, 381, 378, 0,
0, 390, 366, 347, 350, 307, 0, 1009, 590, 601,
612, 623, 634, 645, 656, 662, 671, 682, 693, 702,
708, 713, 722, 729, 286, 277, 259, 187, 179, 173,
135, 133, 87, 738
} ;
static yyconst flex_int16_t yy_def[605] =
{ 0,
578, 1, 579, 579, 580, 580, 580, 580, 581, 581,
582, 582, 580, 580, 580, 580, 580, 580, 580, 580,
580, 580, 580, 580, 580, 580, 580, 580, 578, 29,
583, 583, 578, 584, 578, 578, 578, 578, 578, 578,
578, 585, 578, 586, 586, 578, 578, 578, 585, 578,
578, 578, 584, 578, 578, 578, 578, 578, 587, 578,
578, 578, 578, 578, 578, 578, 578, 578, 578, 588,
588, 578, 578, 588, 578, 578, 578, 578, 578, 578,
578, 578, 578, 578, 578, 578, 578, 578, 578, 589,
578, 578, 590, 578, 590, 591, 578, 578, 578, 590,
578, 578, 578, 578, 578, 584, 578, 592, 578, 592,
592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 578, 585, 49,
578, 593, 594, 586, 594, 578, 578, 578, 578, 578,
578, 578, 595, 578, 578, 578, 578, 578, 578, 596,
578, 597, 588, 588, 578, 578, 578, 578, 578, 578,
578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
578, 578, 590, 591, 592, 578, 578, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 593, 594,
135, 578, 578, 578, 598, 599, 597, 578, 578, 578,
578, 578, 578, 578, 578, 578, 578, 578, 578, 589,
592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 578, 578,
600, 601, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 578, 602, 603, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 578, 596,
578, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 578, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 592, 578,
578, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 578, 578, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 604, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 592, 604,
604, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 578, 578, 592, 592, 592, 578,
578, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
592, 592, 592, 592, 592, 592, 592, 0, 578, 578,
578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
578, 578, 578, 578
} ;
static yyconst flex_int16_t yy_nxt[1068] =
{ 0,
34, 35, 36, 34, 35, 37, 34, 38, 39, 40,
41, 34, 42, 43, 44, 45, 45, 34, 46, 47,
48, 40, 34, 49, 49, 49, 49, 50, 34, 34,
49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
49, 49, 49, 49, 51, 52, 40, 34, 57, 57,
61, 58, 58, 61, 64, 36, 62, 64, 75, 62,
136, 76, 75, 65, 78, 76, 66, 77, 78, 79,
67, 75, 137, 79, 59, 59, 59, 71, 85, 59,
68, 64, 36, 361, 64, 72, 69, 73, 71, 75,
65, 86, 76, 66, 77, 78, 72, 67, 73, 75,
79, 86, 276, 60, 60, 60, 85, 68, 60, 75,
277, 154, 76, 75, 80, 78, 76, 87, 80, 78,
79, 153, 75, 74, 79, 76, 81, 87, 78, 360,
81, 318, 75, 79, 74, 76, 75, 80, 78, 76,
91, 80, 78, 79, 91, 88, 92, 79, 89, 81,
92, 88, 131, 81, 89, 160, 132, 134, 134, 134,
131, 82, 161, 83, 132, 82, 90, 83, 157, 317,
90, 90, 158, 102, 36, 272, 102, 90, 167, 168,
201, 167, 103, 271, 82, 104, 84, 159, 82, 202,
84, 93, 94, 36, 93, 94, 93, 93, 93, 93,
93, 95, 93, 96, 97, 98, 98, 98, 93, 93,
93, 93, 93, 93, 96, 96, 96, 96, 93, 93,
99, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 93, 93, 93, 93, 102,
36, 162, 102, 165, 105, 217, 170, 171, 103, 170,
131, 104, 107, 163, 132, 131, 180, 108, 166, 132,
199, 188, 164, 216, 200, 189, 181, 109, 108, 108,
108, 108, 215, 172, 190, 108, 108, 110, 111, 112,
113, 114, 115, 108, 116, 108, 117, 118, 119, 120,
121, 108, 122, 123, 124, 125, 126, 108, 127, 128,
106, 176, 176, 106, 176, 192, 106, 134, 134, 134,
578, 129, 129, 578, 196, 182, 578, 106, 193, 135,
183, 154, 106, 194, 336, 184, 203, 578, 106, 106,
197, 153, 578, 198, 577, 204, 214, 214, 578, 578,
134, 134, 134, 337, 205, 135, 218, 219, 256, 218,
220, 221, 257, 220, 177, 222, 223, 106, 222, 224,
225, 578, 224, 167, 168, 576, 167, 578, 141, 227,
171, 141, 227, 229, 230, 575, 229, 142, 142, 176,
176, 240, 176, 165, 245, 141, 233, 172, 143, 250,
234, 141, 241, 574, 144, 145, 270, 270, 166, 146,
246, 573, 235, 572, 218, 219, 147, 218, 251, 571,
148, 160, 149, 150, 151, 152, 106, 570, 161, 106,
157, 252, 106, 297, 158, 569, 298, 129, 129, 293,
162, 301, 177, 106, 220, 221, 294, 220, 106, 159,
222, 223, 163, 222, 106, 106, 224, 225, 302, 224,
568, 164, 167, 168, 567, 167, 227, 171, 350, 227,
227, 171, 295, 227, 229, 230, 366, 229, 370, 296,
393, 402, 566, 106, 211, 211, 211, 351, 396, 396,
396, 432, 565, 211, 491, 367, 434, 371, 564, 394,
403, 211, 211, 211, 211, 211, 211, 420, 420, 420,
420, 432, 523, 433, 524, 435, 420, 420, 420, 420,
563, 562, 561, 396, 396, 396, 421, 535, 535, 535,
535, 524, 547, 524, 548, 421, 540, 540, 540, 540,
540, 540, 540, 540, 560, 559, 536, 535, 535, 535,
535, 548, 558, 548, 557, 541, 556, 555, 554, 541,
540, 540, 540, 540, 553, 552, 536, 551, 550, 549,
546, 545, 544, 543, 542, 539, 538, 537, 534, 541,
54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
54, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 63, 63, 63, 63, 63, 63, 63, 63,
63, 63, 63, 70, 70, 70, 70, 70, 70, 70,
70, 70, 70, 70, 101, 101, 101, 101, 101, 101,
101, 101, 101, 101, 101, 106, 533, 532, 531, 106,
106, 530, 529, 528, 527, 106, 130, 526, 525, 522,
130, 130, 130, 521, 130, 520, 130, 133, 133, 519,
133, 140, 140, 140, 140, 140, 140, 140, 140, 140,
140, 140, 153, 153, 153, 153, 153, 153, 153, 518,
153, 153, 153, 169, 169, 169, 169, 169, 169, 169,
169, 169, 173, 517, 516, 173, 173, 515, 514, 173,
513, 173, 174, 174, 174, 491, 174, 175, 175, 175,
512, 175, 209, 209, 511, 209, 209, 209, 209, 209,
209, 209, 209, 210, 210, 210, 510, 210, 490, 490,
509, 490, 490, 490, 490, 490, 490, 490, 490, 508,
507, 506, 505, 504, 503, 502, 501, 500, 499, 498,
497, 496, 495, 494, 493, 492, 491, 489, 488, 487,
486, 485, 484, 483, 482, 481, 480, 479, 478, 477,
476, 475, 474, 473, 472, 471, 470, 469, 468, 467,
466, 465, 464, 463, 462, 461, 460, 459, 458, 457,
456, 455, 454, 453, 452, 451, 450, 449, 448, 447,
446, 445, 444, 443, 442, 441, 440, 439, 438, 437,
436, 431, 430, 429, 428, 427, 426, 425, 424, 423,
422, 419, 418, 417, 416, 415, 414, 413, 412, 411,
410, 409, 408, 407, 406, 405, 404, 401, 400, 399,
398, 397, 395, 392, 391, 390, 389, 388, 387, 386,
385, 384, 383, 382, 381, 380, 379, 378, 377, 376,
375, 374, 373, 372, 369, 368, 365, 364, 363, 362,
359, 358, 357, 356, 355, 354, 353, 352, 349, 348,
347, 346, 345, 344, 343, 342, 341, 340, 339, 338,
335, 334, 333, 332, 331, 330, 329, 328, 327, 326,
325, 324, 323, 322, 321, 320, 319, 316, 315, 314,
313, 312, 311, 310, 309, 308, 307, 306, 305, 304,
303, 300, 299, 292, 291, 290, 289, 288, 287, 286,
285, 284, 283, 282, 281, 280, 279, 278, 275, 274,
273, 269, 268, 267, 266, 265, 264, 263, 262, 261,
260, 259, 258, 255, 254, 253, 249, 248, 247, 244,
243, 242, 239, 238, 237, 236, 232, 231, 228, 226,
155, 154, 213, 212, 208, 207, 206, 195, 191, 187,
186, 185, 179, 178, 138, 138, 156, 154, 155, 154,
138, 139, 138, 578, 100, 55, 55, 53, 33, 578,
578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
578, 578, 578, 578, 578, 578, 578
} ;
static yyconst flex_int16_t yy_chk[1068] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 5, 6,
7, 5, 6, 8, 9, 9, 7, 9, 17, 8,
47, 17, 13, 9, 17, 13, 9, 13, 13, 17,
9, 21, 47, 13, 5, 6, 7, 11, 21, 8,
9, 10, 10, 603, 10, 11, 10, 11, 12, 14,
10, 23, 14, 10, 14, 14, 12, 10, 12, 22,
14, 24, 234, 5, 6, 7, 22, 10, 8, 15,
234, 71, 15, 16, 15, 15, 16, 23, 16, 16,
15, 71, 18, 11, 16, 18, 15, 24, 18, 602,
16, 601, 19, 18, 12, 19, 20, 19, 19, 20,
27, 20, 20, 19, 28, 25, 27, 20, 25, 19,
28, 26, 43, 20, 26, 80, 43, 45, 45, 45,
66, 15, 80, 15, 66, 16, 27, 16, 79, 600,
28, 25, 79, 31, 31, 599, 31, 26, 87, 87,
123, 87, 31, 598, 19, 31, 19, 79, 20, 123,
20, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 32,
32, 81, 32, 85, 32, 597, 90, 90, 32, 90,
97, 32, 38, 81, 97, 104, 112, 38, 85, 104,
122, 117, 81, 596, 122, 117, 112, 38, 38, 38,
38, 38, 595, 90, 117, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
42, 109, 109, 42, 109, 119, 42, 44, 44, 44,
49, 42, 42, 49, 121, 113, 49, 42, 119, 44,
113, 154, 42, 119, 292, 113, 124, 49, 42, 42,
121, 154, 49, 121, 576, 124, 142, 142, 49, 49,
134, 134, 134, 292, 124, 44, 159, 159, 197, 159,
161, 161, 197, 161, 109, 164, 164, 42, 164, 166,
166, 230, 166, 167, 167, 575, 167, 49, 59, 170,
170, 59, 170, 172, 172, 574, 172, 59, 59, 176,
176, 185, 176, 225, 189, 59, 180, 230, 59, 193,
180, 59, 185, 573, 59, 59, 214, 214, 225, 59,
189, 572, 180, 569, 218, 218, 59, 218, 193, 568,
59, 221, 59, 59, 59, 59, 129, 567, 221, 129,
219, 193, 129, 252, 219, 566, 252, 129, 129, 250,
223, 255, 176, 129, 220, 220, 250, 220, 129, 219,
222, 222, 223, 222, 129, 129, 224, 224, 255, 224,
565, 223, 226, 226, 564, 226, 227, 227, 305, 227,
228, 228, 251, 228, 229, 229, 326, 229, 329, 251,
356, 368, 563, 129, 135, 135, 135, 305, 359, 359,
359, 491, 560, 135, 491, 326, 397, 329, 559, 356,
368, 135, 135, 135, 135, 135, 135, 385, 385, 385,
385, 396, 504, 396, 505, 397, 420, 420, 420, 420,
558, 557, 556, 396, 396, 396, 385, 517, 517, 517,
517, 504, 537, 505, 538, 420, 521, 521, 521, 521,
522, 522, 522, 522, 554, 553, 517, 535, 535, 535,
535, 537, 552, 538, 551, 521, 550, 549, 548, 522,
540, 540, 540, 540, 547, 544, 535, 543, 542, 539,
534, 533, 525, 524, 523, 520, 519, 518, 516, 540,
579, 579, 579, 579, 579, 579, 579, 579, 579, 579,
579, 580, 580, 580, 580, 580, 580, 580, 580, 580,
580, 580, 581, 581, 581, 581, 581, 581, 581, 581,
581, 581, 581, 582, 582, 582, 582, 582, 582, 582,
582, 582, 582, 582, 583, 583, 583, 583, 583, 583,
583, 583, 583, 583, 583, 584, 515, 514, 513, 584,
584, 512, 511, 510, 509, 584, 585, 507, 506, 503,
585, 585, 585, 502, 585, 501, 585, 586, 586, 499,
586, 587, 587, 587, 587, 587, 587, 587, 587, 587,
587, 587, 588, 588, 588, 588, 588, 588, 588, 498,
588, 588, 588, 589, 589, 589, 589, 589, 589, 589,
589, 589, 590, 497, 496, 590, 590, 495, 493, 590,
492, 590, 591, 591, 591, 490, 591, 592, 592, 592,
489, 592, 593, 593, 488, 593, 593, 593, 593, 593,
593, 593, 593, 594, 594, 594, 487, 594, 604, 604,
486, 604, 604, 604, 604, 604, 604, 604, 604, 485,
484, 483, 482, 481, 480, 479, 476, 475, 474, 473,
472, 469, 468, 467, 466, 465, 464, 463, 462, 460,
459, 458, 457, 456, 453, 451, 450, 449, 448, 447,
445, 444, 443, 442, 441, 440, 439, 438, 437, 436,
435, 434, 433, 430, 429, 428, 426, 425, 423, 422,
419, 418, 417, 416, 415, 414, 413, 412, 411, 410,
409, 408, 407, 406, 405, 404, 403, 402, 401, 400,
399, 395, 394, 393, 392, 391, 390, 389, 388, 387,
386, 384, 383, 382, 381, 380, 379, 378, 377, 376,
375, 374, 373, 372, 371, 370, 369, 367, 366, 365,
364, 363, 358, 354, 352, 351, 350, 349, 348, 347,
345, 343, 342, 341, 340, 339, 338, 337, 336, 334,
333, 332, 331, 330, 328, 327, 323, 322, 321, 319,
316, 314, 313, 311, 309, 308, 307, 306, 304, 303,
302, 301, 300, 299, 298, 297, 296, 295, 294, 293,
291, 290, 289, 287, 286, 285, 284, 283, 282, 281,
280, 279, 278, 277, 276, 275, 273, 269, 268, 267,
266, 265, 264, 263, 262, 261, 260, 259, 258, 257,
256, 254, 253, 249, 248, 247, 246, 245, 244, 243,
242, 241, 240, 239, 238, 237, 236, 235, 233, 232,
231, 213, 208, 207, 206, 205, 204, 203, 202, 201,
200, 199, 198, 196, 195, 194, 192, 191, 190, 188,
187, 186, 184, 183, 182, 181, 179, 178, 171, 168,
155, 153, 138, 136, 127, 126, 125, 120, 118, 116,
115, 114, 111, 110, 105, 100, 77, 74, 72, 70,
69, 55, 53, 33, 30, 4, 3, 2, 578, 578,
578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
578, 578, 578, 578, 578, 578, 578, 578, 578, 578,
578, 578, 578, 578, 578, 578, 578
} ;
static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;
extern int gram__flex_debug;
int gram__flex_debug = 1;
static yyconst flex_int16_t yy_rule_linenum[130] =
{ 0,
185, 188, 189, 190, 198, 216, 217, 218, 219, 220,
221, 222, 223, 224, 225, 226, 227, 228, 229, 230,
231, 232, 233, 234, 235, 236, 237, 238, 239, 240,
241, 242, 243, 244, 245, 246, 247, 248, 249, 250,
251, 252, 253, 254, 255, 256, 257, 258, 259, 260,
263, 264, 265, 266, 267, 268, 269, 270, 271, 272,
273, 275, 279, 280, 281, 283, 290, 294, 301, 306,
309, 312, 315, 323, 330, 331, 332, 338, 345, 352,
372, 382, 397, 402, 421, 434, 450, 465, 482, 483,
494, 505, 506, 518, 526, 536, 555, 567, 581, 582,
593, 602, 612, 613, 614, 615, 616, 617, 618, 621,
623, 631, 649, 654, 655, 661, 662, 673, 679, 685,
691, 707, 708, 712, 719, 736, 757, 790, 791
} ;
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
*/
#define REJECT reject_used_but_not_detected
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *gram_text;
#line 1 "/Users/akim/src/gnu/bison/src/scan-gram.l"
/* Bison Grammar Scanner -*- C -*-
Copyright (C) 2002-2015 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#define YY_NO_INPUT 1
#line 24 "/Users/akim/src/gnu/bison/src/scan-gram.l"
/* Work around a bug in flex 2.5.31. See Debian bug 333231
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=333231>. */
#undef gram_wrap
#define gram_wrap() 1
#define FLEX_PREFIX(Id) gram_ ## Id
#include <src/flex-scanner.h>
#include <src/complain.h>
#include <src/files.h>
#include <src/getargs.h>
#include <src/gram.h>
#include <quotearg.h>
#include <src/reader.h>
#include <src/uniqstr.h>
#include <c-ctype.h>
#include <mbswidth.h>
#include <quote.h>
#include <src/scan-gram.h>
#define YY_DECL GRAM_LEX_DECL
/* Location of scanner cursor. */
static boundary scanner_cursor;
#define YY_USER_ACTION location_compute (loc, &scanner_cursor, gram_text, gram_leng);
static size_t no_cr_read (FILE *, char *, size_t);
#define YY_INPUT(buf, result, size) ((result) = no_cr_read (gram_in, buf, size))
#define RETURN_PERCENT_PARAM(Value) \
RETURN_VALUE(PERCENT_PARAM, param, param_ ## Value)
#define RETURN_PERCENT_FLAG(Value) \
RETURN_VALUE(PERCENT_FLAG, uniqstr, uniqstr_new (Value))
#define RETURN_VALUE(Token, Field, Value) \
do { \
val->Field = Value; \
return Token; \
} while (0)
#define ROLLBACK_CURRENT_TOKEN \
do { \
scanner_cursor.column -= mbsnwidth (gram_text, gram_leng, 0); \
yyless (0); \
} while (0)
#define DEPRECATED(Msg) \
do { \
size_t i; \
deprecated_directive (loc, gram_text, Msg); \
scanner_cursor.column -= mbsnwidth (Msg, strlen (Msg), 0); \
for (i = strlen (Msg); i != 0; --i) \
unput (Msg[i - 1]); \
} while (0)
/* A string representing the most recently saved token. */
static char *last_string;
/* Bracketed identifier. */
static uniqstr bracketed_id_str = 0;
static location bracketed_id_loc;
static boundary bracketed_id_start;
static int bracketed_id_context_state = 0;
void
gram_scanner_last_string_free (void)
{
STRING_FREE;
}
static void handle_syncline (char *, location);
static unsigned long int scan_integer (char const *p, int base, location loc);
static int convert_ucn_to_byte (char const *hex_text);
static void unexpected_eof (boundary, char const *);
static void unexpected_newline (boundary, char const *);
/* A C-like comment in directives/rules. */
/* Strings and characters in directives/rules. */
/* A identifier was just read in directives/rules. Special state
to capture the sequence 'identifier :'. */
/* POSIX says that a tag must be both an id and a C union member, but
historically almost any character is allowed in a tag. We
disallow NUL, as this simplifies our implementation. We match
angle brackets in nested pairs: several languages use them for
generics/template types. */
/* Four types of user code:
- prologue (code between '%{' '%}' in the first section, before %%);
- actions, printers, union, etc, (between braced in the middle section);
- epilogue (everything after the second %%).
- predicate (code between '%?{' and '{' in middle section); */
/* C and C++ comments in code. */
/* Strings and characters in code. */
/* Bracketed identifiers support. */
/* Zero or more instances of backslash-newline. Following GCC, allow
white space between the backslash and the newline. */
/* An equal sign, with optional leading whitespaces. This is used in some
deprecated constructs. */
#line 1133 "src/scan-gram.c"
#define INITIAL 0
#define SC_YACC_COMMENT 1
#define SC_ESCAPED_STRING 2
#define SC_ESCAPED_CHARACTER 3
#define SC_AFTER_IDENTIFIER 4
#define SC_TAG 5
#define SC_PROLOGUE 6
#define SC_BRACED_CODE 7
#define SC_EPILOGUE 8
#define SC_PREDICATE 9
#define SC_COMMENT 10
#define SC_LINE_COMMENT 11
#define SC_STRING 12
#define SC_CHARACTER 13
#define SC_BRACKETED_ID 14
#define SC_RETURN_BRACKETED_ID 15
#ifndef YY_NO_UNISTD_H
/* Special case for "unistd.h", since it is non-ANSI. We include it way
* down here because we want the user's section 1 to have been scanned first.
* The user has a chance to override it with an option.
*/
/* %if-c-only */
#include <unistd.h>
/* %endif */
/* %if-c++-only */
/* %endif */
#endif
#ifndef YY_EXTRA_TYPE
#define YY_EXTRA_TYPE void *
#endif
/* %if-c-only Reentrant structure and macros (non-C++). */
/* %if-reentrant */
/* %if-c-only */
static int yy_init_globals (void );
/* %endif */
/* %if-reentrant */
/* %endif */
/* %endif End reentrant structures and macros. */
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
int gram_lex_destroy (void );
int gram_get_debug (void );
void gram_set_debug (int debug_flag );
YY_EXTRA_TYPE gram_get_extra (void );
void gram_set_extra (YY_EXTRA_TYPE user_defined );
FILE *gram_get_in (void );
void gram_set_in (FILE * in_str );
FILE *gram_get_out (void );
void gram_set_out (FILE * out_str );
yy_size_t gram_get_leng (void );
char *gram_get_text (void );
int gram_get_lineno (void );
void gram_set_lineno (int line_number );
/* %if-bison-bridge */
/* %endif */
/* Macros after this point can all be overridden by user definitions in
* section 1.
*/
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
extern "C" int gram_wrap (void );
#else
extern int gram_wrap (void );
#endif
#endif
/* %not-for-header */
static void yyunput (int c,char *buf_ptr );
/* %ok-for-header */
/* %endif */
#ifndef yytext_ptr
static void yy_flex_strncpy (char *,yyconst char *,int );
#endif
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * );
#endif
#ifndef YY_NO_INPUT
/* %if-c-only Standard (non-C++) definition */
/* %not-for-header */
#ifdef __cplusplus
static int yyinput (void );
#else
static int input (void );
#endif
/* %ok-for-header */
/* %endif */
#endif
/* %if-c-only */
/* %endif */
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#define YY_READ_BUF_SIZE 8192
#endif
/* Copy whatever the last rule matched to the standard output. */
#ifndef ECHO
/* %if-c-only Standard (non-C++) definition */
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
#define ECHO do { if (fwrite( gram_text, gram_leng, 1, gram_out )) {} } while (0)
/* %endif */
/* %if-c++-only C++ definition */
/* %endif */
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
* is returned in "result".
*/
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
size_t n; \
for ( n = 0; n < max_size && \
(c = getc( gram_in )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
if ( c == '\n' ) \
buf[n++] = (char) c; \
if ( c == EOF && ferror( gram_in ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
result = n; \
} \
else \
{ \
errno=0; \
while ( (result = fread(buf, 1, max_size, gram_in))==0 && ferror(gram_in)) \
{ \
if( errno != EINTR) \
{ \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
break; \
} \
errno=0; \
clearerr(gram_in); \
} \
}\
\
/* %if-c++-only C++ definition \ */\
/* %endif */
#endif
/* No semi-colon after return; correct usage is to write "yyterminate();" -
* we don't want an extra ';' after the "return" because that will cause
* some compilers to complain about unreachable statements.
*/
#ifndef yyterminate
#define yyterminate() return YY_NULL
#endif
/* Number of entries by which start-condition stack grows. */
#ifndef YY_START_STACK_INCR
#define YY_START_STACK_INCR 25
#endif
/* Report a fatal error. */
#ifndef YY_FATAL_ERROR
/* %if-c-only */
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
/* %endif */
/* %if-c++-only */
/* %endif */
#endif
/* %if-tables-serialization structures and prototypes */
/* %not-for-header */
/* %ok-for-header */
/* %not-for-header */
/* %tables-yydmap generated elements */
/* %endif */
/* end tables serialization structures and prototypes */
/* %ok-for-header */
/* Default declaration of generated scanner - a define so the user can
* easily add parameters.
*/
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
/* %if-c-only Standard (non-C++) definition */
extern int gram_lex (void);
#define YY_DECL int gram_lex (void)
/* %endif */
/* %if-c++-only C++ definition */
/* %endif */
#endif /* !YY_DECL */
/* Code executed at the beginning of each rule, after gram_text and gram_leng
* have been set up.
*/
#ifndef YY_USER_ACTION
#define YY_USER_ACTION
#endif
/* Code executed at the end of each rule. */
#ifndef YY_BREAK
#define YY_BREAK break;
#endif
/* %% [6.0] YY_RULE_SETUP definition goes here */
#define YY_RULE_SETUP \
if ( gram_leng > 0 ) \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
(gram_text[gram_leng - 1] == '\n'); \
YY_USER_ACTION
/* %not-for-header */
/** The main scanner function which does all the work.
*/
YY_DECL
{
register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp;
register int yy_act;
/* %% [7.0] user's declarations go here */
#line 146 "/Users/akim/src/gnu/bison/src/scan-gram.l"
/* Nesting level. Either for nested braces, or nested angle brackets
(but not mixed). */
int nesting PACIFY_CC (= 0);
/* Parent context state, when applicable. */
int context_state PACIFY_CC (= 0);
/* Location of most recent identifier, when applicable. */
location id_loc PACIFY_CC (= empty_location);
/* Where containing code started, when applicable. Its initial
value is relevant only when gram_lex is invoked in the SC_EPILOGUE
start condition. */
boundary code_start = scanner_cursor;
/* Where containing comment or string or character literal started,
when applicable. */
boundary token_start PACIFY_CC (= scanner_cursor);
/* We cannot trust YY_USER_INIT, whose semantics changes over time
(it moved in Flex 2.5.38). */
static bool first = true;
if (first)
{
scanner_cursor = loc->start;
first = false;
}
/*-----------------------.
| Scanning white space. |
`-----------------------*/
#line 1430 "src/scan-gram.c"
if ( !(yy_init) )
{
(yy_init) = 1;
#ifdef YY_USER_INIT
YY_USER_INIT;
#endif
if ( ! (yy_start) )
(yy_start) = 1; /* first start state */
if ( ! gram_in )
/* %if-c-only */
gram_in = stdin;
/* %endif */
/* %if-c++-only */
/* %endif */
if ( ! gram_out )
/* %if-c-only */
gram_out = stdout;
/* %endif */
/* %if-c++-only */
/* %endif */
if ( ! YY_CURRENT_BUFFER ) {
gram_ensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
gram__create_buffer(gram_in,YY_BUF_SIZE );
}
gram__load_buffer_state( );
}
while ( 1 ) /* loops until end-of-file is reached */
{
/* %% [8.0] yymore()-related code goes here */
yy_cp = (yy_c_buf_p);
/* Support of gram_text. */
*yy_cp = (yy_hold_char);
/* yy_bp points to the position in yy_ch_buf of the start of
* the current run.
*/
yy_bp = yy_cp;
/* %% [9.0] code to set up and find next match goes here */
yy_current_state = (yy_start);
yy_current_state += YY_AT_BOL();
yy_match:
do
{
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
if ( yy_accept[yy_current_state] )
{
(yy_last_accepting_state) = yy_current_state;
(yy_last_accepting_cpos) = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 579 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
while ( yy_current_state != 578 );
yy_cp = (yy_last_accepting_cpos);
yy_current_state = (yy_last_accepting_state);
yy_find_action:
/* %% [10.0] code to find the action number goes here */
yy_act = yy_accept[yy_current_state];
YY_DO_BEFORE_ACTION;
/* %% [11.0] code for gram_lineno update goes here */
do_action: /* This label is used only to access EOF actions. */
/* %% [12.0] debug code goes here */
if ( gram__flex_debug )
{
if ( yy_act == 0 )
fprintf( stderr, "--scanner backing up\n" );
else if ( yy_act < 130 )
fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
(long)yy_rule_linenum[yy_act], gram_text );
else if ( yy_act == 130 )
fprintf( stderr, "--accepting default rule (\"%s\")\n",
gram_text );
else if ( yy_act == 131 )
fprintf( stderr, "--(end of buffer or a NUL)\n" );
else
fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
}
switch ( yy_act )
{ /* beginning of action switch */
/* %% [13.0] actions go here */
case 0: /* must back up */
/* undo the effects of YY_DO_BEFORE_ACTION */
*yy_cp = (yy_hold_char);
yy_cp = (yy_last_accepting_cpos);
yy_current_state = (yy_last_accepting_state);
goto yy_find_action;
/* Comments and white space. */
case 1:
YY_RULE_SETUP
#line 185 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
complain (loc, Wother, _("stray ',' treated as white space"));
}
YY_BREAK
case 2:
/* rule 2 can match eol */
#line 189 "/Users/akim/src/gnu/bison/src/scan-gram.l"
case 3:
/* rule 3 can match eol */
YY_RULE_SETUP
#line 189 "/Users/akim/src/gnu/bison/src/scan-gram.l"
continue;
YY_BREAK
case 4:
YY_RULE_SETUP
#line 190 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
token_start = loc->start;
context_state = YY_START;
BEGIN SC_YACC_COMMENT;
}
YY_BREAK
/* #line directives are not documented, and may be withdrawn or
modified in future versions of Bison. */
case 5:
/* rule 5 can match eol */
YY_RULE_SETUP
#line 198 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
handle_syncline (gram_text + sizeof "#line " - 1, *loc);
}
YY_BREAK
/*----------------------------.
| Scanning Bison directives. |
`----------------------------*/
/* For directives that are also command line options, the regex must be
"%..."
after "[-_]"s are removed, and the directive must match the --long
option name, with a single string argument. Otherwise, add exceptions
to ../build-aux/cross-options.pl. */
case 6:
YY_RULE_SETUP
#line 216 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_NONASSOC;
YY_BREAK
case 7:
YY_RULE_SETUP
#line 217 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_CODE;
YY_BREAK
case 8:
YY_RULE_SETUP
#line 218 "/Users/akim/src/gnu/bison/src/scan-gram.l"
RETURN_PERCENT_FLAG("parse.trace");
YY_BREAK
case 9:
YY_RULE_SETUP
#line 219 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_DEFAULT_PREC;
YY_BREAK
case 10:
YY_RULE_SETUP
#line 220 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_DEFINE;
YY_BREAK
case 11:
YY_RULE_SETUP
#line 221 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_DEFINES;
YY_BREAK
case 12:
YY_RULE_SETUP
#line 222 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_DESTRUCTOR;
YY_BREAK
case 13:
YY_RULE_SETUP
#line 223 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_DPREC;
YY_BREAK
case 14:
YY_RULE_SETUP
#line 224 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_EMPTY;
YY_BREAK
case 15:
YY_RULE_SETUP
#line 225 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_ERROR_VERBOSE;
YY_BREAK
case 16:
YY_RULE_SETUP
#line 226 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_EXPECT;
YY_BREAK
case 17:
YY_RULE_SETUP
#line 227 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_EXPECT_RR;
YY_BREAK
case 18:
YY_RULE_SETUP
#line 228 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_FILE_PREFIX;
YY_BREAK
case 19:
YY_RULE_SETUP
#line 229 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_YACC;
YY_BREAK
case 20:
YY_RULE_SETUP
#line 230 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_INITIAL_ACTION;
YY_BREAK
case 21:
YY_RULE_SETUP
#line 231 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_GLR_PARSER;
YY_BREAK
case 22:
YY_RULE_SETUP
#line 232 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_LANGUAGE;
YY_BREAK
case 23:
YY_RULE_SETUP
#line 233 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_LEFT;
YY_BREAK
case 24:
YY_RULE_SETUP
#line 234 "/Users/akim/src/gnu/bison/src/scan-gram.l"
RETURN_PERCENT_PARAM(lex);
YY_BREAK
case 25:
YY_RULE_SETUP
#line 235 "/Users/akim/src/gnu/bison/src/scan-gram.l"
RETURN_PERCENT_FLAG("locations");
YY_BREAK
case 26:
YY_RULE_SETUP
#line 236 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_MERGE;
YY_BREAK
case 27:
YY_RULE_SETUP
#line 237 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_NAME_PREFIX;
YY_BREAK
case 28:
YY_RULE_SETUP
#line 238 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_NO_DEFAULT_PREC;
YY_BREAK
case 29:
YY_RULE_SETUP
#line 239 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_NO_LINES;
YY_BREAK
case 30:
YY_RULE_SETUP
#line 240 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_NONASSOC;
YY_BREAK
case 31:
YY_RULE_SETUP
#line 241 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_NONDETERMINISTIC_PARSER;
YY_BREAK
case 32:
YY_RULE_SETUP
#line 242 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_NTERM;
YY_BREAK
case 33:
YY_RULE_SETUP
#line 243 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_OUTPUT;
YY_BREAK
case 34:
YY_RULE_SETUP
#line 244 "/Users/akim/src/gnu/bison/src/scan-gram.l"
RETURN_PERCENT_PARAM(both);
YY_BREAK
case 35:
YY_RULE_SETUP
#line 245 "/Users/akim/src/gnu/bison/src/scan-gram.l"
RETURN_PERCENT_PARAM(parse);
YY_BREAK
case 36:
YY_RULE_SETUP
#line 246 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_PREC;
YY_BREAK
case 37:
YY_RULE_SETUP
#line 247 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_PRECEDENCE;
YY_BREAK
case 38:
YY_RULE_SETUP
#line 248 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_PRINTER;
YY_BREAK
case 39:
YY_RULE_SETUP
#line 249 "/Users/akim/src/gnu/bison/src/scan-gram.l"
RETURN_PERCENT_FLAG("api.pure");
YY_BREAK
case 40:
YY_RULE_SETUP
#line 250 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_REQUIRE;
YY_BREAK
case 41:
YY_RULE_SETUP
#line 251 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_RIGHT;
YY_BREAK
case 42:
YY_RULE_SETUP
#line 252 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_SKELETON;
YY_BREAK
case 43:
YY_RULE_SETUP
#line 253 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_START;
YY_BREAK
case 44:
YY_RULE_SETUP
#line 254 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_TOKEN;
YY_BREAK
case 45:
YY_RULE_SETUP
#line 255 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_TOKEN;
YY_BREAK
case 46:
YY_RULE_SETUP
#line 256 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_TOKEN_TABLE;
YY_BREAK
case 47:
YY_RULE_SETUP
#line 257 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_TYPE;
YY_BREAK
case 48:
YY_RULE_SETUP
#line 258 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_UNION;
YY_BREAK
case 49:
YY_RULE_SETUP
#line 259 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_VERBOSE;
YY_BREAK
case 50:
YY_RULE_SETUP
#line 260 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PERCENT_YACC;
YY_BREAK
/* deprecated */
case 51:
YY_RULE_SETUP
#line 263 "/Users/akim/src/gnu/bison/src/scan-gram.l"
DEPRECATED("%default-prec");
YY_BREAK
case 52:
YY_RULE_SETUP
#line 264 "/Users/akim/src/gnu/bison/src/scan-gram.l"
DEPRECATED("%define parse.error verbose");
YY_BREAK
case 53:
YY_RULE_SETUP
#line 265 "/Users/akim/src/gnu/bison/src/scan-gram.l"
DEPRECATED("%expect-rr");
YY_BREAK
case 54:
/* rule 54 can match eol */
YY_RULE_SETUP
#line 266 "/Users/akim/src/gnu/bison/src/scan-gram.l"
DEPRECATED("%file-prefix");
YY_BREAK
case 55:
YY_RULE_SETUP
#line 267 "/Users/akim/src/gnu/bison/src/scan-gram.l"
DEPRECATED("%fixed-output-files");
YY_BREAK
case 56:
/* rule 56 can match eol */
YY_RULE_SETUP
#line 268 "/Users/akim/src/gnu/bison/src/scan-gram.l"
DEPRECATED("%name-prefix");
YY_BREAK
case 57:
YY_RULE_SETUP
#line 269 "/Users/akim/src/gnu/bison/src/scan-gram.l"
DEPRECATED("%no-default-prec");
YY_BREAK
case 58:
YY_RULE_SETUP
#line 270 "/Users/akim/src/gnu/bison/src/scan-gram.l"
DEPRECATED("%no-lines");
YY_BREAK
case 59:
/* rule 59 can match eol */
YY_RULE_SETUP
#line 271 "/Users/akim/src/gnu/bison/src/scan-gram.l"
DEPRECATED("%output");
YY_BREAK
case 60:
YY_RULE_SETUP
#line 272 "/Users/akim/src/gnu/bison/src/scan-gram.l"
DEPRECATED("%pure-parser");
YY_BREAK
case 61:
YY_RULE_SETUP
#line 273 "/Users/akim/src/gnu/bison/src/scan-gram.l"
DEPRECATED("%token-table");
YY_BREAK
case 62:
YY_RULE_SETUP
#line 275 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
complain (loc, complaint, _("invalid directive: %s"), quote (gram_text));
}
YY_BREAK
case 63:
YY_RULE_SETUP
#line 279 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return EQUAL;
YY_BREAK
case 64:
YY_RULE_SETUP
#line 280 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return PIPE;
YY_BREAK
case 65:
YY_RULE_SETUP
#line 281 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return SEMICOLON;
YY_BREAK
case 66:
YY_RULE_SETUP
#line 283 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
val->uniqstr = uniqstr_new (gram_text);
id_loc = *loc;
bracketed_id_str = NULL;
BEGIN SC_AFTER_IDENTIFIER;
}
YY_BREAK
case 67:
YY_RULE_SETUP
#line 290 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
val->integer = scan_integer (gram_text, 10, *loc);
return INT;
}
YY_BREAK
case 68:
YY_RULE_SETUP
#line 294 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
val->integer = scan_integer (gram_text, 16, *loc);
return INT;
}
YY_BREAK
/* Identifiers may not start with a digit. Yet, don't silently
accept "1FOO" as "1 FOO". */
case 69:
YY_RULE_SETUP
#line 301 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
complain (loc, complaint, _("invalid identifier: %s"), quote (gram_text));
}
YY_BREAK
/* Characters. */
case 70:
YY_RULE_SETUP
#line 306 "/Users/akim/src/gnu/bison/src/scan-gram.l"
token_start = loc->start; BEGIN SC_ESCAPED_CHARACTER;
YY_BREAK
/* Strings. */
case 71:
YY_RULE_SETUP
#line 309 "/Users/akim/src/gnu/bison/src/scan-gram.l"
token_start = loc->start; BEGIN SC_ESCAPED_STRING;
YY_BREAK
/* Prologue. */
case 72:
YY_RULE_SETUP
#line 312 "/Users/akim/src/gnu/bison/src/scan-gram.l"
code_start = loc->start; BEGIN SC_PROLOGUE;
YY_BREAK
/* Code in between braces. */
case 73:
YY_RULE_SETUP
#line 315 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
STRING_GROW;
nesting = 0;
code_start = loc->start;
BEGIN SC_BRACED_CODE;
}
YY_BREAK
/* Semantic predicate. */
case 74:
/* rule 74 can match eol */
YY_RULE_SETUP
#line 323 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
nesting = 0;
code_start = loc->start;
BEGIN SC_PREDICATE;
}
YY_BREAK
/* A type. */
case 75:
YY_RULE_SETUP
#line 330 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return TAG_ANY;
YY_BREAK
case 76:
YY_RULE_SETUP
#line 331 "/Users/akim/src/gnu/bison/src/scan-gram.l"
return TAG_NONE;
YY_BREAK
case 77:
YY_RULE_SETUP
#line 332 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
nesting = 0;
token_start = loc->start;
BEGIN SC_TAG;
}
YY_BREAK
case 78:
YY_RULE_SETUP
#line 338 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
static int percent_percent_count;
if (++percent_percent_count == 2)
BEGIN SC_EPILOGUE;
return PERCENT_PERCENT;
}
YY_BREAK
case 79:
YY_RULE_SETUP
#line 345 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
bracketed_id_str = NULL;
bracketed_id_start = loc->start;
bracketed_id_context_state = YY_START;
BEGIN SC_BRACKETED_ID;
}
YY_BREAK
case 80:
YY_RULE_SETUP
#line 352 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
complain (loc, complaint, "%s: %s",
ngettext ("invalid character", "invalid characters", gram_leng),
quote_mem (gram_text, gram_leng));
}
YY_BREAK
case YY_STATE_EOF(INITIAL):
#line 358 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
loc->start = loc->end = scanner_cursor;
yyterminate ();
}
YY_BREAK
/*--------------------------------------------------------------.
| Supporting \0 complexifies our implementation for no expected |
| added value. |
`--------------------------------------------------------------*/
case 81:
YY_RULE_SETUP
#line 372 "/Users/akim/src/gnu/bison/src/scan-gram.l"
complain (loc, complaint, _("invalid null character"));
YY_BREAK
/*-----------------------------------------------------------------.
| Scanning after an identifier, checking whether a colon is next. |
`-----------------------------------------------------------------*/
case 82:
YY_RULE_SETUP
#line 382 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
if (bracketed_id_str)
{
ROLLBACK_CURRENT_TOKEN;
BEGIN SC_RETURN_BRACKETED_ID;
*loc = id_loc;
return ID;
}
else
{
bracketed_id_start = loc->start;
bracketed_id_context_state = YY_START;
BEGIN SC_BRACKETED_ID;
}
}
YY_BREAK
case 83:
YY_RULE_SETUP
#line 397 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
BEGIN (bracketed_id_str ? SC_RETURN_BRACKETED_ID : INITIAL);
*loc = id_loc;
return ID_COLON;
}
YY_BREAK
case 84:
YY_RULE_SETUP
#line 402 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
ROLLBACK_CURRENT_TOKEN;
BEGIN (bracketed_id_str ? SC_RETURN_BRACKETED_ID : INITIAL);
*loc = id_loc;
return ID;
}
YY_BREAK
case YY_STATE_EOF(SC_AFTER_IDENTIFIER):
#line 408 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
BEGIN (bracketed_id_str ? SC_RETURN_BRACKETED_ID : INITIAL);
*loc = id_loc;
return ID;
}
YY_BREAK
/*--------------------------------.
| Scanning bracketed identifiers. |
`--------------------------------*/
case 85:
YY_RULE_SETUP
#line 421 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
if (bracketed_id_str)
{
complain (loc, complaint,
_("unexpected identifier in bracketed name: %s"),
quote (gram_text));
}
else
{
bracketed_id_str = uniqstr_new (gram_text);
bracketed_id_loc = *loc;
}
}
YY_BREAK
case 86:
YY_RULE_SETUP
#line 434 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
BEGIN bracketed_id_context_state;
if (bracketed_id_str)
{
if (INITIAL == bracketed_id_context_state)
{
val->uniqstr = bracketed_id_str;
bracketed_id_str = 0;
*loc = bracketed_id_loc;
return BRACKETED_ID;
}
}
else
complain (loc, complaint, _("an identifier expected"));
}
YY_BREAK
case 87:
YY_RULE_SETUP
#line 450 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
complain (loc, complaint, "%s: %s",
ngettext ("invalid character in bracketed name",
"invalid characters in bracketed name", gram_leng),
quote_mem (gram_text, gram_leng));
}
YY_BREAK
case YY_STATE_EOF(SC_BRACKETED_ID):
#line 457 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
BEGIN bracketed_id_context_state;
unexpected_eof (bracketed_id_start, "]");
}
YY_BREAK
case 88:
YY_RULE_SETUP
#line 465 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
ROLLBACK_CURRENT_TOKEN;
val->uniqstr = bracketed_id_str;
bracketed_id_str = 0;
*loc = bracketed_id_loc;
BEGIN INITIAL;
return BRACKETED_ID;
}
YY_BREAK
/*---------------------------------------------------------------.
| Scanning a Yacc comment. The initial '/ *' is already eaten. |
`---------------------------------------------------------------*/
case 89:
YY_RULE_SETUP
#line 482 "/Users/akim/src/gnu/bison/src/scan-gram.l"
BEGIN context_state;
YY_BREAK
case 90:
/* rule 90 can match eol */
YY_RULE_SETUP
#line 483 "/Users/akim/src/gnu/bison/src/scan-gram.l"
continue;
YY_BREAK
case YY_STATE_EOF(SC_YACC_COMMENT):
#line 484 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_eof (token_start, "*/"); BEGIN context_state;
YY_BREAK
/*------------------------------------------------------------.
| Scanning a C comment. The initial '/ *' is already eaten. |
`------------------------------------------------------------*/
case 91:
/* rule 91 can match eol */
YY_RULE_SETUP
#line 494 "/Users/akim/src/gnu/bison/src/scan-gram.l"
STRING_GROW; BEGIN context_state;
YY_BREAK
case YY_STATE_EOF(SC_COMMENT):
#line 495 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_eof (token_start, "*/"); BEGIN context_state;
YY_BREAK
/*--------------------------------------------------------------.
| Scanning a line comment. The initial '//' is already eaten. |
`--------------------------------------------------------------*/
case 92:
/* rule 92 can match eol */
YY_RULE_SETUP
#line 505 "/Users/akim/src/gnu/bison/src/scan-gram.l"
STRING_GROW; BEGIN context_state;
YY_BREAK
case 93:
/* rule 93 can match eol */
YY_RULE_SETUP
#line 506 "/Users/akim/src/gnu/bison/src/scan-gram.l"
STRING_GROW;
YY_BREAK
case YY_STATE_EOF(SC_LINE_COMMENT):
#line 507 "/Users/akim/src/gnu/bison/src/scan-gram.l"
BEGIN context_state;
YY_BREAK
/*------------------------------------------------.
| Scanning a Bison string, including its escapes. |
| The initial quote is already eaten. |
`------------------------------------------------*/
case 94:
YY_RULE_SETUP
#line 518 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
STRING_FINISH;
loc->start = token_start;
val->code = last_string;
BEGIN INITIAL;
return STRING;
}
YY_BREAK
case YY_STATE_EOF(SC_ESCAPED_STRING):
#line 525 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_eof (token_start, "\"");
YY_BREAK
case 95:
/* rule 95 can match eol */
YY_RULE_SETUP
#line 526 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_newline (token_start, "\"");
YY_BREAK
/*----------------------------------------------------------.
| Scanning a Bison character literal, decoding its escapes. |
| The initial quote is already eaten. |
`----------------------------------------------------------*/
case 96:
YY_RULE_SETUP
#line 536 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
STRING_FINISH;
loc->start = token_start;
val->character = last_string[0];
/* FIXME: Eventually, make these errors. */
if (last_string[0] == '\0')
{
complain (loc, Wother, _("empty character literal"));
/* '\0' seems dangerous even if we are about to complain. */
val->character = '\'';
}
else if (last_string[1] != '\0')
complain (loc, Wother,
_("extra characters in character literal"));
STRING_FREE;
BEGIN INITIAL;
return CHAR;
}
YY_BREAK
case 97:
/* rule 97 can match eol */
YY_RULE_SETUP
#line 555 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_newline (token_start, "'");
YY_BREAK
case YY_STATE_EOF(SC_ESCAPED_CHARACTER):
#line 556 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_eof (token_start, "'");
YY_BREAK
/*--------------------------------------------------------------.
| Scanning a tag. The initial angle bracket is already eaten. |
`--------------------------------------------------------------*/
case 98:
YY_RULE_SETUP
#line 567 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
--nesting;
if (nesting < 0)
{
STRING_FINISH;
loc->start = token_start;
val->uniqstr = uniqstr_new (last_string);
STRING_FREE;
BEGIN INITIAL;
return TAG;
}
STRING_GROW;
}
YY_BREAK
case 99:
/* rule 99 can match eol */
YY_RULE_SETUP
#line 581 "/Users/akim/src/gnu/bison/src/scan-gram.l"
STRING_GROW;
YY_BREAK
case 100:
YY_RULE_SETUP
#line 582 "/Users/akim/src/gnu/bison/src/scan-gram.l"
STRING_GROW; nesting += gram_leng;
YY_BREAK
case YY_STATE_EOF(SC_TAG):
#line 584 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_eof (token_start, ">");
YY_BREAK
/*----------------------------.
| Decode escaped characters. |
`----------------------------*/
case 101:
YY_RULE_SETUP
#line 593 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
unsigned long int c = strtoul (gram_text + 1, NULL, 8);
if (!c || UCHAR_MAX < c)
complain (loc, complaint, _("invalid number after \\-escape: %s"),
gram_text+1);
else
obstack_1grow (&obstack_for_string, c);
}
YY_BREAK
case 102:
YY_RULE_SETUP
#line 602 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
verify (UCHAR_MAX < ULONG_MAX);
unsigned long int c = strtoul (gram_text + 2, NULL, 16);
if (!c || UCHAR_MAX < c)
complain (loc, complaint, _("invalid number after \\-escape: %s"),
gram_text+1);
else
obstack_1grow (&obstack_for_string, c);
}
YY_BREAK
case 103:
YY_RULE_SETUP
#line 612 "/Users/akim/src/gnu/bison/src/scan-gram.l"
obstack_1grow (&obstack_for_string, '\a');
YY_BREAK
case 104:
YY_RULE_SETUP
#line 613 "/Users/akim/src/gnu/bison/src/scan-gram.l"
obstack_1grow (&obstack_for_string, '\b');
YY_BREAK
case 105:
YY_RULE_SETUP
#line 614 "/Users/akim/src/gnu/bison/src/scan-gram.l"
obstack_1grow (&obstack_for_string, '\f');
YY_BREAK
case 106:
YY_RULE_SETUP
#line 615 "/Users/akim/src/gnu/bison/src/scan-gram.l"
obstack_1grow (&obstack_for_string, '\n');
YY_BREAK
case 107:
YY_RULE_SETUP
#line 616 "/Users/akim/src/gnu/bison/src/scan-gram.l"
obstack_1grow (&obstack_for_string, '\r');
YY_BREAK
case 108:
YY_RULE_SETUP
#line 617 "/Users/akim/src/gnu/bison/src/scan-gram.l"
obstack_1grow (&obstack_for_string, '\t');
YY_BREAK
case 109:
YY_RULE_SETUP
#line 618 "/Users/akim/src/gnu/bison/src/scan-gram.l"
obstack_1grow (&obstack_for_string, '\v');
YY_BREAK
/* \\[\"\'?\\] would be shorter, but it confuses xgettext. */
case 110:
YY_RULE_SETUP
#line 621 "/Users/akim/src/gnu/bison/src/scan-gram.l"
obstack_1grow (&obstack_for_string, gram_text[1]);
YY_BREAK
case 111:
YY_RULE_SETUP
#line 623 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
int c = convert_ucn_to_byte (gram_text);
if (c <= 0)
complain (loc, complaint, _("invalid number after \\-escape: %s"),
gram_text+1);
else
obstack_1grow (&obstack_for_string, c);
}
YY_BREAK
case 112:
/* rule 112 can match eol */
YY_RULE_SETUP
#line 631 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
char const *p = gram_text + 1;
/* Quote only if escaping won't make the character visible. */
if (c_isspace ((unsigned char) *p) && c_isprint ((unsigned char) *p))
p = quote (p);
else
p = quotearg_style_mem (escape_quoting_style, p, 1);
complain (loc, complaint, _("invalid character after \\-escape: %s"),
p);
}
YY_BREAK
/*--------------------------------------------.
| Scanning user-code characters and strings. |
`--------------------------------------------*/
case 113:
/* rule 113 can match eol */
YY_RULE_SETUP
#line 649 "/Users/akim/src/gnu/bison/src/scan-gram.l"
STRING_GROW;
YY_BREAK
case 114:
YY_RULE_SETUP
#line 654 "/Users/akim/src/gnu/bison/src/scan-gram.l"
STRING_GROW; BEGIN context_state;
YY_BREAK
case 115:
/* rule 115 can match eol */
YY_RULE_SETUP
#line 655 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_newline (token_start, "'");
YY_BREAK
case YY_STATE_EOF(SC_CHARACTER):
#line 656 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_eof (token_start, "'");
YY_BREAK
case 116:
YY_RULE_SETUP
#line 661 "/Users/akim/src/gnu/bison/src/scan-gram.l"
STRING_GROW; BEGIN context_state;
YY_BREAK
case 117:
/* rule 117 can match eol */
YY_RULE_SETUP
#line 662 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_newline (token_start, "\"");
YY_BREAK
case YY_STATE_EOF(SC_STRING):
#line 663 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_eof (token_start, "\"");
YY_BREAK
/*---------------------------------------------------.
| Strings, comments etc. can be found in user code. |
`---------------------------------------------------*/
case 118:
YY_RULE_SETUP
#line 673 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
STRING_GROW;
context_state = YY_START;
token_start = loc->start;
BEGIN SC_CHARACTER;
}
YY_BREAK
case 119:
YY_RULE_SETUP
#line 679 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
STRING_GROW;
context_state = YY_START;
token_start = loc->start;
BEGIN SC_STRING;
}
YY_BREAK
case 120:
/* rule 120 can match eol */
YY_RULE_SETUP
#line 685 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
STRING_GROW;
context_state = YY_START;
token_start = loc->start;
BEGIN SC_COMMENT;
}
YY_BREAK
case 121:
/* rule 121 can match eol */
YY_RULE_SETUP
#line 691 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
STRING_GROW;
context_state = YY_START;
BEGIN SC_LINE_COMMENT;
}
YY_BREAK
/*-----------------------------------------------------------.
| Scanning some code in braces (actions, predicates). The |
| initial "{" is already eaten. |
`-----------------------------------------------------------*/
case 122:
/* rule 122 can match eol */
YY_RULE_SETUP
#line 707 "/Users/akim/src/gnu/bison/src/scan-gram.l"
STRING_GROW; nesting++;
YY_BREAK
case 123:
/* rule 123 can match eol */
YY_RULE_SETUP
#line 708 "/Users/akim/src/gnu/bison/src/scan-gram.l"
STRING_GROW; nesting--;
YY_BREAK
/* Tokenize '<<%' correctly (as '<<' '%') rather than incorrrectly
(as '<' '<%'). */
case 124:
/* rule 124 can match eol */
YY_RULE_SETUP
#line 712 "/Users/akim/src/gnu/bison/src/scan-gram.l"
STRING_GROW;
YY_BREAK
case YY_STATE_EOF(SC_BRACED_CODE):
case YY_STATE_EOF(SC_PREDICATE):
#line 714 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_eof (code_start, "}");
YY_BREAK
case 125:
YY_RULE_SETUP
#line 719 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
obstack_1grow (&obstack_for_string, '}');
--nesting;
if (nesting < 0)
{
STRING_FINISH;
loc->start = code_start;
val->code = last_string;
BEGIN INITIAL;
return BRACED_CODE;
}
}
YY_BREAK
case 126:
YY_RULE_SETUP
#line 736 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
--nesting;
if (nesting < 0)
{
STRING_FINISH;
loc->start = code_start;
val->code = last_string;
BEGIN INITIAL;
return BRACED_PREDICATE;
}
else
obstack_1grow (&obstack_for_string, '}');
}
YY_BREAK
/*--------------------------------------------------------------.
| Scanning some prologue: from "%{" (already scanned) to "%}". |
`--------------------------------------------------------------*/
case 127:
YY_RULE_SETUP
#line 757 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
STRING_FINISH;
loc->start = code_start;
val->code = last_string;
BEGIN INITIAL;
return PROLOGUE;
}
YY_BREAK
case YY_STATE_EOF(SC_PROLOGUE):
#line 765 "/Users/akim/src/gnu/bison/src/scan-gram.l"
unexpected_eof (code_start, "%}");
YY_BREAK
/*---------------------------------------------------------------.
| Scanning the epilogue (everything after the second "%%", which |
| has already been eaten). |
`---------------------------------------------------------------*/
case YY_STATE_EOF(SC_EPILOGUE):
#line 776 "/Users/akim/src/gnu/bison/src/scan-gram.l"
{
STRING_FINISH;
loc->start = code_start;
val->code = last_string;
BEGIN INITIAL;
return EPILOGUE;
}
YY_BREAK
/*-----------------------------------------------------.
| By default, grow the string obstack with the input. |
`-----------------------------------------------------*/
case 128:
#line 791 "/Users/akim/src/gnu/bison/src/scan-gram.l"
case 129:
/* rule 129 can match eol */
YY_RULE_SETUP
#line 791 "/Users/akim/src/gnu/bison/src/scan-gram.l"
STRING_GROW;
YY_BREAK
case 130:
YY_RULE_SETUP
#line 793 "/Users/akim/src/gnu/bison/src/scan-gram.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
#line 2649 "src/scan-gram.c"
case YY_STATE_EOF(SC_RETURN_BRACKETED_ID):
yyterminate();
case YY_END_OF_BUFFER:
{
/* Amount of text matched not including the EOB char. */
int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
/* Undo the effects of YY_DO_BEFORE_ACTION. */
*yy_cp = (yy_hold_char);
YY_RESTORE_YY_MORE_OFFSET
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
{
/* We're scanning a new file or input source. It's
* possible that this happened because the user
* just pointed gram_in at a new source and called
* gram_lex(). If so, then we have to assure
* consistency between YY_CURRENT_BUFFER and our
* globals. Here is the right place to do so, because
* this is the first action (other than possibly a
* back-up) that will match for the new input source.
*/
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
YY_CURRENT_BUFFER_LVALUE->yy_input_file = gram_in;
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
}
/* Note that here we test for yy_c_buf_p "<=" to the position
* of the first EOB in the buffer, since yy_c_buf_p will
* already have been incremented past the NUL character
* (since all states make transitions on EOB to the
* end-of-buffer state). Contrast this with the test
* in input().
*/
if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
{ /* This was really a NUL. */
yy_state_type yy_next_state;
(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
yy_current_state = yy_get_previous_state( );
/* Okay, we're now positioned to make the NUL
* transition. We couldn't have
* yy_get_previous_state() go ahead and do it
* for us because it doesn't know how to deal
* with the possibility of jamming (and we don't
* want to build jamming into it because then it
* will run more slowly).
*/
yy_next_state = yy_try_NUL_trans( yy_current_state );
yy_bp = (yytext_ptr) + YY_MORE_ADJ;
if ( yy_next_state )
{
/* Consume the NUL. */
yy_cp = ++(yy_c_buf_p);
yy_current_state = yy_next_state;
goto yy_match;
}
else
{
/* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
yy_cp = (yy_last_accepting_cpos);
yy_current_state = (yy_last_accepting_state);
goto yy_find_action;
}
}
else switch ( yy_get_next_buffer( ) )
{
case EOB_ACT_END_OF_FILE:
{
(yy_did_buffer_switch_on_eof) = 0;
if ( gram_wrap( ) )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
* gram_text, we can now set up
* yy_c_buf_p so that if some total
* hoser (like flex itself) wants to
* call the scanner after we return the
* YY_NULL, it'll still work - another
* YY_NULL will get returned.
*/
(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
yy_act = YY_STATE_EOF(YY_START);
goto do_action;
}
else
{
if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
}
break;
}
case EOB_ACT_CONTINUE_SCAN:
(yy_c_buf_p) =
(yytext_ptr) + yy_amount_of_matched_text;
yy_current_state = yy_get_previous_state( );
yy_cp = (yy_c_buf_p);
yy_bp = (yytext_ptr) + YY_MORE_ADJ;
goto yy_match;
case EOB_ACT_LAST_MATCH:
(yy_c_buf_p) =
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
yy_current_state = yy_get_previous_state( );
yy_cp = (yy_c_buf_p);
yy_bp = (yytext_ptr) + YY_MORE_ADJ;
goto yy_find_action;
}
break;
}
default:
YY_FATAL_ERROR(
"fatal flex scanner internal error--no action found" );
} /* end of action switch */
} /* end of scanning one token */
} /* end of gram_lex */
/* %ok-for-header */
/* %if-c++-only */
/* %not-for-header */
/* %ok-for-header */
/* %endif */
/* yy_get_next_buffer - try to read in a new buffer
*
* Returns a code representing an action:
* EOB_ACT_LAST_MATCH -
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
* EOB_ACT_END_OF_FILE - end of file
*/
/* %if-c-only */
static int yy_get_next_buffer (void)
/* %endif */
/* %if-c++-only */
/* %endif */
{
register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
register char *source = (yytext_ptr);
register int number_to_move, i;
int ret_val;
if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
YY_FATAL_ERROR(
"fatal flex scanner internal error--end of buffer missed" );
if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
{ /* Don't try to fill the buffer, so this is an EOF. */
if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
{
/* We matched a single character, the EOB, so
* treat this as a final EOF.
*/
return EOB_ACT_END_OF_FILE;
}
else
{
/* We matched some text prior to the EOB, first
* process it.
*/
return EOB_ACT_LAST_MATCH;
}
}
/* Try to read more data. */
/* First move last chars to start of buffer. */
number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
/* don't do the read, it's not guaranteed to return an EOF,
* just force an EOF
*/
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
else
{
yy_size_t num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */
/* just a shorter name for the current buffer */
YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
int yy_c_buf_p_offset =
(int) ((yy_c_buf_p) - b->yy_ch_buf);
if ( b->yy_is_our_buffer )
{
yy_size_t new_size = b->yy_buf_size * 2;
if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8;
else
b->yy_buf_size *= 2;
b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
gram_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
}
else
/* Can't grow it, we don't own it. */
b->yy_ch_buf = 0;
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR(
"fatal error - scanner input buffer overflow" );
(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
number_to_move - 1;
}
if ( num_to_read > YY_READ_BUF_SIZE )
num_to_read = YY_READ_BUF_SIZE;
/* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
(yy_n_chars), num_to_read );
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
if ( (yy_n_chars) == 0 )
{
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
gram_restart(gram_in );
}
else
{
ret_val = EOB_ACT_LAST_MATCH;
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
YY_BUFFER_EOF_PENDING;
}
}
else
ret_val = EOB_ACT_CONTINUE_SCAN;
if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */
yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) gram_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
}
(yy_n_chars) += number_to_move;
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
return ret_val;
}
/* yy_get_previous_state - get the state just before the EOB char was reached */
/* %if-c-only */
/* %not-for-header */
static yy_state_type yy_get_previous_state (void)
/* %endif */
/* %if-c++-only */
/* %endif */
{
register yy_state_type yy_current_state;
register char *yy_cp;
/* %% [15.0] code to get the start state into yy_current_state goes here */
yy_current_state = (yy_start);
yy_current_state += YY_AT_BOL();
for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
{
/* %% [16.0] code to find the next state goes here */
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 58);
if ( yy_accept[yy_current_state] )
{
(yy_last_accepting_state) = yy_current_state;
(yy_last_accepting_cpos) = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 579 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
}
return yy_current_state;
}
/* yy_try_NUL_trans - try to make a transition on the NUL character
*
* synopsis
* next_state = yy_try_NUL_trans( current_state );
*/
/* %if-c-only */
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
/* %endif */
/* %if-c++-only */
/* %endif */
{
register int yy_is_jam;
/* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
register char *yy_cp = (yy_c_buf_p);
register YY_CHAR yy_c = 58;
if ( yy_accept[yy_current_state] )
{
(yy_last_accepting_state) = yy_current_state;
(yy_last_accepting_cpos) = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 579 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 578);
return yy_is_jam ? 0 : yy_current_state;
}
/* %if-c-only */
static void yyunput (int c, register char * yy_bp )
/* %endif */
/* %if-c++-only */
/* %endif */
{
register char *yy_cp;
yy_cp = (yy_c_buf_p);
/* undo effects of setting up gram_text */
*yy_cp = (yy_hold_char);
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
{ /* need to shift things up to make room */
/* +2 for EOB chars. */
register yy_size_t number_to_move = (yy_n_chars) + 2;
register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
register char *source =
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
*--dest = *--source;
yy_cp += (int) (dest - source);
yy_bp += (int) (dest - source);
YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
YY_FATAL_ERROR( "flex scanner push-back overflow" );
}
*--yy_cp = (char) c;
/* %% [18.0] update gram_lineno here */
(yytext_ptr) = yy_bp;
(yy_hold_char) = *yy_cp;
(yy_c_buf_p) = yy_cp;
}
/* %if-c-only */
/* %endif */
/* %if-c-only */
#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput (void)
#else
static int input (void)
#endif
/* %endif */
/* %if-c++-only */
/* %endif */
{
int c;
*(yy_c_buf_p) = (yy_hold_char);
if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
{
/* yy_c_buf_p now points to the character we want to return.
* If this occurs *before* the EOB characters, then it's a
* valid NUL; if not, then we've hit the end of the buffer.
*/
if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
/* This was really a NUL. */
*(yy_c_buf_p) = '\0';
else
{ /* need more input */
yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
++(yy_c_buf_p);
switch ( yy_get_next_buffer( ) )
{
case EOB_ACT_LAST_MATCH:
/* This happens because yy_g_n_b()
* sees that we've accumulated a
* token and flags that we need to
* try matching the token before
* proceeding. But for input(),
* there's no matching to consider.
* So convert the EOB_ACT_LAST_MATCH
* to EOB_ACT_END_OF_FILE.
*/
/* Reset buffer status. */
gram_restart(gram_in );
/*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{
if ( gram_wrap( ) )
return EOF;
if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
#ifdef __cplusplus
return yyinput();
#else
return input();
#endif
}
case EOB_ACT_CONTINUE_SCAN:
(yy_c_buf_p) = (yytext_ptr) + offset;
break;
}
}
}
c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
*(yy_c_buf_p) = '\0'; /* preserve gram_text */
(yy_hold_char) = *++(yy_c_buf_p);
/* %% [19.0] update BOL and gram_lineno */
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
return c;
}
/* %if-c-only */
#endif /* ifndef YY_NO_INPUT */
/* %endif */
/** Immediately switch to a different input stream.
* @param input_file A readable stream.
*
* @note This function does not reset the start condition to @c INITIAL .
*/
/* %if-c-only */
void gram_restart (FILE * input_file )
/* %endif */
/* %if-c++-only */
/* %endif */
{
if ( ! YY_CURRENT_BUFFER ){
gram_ensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
gram__create_buffer(gram_in,YY_BUF_SIZE );
}
gram__init_buffer(YY_CURRENT_BUFFER,input_file );
gram__load_buffer_state( );
}
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
*
*/
/* %if-c-only */
void gram__switch_to_buffer (YY_BUFFER_STATE new_buffer )
/* %endif */
/* %if-c++-only */
/* %endif */
{
/* TODO. We should be able to replace this entire function body
* with
* gram_pop_buffer_state();
* gram_push_buffer_state(new_buffer);
*/
gram_ensure_buffer_stack ();
if ( YY_CURRENT_BUFFER == new_buffer )
return;
if ( YY_CURRENT_BUFFER )
{
/* Flush out information for old buffer. */
*(yy_c_buf_p) = (yy_hold_char);
YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
YY_CURRENT_BUFFER_LVALUE = new_buffer;
gram__load_buffer_state( );
/* We don't actually know whether we did this switch during
* EOF (gram_wrap()) processing, but the only time this flag
* is looked at is after gram_wrap() is called, so it's safe
* to go ahead and always set it.
*/
(yy_did_buffer_switch_on_eof) = 1;
}
/* %if-c-only */
static void gram__load_buffer_state (void)
/* %endif */
/* %if-c++-only */
/* %endif */
{
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
gram_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
(yy_hold_char) = *(yy_c_buf_p);
}
/** Allocate and initialize an input buffer state.
* @param file A readable stream.
* @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
*
* @return the allocated buffer state.
*/
/* %if-c-only */
YY_BUFFER_STATE gram__create_buffer (FILE * file, int size )
/* %endif */
/* %if-c++-only */
/* %endif */
{
YY_BUFFER_STATE b;
b = (YY_BUFFER_STATE) gram_alloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in gram__create_buffer()" );
b->yy_buf_size = size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
b->yy_ch_buf = (char *) gram_alloc(b->yy_buf_size + 2 );
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in gram__create_buffer()" );
b->yy_is_our_buffer = 1;
gram__init_buffer(b,file );
return b;
}
/** Destroy the buffer.
* @param b a buffer created with gram__create_buffer()
*
*/
/* %if-c-only */
void gram__delete_buffer (YY_BUFFER_STATE b )
/* %endif */
/* %if-c++-only */
/* %endif */
{
if ( ! b )
return;
if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
gram_free((void *) b->yy_ch_buf );
gram_free((void *) b );
}
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
* such as during a gram_restart() or at EOF.
*/
/* %if-c-only */
static void gram__init_buffer (YY_BUFFER_STATE b, FILE * file )
/* %endif */
/* %if-c++-only */
/* %endif */
{
int oerrno = errno;
gram__flush_buffer(b );
b->yy_input_file = file;
b->yy_fill_buffer = 1;
/* If b is the current buffer, then gram__init_buffer was _probably_
* called from gram_restart() or through yy_get_next_buffer.
* In that case, we don't want to reset the lineno or column.
*/
if (b != YY_CURRENT_BUFFER){
b->yy_bs_lineno = 1;
b->yy_bs_column = 0;
}
/* %if-c-only */
b->yy_is_interactive = 0;
/* %endif */
/* %if-c++-only */
/* %endif */
errno = oerrno;
}
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
*
*/
/* %if-c-only */
void gram__flush_buffer (YY_BUFFER_STATE b )
/* %endif */
/* %if-c++-only */
/* %endif */
{
if ( ! b )
return;
b->yy_n_chars = 0;
/* We always need two end-of-buffer characters. The first causes
* a transition to the end-of-buffer state. The second causes
* a jam in that state.
*/
b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
b->yy_buf_pos = &b->yy_ch_buf[0];
b->yy_at_bol = 1;
b->yy_buffer_status = YY_BUFFER_NEW;
if ( b == YY_CURRENT_BUFFER )
gram__load_buffer_state( );
}
/* %if-c-or-c++ */
/** Pushes the new state onto the stack. The new state becomes
* the current state. This function will allocate the stack
* if necessary.
* @param new_buffer The new state.
*
*/
/* %if-c-only */
void gram_push_buffer_state (YY_BUFFER_STATE new_buffer )
/* %endif */
/* %if-c++-only */
/* %endif */
{
if (new_buffer == NULL)
return;
gram_ensure_buffer_stack();
/* This block is copied from gram__switch_to_buffer. */
if ( YY_CURRENT_BUFFER )
{
/* Flush out information for old buffer. */
*(yy_c_buf_p) = (yy_hold_char);
YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
/* Only push if top exists. Otherwise, replace top. */
if (YY_CURRENT_BUFFER)
(yy_buffer_stack_top)++;
YY_CURRENT_BUFFER_LVALUE = new_buffer;
/* copied from gram__switch_to_buffer. */
gram__load_buffer_state( );
(yy_did_buffer_switch_on_eof) = 1;
}
/* %endif */
/* %if-c-or-c++ */
/** Removes and deletes the top of the stack, if present.
* The next element becomes the new top.
*
*/
/* %if-c-only */
void gram_pop_buffer_state (void)
/* %endif */
/* %if-c++-only */
/* %endif */
{
if (!YY_CURRENT_BUFFER)
return;
gram__delete_buffer(YY_CURRENT_BUFFER );
YY_CURRENT_BUFFER_LVALUE = NULL;
if ((yy_buffer_stack_top) > 0)
--(yy_buffer_stack_top);
if (YY_CURRENT_BUFFER) {
gram__load_buffer_state( );
(yy_did_buffer_switch_on_eof) = 1;
}
}
/* %endif */
/* %if-c-or-c++ */
/* Allocates the stack if it does not exist.
* Guarantees space for at least one push.
*/
/* %if-c-only */
static void gram_ensure_buffer_stack (void)
/* %endif */
/* %if-c++-only */
/* %endif */
{
yy_size_t num_to_alloc;
if (!(yy_buffer_stack)) {
/* First allocation is just for 2 elements, since we don't know if this
* scanner will even need a stack. We use 2 instead of 1 to avoid an
* immediate realloc on the next call.
*/
num_to_alloc = 1;
(yy_buffer_stack) = (struct yy_buffer_state**)gram_alloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
);
if ( ! (yy_buffer_stack) )
YY_FATAL_ERROR( "out of dynamic memory in gram_ensure_buffer_stack()" );
memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
(yy_buffer_stack_max) = num_to_alloc;
(yy_buffer_stack_top) = 0;
return;
}
if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
/* Increase the buffer to prepare for a possible push. */
int grow_size = 8 /* arbitrary grow size */;
num_to_alloc = (yy_buffer_stack_max) + grow_size;
(yy_buffer_stack) = (struct yy_buffer_state**)gram_realloc
((yy_buffer_stack),
num_to_alloc * sizeof(struct yy_buffer_state*)
);
if ( ! (yy_buffer_stack) )
YY_FATAL_ERROR( "out of dynamic memory in gram_ensure_buffer_stack()" );
/* zero only the new slots.*/
memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
(yy_buffer_stack_max) = num_to_alloc;
}
}
/* %endif */
/* %if-c-only */
/** Setup the input buffer state to scan directly from a user-specified character buffer.
* @param base the character buffer
* @param size the size in bytes of the character buffer
*
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE gram__scan_buffer (char * base, yy_size_t size )
{
YY_BUFFER_STATE b;
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
/* They forgot to leave room for the EOB's. */
return 0;
b = (YY_BUFFER_STATE) gram_alloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in gram__scan_buffer()" );
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
b->yy_input_file = 0;
b->yy_n_chars = b->yy_buf_size;
b->yy_is_interactive = 0;
b->yy_at_bol = 1;
b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW;
gram__switch_to_buffer(b );
return b;
}
/* %endif */
/* %if-c-only */
/** Setup the input buffer state to scan a string. The next call to gram_lex() will
* scan from a @e copy of @a str.
* @param yystr a NUL-terminated string to scan
*
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
* gram__scan_bytes() instead.
*/
YY_BUFFER_STATE gram__scan_string (yyconst char * yystr )
{
return gram__scan_bytes(yystr,strlen(yystr) );
}
/* %endif */
/* %if-c-only */
/** Setup the input buffer state to scan the given bytes. The next call to gram_lex() will
* scan from a @e copy of @a bytes.
* @param yybytes the byte buffer to scan
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
*
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE gram__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
int i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
buf = (char *) gram_alloc(n );
if ( ! buf )
YY_FATAL_ERROR( "out of dynamic memory in gram__scan_bytes()" );
for ( i = 0; i < _yybytes_len; ++i )
buf[i] = yybytes[i];
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
b = gram__scan_buffer(buf,n );
if ( ! b )
YY_FATAL_ERROR( "bad buffer in gram__scan_bytes()" );
/* It's okay to grow etc. this buffer, and we should throw it
* away when we're done.
*/
b->yy_is_our_buffer = 1;
return b;
}
/* %endif */
#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#endif
/* %if-c-only */
static void yy_fatal_error (yyconst char* msg )
{
(void) fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
/* %endif */
/* %if-c++-only */
/* %endif */
/* Redefine yyless() so it works in section 3 code. */
#undef yyless
#define yyless(n) \
do \
{ \
/* Undo effects of setting up gram_text. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
gram_text[gram_leng] = (yy_hold_char); \
(yy_c_buf_p) = gram_text + yyless_macro_arg; \
(yy_hold_char) = *(yy_c_buf_p); \
*(yy_c_buf_p) = '\0'; \
gram_leng = yyless_macro_arg; \
} \
while ( 0 )
/* Accessor methods (get/set functions) to struct members. */
/* %if-c-only */
/* %if-reentrant */
/* %endif */
/** Get the current line number.
*
*/
int gram_get_lineno (void)
{
return gram_lineno;
}
/** Get the input stream.
*
*/
FILE *gram_get_in (void)
{
return gram_in;
}
/** Get the output stream.
*
*/
FILE *gram_get_out (void)
{
return gram_out;
}
/** Get the length of the current token.
*
*/
yy_size_t gram_get_leng (void)
{
return gram_leng;
}
/** Get the current token.
*
*/
char *gram_get_text (void)
{
return gram_text;
}
/* %if-reentrant */
/* %endif */
/** Set the current line number.
* @param line_number
*
*/
void gram_set_lineno (int line_number )
{
gram_lineno = line_number;
}
/** Set the input stream. This does not discard the current
* input buffer.
* @param in_str A readable stream.
*
* @see gram__switch_to_buffer
*/
void gram_set_in (FILE * in_str )
{
gram_in = in_str ;
}
void gram_set_out (FILE * out_str )
{
gram_out = out_str ;
}
int gram_get_debug (void)
{
return gram__flex_debug;
}
void gram_set_debug (int bdebug )
{
gram__flex_debug = bdebug ;
}
/* %endif */
/* %if-reentrant */
/* %if-bison-bridge */
/* %endif */
/* %endif if-c-only */
/* %if-c-only */
static int yy_init_globals (void)
{
/* Initialization is the same as for the non-reentrant scanner.
* This function is called from gram_lex_destroy(), so don't allocate here.
*/
(yy_buffer_stack) = 0;
(yy_buffer_stack_top) = 0;
(yy_buffer_stack_max) = 0;
(yy_c_buf_p) = (char *) 0;
(yy_init) = 0;
(yy_start) = 0;
/* Defined in main.c */
#ifdef YY_STDINIT
gram_in = stdin;
gram_out = stdout;
#else
gram_in = (FILE *) 0;
gram_out = (FILE *) 0;
#endif
/* For future reference: Set errno on error, since we are called by
* gram_lex_init()
*/
return 0;
}
/* %endif */
/* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
/* gram_lex_destroy is for both reentrant and non-reentrant scanners. */
int gram_lex_destroy (void)
{
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
gram__delete_buffer(YY_CURRENT_BUFFER );
YY_CURRENT_BUFFER_LVALUE = NULL;
gram_pop_buffer_state();
}
/* Destroy the stack itself. */
gram_free((yy_buffer_stack) );
(yy_buffer_stack) = NULL;
/* Reset the globals. This is important in a non-reentrant scanner so the next time
* gram_lex() is called, initialization will occur. */
yy_init_globals( );
/* %if-reentrant */
/* %endif */
return 0;
}
/* %endif */
/*
* Internal utility routines.
*/
#ifndef yytext_ptr
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
{
register int i;
for ( i = 0; i < n; ++i )
s1[i] = s2[i];
}
#endif
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * s )
{
register int n;
for ( n = 0; s[n]; ++n )
;
return n;
}
#endif
void *gram_alloc (yy_size_t size )
{
return (void *) malloc( size );
}
void *gram_realloc (void * ptr, yy_size_t size )
{
/* The cast to (char *) in the following accommodates both
* implementations that use char* generic pointers, and those
* that use void* generic pointers. It works with the latter
* because both ANSI C and C++ allow castless assignment from
* any pointer type to void*, and deal with argument conversions
* as though doing an assignment.
*/
return (void *) realloc( (char *) ptr, size );
}
void gram_free (void * ptr )
{
free( (char *) ptr ); /* see gram_realloc() for (char *) cast */
}
/* %if-tables-serialization definitions */
/* %define-yytables The name for this specific scanner's tables. */
#define YYTABLES_NAME "yytables"
/* %endif */
/* %ok-for-header */
#line 793 "/Users/akim/src/gnu/bison/src/scan-gram.l"
/* Read bytes from FP into buffer BUF of size SIZE. Return the
number of bytes read. Remove '\r' from input, treating \r\n
and isolated \r as \n. */
static size_t
no_cr_read (FILE *fp, char *buf, size_t size)
{
size_t bytes_read = fread (buf, 1, size, fp);
if (bytes_read)
{
char *w = memchr (buf, '\r', bytes_read);
if (w)
{
char const *r = ++w;
char const *lim = buf + bytes_read;
for (;;)
{
/* Found an '\r'. Treat it like '\n', but ignore any
'\n' that immediately follows. */
w[-1] = '\n';
if (r == lim)
{
int ch = getc (fp);
if (ch != '\n' && ungetc (ch, fp) != ch)
break;
}
else if (*r == '\n')
r++;
/* Copy until the next '\r'. */
do
{
if (r == lim)
return w - buf;
}
while ((*w++ = *r++) != '\r');
}
return w - buf;
}
}
return bytes_read;
}
/*------------------------------------------------------.
| Scan NUMBER for a base-BASE integer at location LOC. |
`------------------------------------------------------*/
static unsigned long int
scan_integer (char const *number, int base, location loc)
{
verify (INT_MAX < ULONG_MAX);
unsigned long int num = strtoul (number, NULL, base);
if (INT_MAX < num)
{
complain (&loc, complaint, _("integer out of range: %s"),
quote (number));
num = INT_MAX;
}
return num;
}
/*------------------------------------------------------------------.
| Convert universal character name UCN to a single-byte character, |
| and return that character. Return -1 if UCN does not correspond |
| to a single-byte character. |
`------------------------------------------------------------------*/
static int
convert_ucn_to_byte (char const *ucn)
{
verify (UCHAR_MAX <= INT_MAX);
unsigned long int code = strtoul (ucn + 2, NULL, 16);
/* FIXME: Currently we assume Unicode-compatible unibyte characters
on ASCII hosts (i.e., Latin-1 on hosts with 8-bit bytes). On
non-ASCII hosts we support only the portable C character set.
These limitations should be removed once we add support for
multibyte characters. */
if (UCHAR_MAX < code)
return -1;
#if ! ('$' == 0x24 && '@' == 0x40 && '`' == 0x60 && '~' == 0x7e)
{
/* A non-ASCII host. Use CODE to index into a table of the C
basic execution character set, which is guaranteed to exist on
all Standard C platforms. This table also includes '$', '@',
and '`', which are not in the basic execution character set but
which are unibyte characters on all the platforms that we know
about. */
static signed char const table[] =
{
'\0', -1, -1, -1, -1, -1, -1, '\a',
'\b', '\t', '\n', '\v', '\f', '\r', -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
' ', '!', '"', '#', '$', '%', '&', '\'',
'(', ')', '*', '+', ',', '-', '.', '/',
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', ':', ';', '<', '=', '>', '?',
'@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
'`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
'x', 'y', 'z', '{', '|', '}', '~'
};
code = code < sizeof table ? table[code] : -1;
}
#endif
return code;
}
/*---------------------------------------------------------------------.
| Handle '#line INT( "FILE")?\n'. ARGS has already skipped '#line '. |
`---------------------------------------------------------------------*/
static void
handle_syncline (char *args, location loc)
{
char *file;
unsigned long int lineno = strtoul (args, &file, 10);
if (INT_MAX <= lineno)
{
complain (&loc, Wother, _("line number overflow"));
lineno = INT_MAX;
}
file = strchr (file, '"');
if (file)
{
*strchr (file + 1, '"') = '\0';
current_file = uniqstr_new (file + 1);
}
boundary_set (&scanner_cursor, current_file, lineno, 1);
}
/*----------------------------------------------------------------.
| For a token or comment starting at START, report message MSGID, |
| which should say that an end marker was found before the |
| expected TOKEN_END. Then, pretend that TOKEN_END was found. |
`----------------------------------------------------------------*/
static void
unexpected_end (boundary start, char const *msgid, char const *token_end)
{
location loc;
loc.start = start;
loc.end = scanner_cursor;
size_t i = strlen (token_end);
/* Adjust scanner cursor so that any later message does not count
the characters about to be inserted. */
scanner_cursor.column -= i;
while (i != 0)
unput (token_end[--i]);
token_end = quote (token_end);
/* Instead of '\'', display "'". */
if (STREQ (token_end, "'\\''"))
token_end = "\"'\"";
complain (&loc, complaint, _(msgid), token_end);
}
/*------------------------------------------------------------------------.
| Report an unexpected EOF in a token or comment starting at START. |
| An end of file was encountered and the expected TOKEN_END was missing. |
| After reporting the problem, pretend that TOKEN_END was found. |
`------------------------------------------------------------------------*/
static void
unexpected_eof (boundary start, char const *token_end)
{
unexpected_end (start, N_("missing %s at end of file"), token_end);
}
/*----------------------------------------.
| Likewise, but for unexpected newlines. |
`----------------------------------------*/
static void
unexpected_newline (boundary start, char const *token_end)
{
unexpected_end (start, N_("missing %s at end of line"), token_end);
}
/*-------------------------.
| Initialize the scanner. |
`-------------------------*/
void
gram_scanner_initialize (void)
{
obstack_init (&obstack_for_string);
}
/*-----------------------------------------------.
| Free all the memory allocated to the scanner. |
`-----------------------------------------------*/
void
gram_scanner_free (void)
{
obstack_free (&obstack_for_string, 0);
/* Reclaim Flex's buffers. */
gram_lex_destroy ();
}