From a94124700ea00d6dcb914cd6f36c105b1b567d83 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 17 Oct 2017 16:30:22 +0200 Subject: [PATCH] Get rid of deprecated options for yacc --- src/template/template_syntax.y | 6 +- src/vm/vm_file_var_syntax.y | 6 +- src/vm/vm_var_parser.c | 822 ++++++++++++++++++++----------- src/vm/vm_var_syntax.y | 6 +- src/xml/expr_arith.y | 6 +- src/xml/expr_bool.y | 6 +- src/xml/expr_parser.c | 864 +++++++++++++++++++++------------ 7 files changed, 1085 insertions(+), 631 deletions(-) diff --git a/src/template/template_syntax.y b/src/template/template_syntax.y index 3795f9425e..d81c185444 100644 --- a/src/template/template_syntax.y +++ b/src/template/template_syntax.y @@ -78,9 +78,9 @@ extern "C" %defines %locations -%pure_parser -%name-prefix = "template__" -%output = "template_syntax.cc" +%pure-parser +%name-prefix "template__" +%output "template_syntax.cc" %token EQUAL COMMA OBRACKET CBRACKET EQUAL_EMPTY CCDATA %token STRING diff --git a/src/vm/vm_file_var_syntax.y b/src/vm/vm_file_var_syntax.y index a2905336d0..77f4aee5ad 100644 --- a/src/vm/vm_file_var_syntax.y +++ b/src/vm/vm_file_var_syntax.y @@ -215,9 +215,9 @@ int get_image_path(VirtualMachine * vm, %defines %locations -%pure_parser -%name-prefix = "vm_file_var__" -%output = "vm_file_var_syntax.cc" +%pure-parser +%name-prefix "vm_file_var__" +%output "vm_file_var_syntax.cc" %token EQUAL COMMA OBRACKET CBRACKET diff --git a/src/vm/vm_var_parser.c b/src/vm/vm_var_parser.c index 3a0e606bec..75d49df339 100644 --- a/src/vm/vm_var_parser.c +++ b/src/vm/vm_var_parser.c @@ -1,6 +1,6 @@ -#line 2 "vm_var_parser.c" +#line 1 "vm_var_parser.c" -#line 4 "vm_var_parser.c" +#line 3 "vm_var_parser.c" #define YY_INT_ALIGNED short int @@ -8,11 +8,17 @@ #define yy_create_buffer vm_var__create_buffer #define yy_delete_buffer vm_var__delete_buffer -#define yy_flex_debug vm_var__flex_debug +#define yy_scan_buffer vm_var__scan_buffer +#define yy_scan_string vm_var__scan_string +#define yy_scan_bytes vm_var__scan_bytes #define yy_init_buffer vm_var__init_buffer #define yy_flush_buffer vm_var__flush_buffer #define yy_load_buffer_state vm_var__load_buffer_state #define yy_switch_to_buffer vm_var__switch_to_buffer +#define yypush_buffer_state vm_var_push_buffer_state +#define yypop_buffer_state vm_var_pop_buffer_state +#define yyensure_buffer_stack vm_var_ensure_buffer_stack +#define yy_flex_debug vm_var__flex_debug #define yyin vm_var_in #define yyleng vm_var_leng #define yylex vm_var_lex @@ -28,11 +34,245 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 1 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif +#ifdef yy_create_buffer +#define vm_var__create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer vm_var__create_buffer +#endif + +#ifdef yy_delete_buffer +#define vm_var__delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer vm_var__delete_buffer +#endif + +#ifdef yy_scan_buffer +#define vm_var__scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer vm_var__scan_buffer +#endif + +#ifdef yy_scan_string +#define vm_var__scan_string_ALREADY_DEFINED +#else +#define yy_scan_string vm_var__scan_string +#endif + +#ifdef yy_scan_bytes +#define vm_var__scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes vm_var__scan_bytes +#endif + +#ifdef yy_init_buffer +#define vm_var__init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer vm_var__init_buffer +#endif + +#ifdef yy_flush_buffer +#define vm_var__flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer vm_var__flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define vm_var__load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state vm_var__load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define vm_var__switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer vm_var__switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define vm_var_push_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state vm_var_push_buffer_state +#endif + +#ifdef yypop_buffer_state +#define vm_var_pop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state vm_var_pop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define vm_var_ensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack vm_var_ensure_buffer_stack +#endif + +#ifdef yylex +#define vm_var_lex_ALREADY_DEFINED +#else +#define yylex vm_var_lex +#endif + +#ifdef yyrestart +#define vm_var_restart_ALREADY_DEFINED +#else +#define yyrestart vm_var_restart +#endif + +#ifdef yylex_init +#define vm_var_lex_init_ALREADY_DEFINED +#else +#define yylex_init vm_var_lex_init +#endif + +#ifdef yylex_init_extra +#define vm_var_lex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra vm_var_lex_init_extra +#endif + +#ifdef yylex_destroy +#define vm_var_lex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy vm_var_lex_destroy +#endif + +#ifdef yyget_debug +#define vm_var_get_debug_ALREADY_DEFINED +#else +#define yyget_debug vm_var_get_debug +#endif + +#ifdef yyset_debug +#define vm_var_set_debug_ALREADY_DEFINED +#else +#define yyset_debug vm_var_set_debug +#endif + +#ifdef yyget_extra +#define vm_var_get_extra_ALREADY_DEFINED +#else +#define yyget_extra vm_var_get_extra +#endif + +#ifdef yyset_extra +#define vm_var_set_extra_ALREADY_DEFINED +#else +#define yyset_extra vm_var_set_extra +#endif + +#ifdef yyget_in +#define vm_var_get_in_ALREADY_DEFINED +#else +#define yyget_in vm_var_get_in +#endif + +#ifdef yyset_in +#define vm_var_set_in_ALREADY_DEFINED +#else +#define yyset_in vm_var_set_in +#endif + +#ifdef yyget_out +#define vm_var_get_out_ALREADY_DEFINED +#else +#define yyget_out vm_var_get_out +#endif + +#ifdef yyset_out +#define vm_var_set_out_ALREADY_DEFINED +#else +#define yyset_out vm_var_set_out +#endif + +#ifdef yyget_leng +#define vm_var_get_leng_ALREADY_DEFINED +#else +#define yyget_leng vm_var_get_leng +#endif + +#ifdef yyget_text +#define vm_var_get_text_ALREADY_DEFINED +#else +#define yyget_text vm_var_get_text +#endif + +#ifdef yyget_lineno +#define vm_var_get_lineno_ALREADY_DEFINED +#else +#define yyget_lineno vm_var_get_lineno +#endif + +#ifdef yyset_lineno +#define vm_var_set_lineno_ALREADY_DEFINED +#else +#define yyset_lineno vm_var_set_lineno +#endif + +#ifdef yywrap +#define vm_var_wrap_ALREADY_DEFINED +#else +#define yywrap vm_var_wrap +#endif + +#ifdef yyalloc +#define vm_var_alloc_ALREADY_DEFINED +#else +#define yyalloc vm_var_alloc +#endif + +#ifdef yyrealloc +#define vm_var_realloc_ALREADY_DEFINED +#else +#define yyrealloc vm_var_realloc +#endif + +#ifdef yyfree +#define vm_var_free_ALREADY_DEFINED +#else +#define yyfree vm_var_free +#endif + +#ifdef yytext +#define vm_var_text_ALREADY_DEFINED +#else +#define yytext vm_var_text +#endif + +#ifdef yyleng +#define vm_var_leng_ALREADY_DEFINED +#else +#define yyleng vm_var_leng +#endif + +#ifdef yyin +#define vm_var_in_ALREADY_DEFINED +#else +#define yyin vm_var_in +#endif + +#ifdef yyout +#define vm_var_out_ALREADY_DEFINED +#else +#define yyout vm_var_out +#endif + +#ifdef yy_flex_debug +#define vm_var__flex_debug_ALREADY_DEFINED +#else +#define yy_flex_debug vm_var__flex_debug +#endif + +#ifdef yylineno +#define vm_var_lineno_ALREADY_DEFINED +#else +#define yylineno vm_var_lineno +#endif + /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ @@ -103,10 +343,16 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ +/* begin standard C++ headers. */ + /* TODO: this is always defined, so inline it */ #define yyconst const @@ -119,32 +365,26 @@ typedef unsigned int flex_uint32_t; /* Returned upon end-of-file. */ #define YY_NULL 0 -/* 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)) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * - /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START - /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE vm_var_restart(vm_var_in ) - +#define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ @@ -174,50 +414,49 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; typedef size_t yy_size_t; #endif -extern int vm_var_leng; +extern int yyleng; -extern FILE *vm_var_in, *vm_var_out; +extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE vm_var_lex. + * existing scanners that call yyless() from OUTSIDE yylex. * One obvious solution it to make yy_act a global. I tried that, and saw - * a 5% performance hit in a non-vm_var_lineno scanner, because yy_act is + * a 5% performance hit in a non-yylineno scanner, because yy_act is * normally declared as a register variable-- so it is not worth it. */ #define YY_LESS_LINENO(n) \ do { \ int yyl;\ - for ( yyl = n; yyl < vm_var_leng; ++yyl )\ - if ( vm_var_text[yyl] == '\n' )\ - --vm_var_lineno;\ + for ( yyl = n; yyl < yyleng; ++yyl )\ + if ( yytext[yyl] == '\n' )\ + --yylineno;\ }while(0) #define YY_LINENO_REWIND_TO(dst) \ do {\ const char *p;\ for ( p = yy_cp-1; p >= (dst); --p)\ if ( *p == '\n' )\ - --vm_var_lineno;\ + --yylineno;\ }while(0) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ - /* Undo effects of setting up vm_var_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 vm_var_text again */ \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) - #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -260,7 +499,7 @@ struct yy_buffer_state 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. */ @@ -277,8 +516,8 @@ struct yy_buffer_state * possible backing-up. * * When we actually see the EOF, we change the status to "new" - * (via vm_var_restart()), so that the user can continue scanning by - * just pointing vm_var_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 @@ -299,106 +538,98 @@ static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) - /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] -/* yy_hold_char holds the character lost when vm_var_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 vm_var_leng; +int yyleng; /* Points to current character in buffer. */ 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 vm_var_wrap()'s to do buffer switches - * instead of setting up a fresh vm_var_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; -void vm_var_restart (FILE *input_file ); -void vm_var__switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE vm_var__create_buffer (FILE *file,int size ); -void vm_var__delete_buffer (YY_BUFFER_STATE b ); -void vm_var__flush_buffer (YY_BUFFER_STATE b ); -void vm_var_push_buffer_state (YY_BUFFER_STATE new_buffer ); -void vm_var_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 vm_var_ensure_buffer_stack (void ); -static void vm_var__load_buffer_state (void ); -static void vm_var__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 vm_var__flush_buffer(YY_CURRENT_BUFFER ) +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 ); -YY_BUFFER_STATE vm_var__scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE vm_var__scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE vm_var__scan_bytes (yyconst char *bytes,int len ); - -void *vm_var_alloc (yy_size_t ); -void *vm_var_realloc (void *,yy_size_t ); -void vm_var_free (void * ); - -#define yy_new_buffer vm_var__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 ){ \ - vm_var_ensure_buffer_stack (); \ + yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - vm_var__create_buffer(vm_var_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 ){\ - vm_var_ensure_buffer_stack (); \ + yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - vm_var__create_buffer(vm_var_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) /* Begin user sect3 */ +typedef flex_uint8_t YY_CHAR; -typedef unsigned char YY_CHAR; - -FILE *vm_var_in = NULL, *vm_var_out = NULL; +FILE *yyin = NULL, *yyout = NULL; typedef int yy_state_type; -extern int vm_var_lineno; +extern int yylineno; +int yylineno = 1; -int vm_var_lineno = 1; - -extern char *vm_var_text; +extern char *yytext; #ifdef yytext_ptr #undef yytext_ptr #endif -#define yytext_ptr vm_var_text +#define yytext_ptr yytext -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 (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 ); /* Done after the current pattern has been matched and before the - * corresponding action - sets up vm_var_text. + * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - vm_var_leng = (int) (yy_cp - yy_bp); \ + yyleng = (int) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; - #define YY_NUM_RULES 12 #define YY_END_OF_BUFFER 13 /* This struct is not used in this scanner, @@ -408,7 +639,7 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[34] = +static const flex_int16_t yy_accept[34] = { 0, 0, 0, 0, 0, 0, 0, 13, 11, 1, 10, 10, 12, 9, 3, 6, 2, 4, 5, 12, 8, @@ -416,7 +647,7 @@ static yyconst flex_int16_t yy_accept[34] = 7, 8, 0 } ; -static yyconst YY_CHAR yy_ec[256] = +static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -448,13 +679,13 @@ static yyconst YY_CHAR yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst YY_CHAR yy_meta[12] = +static const YY_CHAR yy_meta[12] = { 0, 1, 1, 1, 1, 2, 1, 3, 1, 1, 1, 3 } ; -static yyconst flex_uint16_t yy_base[39] = +static const flex_int16_t yy_base[39] = { 0, 41, 40, 0, 0, 8, 12, 44, 0, 47, 47, 18, 47, 47, 41, 0, 40, 39, 47, 32, 20, @@ -462,7 +693,7 @@ static yyconst flex_uint16_t yy_base[39] = 47, 7, 47, 28, 31, 34, 10, 37 } ; -static yyconst flex_int16_t yy_def[39] = +static const flex_int16_t yy_def[39] = { 0, 34, 34, 33, 3, 35, 35, 33, 36, 33, 33, 33, 33, 33, 33, 37, 33, 33, 33, 38, 33, @@ -470,7 +701,7 @@ static yyconst flex_int16_t yy_def[39] = 33, 33, 0, 33, 33, 33, 33, 33 } ; -static yyconst flex_uint16_t yy_nxt[59] = +static const flex_int16_t yy_nxt[59] = { 0, 10, 11, 12, 10, 13, 14, 15, 16, 17, 18, 15, 19, 27, 32, 20, 19, 31, 29, 20, 22, @@ -480,7 +711,7 @@ static yyconst flex_uint16_t yy_nxt[59] = 33, 33, 33, 33, 33, 33, 33, 33 } ; -static yyconst flex_int16_t yy_chk[59] = +static const flex_int16_t yy_chk[59] = { 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 37, 32, 5, 6, 30, 29, 6, 11, @@ -491,15 +722,15 @@ static yyconst flex_int16_t yy_chk[59] = } ; /* Table of booleans, true if rule could match eol. */ -static yyconst flex_int32_t yy_rule_can_match_eol[13] = +static const flex_int32_t yy_rule_can_match_eol[13] = { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, }; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; -extern int vm_var__flex_debug; -int vm_var__flex_debug = 0; +extern int yy_flex_debug; +int yy_flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. @@ -508,7 +739,7 @@ int vm_var__flex_debug = 0; #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET -char *vm_var_text; +char *yytext; #line 1 "vm_var_parser.l" /* -------------------------------------------------------------------------- */ /* Copyright 2002-2017, OpenNebula Project, OpenNebula Systems */ @@ -539,12 +770,12 @@ char *vm_var_text; #define YY_DECL int vm_var_lex (YYSTYPE *lvalp, YYLTYPE *llocp, \ mem_collector *mc) -#define YY_USER_ACTION llocp->first_line = vm_var_lineno; \ +#define YY_USER_ACTION llocp->first_line = yylineno; \ llocp->first_column = llocp->last_column; \ - llocp->last_column += vm_var_leng; + llocp->last_column += yyleng; +#line 776 "vm_var_parser.c" - -#line 548 "vm_var_parser.c" +#line 778 "vm_var_parser.c" #define INITIAL 0 #define VAR 1 @@ -562,36 +793,36 @@ char *vm_var_text; #define YY_EXTRA_TYPE void * #endif -static int yy_init_globals (void ); +static int yy_init_globals ( void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int vm_var_lex_destroy (void ); +int yylex_destroy ( void ); -int vm_var_get_debug (void ); +int yyget_debug ( void ); -void vm_var_set_debug (int debug_flag ); +void yyset_debug ( int debug_flag ); -YY_EXTRA_TYPE vm_var_get_extra (void ); +YY_EXTRA_TYPE yyget_extra ( void ); -void vm_var_set_extra (YY_EXTRA_TYPE user_defined ); +void yyset_extra ( YY_EXTRA_TYPE user_defined ); -FILE *vm_var_get_in (void ); +FILE *yyget_in ( void ); -void vm_var_set_in (FILE * _in_str ); +void yyset_in ( FILE * _in_str ); -FILE *vm_var_get_out (void ); +FILE *yyget_out ( void ); -void vm_var_set_out (FILE * _out_str ); +void yyset_out ( FILE * _out_str ); - int vm_var_get_leng (void ); + int yyget_leng ( void ); -char *vm_var_get_text (void ); +char *yyget_text ( void ); -int vm_var_get_lineno (void ); +int yyget_lineno ( void ); -void vm_var_set_lineno (int _line_number ); +void yyset_lineno ( int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -599,9 +830,9 @@ void vm_var_set_lineno (int _line_number ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int vm_var_wrap (void ); +extern "C" int yywrap ( void ); #else -extern int vm_var_wrap (void ); +extern int yywrap ( void ); #endif #endif @@ -610,19 +841,18 @@ extern int vm_var_wrap (void ); #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 - #ifdef __cplusplus -static int yyinput (void ); +static int yyinput ( void ); #else -static int input (void ); +static int input ( void ); #endif #endif @@ -642,7 +872,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( vm_var_text, (size_t) vm_var_leng, 1, vm_var_out )) {} } while (0) +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -653,20 +883,20 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + int n; \ for ( n = 0; n < max_size && \ - (c = getc( vm_var_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( vm_var_in ) ) \ + if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ - while ( (result = (int) fread(buf, 1, max_size, vm_var_in))==0 && ferror(vm_var_in)) \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -674,7 +904,7 @@ static int input (void ); break; \ } \ errno=0; \ - clearerr(vm_var_in); \ + clearerr(yyin); \ } \ }\ \ @@ -707,12 +937,12 @@ static int input (void ); #ifndef YY_DECL #define YY_DECL_IS_OURS 1 -extern int vm_var_lex (void); +extern int yylex (void); -#define YY_DECL int vm_var_lex (void) +#define YY_DECL int yylex (void) #endif /* !YY_DECL */ -/* Code executed at the beginning of each rule, after vm_var_text and vm_var_leng +/* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION @@ -746,25 +976,26 @@ YY_DECL if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ - if ( ! vm_var_in ) - vm_var_in = stdin; + if ( ! yyin ) + yyin = stdin; - if ( ! vm_var_out ) - vm_var_out = stdout; + if ( ! yyout ) + yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { - vm_var_ensure_buffer_stack (); + yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - vm_var__create_buffer(vm_var_in,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - vm_var__load_buffer_state( ); + yy_load_buffer_state( ); } { #line 43 "vm_var_parser.l" +#line 46 "vm_var_parser.l" /* ------------------------------------------------------------------------- */ /* Parse variables in the form: */ /* $VARIABLE */ @@ -773,13 +1004,13 @@ YY_DECL /* $NUM.CONTEXT_VARIABLE */ /* ------------------------------------------------------------------------- */ -#line 777 "vm_var_parser.c" +#line 1007 "vm_var_parser.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); - /* Support of vm_var_text. */ + /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of @@ -801,9 +1032,9 @@ yy_match: { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 34 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 47 ); @@ -821,11 +1052,11 @@ yy_find_action: if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) { - yy_size_t yyl; - for ( yyl = 0; yyl < vm_var_leng; ++yyl ) - if ( vm_var_text[yyl] == '\n' ) - - vm_var_lineno++; + int yyl; + for ( yyl = 0; yyl < yyleng; ++yyl ) + if ( yytext[yyl] == '\n' ) + + yylineno++; ; } @@ -842,69 +1073,69 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 53 "vm_var_parser.l" +#line 54 "vm_var_parser.l" { BEGIN VAR;} YY_BREAK case 2: YY_RULE_SETUP -#line 55 "vm_var_parser.l" +#line 56 "vm_var_parser.l" { BEGIN VALUE; return EQUAL; } YY_BREAK case 3: YY_RULE_SETUP -#line 56 "vm_var_parser.l" +#line 57 "vm_var_parser.l" { return COMMA;} YY_BREAK case 4: YY_RULE_SETUP -#line 57 "vm_var_parser.l" +#line 58 "vm_var_parser.l" { return OBRACKET;} YY_BREAK case 5: YY_RULE_SETUP -#line 58 "vm_var_parser.l" +#line 59 "vm_var_parser.l" { return CBRACKET;} YY_BREAK case 6: YY_RULE_SETUP -#line 60 "vm_var_parser.l" +#line 61 "vm_var_parser.l" { lvalp->val_str = - mem_collector_strdup(mc,vm_var_text); + mem_collector_strdup(mc,yytext); return VARIABLE;} YY_BREAK case 7: /* rule 7 can match eol */ YY_RULE_SETUP -#line 64 "vm_var_parser.l" +#line 65 "vm_var_parser.l" { lvalp->val_str = - mem_collector_strdup(mc,vm_var_text+1); - lvalp->val_str[vm_var_leng-2] = '\0'; + mem_collector_strdup(mc,yytext+1); + lvalp->val_str[yyleng-2] = '\0'; BEGIN(VAR); return STRING;} YY_BREAK case 8: YY_RULE_SETUP -#line 70 "vm_var_parser.l" +#line 71 "vm_var_parser.l" { lvalp->val_str = - mem_collector_strdup(mc,vm_var_text); + mem_collector_strdup(mc,yytext); BEGIN(VAR); return STRING;} YY_BREAK case 9: YY_RULE_SETUP -#line 75 "vm_var_parser.l" +#line 76 "vm_var_parser.l" { lvalp->val_char = '\0'; return EOA;} YY_BREAK case 10: YY_RULE_SETUP -#line 78 "vm_var_parser.l" -{ lvalp->val_char = *vm_var_text; +#line 79 "vm_var_parser.l" +{ lvalp->val_char = *yytext; BEGIN(INITIAL); return EOA;} YY_BREAK case YY_STATE_EOF(VAR): -#line 82 "vm_var_parser.l" +#line 83 "vm_var_parser.l" { lvalp->val_char = '\0'; BEGIN(INITIAL); return EOA;} @@ -915,15 +1146,15 @@ case YY_STATE_EOF(VAR): case 11: /* rule 11 can match eol */ YY_RULE_SETUP -#line 90 "vm_var_parser.l" -{ lvalp->val_str = mem_collector_strdup(mc,vm_var_text); return RSTRING;} +#line 91 "vm_var_parser.l" +{ lvalp->val_str = mem_collector_strdup(mc,yytext); return RSTRING;} YY_BREAK case 12: YY_RULE_SETUP -#line 92 "vm_var_parser.l" +#line 93 "vm_var_parser.l" ECHO; YY_BREAK -#line 927 "vm_var_parser.c" +#line 1157 "vm_var_parser.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(VALUE): yyterminate(); @@ -941,15 +1172,15 @@ case YY_STATE_EOF(VALUE): { /* We're scanning a new file or input source. It's * possible that this happened because the user - * just pointed vm_var_in at a new source and called - * vm_var_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 = vm_var_in; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } @@ -1002,11 +1233,11 @@ case YY_STATE_EOF(VALUE): { (yy_did_buffer_switch_on_eof) = 0; - if ( vm_var_wrap( ) ) + if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up - * vm_var_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 @@ -1056,7 +1287,7 @@ case YY_STATE_EOF(VALUE): } /* end of action switch */ } /* end of scanning one token */ } /* end of user's declarations */ -} /* end of vm_var_lex */ +} /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * @@ -1069,7 +1300,7 @@ static int yy_get_next_buffer (void) { char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = (yytext_ptr); - yy_size_t number_to_move, i; + int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -1098,7 +1329,7 @@ static int yy_get_next_buffer (void) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (yy_size_t) ((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++); @@ -1134,7 +1365,8 @@ static int yy_get_next_buffer (void) b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - vm_var_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. */ @@ -1166,7 +1398,7 @@ static int yy_get_next_buffer (void) if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - vm_var_restart(vm_var_in ); + yyrestart( yyin ); } else @@ -1180,12 +1412,15 @@ static int yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((int) ((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. */ int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) vm_var_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + 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; @@ -1218,9 +1453,9 @@ static int yy_get_next_buffer (void) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 34 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; } return yy_current_state; @@ -1246,9 +1481,9 @@ static int yy_get_next_buffer (void) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 34 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 33); return yy_is_jam ? 0 : yy_current_state; @@ -1282,7 +1517,7 @@ static int yy_get_next_buffer (void) 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( ) ) @@ -1299,13 +1534,13 @@ static int yy_get_next_buffer (void) */ /* Reset buffer status. */ - vm_var_restart(vm_var_in ); + yyrestart( yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( vm_var_wrap( ) ) + if ( yywrap( ) ) return 0; if ( ! (yy_did_buffer_switch_on_eof) ) @@ -1325,12 +1560,12 @@ static int yy_get_next_buffer (void) } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve vm_var_text */ + *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); if ( c == '\n' ) - - vm_var_lineno++; + + yylineno++; ; return c; @@ -1342,32 +1577,32 @@ static int yy_get_next_buffer (void) * * @note This function does not reset the start condition to @c INITIAL . */ - void vm_var_restart (FILE * input_file ) + void yyrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ - vm_var_ensure_buffer_stack (); + yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - vm_var__create_buffer(vm_var_in,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - vm_var__init_buffer(YY_CURRENT_BUFFER,input_file ); - vm_var__load_buffer_state( ); + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ - void vm_var__switch_to_buffer (YY_BUFFER_STATE new_buffer ) + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with - * vm_var_pop_buffer_state(); - * vm_var_push_buffer_state(new_buffer); + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); */ - vm_var_ensure_buffer_stack (); + yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; @@ -1380,21 +1615,21 @@ static int yy_get_next_buffer (void) } YY_CURRENT_BUFFER_LVALUE = new_buffer; - vm_var__load_buffer_state( ); + yy_load_buffer_state( ); /* We don't actually know whether we did this switch during - * EOF (vm_var_wrap()) processing, but the only time this flag - * is looked at is after vm_var_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; } -static void vm_var__load_buffer_state (void) +static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - vm_var_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } @@ -1404,35 +1639,35 @@ static void vm_var__load_buffer_state (void) * * @return the allocated buffer state. */ - YY_BUFFER_STATE vm_var__create_buffer (FILE * file, int size ) + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) vm_var_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 vm_var__create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - b->yy_buf_size = (yy_size_t)size; + 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 *) vm_var_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 vm_var__create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - vm_var__init_buffer(b,file ); + yy_init_buffer( b, file ); return b; } /** Destroy the buffer. - * @param b a buffer created with vm_var__create_buffer() + * @param b a buffer created with yy_create_buffer() * */ - void vm_var__delete_buffer (YY_BUFFER_STATE b ) + void yy_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) @@ -1442,27 +1677,27 @@ static void vm_var__load_buffer_state (void) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - vm_var_free((void *) b->yy_ch_buf ); + yyfree( (void *) b->yy_ch_buf ); - vm_var_free((void *) b ); + yyfree( (void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, - * such as during a vm_var_restart() or at EOF. + * such as during a yyrestart() or at EOF. */ - static void vm_var__init_buffer (YY_BUFFER_STATE b, FILE * file ) + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; - vm_var__flush_buffer(b ); + yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; - /* If b is the current buffer, then vm_var__init_buffer was _probably_ - * called from vm_var_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){ @@ -1479,7 +1714,7 @@ static void vm_var__load_buffer_state (void) * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ - void vm_var__flush_buffer (YY_BUFFER_STATE b ) + void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; @@ -1499,7 +1734,7 @@ static void vm_var__load_buffer_state (void) b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - vm_var__load_buffer_state( ); + yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes @@ -1508,14 +1743,14 @@ static void vm_var__load_buffer_state (void) * @param new_buffer The new state. * */ -void vm_var_push_buffer_state (YY_BUFFER_STATE new_buffer ) +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; - vm_var_ensure_buffer_stack(); + yyensure_buffer_stack(); - /* This block is copied from vm_var__switch_to_buffer. */ + /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ @@ -1529,8 +1764,8 @@ void vm_var_push_buffer_state (YY_BUFFER_STATE new_buffer ) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; - /* copied from vm_var__switch_to_buffer. */ - vm_var__load_buffer_state( ); + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } @@ -1538,18 +1773,18 @@ void vm_var_push_buffer_state (YY_BUFFER_STATE new_buffer ) * The next element becomes the new top. * */ -void vm_var_pop_buffer_state (void) +void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; - vm_var__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) { - vm_var__load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } @@ -1557,9 +1792,9 @@ void vm_var_pop_buffer_state (void) /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ -static void vm_var_ensure_buffer_stack (void) +static void yyensure_buffer_stack (void) { - int num_to_alloc; + yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { @@ -1568,14 +1803,14 @@ static void vm_var_ensure_buffer_stack (void) * immediate realloc on the next call. */ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ - (yy_buffer_stack) = (struct yy_buffer_state**)vm_var_alloc + (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 vm_var_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; @@ -1587,12 +1822,12 @@ static void vm_var_ensure_buffer_stack (void) 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**)vm_var_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 vm_var_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*)); @@ -1604,9 +1839,9 @@ static void vm_var_ensure_buffer_stack (void) * @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 vm_var__scan_buffer (char * base, yy_size_t size ) +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; @@ -1616,11 +1851,11 @@ YY_BUFFER_STATE vm_var__scan_buffer (char * base, yy_size_t size ) /* They forgot to leave room for the EOB's. */ return NULL; - b = (YY_BUFFER_STATE) vm_var_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 vm_var__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 = NULL; @@ -1630,53 +1865,53 @@ YY_BUFFER_STATE vm_var__scan_buffer (char * base, yy_size_t size ) b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - vm_var__switch_to_buffer(b ); + yy_switch_to_buffer( b ); return b; } -/** Setup the input buffer state to scan a string. The next call to vm_var_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 - * vm_var__scan_bytes() instead. + * yy_scan_bytes() instead. */ -YY_BUFFER_STATE vm_var__scan_string (yyconst char * yystr ) +YY_BUFFER_STATE yy_scan_string (const char * yystr ) { - return vm_var__scan_bytes(yystr,(int) strlen(yystr) ); + return yy_scan_bytes( yystr, (int) strlen(yystr) ); } -/** Setup the input buffer state to scan the given bytes. The next call to vm_var_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 vm_var__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; yy_size_t n; - yy_size_t i; + int i; /* Get memory for full buffer, including space for trailing EOB's. */ - n = (yy_size_t) _yybytes_len + 2; - buf = (char *) vm_var_alloc(n ); + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n ); if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in vm_var__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 = vm_var__scan_buffer(buf,n ); + b = yy_scan_buffer( buf, n ); if ( ! b ) - YY_FATAL_ERROR( "bad buffer in vm_var__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. @@ -1690,9 +1925,9 @@ YY_BUFFER_STATE vm_var__scan_bytes (yyconst char * yybytes, int _yybytes_len ) #define YY_EXIT_FAILURE 2 #endif -static void yynoreturn 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 ); } @@ -1702,14 +1937,14 @@ static void yynoreturn yy_fatal_error (yyconst char* msg ) #define yyless(n) \ do \ { \ - /* Undo effects of setting up vm_var_text. */ \ + /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ - vm_var_text[vm_var_leng] = (yy_hold_char); \ - (yy_c_buf_p) = vm_var_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'; \ - vm_var_leng = yyless_macro_arg; \ + yyleng = yyless_macro_arg; \ } \ while ( 0 ) @@ -1718,89 +1953,89 @@ static void yynoreturn yy_fatal_error (yyconst char* msg ) /** Get the current line number. * */ -int vm_var_get_lineno (void) +int yyget_lineno (void) { - - return vm_var_lineno; + + return yylineno; } /** Get the input stream. * */ -FILE *vm_var_get_in (void) +FILE *yyget_in (void) { - return vm_var_in; + return yyin; } /** Get the output stream. * */ -FILE *vm_var_get_out (void) +FILE *yyget_out (void) { - return vm_var_out; + return yyout; } /** Get the length of the current token. * */ -int vm_var_get_leng (void) +int yyget_leng (void) { - return vm_var_leng; + return yyleng; } /** Get the current token. * */ -char *vm_var_get_text (void) +char *yyget_text (void) { - return vm_var_text; + return yytext; } /** Set the current line number. * @param _line_number line number * */ -void vm_var_set_lineno (int _line_number ) +void yyset_lineno (int _line_number ) { - vm_var_lineno = _line_number; + yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param _in_str A readable stream. * - * @see vm_var__switch_to_buffer + * @see yy_switch_to_buffer */ -void vm_var_set_in (FILE * _in_str ) +void yyset_in (FILE * _in_str ) { - vm_var_in = _in_str ; + yyin = _in_str ; } -void vm_var_set_out (FILE * _out_str ) +void yyset_out (FILE * _out_str ) { - vm_var_out = _out_str ; + yyout = _out_str ; } -int vm_var_get_debug (void) +int yyget_debug (void) { - return vm_var__flex_debug; + return yy_flex_debug; } -void vm_var_set_debug (int _bdebug ) +void yyset_debug (int _bdebug ) { - vm_var__flex_debug = _bdebug ; + yy_flex_debug = _bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. - * This function is called from vm_var_lex_destroy(), so don't allocate here. + * This function is called from yylex_destroy(), so don't allocate here. */ - /* We do not touch vm_var_lineno unless the option is enabled. */ - vm_var_lineno = 1; + /* We do not touch yylineno unless the option is enabled. */ + yylineno = 1; (yy_buffer_stack) = NULL; (yy_buffer_stack_top) = 0; @@ -1811,36 +2046,36 @@ static int yy_init_globals (void) /* Defined in main.c */ #ifdef YY_STDINIT - vm_var_in = stdin; - vm_var_out = stdout; + yyin = stdin; + yyout = stdout; #else - vm_var_in = NULL; - vm_var_out = NULL; + yyin = NULL; + yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by - * vm_var_lex_init() + * yylex_init() */ return 0; } -/* vm_var_lex_destroy is for both reentrant and non-reentrant scanners. */ -int vm_var_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){ - vm_var__delete_buffer(YY_CURRENT_BUFFER ); + yy_delete_buffer( YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; - vm_var_pop_buffer_state(); + yypop_buffer_state(); } /* Destroy the stack itself. */ - vm_var_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 - * vm_var_lex() is called, initialization will occur. */ + * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; @@ -1851,7 +2086,7 @@ int vm_var_lex_destroy (void) */ #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 ) { int i; @@ -1861,7 +2096,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) +static int yy_flex_strlen (const char * s ) { int n; for ( n = 0; s[n]; ++n ) @@ -1871,12 +2106,12 @@ static int yy_flex_strlen (yyconst char * s ) } #endif -void *vm_var_alloc (yy_size_t size ) +void *yyalloc (yy_size_t size ) { return malloc(size); } -void *vm_var_realloc (void * ptr, yy_size_t size ) +void *yyrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both @@ -1889,15 +2124,14 @@ void *vm_var_realloc (void * ptr, yy_size_t size ) return realloc(ptr, size); } -void vm_var_free (void * ptr ) +void yyfree (void * ptr ) { - free( (char *) ptr ); /* see vm_var_realloc() for (char *) cast */ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" -#line 92 "vm_var_parser.l" - +#line 93 "vm_var_parser.l" int vm_var_wrap() diff --git a/src/vm/vm_var_syntax.y b/src/vm/vm_var_syntax.y index 9261dfde7e..8d1dc9c3b0 100644 --- a/src/vm/vm_var_syntax.y +++ b/src/vm/vm_var_syntax.y @@ -413,9 +413,9 @@ void insert_vector(VirtualMachine * vm, %defines %locations -%pure_parser -%name-prefix = "vm_var__" -%output = "vm_var_syntax.cc" +%pure-parser +%name-prefix "vm_var__" +%output "vm_var_syntax.cc" %token EQUAL COMMA OBRACKET CBRACKET diff --git a/src/xml/expr_arith.y b/src/xml/expr_arith.y index 897d72287f..9210241e3f 100644 --- a/src/xml/expr_arith.y +++ b/src/xml/expr_arith.y @@ -83,9 +83,9 @@ extern "C" %defines %locations -%pure_parser -%name-prefix = "expr_arith__" -%output = "expr_arith.cc" +%pure-parser +%name-prefix "expr_arith__" +%output "expr_arith.cc" %left '+' '-' %left '*' '/' diff --git a/src/xml/expr_bool.y b/src/xml/expr_bool.y index dacb0debc5..653e74cb44 100644 --- a/src/xml/expr_bool.y +++ b/src/xml/expr_bool.y @@ -82,9 +82,9 @@ extern "C" %defines %locations -%pure_parser -%name-prefix = "expr_bool__" -%output = "expr_bool.cc" +%pure-parser +%name-prefix "expr_bool__" +%output "expr_bool.cc" %left '!' '&' '|' %token INTEGER diff --git a/src/xml/expr_parser.c b/src/xml/expr_parser.c index c1dad1c6f4..dfb1744f86 100644 --- a/src/xml/expr_parser.c +++ b/src/xml/expr_parser.c @@ -1,6 +1,6 @@ -#line 2 "expr_parser.c" +#line 1 "expr_parser.c" -#line 4 "expr_parser.c" +#line 3 "expr_parser.c" #define YY_INT_ALIGNED short int @@ -8,11 +8,17 @@ #define yy_create_buffer expr__create_buffer #define yy_delete_buffer expr__delete_buffer -#define yy_flex_debug expr__flex_debug +#define yy_scan_buffer expr__scan_buffer +#define yy_scan_string expr__scan_string +#define yy_scan_bytes expr__scan_bytes #define yy_init_buffer expr__init_buffer #define yy_flush_buffer expr__flush_buffer #define yy_load_buffer_state expr__load_buffer_state #define yy_switch_to_buffer expr__switch_to_buffer +#define yypush_buffer_state expr_push_buffer_state +#define yypop_buffer_state expr_pop_buffer_state +#define yyensure_buffer_stack expr_ensure_buffer_stack +#define yy_flex_debug expr__flex_debug #define yyin expr_in #define yyleng expr_leng #define yylex expr_lex @@ -28,11 +34,245 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 0 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif +#ifdef yy_create_buffer +#define expr__create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer expr__create_buffer +#endif + +#ifdef yy_delete_buffer +#define expr__delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer expr__delete_buffer +#endif + +#ifdef yy_scan_buffer +#define expr__scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer expr__scan_buffer +#endif + +#ifdef yy_scan_string +#define expr__scan_string_ALREADY_DEFINED +#else +#define yy_scan_string expr__scan_string +#endif + +#ifdef yy_scan_bytes +#define expr__scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes expr__scan_bytes +#endif + +#ifdef yy_init_buffer +#define expr__init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer expr__init_buffer +#endif + +#ifdef yy_flush_buffer +#define expr__flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer expr__flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define expr__load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state expr__load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define expr__switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer expr__switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define expr_push_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state expr_push_buffer_state +#endif + +#ifdef yypop_buffer_state +#define expr_pop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state expr_pop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define expr_ensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack expr_ensure_buffer_stack +#endif + +#ifdef yylex +#define expr_lex_ALREADY_DEFINED +#else +#define yylex expr_lex +#endif + +#ifdef yyrestart +#define expr_restart_ALREADY_DEFINED +#else +#define yyrestart expr_restart +#endif + +#ifdef yylex_init +#define expr_lex_init_ALREADY_DEFINED +#else +#define yylex_init expr_lex_init +#endif + +#ifdef yylex_init_extra +#define expr_lex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra expr_lex_init_extra +#endif + +#ifdef yylex_destroy +#define expr_lex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy expr_lex_destroy +#endif + +#ifdef yyget_debug +#define expr_get_debug_ALREADY_DEFINED +#else +#define yyget_debug expr_get_debug +#endif + +#ifdef yyset_debug +#define expr_set_debug_ALREADY_DEFINED +#else +#define yyset_debug expr_set_debug +#endif + +#ifdef yyget_extra +#define expr_get_extra_ALREADY_DEFINED +#else +#define yyget_extra expr_get_extra +#endif + +#ifdef yyset_extra +#define expr_set_extra_ALREADY_DEFINED +#else +#define yyset_extra expr_set_extra +#endif + +#ifdef yyget_in +#define expr_get_in_ALREADY_DEFINED +#else +#define yyget_in expr_get_in +#endif + +#ifdef yyset_in +#define expr_set_in_ALREADY_DEFINED +#else +#define yyset_in expr_set_in +#endif + +#ifdef yyget_out +#define expr_get_out_ALREADY_DEFINED +#else +#define yyget_out expr_get_out +#endif + +#ifdef yyset_out +#define expr_set_out_ALREADY_DEFINED +#else +#define yyset_out expr_set_out +#endif + +#ifdef yyget_leng +#define expr_get_leng_ALREADY_DEFINED +#else +#define yyget_leng expr_get_leng +#endif + +#ifdef yyget_text +#define expr_get_text_ALREADY_DEFINED +#else +#define yyget_text expr_get_text +#endif + +#ifdef yyget_lineno +#define expr_get_lineno_ALREADY_DEFINED +#else +#define yyget_lineno expr_get_lineno +#endif + +#ifdef yyset_lineno +#define expr_set_lineno_ALREADY_DEFINED +#else +#define yyset_lineno expr_set_lineno +#endif + +#ifdef yywrap +#define expr_wrap_ALREADY_DEFINED +#else +#define yywrap expr_wrap +#endif + +#ifdef yyalloc +#define expr_alloc_ALREADY_DEFINED +#else +#define yyalloc expr_alloc +#endif + +#ifdef yyrealloc +#define expr_realloc_ALREADY_DEFINED +#else +#define yyrealloc expr_realloc +#endif + +#ifdef yyfree +#define expr_free_ALREADY_DEFINED +#else +#define yyfree expr_free +#endif + +#ifdef yytext +#define expr_text_ALREADY_DEFINED +#else +#define yytext expr_text +#endif + +#ifdef yyleng +#define expr_leng_ALREADY_DEFINED +#else +#define yyleng expr_leng +#endif + +#ifdef yyin +#define expr_in_ALREADY_DEFINED +#else +#define yyin expr_in +#endif + +#ifdef yyout +#define expr_out_ALREADY_DEFINED +#else +#define yyout expr_out +#endif + +#ifdef yy_flex_debug +#define expr__flex_debug_ALREADY_DEFINED +#else +#define yy_flex_debug expr__flex_debug +#endif + +#ifdef yylineno +#define expr_lineno_ALREADY_DEFINED +#else +#define yylineno expr_lineno +#endif + /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ @@ -103,60 +343,48 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ -#ifdef __cplusplus +/* begin standard C++ headers. */ -/* 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 /* Returned upon end-of-file. */ #define YY_NULL 0 -/* 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)) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * - /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START - /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE expr_restart(expr_in ) - +#define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ @@ -186,50 +414,49 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; typedef size_t yy_size_t; #endif -extern yy_size_t expr_leng; +extern int yyleng; -extern FILE *expr_in, *expr_out; +extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE expr_lex. + * existing scanners that call yyless() from OUTSIDE yylex. * One obvious solution it to make yy_act a global. I tried that, and saw - * a 5% performance hit in a non-expr_lineno scanner, because yy_act is + * a 5% performance hit in a non-yylineno scanner, because yy_act is * normally declared as a register variable-- so it is not worth it. */ #define YY_LESS_LINENO(n) \ do { \ int yyl;\ - for ( yyl = n; yyl < expr_leng; ++yyl )\ - if ( expr_text[yyl] == '\n' )\ - --expr_lineno;\ + for ( yyl = n; yyl < yyleng; ++yyl )\ + if ( yytext[yyl] == '\n' )\ + --yylineno;\ }while(0) #define YY_LINENO_REWIND_TO(dst) \ do {\ const char *p;\ for ( p = yy_cp-1; p >= (dst); --p)\ if ( *p == '\n' )\ - --expr_lineno;\ + --yylineno;\ }while(0) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ - /* Undo effects of setting up expr_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 expr_text again */ \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) - #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -244,12 +471,12 @@ 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. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -272,7 +499,7 @@ struct yy_buffer_state 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. */ @@ -289,8 +516,8 @@ struct yy_buffer_state * possible backing-up. * * When we actually see the EOF, we change the status to "new" - * (via expr_restart()), so that the user can continue scanning by - * just pointing expr_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 @@ -300,7 +527,7 @@ struct yy_buffer_state /* 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. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general @@ -311,109 +538,98 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) - /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] -/* yy_hold_char holds the character lost when expr_text is formed. */ +/* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ -yy_size_t expr_leng; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +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 expr_wrap()'s to do buffer switches - * instead of setting up a fresh expr_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; -void expr_restart (FILE *input_file ); -void expr__switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE expr__create_buffer (FILE *file,int size ); -void expr__delete_buffer (YY_BUFFER_STATE b ); -void expr__flush_buffer (YY_BUFFER_STATE b ); -void expr_push_buffer_state (YY_BUFFER_STATE new_buffer ); -void expr_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 expr_ensure_buffer_stack (void ); -static void expr__load_buffer_state (void ); -static void expr__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 expr__flush_buffer(YY_CURRENT_BUFFER ) +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 ); -YY_BUFFER_STATE expr__scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE expr__scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE expr__scan_bytes (yyconst char *bytes,yy_size_t len ); - -void *expr_alloc (yy_size_t ); -void *expr_realloc (void *,yy_size_t ); -void expr_free (void * ); - -#define yy_new_buffer expr__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 ){ \ - expr_ensure_buffer_stack (); \ + yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - expr__create_buffer(expr_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 ){\ - expr_ensure_buffer_stack (); \ + yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - expr__create_buffer(expr_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) /* Begin user sect3 */ +typedef flex_uint8_t YY_CHAR; -typedef unsigned char YY_CHAR; - -FILE *expr_in = (FILE *) 0, *expr_out = (FILE *) 0; +FILE *yyin = NULL, *yyout = NULL; typedef int yy_state_type; -extern int expr_lineno; +extern int yylineno; +int yylineno = 1; -int expr_lineno = 1; - -extern char *expr_text; +extern char *yytext; #ifdef yytext_ptr #undef yytext_ptr #endif -#define yytext_ptr expr_text +#define yytext_ptr yytext -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 ); -#if defined(__GNUC__) && __GNUC__ >= 3 -__attribute__((__noreturn__)) -#endif -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 ); /* Done after the current pattern has been matched and before the - * corresponding action - sets up expr_text. + * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - expr_leng = (size_t) (yy_cp - yy_bp); \ + yyleng = (int) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; - #define YY_NUM_RULES 8 #define YY_END_OF_BUFFER 9 /* This struct is not used in this scanner, @@ -423,13 +639,13 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[20] = +static const flex_int16_t yy_accept[20] = { 0, 7, 7, 9, 8, 7, 1, 8, 1, 5, 2, 7, 0, 3, 5, 0, 2, 4, 6, 0 } ; -static yyconst YY_CHAR yy_ec[256] = +static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -461,26 +677,26 @@ static yyconst YY_CHAR yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst YY_CHAR yy_meta[10] = +static const YY_CHAR yy_meta[10] = { 0, 1, 1, 1, 1, 1, 1, 2, 2, 2 } ; -static yyconst flex_uint16_t yy_base[22] = +static const flex_int16_t yy_base[22] = { 0, 0, 0, 22, 23, 19, 23, 16, 12, 4, 0, 16, 13, 23, 0, 9, 0, 23, 8, 23, 11, 12 } ; -static yyconst flex_int16_t yy_def[22] = +static const flex_int16_t yy_def[22] = { 0, 19, 1, 19, 19, 19, 19, 20, 19, 19, 21, 19, 20, 19, 9, 19, 21, 19, 19, 0, 19, 19 } ; -static yyconst flex_uint16_t yy_nxt[33] = +static const flex_int16_t yy_nxt[33] = { 0, 4, 5, 6, 7, 8, 4, 9, 10, 4, 15, 14, 12, 12, 16, 18, 18, 17, 11, 14, 13, @@ -488,7 +704,7 @@ static yyconst flex_uint16_t yy_nxt[33] = 19, 19 } ; -static yyconst flex_int16_t yy_chk[33] = +static const flex_int16_t yy_chk[33] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 20, 20, 21, 18, 15, 12, 11, 8, 7, @@ -497,15 +713,15 @@ static yyconst flex_int16_t yy_chk[33] = } ; /* Table of booleans, true if rule could match eol. */ -static yyconst flex_int32_t yy_rule_can_match_eol[9] = +static const flex_int32_t yy_rule_can_match_eol[9] = { 0, 0, 0, 0, 1, 0, 0, 0, 0, }; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; -extern int expr__flex_debug; -int expr__flex_debug = 0; +extern int yy_flex_debug; +int yy_flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. @@ -514,7 +730,7 @@ int expr__flex_debug = 0; #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET -char *expr_text; +char *yytext; #line 1 "expr_parser.l" /* -------------------------------------------------------------------------- */ /* Copyright 2002-2017, OpenNebula Project, OpenNebula Systems */ @@ -543,10 +759,11 @@ char *expr_text; #define YY_DECL int expr_lex (YYSTYPE *lvalp, YYLTYPE *llocp, mem_collector *mc) -#define YY_USER_ACTION llocp->first_line = expr_lineno; \ +#define YY_USER_ACTION llocp->first_line = yylineno; \ llocp->first_column = llocp->last_column; \ - llocp->last_column += expr_leng; -#line 550 "expr_parser.c" + llocp->last_column += yyleng; +#line 765 "expr_parser.c" +#line 766 "expr_parser.c" #define INITIAL 0 @@ -562,36 +779,36 @@ char *expr_text; #define YY_EXTRA_TYPE void * #endif -static int yy_init_globals (void ); +static int yy_init_globals ( void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int expr_lex_destroy (void ); +int yylex_destroy ( void ); -int expr_get_debug (void ); +int yyget_debug ( void ); -void expr_set_debug (int debug_flag ); +void yyset_debug ( int debug_flag ); -YY_EXTRA_TYPE expr_get_extra (void ); +YY_EXTRA_TYPE yyget_extra ( void ); -void expr_set_extra (YY_EXTRA_TYPE user_defined ); +void yyset_extra ( YY_EXTRA_TYPE user_defined ); -FILE *expr_get_in (void ); +FILE *yyget_in ( void ); -void expr_set_in (FILE * _in_str ); +void yyset_in ( FILE * _in_str ); -FILE *expr_get_out (void ); +FILE *yyget_out ( void ); -void expr_set_out (FILE * _out_str ); +void yyset_out ( FILE * _out_str ); -yy_size_t expr_get_leng (void ); + int yyget_leng ( void ); -char *expr_get_text (void ); +char *yyget_text ( void ); -int expr_get_lineno (void ); +int yyget_lineno ( void ); -void expr_set_lineno (int _line_number ); +void yyset_lineno ( int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -599,9 +816,9 @@ void expr_set_lineno (int _line_number ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int expr_wrap (void ); +extern "C" int yywrap ( void ); #else -extern int expr_wrap (void ); +extern int yywrap ( void ); #endif #endif @@ -610,19 +827,18 @@ extern int expr_wrap (void ); #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 - #ifdef __cplusplus -static int yyinput (void ); +static int yyinput ( void ); #else -static int input (void ); +static int input ( void ); #endif #endif @@ -642,7 +858,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( expr_text, expr_leng, 1, expr_out )) {} } while (0) +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -653,20 +869,20 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + int n; \ for ( n = 0; n < max_size && \ - (c = getc( expr_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( expr_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, expr_in))==0 && ferror(expr_in)) \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -674,7 +890,7 @@ static int input (void ); break; \ } \ errno=0; \ - clearerr(expr_in); \ + clearerr(yyin); \ } \ }\ \ @@ -707,12 +923,12 @@ static int input (void ); #ifndef YY_DECL #define YY_DECL_IS_OURS 1 -extern int expr_lex (void); +extern int yylex (void); -#define YY_DECL int expr_lex (void) +#define YY_DECL int yylex (void) #endif /* !YY_DECL */ -/* Code executed at the beginning of each rule, after expr_text and expr_leng +/* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION @@ -746,33 +962,34 @@ YY_DECL if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ - if ( ! expr_in ) - expr_in = stdin; + if ( ! yyin ) + yyin = stdin; - if ( ! expr_out ) - expr_out = stdout; + if ( ! yyout ) + yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { - expr_ensure_buffer_stack (); + yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - expr__create_buffer(expr_in,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - expr__load_buffer_state( ); + yy_load_buffer_state( ); } { #line 39 "expr_parser.l" +#line 41 "expr_parser.l" /* --- Tokens --- */ -#line 770 "expr_parser.c" +#line 986 "expr_parser.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); - /* Support of expr_text. */ + /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of @@ -794,9 +1011,9 @@ yy_match: { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 20 ) - 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_base[yy_current_state] != 23 ); @@ -814,11 +1031,11 @@ yy_find_action: if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) { - yy_size_t yyl; - for ( yyl = 0; yyl < expr_leng; ++yyl ) - if ( expr_text[yyl] == '\n' ) - - expr_lineno++; + int yyl; + for ( yyl = 0; yyl < yyleng; ++yyl ) + if ( yytext[yyl] == '\n' ) + + yylineno++; ; } @@ -835,55 +1052,55 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 42 "expr_parser.l" -{ return *expr_text;} +#line 43 "expr_parser.l" +{ return *yytext;} YY_BREAK /* --- Strings, also quoted form --- */ case 2: YY_RULE_SETUP -#line 46 "expr_parser.l" -{ lvalp->val_str = mem_collector_strdup(mc,expr_text); +#line 47 "expr_parser.l" +{ lvalp->val_str = mem_collector_strdup(mc,yytext); return STRING;} YY_BREAK case 3: YY_RULE_SETUP -#line 49 "expr_parser.l" +#line 50 "expr_parser.l" { lvalp->val_str = NULL; return STRING;} YY_BREAK case 4: /* rule 4 can match eol */ YY_RULE_SETUP -#line 52 "expr_parser.l" -{ lvalp->val_str = mem_collector_strdup(mc,expr_text+1); - lvalp->val_str[expr_leng-2] = '\0'; +#line 53 "expr_parser.l" +{ lvalp->val_str = mem_collector_strdup(mc,yytext+1); + lvalp->val_str[yyleng-2] = '\0'; return STRING;} YY_BREAK /* --- Numbers --- */ case 5: YY_RULE_SETUP -#line 58 "expr_parser.l" -{ lvalp->val_int = atoi(expr_text); +#line 59 "expr_parser.l" +{ lvalp->val_int = atoi(yytext); return INTEGER;} YY_BREAK case 6: YY_RULE_SETUP -#line 61 "expr_parser.l" -{ lvalp->val_float = atof(expr_text); +#line 62 "expr_parser.l" +{ lvalp->val_float = atof(yytext); return FLOAT;} YY_BREAK /* --- blanks --- */ case 7: YY_RULE_SETUP -#line 66 "expr_parser.l" +#line 67 "expr_parser.l" YY_BREAK case 8: YY_RULE_SETUP -#line 68 "expr_parser.l" +#line 69 "expr_parser.l" ECHO; YY_BREAK -#line 887 "expr_parser.c" +#line 1103 "expr_parser.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -900,15 +1117,15 @@ case YY_STATE_EOF(INITIAL): { /* We're scanning a new file or input source. It's * possible that this happened because the user - * just pointed expr_in at a new source and called - * expr_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 = expr_in; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } @@ -961,11 +1178,11 @@ case YY_STATE_EOF(INITIAL): { (yy_did_buffer_switch_on_eof) = 0; - if ( expr_wrap( ) ) + if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up - * expr_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 @@ -1015,7 +1232,7 @@ case YY_STATE_EOF(INITIAL): } /* end of action switch */ } /* end of scanning one token */ } /* end of user's declarations */ -} /* end of expr_lex */ +} /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * @@ -1028,7 +1245,7 @@ static int yy_get_next_buffer (void) { char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = (yytext_ptr); - yy_size_t number_to_move, i; + int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) @@ -1057,7 +1274,7 @@ static int yy_get_next_buffer (void) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (yy_size_t) ((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++); @@ -1070,7 +1287,7 @@ static int yy_get_next_buffer (void) else { - yy_size_t num_to_read = + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -1084,7 +1301,7 @@ static int yy_get_next_buffer (void) if ( b->yy_is_our_buffer ) { - yy_size_t new_size = b->yy_buf_size * 2; + int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1093,11 +1310,12 @@ static int yy_get_next_buffer (void) b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - expr_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( @@ -1125,7 +1343,7 @@ static int yy_get_next_buffer (void) if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - expr_restart(expr_in ); + yyrestart( yyin ); } else @@ -1139,12 +1357,15 @@ static int yy_get_next_buffer (void) 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 *) expr_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; @@ -1177,9 +1398,9 @@ static int yy_get_next_buffer (void) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 20 ) - 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; @@ -1205,9 +1426,9 @@ static int yy_get_next_buffer (void) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 20 ) - 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 == 19); return yy_is_jam ? 0 : yy_current_state; @@ -1241,7 +1462,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - yy_size_t 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( ) ) @@ -1258,14 +1479,14 @@ static int yy_get_next_buffer (void) */ /* Reset buffer status. */ - expr_restart(expr_in ); + yyrestart( yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( expr_wrap( ) ) - return EOF; + if ( yywrap( ) ) + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -1284,12 +1505,12 @@ static int yy_get_next_buffer (void) } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve expr_text */ + *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); if ( c == '\n' ) - - expr_lineno++; + + yylineno++; ; return c; @@ -1301,32 +1522,32 @@ static int yy_get_next_buffer (void) * * @note This function does not reset the start condition to @c INITIAL . */ - void expr_restart (FILE * input_file ) + void yyrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ - expr_ensure_buffer_stack (); + yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - expr__create_buffer(expr_in,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - expr__init_buffer(YY_CURRENT_BUFFER,input_file ); - expr__load_buffer_state( ); + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ - void expr__switch_to_buffer (YY_BUFFER_STATE new_buffer ) + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with - * expr_pop_buffer_state(); - * expr_push_buffer_state(new_buffer); + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); */ - expr_ensure_buffer_stack (); + yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; @@ -1339,21 +1560,21 @@ static int yy_get_next_buffer (void) } YY_CURRENT_BUFFER_LVALUE = new_buffer; - expr__load_buffer_state( ); + yy_load_buffer_state( ); /* We don't actually know whether we did this switch during - * EOF (expr_wrap()) processing, but the only time this flag - * is looked at is after expr_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; } -static void expr__load_buffer_state (void) +static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - expr_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } @@ -1363,35 +1584,35 @@ static void expr__load_buffer_state (void) * * @return the allocated buffer state. */ - YY_BUFFER_STATE expr__create_buffer (FILE * file, int size ) + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) expr_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 expr__create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - b->yy_buf_size = (yy_size_t)size; + 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 *) expr_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 expr__create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - expr__init_buffer(b,file ); + yy_init_buffer( b, file ); return b; } /** Destroy the buffer. - * @param b a buffer created with expr__create_buffer() + * @param b a buffer created with yy_create_buffer() * */ - void expr__delete_buffer (YY_BUFFER_STATE b ) + void yy_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) @@ -1401,27 +1622,27 @@ static void expr__load_buffer_state (void) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - expr_free((void *) b->yy_ch_buf ); + yyfree( (void *) b->yy_ch_buf ); - expr_free((void *) b ); + yyfree( (void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, - * such as during a expr_restart() or at EOF. + * such as during a yyrestart() or at EOF. */ - static void expr__init_buffer (YY_BUFFER_STATE b, FILE * file ) + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; - expr__flush_buffer(b ); + yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; - /* If b is the current buffer, then expr__init_buffer was _probably_ - * called from expr_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){ @@ -1438,7 +1659,7 @@ static void expr__load_buffer_state (void) * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ - void expr__flush_buffer (YY_BUFFER_STATE b ) + void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; @@ -1458,7 +1679,7 @@ static void expr__load_buffer_state (void) b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - expr__load_buffer_state( ); + yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes @@ -1467,14 +1688,14 @@ static void expr__load_buffer_state (void) * @param new_buffer The new state. * */ -void expr_push_buffer_state (YY_BUFFER_STATE new_buffer ) +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; - expr_ensure_buffer_stack(); + yyensure_buffer_stack(); - /* This block is copied from expr__switch_to_buffer. */ + /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ @@ -1488,8 +1709,8 @@ void expr_push_buffer_state (YY_BUFFER_STATE new_buffer ) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; - /* copied from expr__switch_to_buffer. */ - expr__load_buffer_state( ); + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } @@ -1497,18 +1718,18 @@ void expr_push_buffer_state (YY_BUFFER_STATE new_buffer ) * The next element becomes the new top. * */ -void expr_pop_buffer_state (void) +void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; - expr__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) { - expr__load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } @@ -1516,7 +1737,7 @@ void expr_pop_buffer_state (void) /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ -static void expr_ensure_buffer_stack (void) +static void yyensure_buffer_stack (void) { yy_size_t num_to_alloc; @@ -1527,14 +1748,14 @@ static void expr_ensure_buffer_stack (void) * immediate realloc on the next call. */ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ - (yy_buffer_stack) = (struct yy_buffer_state**)expr_alloc + (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 expr_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; @@ -1546,12 +1767,12 @@ static void expr_ensure_buffer_stack (void) 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**)expr_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 expr_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*)); @@ -1563,9 +1784,9 @@ static void expr_ensure_buffer_stack (void) * @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 expr__scan_buffer (char * base, yy_size_t size ) +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; @@ -1573,69 +1794,69 @@ YY_BUFFER_STATE expr__scan_buffer (char * base, yy_size_t size ) 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) expr_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 expr__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; - expr__switch_to_buffer(b ); + yy_switch_to_buffer( b ); return b; } -/** Setup the input buffer state to scan a string. The next call to expr_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 - * expr__scan_bytes() instead. + * yy_scan_bytes() instead. */ -YY_BUFFER_STATE expr__scan_string (yyconst char * yystr ) +YY_BUFFER_STATE yy_scan_string (const char * yystr ) { - return expr__scan_bytes(yystr,strlen(yystr) ); + return yy_scan_bytes( yystr, (int) strlen(yystr) ); } -/** Setup the input buffer state to scan the given bytes. The next call to expr_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 expr__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; - yy_size_t i; + int i; /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) expr_alloc(n ); + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n ); if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in expr__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 = expr__scan_buffer(buf,n ); + b = yy_scan_buffer( buf, n ); if ( ! b ) - YY_FATAL_ERROR( "bad buffer in expr__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. @@ -1649,9 +1870,9 @@ YY_BUFFER_STATE expr__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_l #define YY_EXIT_FAILURE 2 #endif -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 ); } @@ -1661,14 +1882,14 @@ static void yy_fatal_error (yyconst char* msg ) #define yyless(n) \ do \ { \ - /* Undo effects of setting up expr_text. */ \ + /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ - expr_text[expr_leng] = (yy_hold_char); \ - (yy_c_buf_p) = expr_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'; \ - expr_leng = yyless_macro_arg; \ + yyleng = yyless_macro_arg; \ } \ while ( 0 ) @@ -1677,129 +1898,129 @@ static void yy_fatal_error (yyconst char* msg ) /** Get the current line number. * */ -int expr_get_lineno (void) +int yyget_lineno (void) { - - return expr_lineno; + + return yylineno; } /** Get the input stream. * */ -FILE *expr_get_in (void) +FILE *yyget_in (void) { - return expr_in; + return yyin; } /** Get the output stream. * */ -FILE *expr_get_out (void) +FILE *yyget_out (void) { - return expr_out; + return yyout; } /** Get the length of the current token. * */ -yy_size_t expr_get_leng (void) +int yyget_leng (void) { - return expr_leng; + return yyleng; } /** Get the current token. * */ -char *expr_get_text (void) +char *yyget_text (void) { - return expr_text; + return yytext; } /** Set the current line number. * @param _line_number line number * */ -void expr_set_lineno (int _line_number ) +void yyset_lineno (int _line_number ) { - expr_lineno = _line_number; + yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param _in_str A readable stream. * - * @see expr__switch_to_buffer + * @see yy_switch_to_buffer */ -void expr_set_in (FILE * _in_str ) +void yyset_in (FILE * _in_str ) { - expr_in = _in_str ; + yyin = _in_str ; } -void expr_set_out (FILE * _out_str ) +void yyset_out (FILE * _out_str ) { - expr_out = _out_str ; + yyout = _out_str ; } -int expr_get_debug (void) +int yyget_debug (void) { - return expr__flex_debug; + return yy_flex_debug; } -void expr_set_debug (int _bdebug ) +void yyset_debug (int _bdebug ) { - expr__flex_debug = _bdebug ; + yy_flex_debug = _bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. - * This function is called from expr_lex_destroy(), so don't allocate here. + * This function is called from yylex_destroy(), so don't allocate here. */ - /* We do not touch expr_lineno unless the option is enabled. */ - expr_lineno = 1; + /* We do not touch yylineno unless the option is enabled. */ + yylineno = 1; - (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 - expr_in = stdin; - expr_out = stdout; + yyin = stdin; + yyout = stdout; #else - expr_in = (FILE *) 0; - expr_out = (FILE *) 0; + yyin = NULL; + yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by - * expr_lex_init() + * yylex_init() */ return 0; } -/* expr_lex_destroy is for both reentrant and non-reentrant scanners. */ -int expr_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){ - expr__delete_buffer(YY_CURRENT_BUFFER ); + yy_delete_buffer( YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; - expr_pop_buffer_state(); + yypop_buffer_state(); } /* Destroy the stack itself. */ - expr_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 - * expr_lex() is called, initialization will occur. */ + * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; @@ -1810,7 +2031,7 @@ int expr_lex_destroy (void) */ #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 ) { int i; @@ -1820,7 +2041,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) +static int yy_flex_strlen (const char * s ) { int n; for ( n = 0; s[n]; ++n ) @@ -1830,12 +2051,12 @@ static int yy_flex_strlen (yyconst char * s ) } #endif -void *expr_alloc (yy_size_t size ) +void *yyalloc (yy_size_t size ) { - return (void *) malloc( size ); + return malloc(size); } -void *expr_realloc (void * ptr, yy_size_t size ) +void *yyrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both @@ -1845,18 +2066,17 @@ void *expr_realloc (void * ptr, yy_size_t size ) * 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 expr_free (void * ptr ) +void yyfree (void * ptr ) { - free( (char *) ptr ); /* see expr_realloc() for (char *) cast */ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" -#line 68 "expr_parser.l" - +#line 69 "expr_parser.l" int expr_wrap()