/* A lexical scanner generated by flex */
/* %not-for-header */
-
/* %if-c-only */
/* %if-not-reentrant */
#define yy_create_buffer code__create_buffer
#define yy_delete_buffer code__delete_buffer
-#define yy_flex_debug code__flex_debug
+#define yy_scan_buffer code__scan_buffer
+#define yy_scan_string code__scan_string
+#define yy_scan_bytes code__scan_bytes
#define yy_init_buffer code__init_buffer
#define yy_flush_buffer code__flush_buffer
#define yy_load_buffer_state code__load_buffer_state
#define yy_switch_to_buffer code__switch_to_buffer
+#define yypush_buffer_state code_push_buffer_state
+#define yypop_buffer_state code_pop_buffer_state
+#define yyensure_buffer_stack code_ensure_buffer_stack
+#define yy_flex_debug code__flex_debug
#define yyin code_in
#define yyleng code_leng
#define yylex code_lex
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_MINOR_VERSION 6
+#define YY_FLEX_SUBMINOR_VERSION 4
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
/* %endif */
/* %if-c-only */
-
+#ifdef yy_create_buffer
+#define code__create_buffer_ALREADY_DEFINED
+#else
+#define yy_create_buffer code__create_buffer
+#endif
+
+#ifdef yy_delete_buffer
+#define code__delete_buffer_ALREADY_DEFINED
+#else
+#define yy_delete_buffer code__delete_buffer
+#endif
+
+#ifdef yy_scan_buffer
+#define code__scan_buffer_ALREADY_DEFINED
+#else
+#define yy_scan_buffer code__scan_buffer
+#endif
+
+#ifdef yy_scan_string
+#define code__scan_string_ALREADY_DEFINED
+#else
+#define yy_scan_string code__scan_string
+#endif
+
+#ifdef yy_scan_bytes
+#define code__scan_bytes_ALREADY_DEFINED
+#else
+#define yy_scan_bytes code__scan_bytes
+#endif
+
+#ifdef yy_init_buffer
+#define code__init_buffer_ALREADY_DEFINED
+#else
+#define yy_init_buffer code__init_buffer
+#endif
+
+#ifdef yy_flush_buffer
+#define code__flush_buffer_ALREADY_DEFINED
+#else
+#define yy_flush_buffer code__flush_buffer
+#endif
+
+#ifdef yy_load_buffer_state
+#define code__load_buffer_state_ALREADY_DEFINED
+#else
+#define yy_load_buffer_state code__load_buffer_state
+#endif
+
+#ifdef yy_switch_to_buffer
+#define code__switch_to_buffer_ALREADY_DEFINED
+#else
+#define yy_switch_to_buffer code__switch_to_buffer
+#endif
+
+#ifdef yypush_buffer_state
+#define code_push_buffer_state_ALREADY_DEFINED
+#else
+#define yypush_buffer_state code_push_buffer_state
+#endif
+
+#ifdef yypop_buffer_state
+#define code_pop_buffer_state_ALREADY_DEFINED
+#else
+#define yypop_buffer_state code_pop_buffer_state
+#endif
+
+#ifdef yyensure_buffer_stack
+#define code_ensure_buffer_stack_ALREADY_DEFINED
+#else
+#define yyensure_buffer_stack code_ensure_buffer_stack
+#endif
+
+#ifdef yylex
+#define code_lex_ALREADY_DEFINED
+#else
+#define yylex code_lex
+#endif
+
+#ifdef yyrestart
+#define code_restart_ALREADY_DEFINED
+#else
+#define yyrestart code_restart
+#endif
+
+#ifdef yylex_init
+#define code_lex_init_ALREADY_DEFINED
+#else
+#define yylex_init code_lex_init
+#endif
+
+#ifdef yylex_init_extra
+#define code_lex_init_extra_ALREADY_DEFINED
+#else
+#define yylex_init_extra code_lex_init_extra
+#endif
+
+#ifdef yylex_destroy
+#define code_lex_destroy_ALREADY_DEFINED
+#else
+#define yylex_destroy code_lex_destroy
+#endif
+
+#ifdef yyget_debug
+#define code_get_debug_ALREADY_DEFINED
+#else
+#define yyget_debug code_get_debug
+#endif
+
+#ifdef yyset_debug
+#define code_set_debug_ALREADY_DEFINED
+#else
+#define yyset_debug code_set_debug
+#endif
+
+#ifdef yyget_extra
+#define code_get_extra_ALREADY_DEFINED
+#else
+#define yyget_extra code_get_extra
+#endif
+
+#ifdef yyset_extra
+#define code_set_extra_ALREADY_DEFINED
+#else
+#define yyset_extra code_set_extra
+#endif
+
+#ifdef yyget_in
+#define code_get_in_ALREADY_DEFINED
+#else
+#define yyget_in code_get_in
+#endif
+
+#ifdef yyset_in
+#define code_set_in_ALREADY_DEFINED
+#else
+#define yyset_in code_set_in
+#endif
+
+#ifdef yyget_out
+#define code_get_out_ALREADY_DEFINED
+#else
+#define yyget_out code_get_out
+#endif
+
+#ifdef yyset_out
+#define code_set_out_ALREADY_DEFINED
+#else
+#define yyset_out code_set_out
+#endif
+
+#ifdef yyget_leng
+#define code_get_leng_ALREADY_DEFINED
+#else
+#define yyget_leng code_get_leng
+#endif
+
+#ifdef yyget_text
+#define code_get_text_ALREADY_DEFINED
+#else
+#define yyget_text code_get_text
+#endif
+
+#ifdef yyget_lineno
+#define code_get_lineno_ALREADY_DEFINED
+#else
+#define yyget_lineno code_get_lineno
+#endif
+
+#ifdef yyset_lineno
+#define code_set_lineno_ALREADY_DEFINED
+#else
+#define yyset_lineno code_set_lineno
+#endif
+
+#ifdef yywrap
+#define code_wrap_ALREADY_DEFINED
+#else
+#define yywrap code_wrap
+#endif
+
/* %endif */
+#ifdef yyalloc
+#define code_alloc_ALREADY_DEFINED
+#else
+#define yyalloc code_alloc
+#endif
+
+#ifdef yyrealloc
+#define code_realloc_ALREADY_DEFINED
+#else
+#define yyrealloc code_realloc
+#endif
+
+#ifdef yyfree
+#define code_free_ALREADY_DEFINED
+#else
+#define yyfree code_free
+#endif
+
/* %if-c-only */
+#ifdef yytext
+#define code_text_ALREADY_DEFINED
+#else
+#define yytext code_text
+#endif
+
+#ifdef yyleng
+#define code_leng_ALREADY_DEFINED
+#else
+#define yyleng code_leng
+#endif
+
+#ifdef yyin
+#define code_in_ALREADY_DEFINED
+#else
+#define yyin code_in
+#endif
+
+#ifdef yyout
+#define code_out_ALREADY_DEFINED
+#else
+#define yyout code_out
+#endif
+
+#ifdef yy_flex_debug
+#define code__flex_debug_ALREADY_DEFINED
+#else
+#define yy_flex_debug code__flex_debug
+#endif
+
+#ifdef yylineno
+#define code_lineno_ALREADY_DEFINED
+#else
+#define yylineno code_lineno
+#endif
+
/* %endif */
/* First, we deal with platform-specific or compiler-specific issues. */
#define UINT32_MAX (4294967295U)
#endif
+#ifndef SIZE_MAX
+#define SIZE_MAX (~(size_t)0)
+#endif
+
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
/* %endif */
+/* begin standard C++ headers. */
/* %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
+/* TODO: this is always defined, so inline it */
#define yyconst const
+
+#if defined(__GNUC__) && __GNUC__ >= 3
+#define yynoreturn __attribute__((__noreturn__))
#else
-#define yyconst
+#define yynoreturn
#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.
+/* Promotes a possibly negative, possibly signed char to an
+ * integer in range [0..255] for use as an array index.
*/
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
/* %ok-for-header */
/* %if-reentrant */
* 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 code_restart(code_in )
-
+#define YY_NEW_FILE yyrestart( yyin )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
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 int code_leng;
+extern int yyleng;
/* %endif */
/* %if-c-only */
/* %if-not-reentrant */
-extern FILE *code_in, *code_out;
+extern FILE *yyin, *yyout;
/* %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)
+ #define YY_LINENO_REWIND_TO(ptr)
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
{ \
- /* Undo effects of setting up code_text. */ \
+ /* Undo effects of setting up yytext. */ \
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 code_text again */ \
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )
-
#if 1
#define unput(c) \
do { \
#define unput(c) yyunput( c, (yytext_ptr) )
#endif
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
- yy_size_t yy_buf_size;
+ int yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
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.
*/
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
- * (via code_restart()), so that the user can continue scanning by
- * just pointing code_in at a new input file.
+ * (via yyrestart()), so that the user can continue scanning by
+ * just pointing yyin at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
/* %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. */
+static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
/* %endif */
/* %ok-for-header */
#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.
*/
/* %if-not-reentrant */
/* %not-for-header */
-
-/* yy_hold_char holds the character lost when code_text is formed. */
+/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_char;
static int yy_n_chars; /* number of characters read into yy_ch_buf */
-int code_leng;
+int yyleng;
/* Points to current character in buffer. */
-static char *yy_c_buf_p = (char *) 0;
+static char *yy_c_buf_p = NULL;
static int yy_init = 0; /* whether we need to initialize */
static int yy_start = 0; /* start state number */
-/* Flag which is used to allow code_wrap()'s to do buffer switches
- * instead of setting up a fresh code_in. A bit of a hack ...
+/* Flag which is used to allow yywrap()'s to do buffer switches
+ * instead of setting up a fresh yyin. A bit of a hack ...
*/
static int yy_did_buffer_switch_on_eof;
/* %ok-for-header */
/* %endif */
-void code_restart (FILE *input_file );
-void code__switch_to_buffer (YY_BUFFER_STATE new_buffer );
-YY_BUFFER_STATE code__create_buffer (FILE *file,int size );
-void code__delete_buffer (YY_BUFFER_STATE b );
-void code__flush_buffer (YY_BUFFER_STATE b );
-void code_push_buffer_state (YY_BUFFER_STATE new_buffer );
-void code_pop_buffer_state (void );
-
-static void code_ensure_buffer_stack (void );
-static void code__load_buffer_state (void );
-static void code__init_buffer (YY_BUFFER_STATE b,FILE *file );
+void yyrestart ( FILE *input_file );
+void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
+YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
+void yy_delete_buffer ( YY_BUFFER_STATE b );
+void yy_flush_buffer ( YY_BUFFER_STATE b );
+void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
+void yypop_buffer_state ( void );
-#define YY_FLUSH_BUFFER code__flush_buffer(YY_CURRENT_BUFFER )
+static void yyensure_buffer_stack ( void );
+static void yy_load_buffer_state ( void );
+static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
+#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
-YY_BUFFER_STATE code__scan_buffer (char *base,yy_size_t size );
-YY_BUFFER_STATE code__scan_string (yyconst char *yy_str );
-YY_BUFFER_STATE code__scan_bytes (yyconst char *bytes,int len );
+YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
+YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
+YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
/* %endif */
-void *code_alloc (yy_size_t );
-void *code_realloc (void *,yy_size_t );
-void code_free (void * );
-
-#define yy_new_buffer code__create_buffer
+void *yyalloc ( yy_size_t );
+void *yyrealloc ( void *, yy_size_t );
+void yyfree ( void * );
+#define yy_new_buffer yy_create_buffer
#define yy_set_interactive(is_interactive) \
{ \
if ( ! YY_CURRENT_BUFFER ){ \
- code_ensure_buffer_stack (); \
+ yyensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \
- code__create_buffer(code_in,YY_BUF_SIZE ); \
+ yy_create_buffer( yyin, YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
-
#define yy_set_bol(at_bol) \
{ \
if ( ! YY_CURRENT_BUFFER ){\
- code_ensure_buffer_stack (); \
+ yyensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \
- code__create_buffer(code_in,YY_BUF_SIZE ); \
+ yy_create_buffer( yyin, 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] code_text/code_in/code_out/yy_state_type/code_lineno etc. def's & init go here */
+/* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
/* Begin user sect3 */
-#define code_wrap(n) 1
+#define code_wrap() (/*CONSTCOND*/1)
#define YY_SKIP_YYWRAP
#define FLEX_DEBUG
+typedef flex_uint8_t YY_CHAR;
-typedef unsigned char YY_CHAR;
-
-FILE *code_in = (FILE *) 0, *code_out = (FILE *) 0;
+FILE *yyin = NULL, *yyout = NULL;
typedef int yy_state_type;
-extern int code_lineno;
+extern int yylineno;
+int yylineno = 1;
-int code_lineno = 1;
+extern char *yytext;
+#ifdef yytext_ptr
+#undef yytext_ptr
+#endif
+#define yytext_ptr yytext
-extern char *code_text;
-#define yytext_ptr code_text
+/* %% [1.5] DFA */
/* %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[] );
+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 yynoreturn yy_fatal_error ( const char* msg );
/* %endif */
/* Done after the current pattern has been matched and before the
- * corresponding action - sets up code_text.
+ * corresponding action - sets up yytext.
*/
#define YY_DO_BEFORE_ACTION \
(yytext_ptr) = yy_bp; \
-/* %% [2.0] code to fiddle code_text and code_leng for yymore() goes here \ */\
- code_leng = (size_t) (yy_cp - yy_bp); \
+/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
+ yyleng = (int) (yy_cp - yy_bp); \
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
-/* %% [3.0] code to copy yytext_ptr to code_text[] goes here, if %array \ */\
+/* %% [3.0] code to copy yytext_ptr to yytext[] 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 18
#define YY_END_OF_BUFFER 19
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[91] =
+static const flex_int16_t yy_accept[91] =
{ 0,
0, 0, 0, 0, 3, 3, 4, 4, 4, 4,
0, 0, 0, 0, 19, 17, 16, 17, 2, 17,
12, 12, 0, 14, 12, 12, 0, 0, 0, 0
} ;
-static yyconst flex_int32_t yy_ec[256] =
+static const YY_CHAR yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1
} ;
-static yyconst flex_int32_t yy_meta[19] =
+static const YY_CHAR yy_meta[19] =
{ 0,
1, 1, 2, 1, 1, 1, 1, 3, 3, 1,
3, 1, 2, 1, 1, 1, 1, 2
} ;
-static yyconst flex_int16_t yy_base[97] =
+static const flex_int16_t yy_base[97] =
{ 0,
0, 13, 121, 120, 0, 3, 4, 5, 6, 7,
27, 0, 20, 21, 125, 178, 178, 26, 178, 8,
} ;
-static yyconst flex_int16_t yy_def[97] =
+static const flex_int16_t yy_def[97] =
{ 0,
91, 91, 2, 2, 2, 2, 2, 2, 2, 2,
2, 11, 11, 11, 90, 90, 90, 90, 90, 90,
} ;
-static yyconst flex_int16_t yy_nxt[197] =
+static const flex_int16_t yy_nxt[197] =
{ 0,
90, 90, 19, 69, 17, 19, 63, 21, 21, 33,
34, 23, 23, 17, 17, 20, 17, 17, 20, 22,
} ;
-static yyconst flex_int16_t yy_chk[197] =
+static const flex_int16_t yy_chk[197] =
{ 0,
0, 0, 5, 95, 1, 6, 93, 7, 8, 20,
20, 9, 10, 1, 1, 5, 1, 2, 6, 7,
static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;
-extern int code__flex_debug;
-int code__flex_debug = 1;
+extern int yy_flex_debug;
+int yy_flex_debug = 1;
-static yyconst flex_int16_t yy_rule_linenum[18] =
+static const flex_int16_t yy_rule_linenum[18] =
{ 0,
- 125, 135, 136, 146, 151, 156, 162, 163, 164, 165,
- 167, 175, 181, 191, 209, 222, 225
+ 126, 136, 137, 147, 152, 157, 163, 164, 165, 166,
+ 168, 176, 182, 192, 210, 223, 226
} ;
/* The intent behind this definition is that it'll catch
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
-char *code_text;
+char *yytext;
#line 1 "src/scan-code.l"
/* Bison Action Scanner -*- C -*-
# define YY_DECL static char *code_lex (code_props *self, int sc_context)
YY_DECL;
-#define YY_USER_ACTION location_compute (loc, &loc->end, code_text, code_leng);
+#define YY_USER_ACTION location_compute (loc, &loc->end, yytext, yyleng);
static char *fetch_type_name (char *cp, char const **type_name,
location dollar_loc);
void code_piece_append(const char *str);
void code_piece_escape(const char *p, size_t n);
void code_piece_flush(size_t n);
-void code_piece_pack();
+void code_piece_pack(void);
int no_handle_action;
-/* C and C++ comments in code. */
+#line 934 "src/scan-code.c"
+#line 82 "src/scan-code.l"
+ /* C and C++ comments in code. */
-/* Strings and characters in code. */
+ /* Strings and characters in code. */
-/* Whether in a rule or symbol action. Specifies the translation
-of $ and @. */
+ /* Whether in a rule or symbol action. Specifies the translation
+ of $ and @. */
/* 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
/* C style identifier. Must start with letter. Will be used for
named symbol references. Shall be kept synchronized with
scan-gram.l "letter" and "id". */
-#line 732 "src/scan-code.c"
+#line 952 "src/scan-code.c"
#define INITIAL 0
#define SC_COMMENT 1
/* %if-reentrant */
/* %if-c-only */
-static int yy_init_globals (void );
+static int yy_init_globals ( void );
/* %endif */
/* %if-reentrant */
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
-int code_lex_destroy (void );
+int yylex_destroy ( void );
-int code_get_debug (void );
+int yyget_debug ( void );
-void code_set_debug (int debug_flag );
+void yyset_debug ( int debug_flag );
-YY_EXTRA_TYPE code_get_extra (void );
+YY_EXTRA_TYPE yyget_extra ( void );
-void code_set_extra (YY_EXTRA_TYPE user_defined );
+void yyset_extra ( YY_EXTRA_TYPE user_defined );
-FILE *code_get_in (void );
+FILE *yyget_in ( void );
-void code_set_in (FILE * in_str );
+void yyset_in ( FILE * _in_str );
-FILE *code_get_out (void );
+FILE *yyget_out ( void );
-void code_set_out (FILE * out_str );
+void yyset_out ( FILE * _out_str );
-int code_get_leng (void );
+ int yyget_leng ( void );
-char *code_get_text (void );
+char *yyget_text ( void );
-int code_get_lineno (void );
+int yyget_lineno ( void );
-void code_set_lineno (int line_number );
+void yyset_lineno ( int _line_number );
/* %if-bison-bridge */
/* %endif */
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int code_wrap (void );
+extern "C" int yywrap ( void );
#else
-extern int code_wrap (void );
+extern int yywrap ( void );
#endif
#endif
/* %not-for-header */
-
+#ifndef YY_NO_UNPUT
+
+#endif
/* %ok-for-header */
/* %endif */
#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int );
+static void yy_flex_strncpy ( char *, const char *, int );
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * );
+static int yy_flex_strlen ( const char * );
#endif
#ifndef YY_NO_INPUT
/* %if-c-only Standard (non-C++) definition */
/* %not-for-header */
-
#ifdef __cplusplus
-static int yyinput (void );
+static int yyinput ( void );
#else
-static int input (void );
+static int input ( void );
#endif
/* %ok-for-header */
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO do { if (fwrite( code_text, code_leng, 1, code_out )) {} } while (0)
+#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
/* %endif */
/* %if-c++-only C++ definition */
/* %endif */
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
- size_t n; \
+ int n; \
for ( n = 0; n < max_size && \
- (c = getc( code_in )) != EOF && c != '\n'; ++n ) \
+ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
if ( c == '\n' ) \
buf[n++] = (char) c; \
- if ( c == EOF && ferror( code_in ) ) \
+ if ( c == EOF && ferror( yyin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
result = n; \
} \
else \
{ \
errno=0; \
- while ( (result = fread(buf, 1, max_size, code_in))==0 && ferror(code_in)) \
+ while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
{ \
if( errno != EINTR) \
{ \
break; \
} \
errno=0; \
- clearerr(code_in); \
+ clearerr(yyin); \
} \
}\
\
/* %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 */
#define YY_DECL_IS_OURS 1
/* %if-c-only Standard (non-C++) definition */
-extern int code_lex (void);
+extern int yylex (void);
-#define YY_DECL int code_lex (void)
+#define YY_DECL int yylex (void)
/* %endif */
/* %if-c++-only C++ definition */
/* %endif */
#endif /* !YY_DECL */
-/* Code executed at the beginning of each rule, after code_text and code_leng
+/* Code executed at the beginning of each rule, after yytext and yyleng
* have been set up.
*/
#ifndef YY_USER_ACTION
/* Code executed at the end of each rule. */
#ifndef YY_BREAK
-#define YY_BREAK break;
+#define YY_BREAK /*LINTED*/break;
#endif
/* %% [6.0] YY_RULE_SETUP definition goes here */
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;
+ yy_state_type yy_current_state;
+ char *yy_cp, *yy_bp;
+ int yy_act;
-/* %% [7.0] user's declarations go here */
-#line 107 "src/scan-code.l"
-
-
-
- /* This scanner is special: it is invoked only once, henceforth
- is expected to return only once. This initialization is
- therefore done once per action to translate. */
- aver (sc_context == SC_SYMBOL_ACTION
- || sc_context == SC_RULE_ACTION
- || sc_context == INITIAL);
- BEGIN sc_context;
-
-
- /*------------------------------------------------------------.
- | Scanning a C comment. The initial '/ *' is already eaten. |
- `------------------------------------------------------------*/
-
-#line 1000 "src/scan-code.c"
-
if ( !(yy_init) )
{
(yy_init) = 1;
if ( ! (yy_start) )
(yy_start) = 1; /* first start state */
- if ( ! code_in )
+ if ( ! yyin )
/* %if-c-only */
- code_in = stdin;
+ yyin = stdin;
/* %endif */
/* %if-c++-only */
/* %endif */
- if ( ! code_out )
+ if ( ! yyout )
/* %if-c-only */
- code_out = stdout;
+ yyout = stdout;
/* %endif */
/* %if-c++-only */
/* %endif */
if ( ! YY_CURRENT_BUFFER ) {
- code_ensure_buffer_stack ();
+ yyensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
- code__create_buffer(code_in,YY_BUF_SIZE );
+ yy_create_buffer( yyin, YY_BUF_SIZE );
}
- code__load_buffer_state( );
+ yy_load_buffer_state( );
}
+ {
+/* %% [7.0] user's declarations go here */
+#line 108 "src/scan-code.l"
+
+
+
+ /* This scanner is special: it is invoked only once, henceforth
+ is expected to return only once. This initialization is
+ therefore done once per action to translate. */
+ aver (sc_context == SC_SYMBOL_ACTION
+ || sc_context == SC_RULE_ACTION
+ || sc_context == INITIAL);
+ BEGIN sc_context;
+
+
+ /*------------------------------------------------------------.
+ | Scanning a C comment. The initial '/ *' is already eaten. |
+ `------------------------------------------------------------*/
+
+#line 1253 "src/scan-code.c"
+
#if 1
/* we do this so that "continue;" in an action works correctly */
for (; ; code_piece_escape(yytext, yy_c_buf_p - yytext))
#else
- while ( 1 ) /* loops until end-of-file is reached */
+ while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
#endif
{
/* %% [8.0] yymore()-related code goes here */
yy_cp = (yy_c_buf_p);
- /* Support of code_text. */
+ /* Support of yytext. */
*yy_cp = (yy_hold_char);
/* yy_bp points to the position in yy_ch_buf of the start of
yy_match:
do
{
- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ 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_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 91 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
++yy_cp;
}
while ( yy_current_state != 90 );
YY_DO_BEFORE_ACTION;
-/* %% [11.0] code for code_lineno update goes here */
+/* %% [11.0] code for yylineno update goes here */
do_action: /* This label is used only to access EOF actions. */
/* %% [12.0] debug code goes here */
- if ( code__flex_debug )
+ if ( yy_flex_debug )
{
if ( yy_act == 0 )
fprintf( stderr, "--scanner backing up\n" );
else if ( yy_act < 18 )
fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
- (long)yy_rule_linenum[yy_act], code_text );
+ (long)yy_rule_linenum[yy_act], yytext );
else if ( yy_act == 18 )
fprintf( stderr, "--accepting default rule (\"%s\")\n",
- code_text );
+ yytext );
else if ( yy_act == 19 )
fprintf( stderr, "--(end of buffer or a NUL)\n" );
else
case 1:
/* rule 1 can match eol */
YY_RULE_SETUP
-#line 125 "src/scan-code.l"
+#line 126 "src/scan-code.l"
STRING_GROW; BEGIN sc_context;
YY_BREAK
case 2:
/* rule 2 can match eol */
YY_RULE_SETUP
-#line 135 "src/scan-code.l"
+#line 136 "src/scan-code.l"
STRING_GROW; BEGIN sc_context;
YY_BREAK
case 3:
/* rule 3 can match eol */
YY_RULE_SETUP
-#line 136 "src/scan-code.l"
+#line 137 "src/scan-code.l"
STRING_GROW;
YY_BREAK
case 4:
/* rule 4 can match eol */
YY_RULE_SETUP
-#line 146 "src/scan-code.l"
+#line 147 "src/scan-code.l"
STRING_GROW;
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 151 "src/scan-code.l"
+#line 152 "src/scan-code.l"
STRING_GROW; BEGIN sc_context;
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 156 "src/scan-code.l"
+#line 157 "src/scan-code.l"
STRING_GROW; BEGIN sc_context;
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 162 "src/scan-code.l"
+#line 163 "src/scan-code.l"
STRING_GROW; BEGIN SC_CHARACTER;
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 163 "src/scan-code.l"
+#line 164 "src/scan-code.l"
STRING_GROW; BEGIN SC_STRING;
YY_BREAK
case 9:
/* rule 9 can match eol */
YY_RULE_SETUP
-#line 164 "src/scan-code.l"
+#line 165 "src/scan-code.l"
STRING_GROW; BEGIN SC_COMMENT;
YY_BREAK
case 10:
/* rule 10 can match eol */
YY_RULE_SETUP
-#line 165 "src/scan-code.l"
+#line 166 "src/scan-code.l"
STRING_GROW; BEGIN SC_LINE_COMMENT;
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 167 "src/scan-code.l"
+#line 168 "src/scan-code.l"
{
- complain (loc, Wother, _("stray '%s'"), code_text);
- obstack_escape (&obstack_for_string, code_text);
+ complain (loc, Wother, _("stray '%s'"), yytext);
+ obstack_escape (&obstack_for_string, yytext);
}
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 175 "src/scan-code.l"
+#line 176 "src/scan-code.l"
{
ref_tail_fields = NULL;
- handle_action_dollar (self->rule, code_text, *loc);
+ handle_action_dollar (self->rule, yytext, *loc);
if (ref_tail_fields)
obstack_sgrow (&obstack_for_string, ref_tail_fields);
}
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 181 "src/scan-code.l"
+#line 182 "src/scan-code.l"
{
ref_tail_fields = NULL;
- handle_action_at (self->rule, code_text, *loc);
+ handle_action_at (self->rule, yytext, *loc);
if (ref_tail_fields)
obstack_sgrow (&obstack_for_string, ref_tail_fields);
}
case 14:
YY_RULE_SETUP
-#line 191 "src/scan-code.l"
+#line 192 "src/scan-code.l"
{
int i = sprintf(code_piece_temp, "<AST_Text_ValueReference tag_name=\"");
- int j = i + sprintf(code_piece_temp + i, "%s", code_text + 2);
+ int j = i + sprintf(code_piece_temp + i, "%s", yytext + 2);
while (j > i && code_piece_temp[--j] != '>')
;
sprintf(code_piece_temp + j, "\">");
code_piece_append(code_piece_temp);
- i = strlen(code_text);
- code_piece_escape(code_text, i);
+ i = strlen(yytext);
+ code_piece_escape(yytext, i);
code_piece_append("</AST_Text_ValueReference>");
const char *type_name = NULL;
- fetch_type_name (code_text + 1, &type_name, *loc)[-1] = 0;
+ fetch_type_name (yytext + 1, &type_name, *loc)[-1] = 0;
obstack_sgrow (&obstack_for_string, "]b4_dollar_dollar(");
obstack_quote (&obstack_for_string, type_name);
obstack_sgrow (&obstack_for_string, ")[");
self->is_value_used = true;
- code_text += i;
+ yytext += i;
}
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 209 "src/scan-code.l"
+#line 210 "src/scan-code.l"
{
obstack_sgrow (&obstack_for_string, "]b4_at_dollar[");
muscle_percent_define_ensure("locations", the_location, true);
code_piece_append("<AST_Text_ValueLocation>");
- code_piece_flush(strlen(code_text));
+ code_piece_flush(strlen(yytext));
code_piece_append("</AST_Text_ValueLocation>");
}
YY_BREAK
/* Escape M4 quoting characters in C code. */
case 16:
YY_RULE_SETUP
-#line 222 "src/scan-code.l"
-obstack_escape (&obstack_for_string, code_text);
+#line 223 "src/scan-code.l"
+obstack_escape (&obstack_for_string, yytext);
YY_BREAK
/* By default, grow the string obstack with the input. */
case 17:
/* rule 17 can match eol */
YY_RULE_SETUP
-#line 225 "src/scan-code.l"
+#line 226 "src/scan-code.l"
STRING_GROW;
YY_BREAK
/* End of processing. */
case YY_STATE_EOF(SC_CHARACTER):
case YY_STATE_EOF(SC_RULE_ACTION):
case YY_STATE_EOF(SC_SYMBOL_ACTION):
-#line 228 "src/scan-code.l"
+#line 229 "src/scan-code.l"
STRING_FINISH; /*code_piece_pack(); --code_piece0;*/ return last_string;
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 231 "src/scan-code.l"
+#line 232 "src/scan-code.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
-#line 1287 "src/scan-code.c"
+#line 1506 "src/scan-code.c"
case YY_END_OF_BUFFER:
{
{
/* We're scanning a new file or input source. It's
* possible that this happened because the user
- * just pointed code_in at a new source and called
- * code_lex(). If so, then we have to assure
+ * just pointed yyin at a new source and called
+ * yylex(). 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 = code_in;
+/* %if-c-only */
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+/* %endif */
+/* %if-c++-only */
+/* %endif */
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
}
{
(yy_did_buffer_switch_on_eof) = 0;
- if ( code_wrap( ) )
+ if ( yywrap( ) )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
- * code_text, we can now set up
+ * yytext, 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
"fatal flex scanner internal error--no action found" );
} /* end of action switch */
} /* end of scanning one token */
-} /* end of code_lex */
+ } /* end of user's declarations */
+} /* end of yylex */
/* %ok-for-header */
/* %if-c++-only */
/* %not-for-header */
-
/* %ok-for-header */
/* %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;
+ char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ char *source = (yytext_ptr);
+ int number_to_move, i;
int ret_val;
if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
/* Try to read more data. */
/* First move last chars to start of buffer. */
- number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
+ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
{ /* Not enough room in the buffer - grow it. */
/* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = YY_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);
b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
- code_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
+ yyrealloc( (void *) b->yy_ch_buf,
+ (yy_size_t) (b->yy_buf_size + 2) );
}
else
/* Can't grow it, we don't own it. */
- b->yy_ch_buf = 0;
+ b->yy_ch_buf = NULL;
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR(
/* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
- (yy_n_chars), (size_t) num_to_read );
+ (yy_n_chars), num_to_read );
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
- code_restart(code_in );
+ yyrestart( yyin );
}
else
else
ret_val = EOB_ACT_CONTINUE_SCAN;
- if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ if (((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 *) code_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
+ int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
+ (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+ /* "- 2" to take care of EOB's */
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
}
(yy_n_chars) += number_to_move;
/* %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;
+ yy_state_type yy_current_state;
+ char *yy_cp;
/* %% [15.0] code to get the start state into yy_current_state goes here */
yy_current_state = (yy_start);
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)] : 18);
+ YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 18);
if ( yy_accept[yy_current_state] )
{
(yy_last_accepting_state) = yy_current_state;
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 91 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
}
return yy_current_state;
/* %if-c++-only */
/* %endif */
{
- register int yy_is_jam;
+ 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);
+ char *yy_cp = (yy_c_buf_p);
- register YY_CHAR yy_c = 18;
+ YY_CHAR yy_c = 18;
if ( yy_accept[yy_current_state] )
{
(yy_last_accepting_state) = yy_current_state;
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 91 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
yy_is_jam = (yy_current_state == 90);
- return yy_is_jam ? 0 : yy_current_state;
+ return yy_is_jam ? 0 : yy_current_state;
}
+#ifndef YY_NO_UNPUT
/* %if-c-only */
/* %endif */
+#endif
/* %if-c-only */
#ifndef YY_NO_INPUT
else
{ /* need more input */
- int offset = (yy_c_buf_p) - (yytext_ptr);
+ int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
++(yy_c_buf_p);
switch ( yy_get_next_buffer( ) )
*/
/* Reset buffer status. */
- code_restart(code_in );
+ yyrestart( yyin );
/*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{
- if ( code_wrap( ) )
- return EOF;
+ if ( yywrap( ) )
+ return 0;
if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
}
c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
- *(yy_c_buf_p) = '\0'; /* preserve code_text */
+ *(yy_c_buf_p) = '\0'; /* preserve yytext */
(yy_hold_char) = *++(yy_c_buf_p);
-/* %% [19.0] update BOL and code_lineno */
+/* %% [19.0] update BOL and yylineno */
return c;
}
* @note This function does not reset the start condition to @c INITIAL .
*/
/* %if-c-only */
- void code_restart (FILE * input_file )
+ void yyrestart (FILE * input_file )
/* %endif */
/* %if-c++-only */
/* %endif */
{
if ( ! YY_CURRENT_BUFFER ){
- code_ensure_buffer_stack ();
+ yyensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
- code__create_buffer(code_in,YY_BUF_SIZE );
+ yy_create_buffer( yyin, YY_BUF_SIZE );
}
- code__init_buffer(YY_CURRENT_BUFFER,input_file );
- code__load_buffer_state( );
+ yy_init_buffer( YY_CURRENT_BUFFER, input_file );
+ yy_load_buffer_state( );
}
+/* %if-c++-only */
+/* %endif */
+
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
*
*/
/* %if-c-only */
- void code__switch_to_buffer (YY_BUFFER_STATE new_buffer )
+ void yy_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
- * code_pop_buffer_state();
- * code_push_buffer_state(new_buffer);
+ * yypop_buffer_state();
+ * yypush_buffer_state(new_buffer);
*/
- code_ensure_buffer_stack ();
+ yyensure_buffer_stack ();
if ( YY_CURRENT_BUFFER == new_buffer )
return;
}
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- code__load_buffer_state( );
+ yy_load_buffer_state( );
/* We don't actually know whether we did this switch during
- * EOF (code_wrap()) processing, but the only time this flag
- * is looked at is after code_wrap() is called, so it's safe
+ * EOF (yywrap()) processing, but the only time this flag
+ * is looked at is after yywrap() 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 code__load_buffer_state (void)
+static void yy_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;
- code_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+/* %if-c-only */
+ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+/* %endif */
+/* %if-c++-only */
+/* %endif */
(yy_hold_char) = *(yy_c_buf_p);
}
* @return the allocated buffer state.
*/
/* %if-c-only */
- YY_BUFFER_STATE code__create_buffer (FILE * file, int size )
+ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
/* %endif */
/* %if-c++-only */
/* %endif */
{
YY_BUFFER_STATE b;
- b = (YY_BUFFER_STATE) code_alloc(sizeof( struct yy_buffer_state ) );
+ b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in code__create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_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 *) code_alloc(b->yy_buf_size + 2 );
+ b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in code__create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_is_our_buffer = 1;
- code__init_buffer(b,file );
+ yy_init_buffer( b, file );
return b;
}
+/* %if-c++-only */
+/* %endif */
+
/** Destroy the buffer.
- * @param b a buffer created with code__create_buffer()
+ * @param b a buffer created with yy_create_buffer()
*
*/
/* %if-c-only */
- void code__delete_buffer (YY_BUFFER_STATE b )
+ void yy_delete_buffer (YY_BUFFER_STATE b )
/* %endif */
/* %if-c++-only */
/* %endif */
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
- code_free((void *) b->yy_ch_buf );
+ yyfree( (void *) b->yy_ch_buf );
- code_free((void *) b );
+ yyfree( (void *) b );
}
-/* %if-c-only */
-
-/* %endif */
-
-/* %if-c++-only */
-/* %endif */
-
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
- * such as during a code_restart() or at EOF.
+ * such as during a yyrestart() or at EOF.
*/
/* %if-c-only */
- static void code__init_buffer (YY_BUFFER_STATE b, FILE * file )
+ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
/* %endif */
/* %if-c++-only */
/* %endif */
{
int oerrno = errno;
- code__flush_buffer(b );
+ yy_flush_buffer( b );
+/* %if-c-only */
b->yy_input_file = file;
+/* %endif */
+/* %if-c++-only */
+/* %endif */
b->yy_fill_buffer = 1;
- /* If b is the current buffer, then code__init_buffer was _probably_
- * called from code_restart() or through yy_get_next_buffer.
+ /* If b is the current buffer, then yy_init_buffer was _probably_
+ * called from yyrestart() or through yy_get_next_buffer.
* In that case, we don't want to reset the lineno or column.
*/
if (b != YY_CURRENT_BUFFER){
*
*/
/* %if-c-only */
- void code__flush_buffer (YY_BUFFER_STATE b )
+ void yy_flush_buffer (YY_BUFFER_STATE b )
/* %endif */
/* %if-c++-only */
/* %endif */
b->yy_buffer_status = YY_BUFFER_NEW;
if ( b == YY_CURRENT_BUFFER )
- code__load_buffer_state( );
+ yy_load_buffer_state( );
}
/* %if-c-or-c++ */
*
*/
/* %if-c-only */
-void code_push_buffer_state (YY_BUFFER_STATE new_buffer )
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
/* %endif */
/* %if-c++-only */
/* %endif */
if (new_buffer == NULL)
return;
- code_ensure_buffer_stack();
+ yyensure_buffer_stack();
- /* This block is copied from code__switch_to_buffer. */
+ /* This block is copied from yy_switch_to_buffer. */
if ( YY_CURRENT_BUFFER )
{
/* Flush out information for old buffer. */
(yy_buffer_stack_top)++;
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- /* copied from code__switch_to_buffer. */
- code__load_buffer_state( );
+ /* copied from yy_switch_to_buffer. */
+ yy_load_buffer_state( );
(yy_did_buffer_switch_on_eof) = 1;
}
/* %endif */
*
*/
/* %if-c-only */
-void code_pop_buffer_state (void)
+void yypop_buffer_state (void)
/* %endif */
/* %if-c++-only */
/* %endif */
if (!YY_CURRENT_BUFFER)
return;
- code__delete_buffer(YY_CURRENT_BUFFER );
+ yy_delete_buffer(YY_CURRENT_BUFFER );
YY_CURRENT_BUFFER_LVALUE = NULL;
if ((yy_buffer_stack_top) > 0)
--(yy_buffer_stack_top);
if (YY_CURRENT_BUFFER) {
- code__load_buffer_state( );
+ yy_load_buffer_state( );
(yy_did_buffer_switch_on_eof) = 1;
}
}
* Guarantees space for at least one push.
*/
/* %if-c-only */
-static void code_ensure_buffer_stack (void)
+static void yyensure_buffer_stack (void)
/* %endif */
/* %if-c++-only */
/* %endif */
{
- int num_to_alloc;
+ yy_size_t num_to_alloc;
if (!(yy_buffer_stack)) {
* 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**)code_alloc
+ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
+ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
);
if ( ! (yy_buffer_stack) )
- YY_FATAL_ERROR( "out of dynamic memory in code_ensure_buffer_stack()" );
-
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_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 */;
+ yy_size_t grow_size = 8 /* arbitrary grow size */;
num_to_alloc = (yy_buffer_stack_max) + grow_size;
- (yy_buffer_stack) = (struct yy_buffer_state**)code_realloc
+ (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
((yy_buffer_stack),
num_to_alloc * sizeof(struct yy_buffer_state*)
);
if ( ! (yy_buffer_stack) )
- YY_FATAL_ERROR( "out of dynamic memory in code_ensure_buffer_stack()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
/* zero only the new slots.*/
memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
* @param base the character buffer
* @param size the size in bytes of the character buffer
*
- * @return the newly allocated buffer state object.
+ * @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE code__scan_buffer (char * base, yy_size_t size )
+YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
{
YY_BUFFER_STATE b;
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;
+ return NULL;
- b = (YY_BUFFER_STATE) code_alloc(sizeof( struct yy_buffer_state ) );
+ b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in code__scan_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_size = (int) (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_input_file = NULL;
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;
- code__switch_to_buffer(b );
+ yy_switch_to_buffer( b );
return b;
}
/* %endif */
/* %if-c-only */
-/** Setup the input buffer state to scan a string. The next call to code_lex() will
+/** Setup the input buffer state to scan a string. The next call to yylex() 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
- * code__scan_bytes() instead.
+ * yy_scan_bytes() instead.
*/
-YY_BUFFER_STATE code__scan_string (yyconst char * yystr )
+YY_BUFFER_STATE yy_scan_string (const char * yystr )
{
- return code__scan_bytes(yystr,strlen(yystr) );
+ return yy_scan_bytes( yystr, (int) strlen(yystr) );
}
/* %endif */
/* %if-c-only */
-/** Setup the input buffer state to scan the given bytes. The next call to code_lex() will
+/** Setup the input buffer state to scan the given bytes. The next call to yylex() 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 code__scan_bytes (yyconst char * yybytes, int _yybytes_len )
+YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
{
YY_BUFFER_STATE b;
char *buf;
int i;
/* Get memory for full buffer, including space for trailing EOB's. */
- n = _yybytes_len + 2;
- buf = (char *) code_alloc(n );
+ n = (yy_size_t) (_yybytes_len + 2);
+ buf = (char *) yyalloc( n );
if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in code__scan_bytes()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_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 = code__scan_buffer(buf,n );
+ b = yy_scan_buffer( buf, n );
if ( ! b )
- YY_FATAL_ERROR( "bad buffer in code__scan_bytes()" );
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
/* It's okay to grow etc. this buffer, and we should throw it
* away when we're done.
#endif
/* %if-c-only */
-static void yy_fatal_error (yyconst char* msg )
+static void yynoreturn yy_fatal_error (const char* msg )
{
- (void) fprintf( stderr, "%s\n", msg );
+ fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
/* %endif */
#define yyless(n) \
do \
{ \
- /* Undo effects of setting up code_text. */ \
+ /* Undo effects of setting up yytext. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
- code_text[code_leng] = (yy_hold_char); \
- (yy_c_buf_p) = code_text + yyless_macro_arg; \
+ yytext[yyleng] = (yy_hold_char); \
+ (yy_c_buf_p) = yytext + yyless_macro_arg; \
(yy_hold_char) = *(yy_c_buf_p); \
*(yy_c_buf_p) = '\0'; \
- code_leng = yyless_macro_arg; \
+ yyleng = yyless_macro_arg; \
} \
while ( 0 )
/** Get the current line number.
*
*/
-int code_get_lineno (void)
+int yyget_lineno (void)
{
-
- return code_lineno;
+
+ return yylineno;
}
/** Get the input stream.
*
*/
-FILE *code_get_in (void)
+FILE *yyget_in (void)
{
- return code_in;
+ return yyin;
}
/** Get the output stream.
*
*/
-FILE *code_get_out (void)
+FILE *yyget_out (void)
{
- return code_out;
+ return yyout;
}
/** Get the length of the current token.
*
*/
-int code_get_leng (void)
+int yyget_leng (void)
{
- return code_leng;
+ return yyleng;
}
/** Get the current token.
*
*/
-char *code_get_text (void)
+char *yyget_text (void)
{
- return code_text;
+ return yytext;
}
/* %if-reentrant */
/* %endif */
/** Set the current line number.
- * @param line_number
+ * @param _line_number line number
*
*/
-void code_set_lineno (int line_number )
+void yyset_lineno (int _line_number )
{
- code_lineno = line_number;
+ yylineno = _line_number;
}
/** Set the input stream. This does not discard the current
* input buffer.
- * @param in_str A readable stream.
+ * @param _in_str A readable stream.
*
- * @see code__switch_to_buffer
+ * @see yy_switch_to_buffer
*/
-void code_set_in (FILE * in_str )
+void yyset_in (FILE * _in_str )
{
- code_in = in_str ;
+ yyin = _in_str ;
}
-void code_set_out (FILE * out_str )
+void yyset_out (FILE * _out_str )
{
- code_out = out_str ;
+ yyout = _out_str ;
}
-int code_get_debug (void)
+int yyget_debug (void)
{
- return code__flex_debug;
+ return yy_flex_debug;
}
-void code_set_debug (int bdebug )
+void yyset_debug (int _bdebug )
{
- code__flex_debug = bdebug ;
+ yy_flex_debug = _bdebug ;
}
/* %endif */
static int yy_init_globals (void)
{
/* Initialization is the same as for the non-reentrant scanner.
- * This function is called from code_lex_destroy(), so don't allocate here.
+ * This function is called from yylex_destroy(), so don't allocate here.
*/
- (yy_buffer_stack) = 0;
+ (yy_buffer_stack) = NULL;
(yy_buffer_stack_top) = 0;
(yy_buffer_stack_max) = 0;
- (yy_c_buf_p) = (char *) 0;
+ (yy_c_buf_p) = NULL;
(yy_init) = 0;
(yy_start) = 0;
/* Defined in main.c */
#ifdef YY_STDINIT
- code_in = stdin;
- code_out = stdout;
+ yyin = stdin;
+ yyout = stdout;
#else
- code_in = (FILE *) 0;
- code_out = (FILE *) 0;
+ yyin = NULL;
+ yyout = NULL;
#endif
/* For future reference: Set errno on error, since we are called by
- * code_lex_init()
+ * yylex_init()
*/
return 0;
}
/* %endif */
/* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
-/* code_lex_destroy is for both reentrant and non-reentrant scanners. */
-int code_lex_destroy (void)
+/* yylex_destroy is for both reentrant and non-reentrant scanners. */
+int yylex_destroy (void)
{
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
- code__delete_buffer(YY_CURRENT_BUFFER );
+ yy_delete_buffer( YY_CURRENT_BUFFER );
YY_CURRENT_BUFFER_LVALUE = NULL;
- code_pop_buffer_state();
+ yypop_buffer_state();
}
/* Destroy the stack itself. */
- code_free((yy_buffer_stack) );
+ yyfree((yy_buffer_stack) );
(yy_buffer_stack) = NULL;
/* Reset the globals. This is important in a non-reentrant scanner so the next time
- * code_lex() is called, initialization will occur. */
+ * yylex() is called, initialization will occur. */
yy_init_globals( );
/* %if-reentrant */
*/
#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
+static void yy_flex_strncpy (char* s1, const char * s2, int n )
{
- register int i;
+
+ 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 )
+static int yy_flex_strlen (const char * s )
{
- register int n;
+ int n;
for ( n = 0; s[n]; ++n )
;
}
#endif
-void *code_alloc (yy_size_t size )
+void *yyalloc (yy_size_t size )
{
- return (void *) malloc( size );
+ return malloc(size);
}
-void *code_realloc (void * ptr, yy_size_t size )
+void *yyrealloc (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
* any pointer type to void*, and deal with argument conversions
* as though doing an assignment.
*/
- return (void *) realloc( (char *) ptr, size );
+ return realloc(ptr, size);
}
-void code_free (void * ptr )
+void yyfree (void * ptr )
{
- free( (char *) ptr ); /* see code_realloc() for (char *) cast */
+ free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
}
/* %if-tables-serialization definitions */
/* %ok-for-header */
-#line 231 "src/scan-code.l"
-
+#line 232 "src/scan-code.l"
static inline bool
#if 1
if (n == LHS_REF) {
int i = sprintf(code_piece_temp, "<AST_Text_ValueReference tag_name=\"");
- int j = i + sprintf(code_piece_temp + i, "%s", code_text + 2);
+ int j = i + sprintf(code_piece_temp + i, "%s", yytext + 2);
while (j > i && code_piece_temp[--j] != '>')
;
sprintf(code_piece_temp + j, "\">");
code_piece_append(code_piece_temp);
- code_piece_flush(strlen(code_text));
+ code_piece_flush(strlen(yytext));
code_piece_append("</AST_Text_ValueReference>");
}
else {
int i = sprintf(code_piece_temp, "<AST_Text_StackReference tag_name=\"");
- int j = i + sprintf(code_piece_temp + i, "%s", code_text + 2);
+ int j = i + sprintf(code_piece_temp + i, "%s", yytext + 2);
while (j > i && code_piece_temp[--j] != '>')
;
sprintf(code_piece_temp + j, "\" index=\"%d\">", n);
code_piece_append(code_piece_temp);
- code_piece_flush(strlen(code_text));
+ code_piece_flush(strlen(yytext));
code_piece_append("</AST_Text_StackReference>");
}
if (no_handle_action)
#if 1
if (n == LHS_REF) {
code_piece_append("<AST_Text_ValueLocation>");
- code_piece_flush(strlen(code_text));
+ code_piece_flush(strlen(yytext));
code_piece_append("</AST_Text_ValueLocation>");
}
else {
sprintf(code_piece_temp, "<AST_Text_StackLocation index=\"%d\">", n);
code_piece_append(code_piece_temp);
- code_piece_flush(strlen(code_text));
+ code_piece_flush(strlen(yytext));
code_piece_append("</AST_Text_StackLocation>");
}
if (no_handle_action)
if (!initialized)
{
obstack_init (&obstack_for_string);
- code__flex_debug = 0;
+ yy_flex_debug = 0;
initialized = true;
}
loc->start = loc->end = self->location.start;
- code__switch_to_buffer (code__scan_string (self->code));
+ yy_switch_to_buffer (yy_scan_string (self->code));
res = code_lex (self, sc_context);
- code__delete_buffer (YY_CURRENT_BUFFER);
+ yy_delete_buffer (YY_CURRENT_BUFFER);
return res;
}
variant_table_free ();
/* Reclaim Flex's buffers. */
- code_lex_destroy ();
+ yylex_destroy ();
}
/* Nick */
}
void code_piece_flush(size_t n) {
- code_piece_escape(code_text, n);
- code_text += n;
+ code_piece_escape(yytext, n);
+ yytext += n;
}
-void code_piece_pack() {
+void code_piece_pack(void) {
int i;
size_t j = 0;
for (i = code_piece0; i < code_piece1; ++i)
/* 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_scan_buffer gram__scan_buffer
+#define yy_scan_string gram__scan_string
+#define yy_scan_bytes gram__scan_bytes
#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 yypush_buffer_state gram_push_buffer_state
+#define yypop_buffer_state gram_pop_buffer_state
+#define yyensure_buffer_stack gram_ensure_buffer_stack
+#define yy_flex_debug gram__flex_debug
#define yyin gram_in
#define yyleng gram_leng
#define yylex gram_lex
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_MINOR_VERSION 6
+#define YY_FLEX_SUBMINOR_VERSION 4
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
/* %endif */
/* %if-c-only */
-
+#ifdef yy_create_buffer
+#define gram__create_buffer_ALREADY_DEFINED
+#else
+#define yy_create_buffer gram__create_buffer
+#endif
+
+#ifdef yy_delete_buffer
+#define gram__delete_buffer_ALREADY_DEFINED
+#else
+#define yy_delete_buffer gram__delete_buffer
+#endif
+
+#ifdef yy_scan_buffer
+#define gram__scan_buffer_ALREADY_DEFINED
+#else
+#define yy_scan_buffer gram__scan_buffer
+#endif
+
+#ifdef yy_scan_string
+#define gram__scan_string_ALREADY_DEFINED
+#else
+#define yy_scan_string gram__scan_string
+#endif
+
+#ifdef yy_scan_bytes
+#define gram__scan_bytes_ALREADY_DEFINED
+#else
+#define yy_scan_bytes gram__scan_bytes
+#endif
+
+#ifdef yy_init_buffer
+#define gram__init_buffer_ALREADY_DEFINED
+#else
+#define yy_init_buffer gram__init_buffer
+#endif
+
+#ifdef yy_flush_buffer
+#define gram__flush_buffer_ALREADY_DEFINED
+#else
+#define yy_flush_buffer gram__flush_buffer
+#endif
+
+#ifdef yy_load_buffer_state
+#define gram__load_buffer_state_ALREADY_DEFINED
+#else
+#define yy_load_buffer_state gram__load_buffer_state
+#endif
+
+#ifdef yy_switch_to_buffer
+#define gram__switch_to_buffer_ALREADY_DEFINED
+#else
+#define yy_switch_to_buffer gram__switch_to_buffer
+#endif
+
+#ifdef yypush_buffer_state
+#define gram_push_buffer_state_ALREADY_DEFINED
+#else
+#define yypush_buffer_state gram_push_buffer_state
+#endif
+
+#ifdef yypop_buffer_state
+#define gram_pop_buffer_state_ALREADY_DEFINED
+#else
+#define yypop_buffer_state gram_pop_buffer_state
+#endif
+
+#ifdef yyensure_buffer_stack
+#define gram_ensure_buffer_stack_ALREADY_DEFINED
+#else
+#define yyensure_buffer_stack gram_ensure_buffer_stack
+#endif
+
+#ifdef yylex
+#define gram_lex_ALREADY_DEFINED
+#else
+#define yylex gram_lex
+#endif
+
+#ifdef yyrestart
+#define gram_restart_ALREADY_DEFINED
+#else
+#define yyrestart gram_restart
+#endif
+
+#ifdef yylex_init
+#define gram_lex_init_ALREADY_DEFINED
+#else
+#define yylex_init gram_lex_init
+#endif
+
+#ifdef yylex_init_extra
+#define gram_lex_init_extra_ALREADY_DEFINED
+#else
+#define yylex_init_extra gram_lex_init_extra
+#endif
+
+#ifdef yylex_destroy
+#define gram_lex_destroy_ALREADY_DEFINED
+#else
+#define yylex_destroy gram_lex_destroy
+#endif
+
+#ifdef yyget_debug
+#define gram_get_debug_ALREADY_DEFINED
+#else
+#define yyget_debug gram_get_debug
+#endif
+
+#ifdef yyset_debug
+#define gram_set_debug_ALREADY_DEFINED
+#else
+#define yyset_debug gram_set_debug
+#endif
+
+#ifdef yyget_extra
+#define gram_get_extra_ALREADY_DEFINED
+#else
+#define yyget_extra gram_get_extra
+#endif
+
+#ifdef yyset_extra
+#define gram_set_extra_ALREADY_DEFINED
+#else
+#define yyset_extra gram_set_extra
+#endif
+
+#ifdef yyget_in
+#define gram_get_in_ALREADY_DEFINED
+#else
+#define yyget_in gram_get_in
+#endif
+
+#ifdef yyset_in
+#define gram_set_in_ALREADY_DEFINED
+#else
+#define yyset_in gram_set_in
+#endif
+
+#ifdef yyget_out
+#define gram_get_out_ALREADY_DEFINED
+#else
+#define yyget_out gram_get_out
+#endif
+
+#ifdef yyset_out
+#define gram_set_out_ALREADY_DEFINED
+#else
+#define yyset_out gram_set_out
+#endif
+
+#ifdef yyget_leng
+#define gram_get_leng_ALREADY_DEFINED
+#else
+#define yyget_leng gram_get_leng
+#endif
+
+#ifdef yyget_text
+#define gram_get_text_ALREADY_DEFINED
+#else
+#define yyget_text gram_get_text
+#endif
+
+#ifdef yyget_lineno
+#define gram_get_lineno_ALREADY_DEFINED
+#else
+#define yyget_lineno gram_get_lineno
+#endif
+
+#ifdef yyset_lineno
+#define gram_set_lineno_ALREADY_DEFINED
+#else
+#define yyset_lineno gram_set_lineno
+#endif
+
+#ifdef yywrap
+#define gram_wrap_ALREADY_DEFINED
+#else
+#define yywrap gram_wrap
+#endif
+
/* %endif */
+#ifdef yyalloc
+#define gram_alloc_ALREADY_DEFINED
+#else
+#define yyalloc gram_alloc
+#endif
+
+#ifdef yyrealloc
+#define gram_realloc_ALREADY_DEFINED
+#else
+#define yyrealloc gram_realloc
+#endif
+
+#ifdef yyfree
+#define gram_free_ALREADY_DEFINED
+#else
+#define yyfree gram_free
+#endif
+
/* %if-c-only */
+#ifdef yytext
+#define gram_text_ALREADY_DEFINED
+#else
+#define yytext gram_text
+#endif
+
+#ifdef yyleng
+#define gram_leng_ALREADY_DEFINED
+#else
+#define yyleng gram_leng
+#endif
+
+#ifdef yyin
+#define gram_in_ALREADY_DEFINED
+#else
+#define yyin gram_in
+#endif
+
+#ifdef yyout
+#define gram_out_ALREADY_DEFINED
+#else
+#define yyout gram_out
+#endif
+
+#ifdef yy_flex_debug
+#define gram__flex_debug_ALREADY_DEFINED
+#else
+#define yy_flex_debug gram__flex_debug
+#endif
+
+#ifdef yylineno
+#define gram_lineno_ALREADY_DEFINED
+#else
+#define yylineno gram_lineno
+#endif
+
/* %endif */
/* First, we deal with platform-specific or compiler-specific issues. */
#define UINT32_MAX (4294967295U)
#endif
+#ifndef SIZE_MAX
+#define SIZE_MAX (~(size_t)0)
+#endif
+
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
/* %endif */
+/* begin standard C++ headers. */
/* %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
+/* TODO: this is always defined, so inline it */
#define yyconst const
+
+#if defined(__GNUC__) && __GNUC__ >= 3
+#define yynoreturn __attribute__((__noreturn__))
#else
-#define yyconst
+#define yynoreturn
#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.
+/* Promotes a possibly negative, possibly signed char to an
+ * integer in range [0..255] for use as an array index.
*/
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
/* %ok-for-header */
/* %if-reentrant */
* 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_NEW_FILE yyrestart( yyin )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
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 int gram_leng;
+extern int yyleng;
/* %endif */
/* %if-c-only */
/* %if-not-reentrant */
-extern FILE *gram_in, *gram_out;
+extern FILE *yyin, *yyout;
/* %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)
+ #define YY_LINENO_REWIND_TO(ptr)
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
{ \
- /* Undo effects of setting up gram_text. */ \
+ /* Undo effects of setting up yytext. */ \
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 */ \
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )
-
#if 1
#define unput(c) \
do { \
#define unput(c) yyunput( c, (yytext_ptr) )
#endif
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
- yy_size_t yy_buf_size;
+ int yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
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.
*/
* 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.
+ * (via yyrestart()), so that the user can continue scanning by
+ * just pointing yyin at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
/* %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. */
+static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
/* %endif */
/* %ok-for-header */
#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.
*/
/* %if-not-reentrant */
/* %not-for-header */
-
-/* yy_hold_char holds the character lost when gram_text is formed. */
+/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_char;
static int yy_n_chars; /* number of characters read into yy_ch_buf */
-int gram_leng;
+int yyleng;
/* Points to current character in buffer. */
-static char *yy_c_buf_p = (char *) 0;
+static char *yy_c_buf_p = NULL;
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 ...
+/* Flag which is used to allow yywrap()'s to do buffer switches
+ * instead of setting up a fresh yyin. 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 );
+void yyrestart ( FILE *input_file );
+void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
+YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
+void yy_delete_buffer ( YY_BUFFER_STATE b );
+void yy_flush_buffer ( YY_BUFFER_STATE b );
+void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
+void yypop_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 );
+static void yyensure_buffer_stack ( void );
+static void yy_load_buffer_state ( void );
+static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
+#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
-#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,int len );
+YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
+YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
+YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int 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
+void *yyalloc ( yy_size_t );
+void *yyrealloc ( void *, yy_size_t );
+void yyfree ( void * );
+#define yy_new_buffer yy_create_buffer
#define yy_set_interactive(is_interactive) \
{ \
if ( ! YY_CURRENT_BUFFER ){ \
- gram_ensure_buffer_stack (); \
+ yyensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \
- gram__create_buffer(gram_in,YY_BUF_SIZE ); \
+ yy_create_buffer( yyin, 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 (); \
+ yyensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \
- gram__create_buffer(gram_in,YY_BUF_SIZE ); \
+ yy_create_buffer( yyin, 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 */
+/* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
/* Begin user sect3 */
-#define gram_wrap(n) 1
+#define gram_wrap() (/*CONSTCOND*/1)
#define YY_SKIP_YYWRAP
#define FLEX_DEBUG
+typedef flex_uint8_t YY_CHAR;
-typedef unsigned char YY_CHAR;
-
-FILE *gram_in = (FILE *) 0, *gram_out = (FILE *) 0;
+FILE *yyin = NULL, *yyout = NULL;
typedef int yy_state_type;
-extern int gram_lineno;
+extern int yylineno;
+int yylineno = 1;
-int gram_lineno = 1;
+extern char *yytext;
+#ifdef yytext_ptr
+#undef yytext_ptr
+#endif
+#define yytext_ptr yytext
-extern char *gram_text;
-#define yytext_ptr gram_text
+/* %% [1.5] DFA */
/* %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[] );
+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 yynoreturn yy_fatal_error ( const char* msg );
/* %endif */
/* Done after the current pattern has been matched and before the
- * corresponding action - sets up gram_text.
+ * corresponding action - sets up yytext.
*/
#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); \
+/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
+ yyleng = (int) (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 \ */\
+/* %% [3.0] code to copy yytext_ptr to yytext[] 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 134
#define YY_END_OF_BUFFER 135
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[591] =
+static const flex_int16_t yy_accept[591] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
63, 19, 56, 63, 63, 63, 63, 63, 31, 0
} ;
-static yyconst flex_int32_t yy_ec[256] =
+static const YY_CHAR 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
} ;
-static yyconst flex_int32_t yy_meta[62] =
+static const YY_CHAR yy_meta[62] =
{ 0,
1, 2, 3, 1, 2, 4, 1, 4, 4, 1,
1, 4, 4, 5, 6, 2, 7, 7, 7, 1,
1
} ;
-static yyconst flex_int16_t yy_base[617] =
+static const flex_int16_t yy_base[617] =
{ 0,
0, 1038, 1032, 1031, 59, 60, 61, 64, 66, 82,
66, 85, 102, 120, 129, 141, 149, 150, 161, 170,
222, 183, 181, 147, 69, 810
} ;
-static yyconst flex_int16_t yy_def[617] =
+static const flex_int16_t yy_def[617] =
{ 0,
590, 1, 591, 591, 592, 592, 592, 592, 593, 593,
594, 594, 592, 592, 592, 592, 592, 592, 592, 592,
590, 590, 590, 590, 590, 590
} ;
-static yyconst flex_int16_t yy_nxt[1108] =
+static const flex_int16_t yy_nxt[1108] =
{ 0,
36, 37, 38, 36, 37, 39, 36, 40, 41, 42,
43, 44, 45, 36, 46, 47, 48, 49, 49, 36,
590, 590, 590, 590, 590, 590, 590
} ;
-static yyconst flex_int16_t yy_chk[1108] =
+static const flex_int16_t yy_chk[1108] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;
-extern int gram__flex_debug;
-int gram__flex_debug = 1;
+extern int yy_flex_debug;
+int yy_flex_debug = 1;
-static yyconst flex_int16_t yy_rule_linenum[134] =
+static const flex_int16_t yy_rule_linenum[134] =
{ 0,
- 201, 204, 205, 206, 214, 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, 261, 262, 263, 264, 265, 266,
- 267, 268, 270, 271, 272, 273, 274, 275, 276, 277,
- 278, 281, 282, 283, 284, 285, 286, 287, 288, 289,
- 290, 291, 293, 297, 298, 299, 301, 313, 327, 344,
- 349, 352, 355, 358, 370, 381, 390, 395, 396, 397,
- 407, 421, 428, 448, 458, 473, 483, 510, 523, 539,
- 554, 571, 572, 583, 594, 595, 607, 623, 633, 660,
-
- 672, 694, 695, 706, 721, 737, 738, 739, 740, 741,
- 742, 743, 746, 748, 762, 780, 785, 786, 792, 793,
- 805, 811, 817, 823, 840, 841, 845, 852, 877, 903,
- 931, 978, 980
+ 202, 205, 206, 207, 215, 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, 261, 262, 263, 264, 265, 266, 267,
+ 268, 269, 271, 272, 273, 274, 275, 276, 277, 278,
+ 279, 282, 283, 284, 285, 286, 287, 288, 289, 290,
+ 291, 292, 294, 298, 299, 300, 302, 314, 328, 345,
+ 350, 353, 356, 359, 371, 382, 391, 396, 397, 398,
+ 408, 422, 429, 449, 459, 474, 484, 511, 524, 540,
+ 555, 572, 573, 584, 595, 596, 608, 624, 634, 661,
+
+ 673, 695, 696, 707, 722, 738, 739, 740, 741, 742,
+ 743, 744, 747, 749, 763, 781, 786, 787, 793, 794,
+ 806, 812, 818, 824, 841, 842, 846, 853, 878, 904,
+ 932, 979, 981
} ;
/* The intent behind this definition is that it'll catch
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
-char *gram_text;
+char *yytext;
#line 1 "src/scan-gram.l"
/* Bison Grammar Scanner -*- C -*-
/* Location of scanner cursor. */
static boundary scanner_cursor;
-#define YY_USER_ACTION location_compute (loc, &scanner_cursor, gram_text, gram_leng);
+#define YY_USER_ACTION location_compute (loc, &scanner_cursor, yytext, yyleng);
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 YY_INPUT(buf, result, size) ((result) = no_cr_read (yyin, buf, size))
#define RETURN_PERCENT_PARAM(Value) \
RETURN_VALUE(PERCENT_PARAM, param, param_ ## Value)
#define ROLLBACK_CURRENT_TOKEN \
do { \
- scanner_cursor.column -= mbsnwidth (gram_text, gram_leng, 0); \
+ scanner_cursor.column -= mbsnwidth (yytext, yyleng, 0); \
yyless (0); \
} while (0)
#define DEPRECATED(Msg) \
do { \
size_t i; \
- deprecated_directive (loc, gram_text, Msg); \
+ deprecated_directive (loc, yytext, Msg); \
scanner_cursor.column -= mbsnwidth (Msg, strlen (Msg), 0); \
for (i = strlen (Msg); i != 0; --i) \
unput (Msg[i - 1]); \
void gram_piece_insert(int n, const char *str);
void gram_piece_escape(const char *p, size_t n);
void gram_piece_flush(size_t n);
-void gram_piece_pack();
+void gram_piece_pack(void);
-/* A C-like comment in directives/rules. */
+#line 1359 "src/scan-gram.c"
+#line 120 "src/scan-gram.l"
+ /* A C-like comment in directives/rules. */
-/* Strings and characters in directives/rules. */
+ /* Strings and characters in directives/rules. */
-/* A identifier was just read in directives/rules. Special state
-to capture the sequence 'identifier :'. */
+ /* 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. */
+ /* 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); */
+ /* 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. */
+ /* C and C++ comments in code. */
-/* Strings and characters in code. */
+ /* Strings and characters in code. */
-/* Bracketed identifiers support. */
+ /* Bracketed identifiers support. */
-/* Nick extra rules for element groups */
+ /* Nick extra rules for element groups */
/* 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 1172 "src/scan-gram.c"
+#line 1392 "src/scan-gram.c"
#define INITIAL 0
#define SC_YACC_COMMENT 1
/* %if-reentrant */
/* %if-c-only */
-static int yy_init_globals (void );
+static int yy_init_globals ( void );
/* %endif */
/* %if-reentrant */
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
-int gram_lex_destroy (void );
+int yylex_destroy ( void );
-int gram_get_debug (void );
+int yyget_debug ( void );
-void gram_set_debug (int debug_flag );
+void yyset_debug ( int debug_flag );
-YY_EXTRA_TYPE gram_get_extra (void );
+YY_EXTRA_TYPE yyget_extra ( void );
-void gram_set_extra (YY_EXTRA_TYPE user_defined );
+void yyset_extra ( YY_EXTRA_TYPE user_defined );
-FILE *gram_get_in (void );
+FILE *yyget_in ( void );
-void gram_set_in (FILE * in_str );
+void yyset_in ( FILE * _in_str );
-FILE *gram_get_out (void );
+FILE *yyget_out ( void );
-void gram_set_out (FILE * out_str );
+void yyset_out ( FILE * _out_str );
-int gram_get_leng (void );
+ int yyget_leng ( void );
-char *gram_get_text (void );
+char *yyget_text ( void );
-int gram_get_lineno (void );
+int yyget_lineno ( void );
-void gram_set_lineno (int line_number );
+void yyset_lineno ( int _line_number );
/* %if-bison-bridge */
/* %endif */
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int gram_wrap (void );
+extern "C" int yywrap ( void );
#else
-extern int gram_wrap (void );
+extern int yywrap ( void );
#endif
#endif
/* %not-for-header */
-
- static void yyunput (int c,char *buf_ptr );
+#ifndef YY_NO_UNPUT
+ static void yyunput ( int c, char *buf_ptr );
+
+#endif
/* %ok-for-header */
/* %endif */
#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int );
+static void yy_flex_strncpy ( char *, const char *, int );
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * );
+static int yy_flex_strlen ( const char * );
#endif
#ifndef YY_NO_INPUT
/* %if-c-only Standard (non-C++) definition */
/* %not-for-header */
-
#ifdef __cplusplus
-static int yyinput (void );
+static int yyinput ( void );
#else
-static int input (void );
+static int input ( void );
#endif
/* %ok-for-header */
/* 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)
+#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
/* %endif */
/* %if-c++-only C++ definition */
/* %endif */
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
- size_t n; \
+ int n; \
for ( n = 0; n < max_size && \
- (c = getc( gram_in )) != EOF && c != '\n'; ++n ) \
+ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
if ( c == '\n' ) \
buf[n++] = (char) c; \
- if ( c == EOF && ferror( gram_in ) ) \
+ if ( c == EOF && ferror( yyin ) ) \
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)) \
+ while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
{ \
if( errno != EINTR) \
{ \
break; \
} \
errno=0; \
- clearerr(gram_in); \
+ clearerr(yyin); \
} \
}\
\
/* %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 */
#define YY_DECL_IS_OURS 1
/* %if-c-only Standard (non-C++) definition */
-extern int gram_lex (void);
+extern int yylex (void);
-#define YY_DECL int gram_lex (void)
+#define YY_DECL int yylex (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
+/* Code executed at the beginning of each rule, after yytext and yyleng
* have been set up.
*/
#ifndef YY_USER_ACTION
/* Code executed at the end of each rule. */
#ifndef YY_BREAK
-#define YY_BREAK break;
+#define YY_BREAK /*LINTED*/break;
#endif
/* %% [6.0] YY_RULE_SETUP definition goes here */
#define YY_RULE_SETUP \
- if ( gram_leng > 0 ) \
+ if ( yyleng > 0 ) \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
- (gram_text[gram_leng - 1] == '\n'); \
+ (yytext[yyleng - 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;
+ yy_state_type yy_current_state;
+ char *yy_cp, *yy_bp;
+ int yy_act;
+ if ( !(yy_init) )
+ {
+ (yy_init) = 1;
+
+#ifdef YY_USER_INIT
+ YY_USER_INIT;
+#endif
+
+ if ( ! (yy_start) )
+ (yy_start) = 1; /* first start state */
+
+ if ( ! yyin )
+/* %if-c-only */
+ yyin = stdin;
+/* %endif */
+/* %if-c++-only */
+/* %endif */
+
+ if ( ! yyout )
+/* %if-c-only */
+ yyout = stdout;
+/* %endif */
+/* %if-c++-only */
+/* %endif */
+
+ if ( ! YY_CURRENT_BUFFER ) {
+ yyensure_buffer_stack ();
+ YY_CURRENT_BUFFER_LVALUE =
+ yy_create_buffer( yyin, YY_BUF_SIZE );
+ }
+
+ yy_load_buffer_state( );
+ }
+
+ {
/* %% [7.0] user's declarations go here */
-#line 162 "src/scan-gram.l"
+#line 163 "src/scan-gram.l"
/* Nesting level. Either for nested braces, or nested angle brackets
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
+ value is relevant only when yylex is invoked in the SC_EPILOGUE
start condition. */
boundary code_start = scanner_cursor;
| Scanning white space. |
`-----------------------*/
-#line 1475 "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( );
- }
+#line 1728 "src/scan-gram.c"
#if 1
/* we do this so that "continue;" in an action works correctly */
for (; ; gram_piece_escape(yytext, yy_c_buf_p - yytext))
#else
- while ( 1 ) /* loops until end-of-file is reached */
+ while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
#endif
{
/* %% [8.0] yymore()-related code goes here */
yy_cp = (yy_c_buf_p);
- /* Support of gram_text. */
+ /* Support of yytext. */
*yy_cp = (yy_hold_char);
/* yy_bp points to the position in yy_ch_buf of the start of
yy_match:
do
{
- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ 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_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 591 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
++yy_cp;
}
while ( yy_current_state != 590 );
YY_DO_BEFORE_ACTION;
-/* %% [11.0] code for gram_lineno update goes here */
+/* %% [11.0] code for yylineno 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_flex_debug )
{
if ( yy_act == 0 )
fprintf( stderr, "--scanner backing up\n" );
else if ( yy_act < 134 )
fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
- (long)yy_rule_linenum[yy_act], gram_text );
+ (long)yy_rule_linenum[yy_act], yytext );
else if ( yy_act == 134 )
fprintf( stderr, "--accepting default rule (\"%s\")\n",
- gram_text );
+ yytext );
else if ( yy_act == 135 )
fprintf( stderr, "--(end of buffer or a NUL)\n" );
else
/* Comments and white space. */
case 1:
YY_RULE_SETUP
-#line 201 "src/scan-gram.l"
+#line 202 "src/scan-gram.l"
{
complain (loc, Wother, _("stray ',' treated as white space"));
}
YY_BREAK
case 2:
/* rule 2 can match eol */
-#line 205 "src/scan-gram.l"
+#line 206 "src/scan-gram.l"
case 3:
/* rule 3 can match eol */
YY_RULE_SETUP
-#line 205 "src/scan-gram.l"
+#line 206 "src/scan-gram.l"
continue;
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 206 "src/scan-gram.l"
+#line 207 "src/scan-gram.l"
{
token_start = loc->start;
context_state = YY_START;
case 5:
/* rule 5 can match eol */
YY_RULE_SETUP
-#line 214 "src/scan-gram.l"
+#line 215 "src/scan-gram.l"
{
- handle_syncline (gram_text + sizeof "#line " - 1, *loc);
+ handle_syncline (yytext + sizeof "#line " - 1, *loc);
}
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 232 "src/scan-gram.l"
+#line 233 "src/scan-gram.l"
return PERCENT_NONASSOC;
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 233 "src/scan-gram.l"
+#line 234 "src/scan-gram.l"
return PERCENT_CODE;
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 234 "src/scan-gram.l"
+#line 235 "src/scan-gram.l"
RETURN_PERCENT_FLAG("parse.trace");
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 235 "src/scan-gram.l"
+#line 236 "src/scan-gram.l"
return PERCENT_DEFAULT_PREC;
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 236 "src/scan-gram.l"
+#line 237 "src/scan-gram.l"
return PERCENT_DEFINE;
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 237 "src/scan-gram.l"
+#line 238 "src/scan-gram.l"
return PERCENT_DEFINES;
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 238 "src/scan-gram.l"
+#line 239 "src/scan-gram.l"
return PERCENT_DESTRUCTOR;
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 239 "src/scan-gram.l"
+#line 240 "src/scan-gram.l"
return PERCENT_DPREC;
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 240 "src/scan-gram.l"
+#line 241 "src/scan-gram.l"
return PERCENT_EMPTY;
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 241 "src/scan-gram.l"
+#line 242 "src/scan-gram.l"
return PERCENT_ERROR_VERBOSE;
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 242 "src/scan-gram.l"
+#line 243 "src/scan-gram.l"
return PERCENT_EXPECT;
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 243 "src/scan-gram.l"
+#line 244 "src/scan-gram.l"
return PERCENT_EXPECT_RR;
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 244 "src/scan-gram.l"
+#line 245 "src/scan-gram.l"
return PERCENT_FILE_PREFIX;
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 245 "src/scan-gram.l"
+#line 246 "src/scan-gram.l"
return PERCENT_YACC;
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 246 "src/scan-gram.l"
+#line 247 "src/scan-gram.l"
return PERCENT_INITIAL_ACTION;
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 247 "src/scan-gram.l"
+#line 248 "src/scan-gram.l"
return PERCENT_GLR_PARSER;
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 248 "src/scan-gram.l"
+#line 249 "src/scan-gram.l"
return PERCENT_LANGUAGE;
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 249 "src/scan-gram.l"
+#line 250 "src/scan-gram.l"
return PERCENT_LEFT;
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 250 "src/scan-gram.l"
+#line 251 "src/scan-gram.l"
RETURN_PERCENT_PARAM(lex);
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 251 "src/scan-gram.l"
+#line 252 "src/scan-gram.l"
RETURN_PERCENT_FLAG("locations");
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 252 "src/scan-gram.l"
+#line 253 "src/scan-gram.l"
return PERCENT_MERGE;
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 253 "src/scan-gram.l"
+#line 254 "src/scan-gram.l"
return PERCENT_NAME_PREFIX;
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 254 "src/scan-gram.l"
+#line 255 "src/scan-gram.l"
return PERCENT_NO_DEFAULT_PREC;
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 255 "src/scan-gram.l"
+#line 256 "src/scan-gram.l"
return PERCENT_NO_LINES;
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 256 "src/scan-gram.l"
+#line 257 "src/scan-gram.l"
return PERCENT_NONASSOC;
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 257 "src/scan-gram.l"
+#line 258 "src/scan-gram.l"
return PERCENT_NONDETERMINISTIC_PARSER;
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 258 "src/scan-gram.l"
+#line 259 "src/scan-gram.l"
return PERCENT_NTERM;
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 259 "src/scan-gram.l"
+#line 260 "src/scan-gram.l"
return PERCENT_OUTPUT;
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 260 "src/scan-gram.l"
+#line 261 "src/scan-gram.l"
RETURN_PERCENT_PARAM(both);
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 261 "src/scan-gram.l"
+#line 262 "src/scan-gram.l"
RETURN_PERCENT_PARAM(parse);
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 262 "src/scan-gram.l"
+#line 263 "src/scan-gram.l"
return PERCENT_PREC;
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 263 "src/scan-gram.l"
+#line 264 "src/scan-gram.l"
return PERCENT_PRECEDENCE;
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 264 "src/scan-gram.l"
+#line 265 "src/scan-gram.l"
return PERCENT_PRINTER;
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 265 "src/scan-gram.l"
+#line 266 "src/scan-gram.l"
RETURN_PERCENT_FLAG("api.pure");
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 266 "src/scan-gram.l"
+#line 267 "src/scan-gram.l"
return PERCENT_REQUIRE;
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 267 "src/scan-gram.l"
+#line 268 "src/scan-gram.l"
return PERCENT_RIGHT;
YY_BREAK
case 42:
YY_RULE_SETUP
-#line 268 "src/scan-gram.l"
+#line 269 "src/scan-gram.l"
return PERCENT_SKELETON;
YY_BREAK
/* Nick added %space */
case 43:
YY_RULE_SETUP
-#line 270 "src/scan-gram.l"
+#line 271 "src/scan-gram.l"
return PERCENT_SPACE;
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 271 "src/scan-gram.l"
+#line 272 "src/scan-gram.l"
return PERCENT_START;
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 272 "src/scan-gram.l"
+#line 273 "src/scan-gram.l"
return PERCENT_TOKEN;
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 273 "src/scan-gram.l"
+#line 274 "src/scan-gram.l"
return PERCENT_TOKEN;
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 274 "src/scan-gram.l"
+#line 275 "src/scan-gram.l"
return PERCENT_TOKEN_TABLE;
YY_BREAK
case 48:
YY_RULE_SETUP
-#line 275 "src/scan-gram.l"
+#line 276 "src/scan-gram.l"
return PERCENT_TYPE;
YY_BREAK
case 49:
YY_RULE_SETUP
-#line 276 "src/scan-gram.l"
+#line 277 "src/scan-gram.l"
return PERCENT_UNION;
YY_BREAK
case 50:
YY_RULE_SETUP
-#line 277 "src/scan-gram.l"
+#line 278 "src/scan-gram.l"
return PERCENT_VERBOSE;
YY_BREAK
case 51:
YY_RULE_SETUP
-#line 278 "src/scan-gram.l"
+#line 279 "src/scan-gram.l"
return PERCENT_YACC;
YY_BREAK
/* deprecated */
case 52:
YY_RULE_SETUP
-#line 281 "src/scan-gram.l"
+#line 282 "src/scan-gram.l"
DEPRECATED("%default-prec");
YY_BREAK
case 53:
YY_RULE_SETUP
-#line 282 "src/scan-gram.l"
+#line 283 "src/scan-gram.l"
DEPRECATED("%define parse.error verbose");
YY_BREAK
case 54:
YY_RULE_SETUP
-#line 283 "src/scan-gram.l"
+#line 284 "src/scan-gram.l"
DEPRECATED("%expect-rr");
YY_BREAK
case 55:
/* rule 55 can match eol */
YY_RULE_SETUP
-#line 284 "src/scan-gram.l"
+#line 285 "src/scan-gram.l"
DEPRECATED("%file-prefix");
YY_BREAK
case 56:
YY_RULE_SETUP
-#line 285 "src/scan-gram.l"
+#line 286 "src/scan-gram.l"
DEPRECATED("%fixed-output-files");
YY_BREAK
case 57:
/* rule 57 can match eol */
YY_RULE_SETUP
-#line 286 "src/scan-gram.l"
+#line 287 "src/scan-gram.l"
DEPRECATED("%name-prefix");
YY_BREAK
case 58:
YY_RULE_SETUP
-#line 287 "src/scan-gram.l"
+#line 288 "src/scan-gram.l"
DEPRECATED("%no-default-prec");
YY_BREAK
case 59:
YY_RULE_SETUP
-#line 288 "src/scan-gram.l"
+#line 289 "src/scan-gram.l"
DEPRECATED("%no-lines");
YY_BREAK
case 60:
/* rule 60 can match eol */
YY_RULE_SETUP
-#line 289 "src/scan-gram.l"
+#line 290 "src/scan-gram.l"
DEPRECATED("%output");
YY_BREAK
case 61:
YY_RULE_SETUP
-#line 290 "src/scan-gram.l"
+#line 291 "src/scan-gram.l"
DEPRECATED("%pure-parser");
YY_BREAK
case 62:
YY_RULE_SETUP
-#line 291 "src/scan-gram.l"
+#line 292 "src/scan-gram.l"
DEPRECATED("%token-table");
YY_BREAK
case 63:
YY_RULE_SETUP
-#line 293 "src/scan-gram.l"
+#line 294 "src/scan-gram.l"
{
- complain (loc, complaint, _("invalid directive: %s"), quote (gram_text));
+ complain (loc, complaint, _("invalid directive: %s"), quote (yytext));
}
YY_BREAK
case 64:
YY_RULE_SETUP
-#line 297 "src/scan-gram.l"
+#line 298 "src/scan-gram.l"
return EQUAL;
YY_BREAK
case 65:
YY_RULE_SETUP
-#line 298 "src/scan-gram.l"
+#line 299 "src/scan-gram.l"
return PIPE;
YY_BREAK
case 66:
YY_RULE_SETUP
-#line 299 "src/scan-gram.l"
+#line 300 "src/scan-gram.l"
return SEMICOLON;
YY_BREAK
case 67:
YY_RULE_SETUP
-#line 301 "src/scan-gram.l"
+#line 302 "src/scan-gram.l"
{
- val->uniqstr = uniqstr_new (gram_text);
+ val->uniqstr = uniqstr_new (yytext);
id_loc = *loc;
bracketed_id_str = NULL;
BEGIN SC_AFTER_IDENTIFIER;
gram_piece_pack();
gram_piece_append("<AST_ID>");
- gram_piece_flush(strlen(gram_text));
+ gram_piece_flush(strlen(yytext));
gram_piece_append("</AST_ID>");
gram_piece_pack();
}
YY_BREAK
case 68:
YY_RULE_SETUP
-#line 313 "src/scan-gram.l"
+#line 314 "src/scan-gram.l"
{
- val->integer = scan_integer (gram_text, 10, *loc);
+ val->integer = scan_integer (yytext, 10, *loc);
#if 0
gram_piece_pack();
sprintf(gram_piece_temp, "<AST_Int value=\"%d\">", val->integer);
gram_piece_append(gram_piece_temp);
- gram_piece_escape(gram_text, strlen(gram_text));
+ gram_piece_escape(yytext, strlen(yytext));
gram_piece_append("</AST_Int>");
gram_piece_pack();
return ~INT;
YY_BREAK
case 69:
YY_RULE_SETUP
-#line 327 "src/scan-gram.l"
+#line 328 "src/scan-gram.l"
{
- val->integer = scan_integer (gram_text, 16, *loc);
+ val->integer = scan_integer (yytext, 16, *loc);
#if 0
gram_piece_pack();
sprintf(gram_piece_temp, "<AST_Int value=\"%d\">", val->integer);
gram_piece_append(gram_piece_temp);
- gram_piece_escape(gram_text, strlen(gram_text));
+ gram_piece_escape(yytext, strlen(yytext));
gram_piece_append("</AST_Int>");
gram_piece_pack();
return ~INT;
accept "1FOO" as "1 FOO". */
case 70:
YY_RULE_SETUP
-#line 344 "src/scan-gram.l"
+#line 345 "src/scan-gram.l"
{
- complain (loc, complaint, _("invalid identifier: %s"), quote (gram_text));
+ complain (loc, complaint, _("invalid identifier: %s"), quote (yytext));
}
YY_BREAK
/* Characters. */
case 71:
YY_RULE_SETUP
-#line 349 "src/scan-gram.l"
-token_start = loc->start; BEGIN SC_ESCAPED_CHARACTER; gram_piece_pack(); gram_piece_append("<AST_Char>"); gram_piece_flush(strlen(gram_text)); gram_piece_append("<AST_Text>");
+#line 350 "src/scan-gram.l"
+token_start = loc->start; BEGIN SC_ESCAPED_CHARACTER; gram_piece_pack(); gram_piece_append("<AST_Char>"); gram_piece_flush(strlen(yytext)); gram_piece_append("<AST_Text>");
YY_BREAK
/* Strings. */
case 72:
YY_RULE_SETUP
-#line 352 "src/scan-gram.l"
-token_start = loc->start; BEGIN SC_ESCAPED_STRING; gram_piece_pack(); gram_piece_append("<AST_String>"); gram_piece_flush(strlen(gram_text)); gram_piece_append("<AST_Text>");
+#line 353 "src/scan-gram.l"
+token_start = loc->start; BEGIN SC_ESCAPED_STRING; gram_piece_pack(); gram_piece_append("<AST_String>"); gram_piece_flush(strlen(yytext)); gram_piece_append("<AST_Text>");
YY_BREAK
/* Prologue. */
case 73:
YY_RULE_SETUP
-#line 355 "src/scan-gram.l"
-code_start = loc->start; BEGIN SC_PROLOGUE; gram_piece_pack(); gram_piece_append("<AST_Section1_Prologue>"); gram_piece_flush(strlen(gram_text)); gram_piece_append("<AST_Text>");
+#line 356 "src/scan-gram.l"
+code_start = loc->start; BEGIN SC_PROLOGUE; gram_piece_pack(); gram_piece_append("<AST_Section1_Prologue>"); gram_piece_flush(strlen(yytext)); gram_piece_append("<AST_Text>");
YY_BREAK
/* Code in between braces. */
case 74:
YY_RULE_SETUP
-#line 358 "src/scan-gram.l"
+#line 359 "src/scan-gram.l"
{
STRING_GROW;
nesting = 0;
BEGIN SC_BRACED_CODE;
gram_piece_pack();
gram_piece_append("<AST_BracedCode>");
- gram_piece_flush(strlen(gram_text));
+ gram_piece_flush(strlen(yytext));
gram_piece_append("<AST_Text>");
}
YY_BREAK
case 75:
/* rule 75 can match eol */
YY_RULE_SETUP
-#line 370 "src/scan-gram.l"
+#line 371 "src/scan-gram.l"
{
nesting = 0;
code_start = loc->start;
gram_piece_pack();
gram_piece_append("<AST_BracedPredicate>");
- gram_piece_flush(strlen(gram_text));
+ gram_piece_flush(strlen(yytext));
gram_piece_append("<AST_Text>");
BEGIN SC_PREDICATE;
}
/* Nick extra rules for element groups */
case 76:
YY_RULE_SETUP
-#line 381 "src/scan-gram.l"
+#line 382 "src/scan-gram.l"
{
STRING_GROW;
nesting = 0;
code_start = loc->start;
BEGIN SC_ELEMENT_GROUP;
gram_piece_pack();
- gram_piece_flush(strlen(gram_text));
+ gram_piece_flush(strlen(yytext));
gram_piece_append("<AST_Text>");
}
YY_BREAK
case 77:
YY_RULE_SETUP
-#line 390 "src/scan-gram.l"
+#line 391 "src/scan-gram.l"
{
return ')';
}
/* A type. */
case 78:
YY_RULE_SETUP
-#line 395 "src/scan-gram.l"
+#line 396 "src/scan-gram.l"
gram_piece_pack(); gram_piece_append("<AST_TagRef><<AST_Text>*</AST_Text>></AST_TagRef>"); return ~TAG_ANY; /*return TAG_ANY;*/
YY_BREAK
case 79:
YY_RULE_SETUP
-#line 396 "src/scan-gram.l"
+#line 397 "src/scan-gram.l"
gram_piece_pack(); gram_piece_append("<AST_TagRef><<AST_Text />></AST_TagRef>"); return ~TAG_NONE; /*return TAG_NONE;*/
YY_BREAK
case 80:
YY_RULE_SETUP
-#line 397 "src/scan-gram.l"
+#line 398 "src/scan-gram.l"
{
nesting = 0;
token_start = loc->start;
BEGIN SC_TAG;
gram_piece_pack();
gram_piece_append("<AST_TagRef>");
- gram_piece_flush(strlen(gram_text));
+ gram_piece_flush(strlen(yytext));
gram_piece_append("<AST_Text>");
}
YY_BREAK
case 81:
YY_RULE_SETUP
-#line 407 "src/scan-gram.l"
+#line 408 "src/scan-gram.l"
{
static int percent_percent_count;
if (++percent_percent_count == 2)
{
BEGIN SC_EPILOGUE;
gram_piece_pack();
- gram_piece_escape(gram_text, strlen(gram_text));
+ gram_piece_escape(yytext, strlen(yytext));
gram_piece_pack();
gram_piece_pack();
return ~PERCENT_PERCENT;
YY_BREAK
case 82:
YY_RULE_SETUP
-#line 421 "src/scan-gram.l"
+#line 422 "src/scan-gram.l"
{
bracketed_id_str = NULL;
bracketed_id_start = loc->start;
YY_BREAK
case 83:
YY_RULE_SETUP
-#line 428 "src/scan-gram.l"
+#line 429 "src/scan-gram.l"
{
complain (loc, complaint, "%s: %s",
- ngettext ("invalid character", "invalid characters", gram_leng),
- quote_mem (gram_text, gram_leng));
+ ngettext ("invalid character", "invalid characters", yyleng),
+ quote_mem (yytext, yyleng));
}
YY_BREAK
case YY_STATE_EOF(INITIAL):
-#line 434 "src/scan-gram.l"
+#line 435 "src/scan-gram.l"
{
loc->start = loc->end = scanner_cursor;
yyterminate ();
case 84:
YY_RULE_SETUP
-#line 448 "src/scan-gram.l"
+#line 449 "src/scan-gram.l"
complain (loc, complaint, _("invalid null character"));
YY_BREAK
case 85:
YY_RULE_SETUP
-#line 458 "src/scan-gram.l"
+#line 459 "src/scan-gram.l"
{
if (bracketed_id_str)
{
YY_BREAK
case 86:
YY_RULE_SETUP
-#line 473 "src/scan-gram.l"
+#line 474 "src/scan-gram.l"
{
BEGIN (bracketed_id_str ? SC_RETURN_BRACKETED_ID : INITIAL);
*loc = id_loc;
#if 1
- gram_piece_escape(gram_text, strlen(gram_text));
+ gram_piece_escape(yytext, strlen(yytext));
return ~ID_COLON;
#else
return ID_COLON;
YY_BREAK
case 87:
YY_RULE_SETUP
-#line 483 "src/scan-gram.l"
+#line 484 "src/scan-gram.l"
{
ROLLBACK_CURRENT_TOKEN;
BEGIN (bracketed_id_str ? SC_RETURN_BRACKETED_ID : INITIAL);
}
YY_BREAK
case YY_STATE_EOF(SC_AFTER_IDENTIFIER):
-#line 493 "src/scan-gram.l"
+#line 494 "src/scan-gram.l"
{
BEGIN (bracketed_id_str ? SC_RETURN_BRACKETED_ID : INITIAL);
*loc = id_loc;
case 88:
YY_RULE_SETUP
-#line 510 "src/scan-gram.l"
+#line 511 "src/scan-gram.l"
{
if (bracketed_id_str)
{
complain (loc, complaint,
_("unexpected identifier in bracketed name: %s"),
- quote (gram_text));
+ quote (yytext));
}
else
{
- bracketed_id_str = uniqstr_new (gram_text);
+ bracketed_id_str = uniqstr_new (yytext);
bracketed_id_loc = *loc;
}
}
YY_BREAK
case 89:
YY_RULE_SETUP
-#line 523 "src/scan-gram.l"
+#line 524 "src/scan-gram.l"
{
BEGIN bracketed_id_context_state;
if (bracketed_id_str)
YY_BREAK
case 90:
YY_RULE_SETUP
-#line 539 "src/scan-gram.l"
+#line 540 "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));
+ "invalid characters in bracketed name", yyleng),
+ quote_mem (yytext, yyleng));
}
YY_BREAK
case YY_STATE_EOF(SC_BRACKETED_ID):
-#line 546 "src/scan-gram.l"
+#line 547 "src/scan-gram.l"
{
BEGIN bracketed_id_context_state;
unexpected_eof (bracketed_id_start, "]");
case 91:
YY_RULE_SETUP
-#line 554 "src/scan-gram.l"
+#line 555 "src/scan-gram.l"
{
ROLLBACK_CURRENT_TOKEN;
val->uniqstr = bracketed_id_str;
case 92:
YY_RULE_SETUP
-#line 571 "src/scan-gram.l"
+#line 572 "src/scan-gram.l"
BEGIN context_state;
YY_BREAK
case 93:
/* rule 93 can match eol */
YY_RULE_SETUP
-#line 572 "src/scan-gram.l"
+#line 573 "src/scan-gram.l"
continue;
YY_BREAK
case YY_STATE_EOF(SC_YACC_COMMENT):
-#line 573 "src/scan-gram.l"
+#line 574 "src/scan-gram.l"
unexpected_eof (token_start, "*/"); BEGIN context_state;
YY_BREAK
case 94:
/* rule 94 can match eol */
YY_RULE_SETUP
-#line 583 "src/scan-gram.l"
+#line 584 "src/scan-gram.l"
STRING_GROW; BEGIN context_state;
YY_BREAK
case YY_STATE_EOF(SC_COMMENT):
-#line 584 "src/scan-gram.l"
+#line 585 "src/scan-gram.l"
unexpected_eof (token_start, "*/"); BEGIN context_state;
YY_BREAK
case 95:
/* rule 95 can match eol */
YY_RULE_SETUP
-#line 594 "src/scan-gram.l"
+#line 595 "src/scan-gram.l"
STRING_GROW; BEGIN context_state;
YY_BREAK
case 96:
/* rule 96 can match eol */
YY_RULE_SETUP
-#line 595 "src/scan-gram.l"
+#line 596 "src/scan-gram.l"
STRING_GROW;
YY_BREAK
case YY_STATE_EOF(SC_LINE_COMMENT):
-#line 596 "src/scan-gram.l"
+#line 597 "src/scan-gram.l"
BEGIN context_state;
YY_BREAK
case 97:
YY_RULE_SETUP
-#line 607 "src/scan-gram.l"
+#line 608 "src/scan-gram.l"
{
STRING_FINISH;
loc->start = token_start;
BEGIN INITIAL;
#if 1
gram_piece_append("</AST_Text>");
- gram_piece_escape(gram_text, strlen(gram_text));
+ gram_piece_escape(yytext, strlen(yytext));
gram_piece_append("</AST_String>");
gram_piece_pack();
return ~STRING;
}
YY_BREAK
case YY_STATE_EOF(SC_ESCAPED_STRING):
-#line 622 "src/scan-gram.l"
+#line 623 "src/scan-gram.l"
unexpected_eof (token_start, "\"");
YY_BREAK
case 98:
/* rule 98 can match eol */
YY_RULE_SETUP
-#line 623 "src/scan-gram.l"
+#line 624 "src/scan-gram.l"
unexpected_newline (token_start, "\"");
YY_BREAK
case 99:
YY_RULE_SETUP
-#line 633 "src/scan-gram.l"
+#line 634 "src/scan-gram.l"
{
STRING_FINISH;
loc->start = token_start;
BEGIN INITIAL;
#if 1
gram_piece_append("</AST_Text>");
- gram_piece_escape(gram_text, strlen(gram_text));
+ gram_piece_escape(yytext, strlen(yytext));
gram_piece_append("</AST_Char>");
gram_piece_pack();
return ~CHAR;
case 100:
/* rule 100 can match eol */
YY_RULE_SETUP
-#line 660 "src/scan-gram.l"
+#line 661 "src/scan-gram.l"
unexpected_newline (token_start, "'");
YY_BREAK
case YY_STATE_EOF(SC_ESCAPED_CHARACTER):
-#line 661 "src/scan-gram.l"
+#line 662 "src/scan-gram.l"
unexpected_eof (token_start, "'");
YY_BREAK
case 101:
YY_RULE_SETUP
-#line 672 "src/scan-gram.l"
+#line 673 "src/scan-gram.l"
{
--nesting;
if (nesting < 0)
BEGIN INITIAL;
#if 1
gram_piece_append("</AST_Text>");
- gram_piece_escape(gram_text, strlen(gram_text));
+ gram_piece_escape(yytext, strlen(yytext));
gram_piece_append("</AST_TagRef>");
gram_piece_pack();
return ~TAG;
case 102:
/* rule 102 can match eol */
YY_RULE_SETUP
-#line 694 "src/scan-gram.l"
+#line 695 "src/scan-gram.l"
STRING_GROW;
YY_BREAK
case 103:
YY_RULE_SETUP
-#line 695 "src/scan-gram.l"
-STRING_GROW; nesting += gram_leng;
+#line 696 "src/scan-gram.l"
+STRING_GROW; nesting += yyleng;
YY_BREAK
case YY_STATE_EOF(SC_TAG):
-#line 697 "src/scan-gram.l"
+#line 698 "src/scan-gram.l"
unexpected_eof (token_start, ">");
YY_BREAK
case 104:
YY_RULE_SETUP
-#line 706 "src/scan-gram.l"
+#line 707 "src/scan-gram.l"
{
- unsigned long int c = strtoul (gram_text + 1, NULL, 8);
+ unsigned long int c = strtoul (yytext + 1, NULL, 8);
if (!c || UCHAR_MAX < c)
complain (loc, complaint, _("invalid number after \\-escape: %s"),
- gram_text+1);
+ yytext+1);
else
{
obstack_1grow (&obstack_for_string, c);
sprintf(gram_piece_temp, "<AST_Text_Escape character=\"%d\">", (int)c);
gram_piece_append(gram_piece_temp);
- gram_piece_flush(strlen(gram_text));
+ gram_piece_flush(strlen(yytext));
gram_piece_append("</AST_Text_Escape>");
}
}
YY_BREAK
case 105:
YY_RULE_SETUP
-#line 721 "src/scan-gram.l"
+#line 722 "src/scan-gram.l"
{
verify (UCHAR_MAX < ULONG_MAX);
- unsigned long int c = strtoul (gram_text + 2, NULL, 16);
+ unsigned long int c = strtoul (yytext + 2, NULL, 16);
if (!c || UCHAR_MAX < c)
complain (loc, complaint, _("invalid number after \\-escape: %s"),
- gram_text+1);
+ yytext+1);
else
{
obstack_1grow (&obstack_for_string, c);
sprintf(gram_piece_temp, "<AST_Text_Escape character=\"%d\">", (int)c);
gram_piece_append(gram_piece_temp);
- gram_piece_flush(strlen(gram_text));
+ gram_piece_flush(strlen(yytext));
gram_piece_append("</AST_Text_Escape>");
}
}
YY_BREAK
case 106:
YY_RULE_SETUP
-#line 737 "src/scan-gram.l"
-obstack_1grow (&obstack_for_string, '\a'); gram_piece_append("<AST_Text_Escape character=\"7\">"); gram_piece_flush(strlen(gram_text)); gram_piece_append("</AST_Text_Escape>");
+#line 738 "src/scan-gram.l"
+obstack_1grow (&obstack_for_string, '\a'); gram_piece_append("<AST_Text_Escape character=\"7\">"); gram_piece_flush(strlen(yytext)); gram_piece_append("</AST_Text_Escape>");
YY_BREAK
case 107:
YY_RULE_SETUP
-#line 738 "src/scan-gram.l"
-obstack_1grow (&obstack_for_string, '\b'); gram_piece_append("<AST_Text_Escape character=\"8\">"); gram_piece_flush(strlen(gram_text)); gram_piece_append("</AST_Text_Escape>");
+#line 739 "src/scan-gram.l"
+obstack_1grow (&obstack_for_string, '\b'); gram_piece_append("<AST_Text_Escape character=\"8\">"); gram_piece_flush(strlen(yytext)); gram_piece_append("</AST_Text_Escape>");
YY_BREAK
case 108:
YY_RULE_SETUP
-#line 739 "src/scan-gram.l"
-obstack_1grow (&obstack_for_string, '\f'); gram_piece_append("<AST_Text_Escape character=\"12\">"); gram_piece_flush(strlen(gram_text)); gram_piece_append("</AST_Text_Escape>");
+#line 740 "src/scan-gram.l"
+obstack_1grow (&obstack_for_string, '\f'); gram_piece_append("<AST_Text_Escape character=\"12\">"); gram_piece_flush(strlen(yytext)); gram_piece_append("</AST_Text_Escape>");
YY_BREAK
case 109:
YY_RULE_SETUP
-#line 740 "src/scan-gram.l"
-obstack_1grow (&obstack_for_string, '\n'); gram_piece_append("<AST_Text_Escape character=\"10\">"); gram_piece_flush(strlen(gram_text)); gram_piece_append("</AST_Text_Escape>");
+#line 741 "src/scan-gram.l"
+obstack_1grow (&obstack_for_string, '\n'); gram_piece_append("<AST_Text_Escape character=\"10\">"); gram_piece_flush(strlen(yytext)); gram_piece_append("</AST_Text_Escape>");
YY_BREAK
case 110:
YY_RULE_SETUP
-#line 741 "src/scan-gram.l"
-obstack_1grow (&obstack_for_string, '\r'); gram_piece_append("<AST_Text_Escape character=\"13\">"); gram_piece_flush(strlen(gram_text)); gram_piece_append("</AST_Text_Escape>");
+#line 742 "src/scan-gram.l"
+obstack_1grow (&obstack_for_string, '\r'); gram_piece_append("<AST_Text_Escape character=\"13\">"); gram_piece_flush(strlen(yytext)); gram_piece_append("</AST_Text_Escape>");
YY_BREAK
case 111:
YY_RULE_SETUP
-#line 742 "src/scan-gram.l"
-obstack_1grow (&obstack_for_string, '\t'); gram_piece_append("<AST_Text_Escape character=\"9\">"); gram_piece_flush(strlen(gram_text)); gram_piece_append("</AST_Text_Escape>");
+#line 743 "src/scan-gram.l"
+obstack_1grow (&obstack_for_string, '\t'); gram_piece_append("<AST_Text_Escape character=\"9\">"); gram_piece_flush(strlen(yytext)); gram_piece_append("</AST_Text_Escape>");
YY_BREAK
case 112:
YY_RULE_SETUP
-#line 743 "src/scan-gram.l"
-obstack_1grow (&obstack_for_string, '\v'); gram_piece_append("<AST_Text_Escape character=\"11\">"); gram_piece_flush(strlen(gram_text)); gram_piece_append("</AST_Text_Escape>");
+#line 744 "src/scan-gram.l"
+obstack_1grow (&obstack_for_string, '\v'); gram_piece_append("<AST_Text_Escape character=\"11\">"); gram_piece_flush(strlen(yytext)); gram_piece_append("</AST_Text_Escape>");
YY_BREAK
/* \\[\"\'?\\] would be shorter, but it confuses xgettext. */
case 113:
YY_RULE_SETUP
-#line 746 "src/scan-gram.l"
-obstack_1grow (&obstack_for_string, gram_text[1]); sprintf(gram_piece_temp, "<AST_Text_Escape character=\"%d\">", gram_text[1]); gram_piece_append(gram_piece_temp); gram_piece_flush(strlen(gram_text)); gram_piece_append("</AST_Text_Escape>");
+#line 747 "src/scan-gram.l"
+obstack_1grow (&obstack_for_string, yytext[1]); sprintf(gram_piece_temp, "<AST_Text_Escape character=\"%d\">", yytext[1]); gram_piece_append(gram_piece_temp); gram_piece_flush(strlen(yytext)); gram_piece_append("</AST_Text_Escape>");
YY_BREAK
case 114:
YY_RULE_SETUP
-#line 748 "src/scan-gram.l"
+#line 749 "src/scan-gram.l"
{
- int c = convert_ucn_to_byte (gram_text);
+ int c = convert_ucn_to_byte (yytext);
if (c <= 0)
complain (loc, complaint, _("invalid number after \\-escape: %s"),
- gram_text+1);
+ yytext+1);
else
{
obstack_1grow (&obstack_for_string, c);
sprintf(gram_piece_temp, "<AST_Text_Escape character=\"%d\">", c);
gram_piece_append(gram_piece_temp);
- gram_piece_flush(strlen(gram_text));
+ gram_piece_flush(strlen(yytext));
gram_piece_append("</AST_Text_Escape>");
}
}
case 115:
/* rule 115 can match eol */
YY_RULE_SETUP
-#line 762 "src/scan-gram.l"
+#line 763 "src/scan-gram.l"
{
- char const *p = gram_text + 1;
+ char const *p = yytext + 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);
case 116:
/* rule 116 can match eol */
YY_RULE_SETUP
-#line 780 "src/scan-gram.l"
+#line 781 "src/scan-gram.l"
STRING_GROW;
YY_BREAK
case 117:
YY_RULE_SETUP
-#line 785 "src/scan-gram.l"
+#line 786 "src/scan-gram.l"
STRING_GROW; BEGIN context_state;
YY_BREAK
case 118:
/* rule 118 can match eol */
YY_RULE_SETUP
-#line 786 "src/scan-gram.l"
+#line 787 "src/scan-gram.l"
unexpected_newline (token_start, "'");
YY_BREAK
case YY_STATE_EOF(SC_CHARACTER):
-#line 787 "src/scan-gram.l"
+#line 788 "src/scan-gram.l"
unexpected_eof (token_start, "'");
YY_BREAK
case 119:
YY_RULE_SETUP
-#line 792 "src/scan-gram.l"
+#line 793 "src/scan-gram.l"
STRING_GROW; BEGIN context_state;
YY_BREAK
case 120:
/* rule 120 can match eol */
YY_RULE_SETUP
-#line 793 "src/scan-gram.l"
+#line 794 "src/scan-gram.l"
unexpected_newline (token_start, "\"");
YY_BREAK
case YY_STATE_EOF(SC_STRING):
-#line 794 "src/scan-gram.l"
+#line 795 "src/scan-gram.l"
unexpected_eof (token_start, "\"");
YY_BREAK
case 121:
YY_RULE_SETUP
-#line 805 "src/scan-gram.l"
+#line 806 "src/scan-gram.l"
{
STRING_GROW;
context_state = YY_START;
YY_BREAK
case 122:
YY_RULE_SETUP
-#line 811 "src/scan-gram.l"
+#line 812 "src/scan-gram.l"
{
STRING_GROW;
context_state = YY_START;
case 123:
/* rule 123 can match eol */
YY_RULE_SETUP
-#line 817 "src/scan-gram.l"
+#line 818 "src/scan-gram.l"
{
STRING_GROW;
context_state = YY_START;
case 124:
/* rule 124 can match eol */
YY_RULE_SETUP
-#line 823 "src/scan-gram.l"
+#line 824 "src/scan-gram.l"
{
STRING_GROW;
context_state = YY_START;
case 125:
/* rule 125 can match eol */
YY_RULE_SETUP
-#line 840 "src/scan-gram.l"
+#line 841 "src/scan-gram.l"
STRING_GROW; nesting++;
YY_BREAK
case 126:
/* rule 126 can match eol */
YY_RULE_SETUP
-#line 841 "src/scan-gram.l"
+#line 842 "src/scan-gram.l"
STRING_GROW; nesting--;
YY_BREAK
/* Tokenize '<<%' correctly (as '<<' '%') rather than incorrrectly
case 127:
/* rule 127 can match eol */
YY_RULE_SETUP
-#line 845 "src/scan-gram.l"
+#line 846 "src/scan-gram.l"
STRING_GROW;
YY_BREAK
case YY_STATE_EOF(SC_BRACED_CODE):
case YY_STATE_EOF(SC_PREDICATE):
case YY_STATE_EOF(SC_ELEMENT_GROUP):
-#line 847 "src/scan-gram.l"
+#line 848 "src/scan-gram.l"
unexpected_eof (code_start, "}");
YY_BREAK
case 128:
YY_RULE_SETUP
-#line 852 "src/scan-gram.l"
+#line 853 "src/scan-gram.l"
{
obstack_1grow (&obstack_for_string, '}');
BEGIN INITIAL;
#if 1
gram_piece_append("</AST_Text>");
- gram_piece_escape(gram_text, strlen(gram_text));
+ gram_piece_escape(yytext, strlen(yytext));
gram_piece_append("</AST_BracedCode>");
gram_piece_pack();
return ~BRACED_CODE;
case 129:
YY_RULE_SETUP
-#line 877 "src/scan-gram.l"
+#line 878 "src/scan-gram.l"
{
--nesting;
if (nesting < 0)
BEGIN INITIAL;
#if 1
gram_piece_append("</AST_Text>");
- gram_piece_escape(gram_text, strlen(gram_text));
+ gram_piece_escape(yytext, strlen(yytext));
gram_piece_append("</AST_BracedPredicate>");
gram_piece_pack();
return ~BRACED_PREDICATE;
case 130:
YY_RULE_SETUP
-#line 903 "src/scan-gram.l"
+#line 904 "src/scan-gram.l"
{
obstack_1grow (&obstack_for_string, '}');
BEGIN INITIAL;
#if 1
gram_piece_append("</AST_Text>");
- gram_piece_escape(gram_text, strlen(gram_text));
+ gram_piece_escape(yytext, strlen(yytext));
gram_piece_pack();
return ~'(';
#else
case 131:
YY_RULE_SETUP
-#line 931 "src/scan-gram.l"
+#line 932 "src/scan-gram.l"
{
STRING_FINISH;
loc->start = code_start;
BEGIN INITIAL;
#if 1
gram_piece_append("</AST_Text>");
- gram_piece_escape(gram_text, strlen(gram_text));
+ gram_piece_escape(yytext, strlen(yytext));
gram_piece_append("</AST_Section1_Prologue>");
gram_piece_pack();
return ~PROLOGUE;
}
YY_BREAK
case YY_STATE_EOF(SC_PROLOGUE):
-#line 947 "src/scan-gram.l"
+#line 948 "src/scan-gram.l"
unexpected_eof (code_start, "%}");
YY_BREAK
case YY_STATE_EOF(SC_EPILOGUE):
-#line 958 "src/scan-gram.l"
+#line 959 "src/scan-gram.l"
{
STRING_FINISH;
loc->start = code_start;
`-----------------------------------------------------*/
/* Nick added: SC_ELEMENT_GROUP */
case 132:
-#line 979 "src/scan-gram.l"
+#line 980 "src/scan-gram.l"
/* Nick added: SC_ELEMENT_GROUP */
case 133:
/* rule 133 can match eol */
YY_RULE_SETUP
-#line 980 "src/scan-gram.l"
+#line 981 "src/scan-gram.l"
STRING_GROW;
YY_BREAK
case 134:
YY_RULE_SETUP
-#line 983 "src/scan-gram.l"
+#line 984 "src/scan-gram.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
-#line 2882 "src/scan-gram.c"
+#line 3101 "src/scan-gram.c"
case YY_STATE_EOF(SC_RETURN_BRACKETED_ID):
yyterminate();
{
/* 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
+ * just pointed yyin at a new source and called
+ * yylex(). 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;
+/* %if-c-only */
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+/* %endif */
+/* %if-c++-only */
+/* %endif */
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
}
{
(yy_did_buffer_switch_on_eof) = 0;
- if ( gram_wrap( ) )
+ if ( yywrap( ) )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
- * gram_text, we can now set up
+ * yytext, 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
"fatal flex scanner internal error--no action found" );
} /* end of action switch */
} /* end of scanning one token */
-} /* end of gram_lex */
+ } /* end of user's declarations */
+} /* end of yylex */
/* %ok-for-header */
/* %if-c++-only */
/* %not-for-header */
-
/* %ok-for-header */
/* %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;
+ char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ char *source = (yytext_ptr);
+ int number_to_move, i;
int ret_val;
if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
/* Try to read more data. */
/* First move last chars to start of buffer. */
- number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
+ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
{ /* Not enough room in the buffer - grow it. */
/* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = YY_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);
b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
- gram_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
+ yyrealloc( (void *) b->yy_ch_buf,
+ (yy_size_t) (b->yy_buf_size + 2) );
}
else
/* Can't grow it, we don't own it. */
- b->yy_ch_buf = 0;
+ b->yy_ch_buf = NULL;
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR(
/* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
- (yy_n_chars), (size_t) num_to_read );
+ (yy_n_chars), num_to_read );
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
- gram_restart(gram_in );
+ yyrestart( yyin );
}
else
else
ret_val = EOB_ACT_CONTINUE_SCAN;
- if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ if (((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 );
+ int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
+ (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+ /* "- 2" to take care of EOB's */
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
}
(yy_n_chars) += number_to_move;
/* %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;
+ yy_state_type yy_current_state;
+ char *yy_cp;
/* %% [15.0] code to get the start state into yy_current_state goes here */
yy_current_state = (yy_start);
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)] : 61);
+ YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 61);
if ( yy_accept[yy_current_state] )
{
(yy_last_accepting_state) = yy_current_state;
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 591 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
}
return yy_current_state;
/* %if-c++-only */
/* %endif */
{
- register int yy_is_jam;
+ 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);
+ char *yy_cp = (yy_c_buf_p);
- register YY_CHAR yy_c = 61;
+ YY_CHAR yy_c = 61;
if ( yy_accept[yy_current_state] )
{
(yy_last_accepting_state) = yy_current_state;
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 591 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
yy_is_jam = (yy_current_state == 590);
- return yy_is_jam ? 0 : yy_current_state;
+ return yy_is_jam ? 0 : yy_current_state;
}
+#ifndef YY_NO_UNPUT
/* %if-c-only */
- static void yyunput (int c, register char * yy_bp )
+ static void yyunput (int c, char * yy_bp )
/* %endif */
/* %if-c++-only */
/* %endif */
{
- register char *yy_cp;
+ char *yy_cp;
yy_cp = (yy_c_buf_p);
- /* undo effects of setting up gram_text */
+ /* undo effects of setting up yytext */
*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 int number_to_move = (yy_n_chars) + 2;
- register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+ int number_to_move = (yy_n_chars) + 2;
+ char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
- register char *source =
+ char *source =
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
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;
+ (yy_n_chars) = (int) 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 */
+/* %% [18.0] update yylineno here */
(yytext_ptr) = yy_bp;
(yy_hold_char) = *yy_cp;
/* %if-c-only */
/* %endif */
+#endif
/* %if-c-only */
#ifndef YY_NO_INPUT
else
{ /* need more input */
- int offset = (yy_c_buf_p) - (yytext_ptr);
+ int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
++(yy_c_buf_p);
switch ( yy_get_next_buffer( ) )
*/
/* Reset buffer status. */
- gram_restart(gram_in );
+ yyrestart( yyin );
/*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{
- if ( gram_wrap( ) )
- return EOF;
+ if ( yywrap( ) )
+ return 0;
if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
}
c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
- *(yy_c_buf_p) = '\0'; /* preserve gram_text */
+ *(yy_c_buf_p) = '\0'; /* preserve yytext */
(yy_hold_char) = *++(yy_c_buf_p);
-/* %% [19.0] update BOL and gram_lineno */
+/* %% [19.0] update BOL and yylineno */
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
return c;
* @note This function does not reset the start condition to @c INITIAL .
*/
/* %if-c-only */
- void gram_restart (FILE * input_file )
+ void yyrestart (FILE * input_file )
/* %endif */
/* %if-c++-only */
/* %endif */
{
if ( ! YY_CURRENT_BUFFER ){
- gram_ensure_buffer_stack ();
+ yyensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
- gram__create_buffer(gram_in,YY_BUF_SIZE );
+ yy_create_buffer( yyin, YY_BUF_SIZE );
}
- gram__init_buffer(YY_CURRENT_BUFFER,input_file );
- gram__load_buffer_state( );
+ yy_init_buffer( YY_CURRENT_BUFFER, input_file );
+ yy_load_buffer_state( );
}
+/* %if-c++-only */
+/* %endif */
+
/** 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 )
+ void yy_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);
+ * yypop_buffer_state();
+ * yypush_buffer_state(new_buffer);
*/
- gram_ensure_buffer_stack ();
+ yyensure_buffer_stack ();
if ( YY_CURRENT_BUFFER == new_buffer )
return;
}
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- gram__load_buffer_state( );
+ yy_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
+ * EOF (yywrap()) processing, but the only time this flag
+ * is looked at is after yywrap() 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)
+static void yy_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;
+/* %if-c-only */
+ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+/* %endif */
+/* %if-c++-only */
+/* %endif */
(yy_hold_char) = *(yy_c_buf_p);
}
* @return the allocated buffer state.
*/
/* %if-c-only */
- YY_BUFFER_STATE gram__create_buffer (FILE * file, int size )
+ YY_BUFFER_STATE yy_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 ) );
+ b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in gram__create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_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 );
+ b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in gram__create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_is_our_buffer = 1;
- gram__init_buffer(b,file );
+ yy_init_buffer( b, file );
return b;
}
+/* %if-c++-only */
+/* %endif */
+
/** Destroy the buffer.
- * @param b a buffer created with gram__create_buffer()
+ * @param b a buffer created with yy_create_buffer()
*
*/
/* %if-c-only */
- void gram__delete_buffer (YY_BUFFER_STATE b )
+ void yy_delete_buffer (YY_BUFFER_STATE b )
/* %endif */
/* %if-c++-only */
/* %endif */
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
- gram_free((void *) b->yy_ch_buf );
+ yyfree( (void *) b->yy_ch_buf );
- gram_free((void *) b );
+ yyfree( (void *) b );
}
-/* %if-c-only */
-
-/* %endif */
-
-/* %if-c++-only */
-/* %endif */
-
/* 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.
+ * such as during a yyrestart() or at EOF.
*/
/* %if-c-only */
- static void gram__init_buffer (YY_BUFFER_STATE b, FILE * file )
+ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
/* %endif */
/* %if-c++-only */
/* %endif */
{
int oerrno = errno;
- gram__flush_buffer(b );
+ yy_flush_buffer( b );
+/* %if-c-only */
b->yy_input_file = file;
+/* %endif */
+/* %if-c++-only */
+/* %endif */
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.
+ /* If b is the current buffer, then yy_init_buffer was _probably_
+ * called from yyrestart() or through yy_get_next_buffer.
* In that case, we don't want to reset the lineno or column.
*/
if (b != YY_CURRENT_BUFFER){
*
*/
/* %if-c-only */
- void gram__flush_buffer (YY_BUFFER_STATE b )
+ void yy_flush_buffer (YY_BUFFER_STATE b )
/* %endif */
/* %if-c++-only */
/* %endif */
b->yy_buffer_status = YY_BUFFER_NEW;
if ( b == YY_CURRENT_BUFFER )
- gram__load_buffer_state( );
+ yy_load_buffer_state( );
}
/* %if-c-or-c++ */
*
*/
/* %if-c-only */
-void gram_push_buffer_state (YY_BUFFER_STATE new_buffer )
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
/* %endif */
/* %if-c++-only */
/* %endif */
if (new_buffer == NULL)
return;
- gram_ensure_buffer_stack();
+ yyensure_buffer_stack();
- /* This block is copied from gram__switch_to_buffer. */
+ /* This block is copied from yy_switch_to_buffer. */
if ( YY_CURRENT_BUFFER )
{
/* Flush out information for old buffer. */
(yy_buffer_stack_top)++;
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- /* copied from gram__switch_to_buffer. */
- gram__load_buffer_state( );
+ /* copied from yy_switch_to_buffer. */
+ yy_load_buffer_state( );
(yy_did_buffer_switch_on_eof) = 1;
}
/* %endif */
*
*/
/* %if-c-only */
-void gram_pop_buffer_state (void)
+void yypop_buffer_state (void)
/* %endif */
/* %if-c++-only */
/* %endif */
if (!YY_CURRENT_BUFFER)
return;
- gram__delete_buffer(YY_CURRENT_BUFFER );
+ yy_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_load_buffer_state( );
(yy_did_buffer_switch_on_eof) = 1;
}
}
* Guarantees space for at least one push.
*/
/* %if-c-only */
-static void gram_ensure_buffer_stack (void)
+static void yyensure_buffer_stack (void)
/* %endif */
/* %if-c++-only */
/* %endif */
{
- int num_to_alloc;
+ yy_size_t num_to_alloc;
if (!(yy_buffer_stack)) {
* 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 = 1; /* After all that talk, this was set to 1 anyways... */
+ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
);
if ( ! (yy_buffer_stack) )
- YY_FATAL_ERROR( "out of dynamic memory in gram_ensure_buffer_stack()" );
-
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_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 */;
+ yy_size_t 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) = (struct yy_buffer_state**)yyrealloc
((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()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
/* zero only the new slots.*/
memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
* @param base the character buffer
* @param size the size in bytes of the character buffer
*
- * @return the newly allocated buffer state object.
+ * @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE gram__scan_buffer (char * base, yy_size_t size )
+YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
{
YY_BUFFER_STATE b;
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;
+ return NULL;
- b = (YY_BUFFER_STATE) gram_alloc(sizeof( struct yy_buffer_state ) );
+ b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in gram__scan_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_size = (int) (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_input_file = NULL;
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 );
+ yy_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
+/** Setup the input buffer state to scan a string. The next call to yylex() 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_scan_bytes() instead.
*/
-YY_BUFFER_STATE gram__scan_string (yyconst char * yystr )
+YY_BUFFER_STATE yy_scan_string (const char * yystr )
{
- return gram__scan_bytes(yystr,strlen(yystr) );
+ return yy_scan_bytes( yystr, (int) strlen(yystr) );
}
/* %endif */
/* %if-c-only */
-/** Setup the input buffer state to scan the given bytes. The next call to gram_lex() will
+/** Setup the input buffer state to scan the given bytes. The next call to yylex() 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, int _yybytes_len )
+YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
{
YY_BUFFER_STATE b;
char *buf;
int i;
/* Get memory for full buffer, including space for trailing EOB's. */
- n = _yybytes_len + 2;
- buf = (char *) gram_alloc(n );
+ n = (yy_size_t) (_yybytes_len + 2);
+ buf = (char *) yyalloc( n );
if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in gram__scan_bytes()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_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 );
+ b = yy_scan_buffer( buf, n );
if ( ! b )
- YY_FATAL_ERROR( "bad buffer in gram__scan_bytes()" );
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
/* It's okay to grow etc. this buffer, and we should throw it
* away when we're done.
#endif
/* %if-c-only */
-static void yy_fatal_error (yyconst char* msg )
+static void yynoreturn yy_fatal_error (const char* msg )
{
- (void) fprintf( stderr, "%s\n", msg );
+ fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
/* %endif */
#define yyless(n) \
do \
{ \
- /* Undo effects of setting up gram_text. */ \
+ /* Undo effects of setting up yytext. */ \
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; \
+ yytext[yyleng] = (yy_hold_char); \
+ (yy_c_buf_p) = yytext + yyless_macro_arg; \
(yy_hold_char) = *(yy_c_buf_p); \
*(yy_c_buf_p) = '\0'; \
- gram_leng = yyless_macro_arg; \
+ yyleng = yyless_macro_arg; \
} \
while ( 0 )
/** Get the current line number.
*
*/
-int gram_get_lineno (void)
+int yyget_lineno (void)
{
-
- return gram_lineno;
+
+ return yylineno;
}
/** Get the input stream.
*
*/
-FILE *gram_get_in (void)
+FILE *yyget_in (void)
{
- return gram_in;
+ return yyin;
}
/** Get the output stream.
*
*/
-FILE *gram_get_out (void)
+FILE *yyget_out (void)
{
- return gram_out;
+ return yyout;
}
/** Get the length of the current token.
*
*/
-int gram_get_leng (void)
+int yyget_leng (void)
{
- return gram_leng;
+ return yyleng;
}
/** Get the current token.
*
*/
-char *gram_get_text (void)
+char *yyget_text (void)
{
- return gram_text;
+ return yytext;
}
/* %if-reentrant */
/* %endif */
/** Set the current line number.
- * @param line_number
+ * @param _line_number line number
*
*/
-void gram_set_lineno (int line_number )
+void yyset_lineno (int _line_number )
{
- gram_lineno = line_number;
+ yylineno = _line_number;
}
/** Set the input stream. This does not discard the current
* input buffer.
- * @param in_str A readable stream.
+ * @param _in_str A readable stream.
*
- * @see gram__switch_to_buffer
+ * @see yy_switch_to_buffer
*/
-void gram_set_in (FILE * in_str )
+void yyset_in (FILE * _in_str )
{
- gram_in = in_str ;
+ yyin = _in_str ;
}
-void gram_set_out (FILE * out_str )
+void yyset_out (FILE * _out_str )
{
- gram_out = out_str ;
+ yyout = _out_str ;
}
-int gram_get_debug (void)
+int yyget_debug (void)
{
- return gram__flex_debug;
+ return yy_flex_debug;
}
-void gram_set_debug (int bdebug )
+void yyset_debug (int _bdebug )
{
- gram__flex_debug = bdebug ;
+ yy_flex_debug = _bdebug ;
}
/* %endif */
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.
+ * This function is called from yylex_destroy(), so don't allocate here.
*/
- (yy_buffer_stack) = 0;
+ (yy_buffer_stack) = NULL;
(yy_buffer_stack_top) = 0;
(yy_buffer_stack_max) = 0;
- (yy_c_buf_p) = (char *) 0;
+ (yy_c_buf_p) = NULL;
(yy_init) = 0;
(yy_start) = 0;
/* Defined in main.c */
#ifdef YY_STDINIT
- gram_in = stdin;
- gram_out = stdout;
+ yyin = stdin;
+ yyout = stdout;
#else
- gram_in = (FILE *) 0;
- gram_out = (FILE *) 0;
+ yyin = NULL;
+ yyout = NULL;
#endif
/* For future reference: Set errno on error, since we are called by
- * gram_lex_init()
+ * yylex_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)
+/* yylex_destroy is for both reentrant and non-reentrant scanners. */
+int yylex_destroy (void)
{
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
- gram__delete_buffer(YY_CURRENT_BUFFER );
+ yy_delete_buffer( YY_CURRENT_BUFFER );
YY_CURRENT_BUFFER_LVALUE = NULL;
- gram_pop_buffer_state();
+ yypop_buffer_state();
}
/* Destroy the stack itself. */
- gram_free((yy_buffer_stack) );
+ yyfree((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. */
+ * yylex() is called, initialization will occur. */
yy_init_globals( );
/* %if-reentrant */
*/
#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
+static void yy_flex_strncpy (char* s1, const char * s2, int n )
{
- register int i;
+
+ 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 )
+static int yy_flex_strlen (const char * s )
{
- register int n;
+ int n;
for ( n = 0; s[n]; ++n )
;
}
#endif
-void *gram_alloc (yy_size_t size )
+void *yyalloc (yy_size_t size )
{
- return (void *) malloc( size );
+ return malloc(size);
}
-void *gram_realloc (void * ptr, yy_size_t size )
+void *yyrealloc (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
* any pointer type to void*, and deal with argument conversions
* as though doing an assignment.
*/
- return (void *) realloc( (char *) ptr, size );
+ return realloc(ptr, size);
}
-void gram_free (void * ptr )
+void yyfree (void * ptr )
{
- free( (char *) ptr ); /* see gram_realloc() for (char *) cast */
+ free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
}
/* %if-tables-serialization definitions */
/* %ok-for-header */
-#line 983 "src/scan-gram.l"
-
+#line 984 "src/scan-gram.l"
/* Read bytes from FP into buffer BUF of size SIZE. Return the
{
obstack_free (&obstack_for_string, 0);
/* Reclaim Flex's buffers. */
- gram_lex_destroy ();
+ yylex_destroy ();
}
/* Nick */
}
void gram_piece_flush(size_t n) {
- gram_piece_escape(gram_text, n);
- gram_text += n;
+ gram_piece_escape(yytext, n);
+ yytext += n;
}
-void gram_piece_pack() {
+void gram_piece_pack(void) {
int i;
size_t j = 0;
for (i = gram_piece0; i < gram_piece1; ++i)
if (result < 0)
return ~result;
gram_piece_pack();
- gram_piece_escape(gram_text, strlen(gram_text));
+ gram_piece_escape(yytext, strlen(yytext));
gram_piece_pack();
return result;
}