1,6 → 1,5 |
#line 2 "glcpp/glcpp-lex.c" |
|
#line 4 "glcpp/glcpp-lex.c" |
#line 2 "<stdout>" |
|
#define YY_INT_ALIGNED short int |
|
8,12 → 7,246 |
|
#define FLEX_SCANNER |
#define YY_FLEX_MAJOR_VERSION 2 |
#define YY_FLEX_MINOR_VERSION 5 |
#define YY_FLEX_SUBMINOR_VERSION 35 |
#define YY_FLEX_MINOR_VERSION 6 |
#define YY_FLEX_SUBMINOR_VERSION 4 |
#if YY_FLEX_SUBMINOR_VERSION > 0 |
#define FLEX_BETA |
#endif |
|
#ifdef yy_create_buffer |
#define glcpp__create_buffer_ALREADY_DEFINED |
#else |
#define yy_create_buffer glcpp__create_buffer |
#endif |
|
#ifdef yy_delete_buffer |
#define glcpp__delete_buffer_ALREADY_DEFINED |
#else |
#define yy_delete_buffer glcpp__delete_buffer |
#endif |
|
#ifdef yy_scan_buffer |
#define glcpp__scan_buffer_ALREADY_DEFINED |
#else |
#define yy_scan_buffer glcpp__scan_buffer |
#endif |
|
#ifdef yy_scan_string |
#define glcpp__scan_string_ALREADY_DEFINED |
#else |
#define yy_scan_string glcpp__scan_string |
#endif |
|
#ifdef yy_scan_bytes |
#define glcpp__scan_bytes_ALREADY_DEFINED |
#else |
#define yy_scan_bytes glcpp__scan_bytes |
#endif |
|
#ifdef yy_init_buffer |
#define glcpp__init_buffer_ALREADY_DEFINED |
#else |
#define yy_init_buffer glcpp__init_buffer |
#endif |
|
#ifdef yy_flush_buffer |
#define glcpp__flush_buffer_ALREADY_DEFINED |
#else |
#define yy_flush_buffer glcpp__flush_buffer |
#endif |
|
#ifdef yy_load_buffer_state |
#define glcpp__load_buffer_state_ALREADY_DEFINED |
#else |
#define yy_load_buffer_state glcpp__load_buffer_state |
#endif |
|
#ifdef yy_switch_to_buffer |
#define glcpp__switch_to_buffer_ALREADY_DEFINED |
#else |
#define yy_switch_to_buffer glcpp__switch_to_buffer |
#endif |
|
#ifdef yypush_buffer_state |
#define glcpp_push_buffer_state_ALREADY_DEFINED |
#else |
#define yypush_buffer_state glcpp_push_buffer_state |
#endif |
|
#ifdef yypop_buffer_state |
#define glcpp_pop_buffer_state_ALREADY_DEFINED |
#else |
#define yypop_buffer_state glcpp_pop_buffer_state |
#endif |
|
#ifdef yyensure_buffer_stack |
#define glcpp_ensure_buffer_stack_ALREADY_DEFINED |
#else |
#define yyensure_buffer_stack glcpp_ensure_buffer_stack |
#endif |
|
#ifdef yylex |
#define glcpp_lex_ALREADY_DEFINED |
#else |
#define yylex glcpp_lex |
#endif |
|
#ifdef yyrestart |
#define glcpp_restart_ALREADY_DEFINED |
#else |
#define yyrestart glcpp_restart |
#endif |
|
#ifdef yylex_init |
#define glcpp_lex_init_ALREADY_DEFINED |
#else |
#define yylex_init glcpp_lex_init |
#endif |
|
#ifdef yylex_init_extra |
#define glcpp_lex_init_extra_ALREADY_DEFINED |
#else |
#define yylex_init_extra glcpp_lex_init_extra |
#endif |
|
#ifdef yylex_destroy |
#define glcpp_lex_destroy_ALREADY_DEFINED |
#else |
#define yylex_destroy glcpp_lex_destroy |
#endif |
|
#ifdef yyget_debug |
#define glcpp_get_debug_ALREADY_DEFINED |
#else |
#define yyget_debug glcpp_get_debug |
#endif |
|
#ifdef yyset_debug |
#define glcpp_set_debug_ALREADY_DEFINED |
#else |
#define yyset_debug glcpp_set_debug |
#endif |
|
#ifdef yyget_extra |
#define glcpp_get_extra_ALREADY_DEFINED |
#else |
#define yyget_extra glcpp_get_extra |
#endif |
|
#ifdef yyset_extra |
#define glcpp_set_extra_ALREADY_DEFINED |
#else |
#define yyset_extra glcpp_set_extra |
#endif |
|
#ifdef yyget_in |
#define glcpp_get_in_ALREADY_DEFINED |
#else |
#define yyget_in glcpp_get_in |
#endif |
|
#ifdef yyset_in |
#define glcpp_set_in_ALREADY_DEFINED |
#else |
#define yyset_in glcpp_set_in |
#endif |
|
#ifdef yyget_out |
#define glcpp_get_out_ALREADY_DEFINED |
#else |
#define yyget_out glcpp_get_out |
#endif |
|
#ifdef yyset_out |
#define glcpp_set_out_ALREADY_DEFINED |
#else |
#define yyset_out glcpp_set_out |
#endif |
|
#ifdef yyget_leng |
#define glcpp_get_leng_ALREADY_DEFINED |
#else |
#define yyget_leng glcpp_get_leng |
#endif |
|
#ifdef yyget_text |
#define glcpp_get_text_ALREADY_DEFINED |
#else |
#define yyget_text glcpp_get_text |
#endif |
|
#ifdef yyget_lineno |
#define glcpp_get_lineno_ALREADY_DEFINED |
#else |
#define yyget_lineno glcpp_get_lineno |
#endif |
|
#ifdef yyset_lineno |
#define glcpp_set_lineno_ALREADY_DEFINED |
#else |
#define yyset_lineno glcpp_set_lineno |
#endif |
|
#ifdef yyget_column |
#define glcpp_get_column_ALREADY_DEFINED |
#else |
#define yyget_column glcpp_get_column |
#endif |
|
#ifdef yyset_column |
#define glcpp_set_column_ALREADY_DEFINED |
#else |
#define yyset_column glcpp_set_column |
#endif |
|
#ifdef yywrap |
#define glcpp_wrap_ALREADY_DEFINED |
#else |
#define yywrap glcpp_wrap |
#endif |
|
#ifdef yyget_lval |
#define glcpp_get_lval_ALREADY_DEFINED |
#else |
#define yyget_lval glcpp_get_lval |
#endif |
|
#ifdef yyset_lval |
#define glcpp_set_lval_ALREADY_DEFINED |
#else |
#define yyset_lval glcpp_set_lval |
#endif |
|
#ifdef yyget_lloc |
#define glcpp_get_lloc_ALREADY_DEFINED |
#else |
#define yyget_lloc glcpp_get_lloc |
#endif |
|
#ifdef yyset_lloc |
#define glcpp_set_lloc_ALREADY_DEFINED |
#else |
#define yyset_lloc glcpp_set_lloc |
#endif |
|
#ifdef yyalloc |
#define glcpp_alloc_ALREADY_DEFINED |
#else |
#define yyalloc glcpp_alloc |
#endif |
|
#ifdef yyrealloc |
#define glcpp_realloc_ALREADY_DEFINED |
#else |
#define yyrealloc glcpp_realloc |
#endif |
|
#ifdef yyfree |
#define glcpp_free_ALREADY_DEFINED |
#else |
#define yyfree glcpp_free |
#endif |
|
/* First, we deal with platform-specific or compiler-specific issues. */ |
|
/* begin standard C headers. */ |
84,40 → 317,32 |
#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 |
/* TODO: this is always defined, so inline it */ |
#define yyconst const |
|
#else /* ! __cplusplus */ |
|
/* C99 requires __STDC__ to be defined as 1. */ |
#if defined (__STDC__) |
|
#define YY_USE_CONST |
|
#endif /* defined (__STDC__) */ |
#endif /* ! __cplusplus */ |
|
#ifdef YY_USE_CONST |
#define yyconst const |
#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)) |
|
/* An opaque pointer. */ |
#ifndef YY_TYPEDEF_YY_SCANNER_T |
141,7 → 366,6 |
* definition of BEGIN. |
*/ |
#define BEGIN yyg->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. |
148,13 → 372,10 |
*/ |
#define YY_START ((yyg->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 glcpp_restart(yyin ,yyscanner ) |
|
#define YY_NEW_FILE yyrestart( yyin , yyscanner ) |
#define YY_END_OF_BUFFER_CHAR 0 |
|
/* Size of default input buffer. */ |
179,11 → 400,17 |
typedef struct yy_buffer_state *YY_BUFFER_STATE; |
#endif |
|
#ifndef YY_TYPEDEF_YY_SIZE_T |
#define YY_TYPEDEF_YY_SIZE_T |
typedef size_t yy_size_t; |
#endif |
|
#define EOB_ACT_CONTINUE_SCAN 0 |
#define EOB_ACT_END_OF_FILE 1 |
#define EOB_ACT_LAST_MATCH 2 |
|
#define YY_LESS_LINENO(n) |
#define YY_LINENO_REWIND_TO(ptr) |
|
/* Return all but the first "n" matched characters back to the input stream. */ |
#define yyless(n) \ |
198,14 → 425,8 |
YY_DO_BEFORE_ACTION; /* set up yytext again */ \ |
} \ |
while ( 0 ) |
|
#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) |
|
#ifndef YY_TYPEDEF_YY_SIZE_T |
#define YY_TYPEDEF_YY_SIZE_T |
typedef size_t yy_size_t; |
#endif |
|
#ifndef YY_STRUCT_YY_BUFFER_STATE |
#define YY_STRUCT_YY_BUFFER_STATE |
struct yy_buffer_state |
218,7 → 439,7 |
/* 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. |
263,7 → 484,7 |
* possible backing-up. |
* |
* When we actually see the EOF, we change the status to "new" |
* (via glcpp_restart()), so that the user can continue scanning by |
* (via yyrestart()), so that the user can continue scanning by |
* just pointing yyin at a new input file. |
*/ |
#define YY_BUFFER_EOF_PENDING 2 |
280,65 → 501,59 |
#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ |
? yyg->yy_buffer_stack[yyg->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 yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] |
|
void glcpp_restart (FILE *input_file ,yyscan_t yyscanner ); |
void glcpp__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); |
YY_BUFFER_STATE glcpp__create_buffer (FILE *file,int size ,yyscan_t yyscanner ); |
void glcpp__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); |
void glcpp__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); |
void glcpp_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); |
void glcpp_pop_buffer_state (yyscan_t yyscanner ); |
void yyrestart ( FILE *input_file , yyscan_t yyscanner ); |
void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); |
YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); |
void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); |
void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); |
void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); |
void yypop_buffer_state ( yyscan_t yyscanner ); |
|
static void glcpp_ensure_buffer_stack (yyscan_t yyscanner ); |
static void glcpp__load_buffer_state (yyscan_t yyscanner ); |
static void glcpp__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); |
static void yyensure_buffer_stack ( yyscan_t yyscanner ); |
static void yy_load_buffer_state ( yyscan_t yyscanner ); |
static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); |
#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) |
|
#define YY_FLUSH_BUFFER glcpp__flush_buffer(YY_CURRENT_BUFFER ,yyscanner) |
YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); |
YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); |
YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); |
|
YY_BUFFER_STATE glcpp__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); |
YY_BUFFER_STATE glcpp__scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); |
YY_BUFFER_STATE glcpp__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); |
void *yyalloc ( yy_size_t , yyscan_t yyscanner ); |
void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); |
void yyfree ( void * , yyscan_t yyscanner ); |
|
void *glcpp_alloc (yy_size_t ,yyscan_t yyscanner ); |
void *glcpp_realloc (void *,yy_size_t ,yyscan_t yyscanner ); |
void glcpp_free (void * ,yyscan_t yyscanner ); |
|
#define yy_new_buffer glcpp__create_buffer |
|
#define yy_new_buffer yy_create_buffer |
#define yy_set_interactive(is_interactive) \ |
{ \ |
if ( ! YY_CURRENT_BUFFER ){ \ |
glcpp_ensure_buffer_stack (yyscanner); \ |
yyensure_buffer_stack (yyscanner); \ |
YY_CURRENT_BUFFER_LVALUE = \ |
glcpp__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ |
yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ |
} \ |
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ |
} |
|
#define yy_set_bol(at_bol) \ |
{ \ |
if ( ! YY_CURRENT_BUFFER ){\ |
glcpp_ensure_buffer_stack (yyscanner); \ |
yyensure_buffer_stack (yyscanner); \ |
YY_CURRENT_BUFFER_LVALUE = \ |
glcpp__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ |
yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ |
} \ |
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ |
} |
|
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) |
|
/* Begin user sect3 */ |
|
#define glcpp_wrap(n) 1 |
#define glcpp_wrap(yyscanner) (/*CONSTCOND*/1) |
#define YY_SKIP_YYWRAP |
typedef flex_uint8_t YY_CHAR; |
|
typedef unsigned char YY_CHAR; |
|
typedef int yy_state_type; |
|
#define yytext_ptr yytext_r |
346,7 → 561,7 |
static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); |
static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); |
static int yy_get_next_buffer (yyscan_t yyscanner ); |
static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); |
static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); |
|
/* Done after the current pattern has been matched and before the |
* corresponding action - sets up yytext. |
353,11 → 568,10 |
*/ |
#define YY_DO_BEFORE_ACTION \ |
yyg->yytext_ptr = yy_bp; \ |
yyleng = (size_t) (yy_cp - yy_bp); \ |
yyleng = (int) (yy_cp - yy_bp); \ |
yyg->yy_hold_char = *yy_cp; \ |
*yy_cp = '\0'; \ |
yyg->yy_c_buf_p = yy_cp; |
|
#define YY_NUM_RULES 43 |
#define YY_END_OF_BUFFER 44 |
/* This struct is not used in this scanner, |
367,7 → 581,7 |
flex_int32_t yy_verify; |
flex_int32_t yy_nxt; |
}; |
static yyconst flex_int16_t yy_accept[150] = |
static const flex_int16_t yy_accept[150] = |
{ 0, |
0, 0, 0, 0, 3, 3, 0, 0, 0, 0, |
0, 0, 44, 39, 40, 41, 43, 38, 43, 38, |
387,7 → 601,7 |
0, 0, 19, 0, 9, 0, 0, 8, 0 |
} ; |
|
static yyconst flex_int32_t yy_ec[256] = |
static const YY_CHAR yy_ec[256] = |
{ 0, |
1, 1, 1, 1, 1, 1, 1, 1, 2, 3, |
4, 4, 4, 1, 1, 1, 1, 1, 1, 1, |
419,7 → 633,7 |
1, 1, 1, 1, 1 |
} ; |
|
static yyconst flex_int32_t yy_meta[40] = |
static const YY_CHAR yy_meta[40] = |
{ 0, |
1, 1, 2, 1, 1, 1, 1, 1, 3, 4, |
1, 5, 5, 5, 1, 1, 1, 5, 6, 6, |
427,7 → 641,7 |
6, 6, 6, 6, 6, 6, 6, 6, 1 |
} ; |
|
static yyconst flex_int16_t yy_base[164] = |
static const flex_int16_t yy_base[164] = |
{ 0, |
0, 38, 0, 0, 38, 39, 321, 320, 319, 44, |
50, 0, 321, 319, 317, 325, 325, 302, 311, 325, |
449,7 → 663,7 |
255, 259, 267 |
} ; |
|
static yyconst flex_int16_t yy_def[164] = |
static const flex_int16_t yy_def[164] = |
{ 0, |
149, 1, 150, 150, 151, 151, 152, 152, 153, 153, |
149, 11, 149, 149, 149, 149, 149, 149, 149, 149, |
471,7 → 685,7 |
149, 149, 149 |
} ; |
|
static yyconst flex_int16_t yy_nxt[365] = |
static const flex_int16_t yy_nxt[365] = |
{ 0, |
14, 15, 16, 17, 18, 19, 20, 21, 20, 20, |
22, 23, 24, 24, 25, 26, 27, 28, 28, 28, |
515,7 → 729,7 |
149, 149, 149, 149 |
} ; |
|
static yyconst flex_int16_t yy_chk[365] = |
static const flex_int16_t yy_chk[365] = |
{ 0, |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
628,6 → 842,7 |
yycolumn = 1; \ |
yylloc->source = 0; \ |
} while(0) |
#line 845 "<stdout>" |
|
/* The OTHER class is simply a catch-all for things that the CPP |
parser just doesn't care about. Since flex regular expressions that |
635,7 → 850,7 |
strings, we have to be careful to avoid OTHER matching and hiding |
something that CPP does care about. So we simply exclude all |
characters that appear in any other expressions. */ |
#line 639 "glcpp/glcpp-lex.c" |
#line 853 "<stdout>" |
|
#define INITIAL 0 |
#define DONE 1 |
700,50 → 915,50 |
|
# define yylloc yyg->yylloc_r |
|
int glcpp_lex_init (yyscan_t* scanner); |
int yylex_init (yyscan_t* scanner); |
|
int glcpp_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); |
int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); |
|
/* Accessor methods to globals. |
These are made visible to non-reentrant scanners for convenience. */ |
|
int glcpp_lex_destroy (yyscan_t yyscanner ); |
int yylex_destroy ( yyscan_t yyscanner ); |
|
int glcpp_get_debug (yyscan_t yyscanner ); |
int yyget_debug ( yyscan_t yyscanner ); |
|
void glcpp_set_debug (int debug_flag ,yyscan_t yyscanner ); |
void yyset_debug ( int debug_flag , yyscan_t yyscanner ); |
|
YY_EXTRA_TYPE glcpp_get_extra (yyscan_t yyscanner ); |
YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); |
|
void glcpp_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); |
void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); |
|
FILE *glcpp_get_in (yyscan_t yyscanner ); |
FILE *yyget_in ( yyscan_t yyscanner ); |
|
void glcpp_set_in (FILE * in_str ,yyscan_t yyscanner ); |
void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); |
|
FILE *glcpp_get_out (yyscan_t yyscanner ); |
FILE *yyget_out ( yyscan_t yyscanner ); |
|
void glcpp_set_out (FILE * out_str ,yyscan_t yyscanner ); |
void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); |
|
int glcpp_get_leng (yyscan_t yyscanner ); |
int yyget_leng ( yyscan_t yyscanner ); |
|
char *glcpp_get_text (yyscan_t yyscanner ); |
char *yyget_text ( yyscan_t yyscanner ); |
|
int glcpp_get_lineno (yyscan_t yyscanner ); |
int yyget_lineno ( yyscan_t yyscanner ); |
|
void glcpp_set_lineno (int line_number ,yyscan_t yyscanner ); |
void yyset_lineno ( int _line_number , yyscan_t yyscanner ); |
|
int glcpp_get_column (yyscan_t yyscanner ); |
int yyget_column ( yyscan_t yyscanner ); |
|
void glcpp_set_column (int column_no ,yyscan_t yyscanner ); |
void yyset_column ( int _column_no , yyscan_t yyscanner ); |
|
YYSTYPE * glcpp_get_lval (yyscan_t yyscanner ); |
YYSTYPE * yyget_lval ( yyscan_t yyscanner ); |
|
void glcpp_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); |
void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner ); |
|
YYLTYPE *glcpp_get_lloc (yyscan_t yyscanner ); |
YYLTYPE *yyget_lloc ( yyscan_t yyscanner ); |
|
void glcpp_set_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner ); |
void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner ); |
|
/* Macros after this point can all be overridden by user definitions in |
* section 1. |
751,24 → 966,27 |
|
#ifndef YY_SKIP_YYWRAP |
#ifdef __cplusplus |
extern "C" int glcpp_wrap (yyscan_t yyscanner ); |
extern "C" int yywrap ( yyscan_t yyscanner ); |
#else |
extern int glcpp_wrap (yyscan_t yyscanner ); |
extern int yywrap ( yyscan_t yyscanner ); |
#endif |
#endif |
|
#ifndef YY_NO_UNPUT |
|
static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner); |
|
#endif |
|
#ifndef yytext_ptr |
static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); |
static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); |
#endif |
|
#ifdef YY_NEED_STRLEN |
static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); |
static int yy_flex_strlen ( const char * , yyscan_t yyscanner); |
#endif |
|
#ifndef YY_NO_INPUT |
|
#ifdef __cplusplus |
static int yyinput (yyscan_t yyscanner ); |
#else |
777,7 → 995,7 |
|
#endif |
|
static void yy_push_state (int new_state ,yyscan_t yyscanner); |
static void yy_push_state ( int _new_state , yyscan_t yyscanner); |
|
static void yy_pop_state (yyscan_t yyscanner ); |
|
798,7 → 1016,7 |
/* This used to be an fputs(), but since the string might contain NUL's, |
* we now use fwrite(). |
*/ |
#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } 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, |
809,7 → 1027,7 |
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ |
{ \ |
int c = '*'; \ |
size_t n; \ |
int n; \ |
for ( n = 0; n < max_size && \ |
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \ |
buf[n] = (char) c; \ |
822,7 → 1040,7 |
else \ |
{ \ |
errno=0; \ |
while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ |
while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ |
{ \ |
if( errno != EINTR) \ |
{ \ |
863,10 → 1081,10 |
#ifndef YY_DECL |
#define YY_DECL_IS_OURS 1 |
|
extern int glcpp_lex \ |
extern int yylex \ |
(YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner); |
|
#define YY_DECL int glcpp_lex \ |
#define YY_DECL int yylex \ |
(YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) |
#endif /* !YY_DECL */ |
|
879,7 → 1097,7 |
|
/* Code executed at the end of each rule. */ |
#ifndef YY_BREAK |
#define YY_BREAK break; |
#define YY_BREAK /*LINTED*/break; |
#endif |
|
#define YY_RULE_SETUP \ |
892,28 → 1110,11 |
*/ |
YY_DECL |
{ |
register yy_state_type yy_current_state; |
register char *yy_cp, *yy_bp; |
register int yy_act; |
yy_state_type yy_current_state; |
char *yy_cp, *yy_bp; |
int yy_act; |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
|
#line 94 "glcpp/glcpp-lex.l" |
|
/* Implicitly switch between SKIP and INITIAL (non-skipping); |
* don't switch if some other state was explicitly set. |
*/ |
glcpp_parser_t *parser = yyextra; |
if (YY_START == 0 || YY_START == SKIP) { |
if (parser->lexing_if || parser->skip_stack == NULL || parser->skip_stack->type == SKIP_NO_SKIP) { |
BEGIN 0; |
} else { |
BEGIN SKIP; |
} |
} |
|
/* Single-line comments */ |
#line 916 "glcpp/glcpp-lex.c" |
|
yylval = yylval_param; |
|
yylloc = yylloc_param; |
936,16 → 1137,35 |
yyout = stdout; |
|
if ( ! YY_CURRENT_BUFFER ) { |
glcpp_ensure_buffer_stack (yyscanner); |
yyensure_buffer_stack (yyscanner); |
YY_CURRENT_BUFFER_LVALUE = |
glcpp__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); |
yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); |
} |
|
glcpp__load_buffer_state(yyscanner ); |
yy_load_buffer_state( yyscanner ); |
} |
|
while ( 1 ) /* loops until end-of-file is reached */ |
{ |
#line 94 "glcpp/glcpp-lex.l" |
|
#line 96 "glcpp/glcpp-lex.l" |
/* Implicitly switch between SKIP and INITIAL (non-skipping); |
* don't switch if some other state was explicitly set. |
*/ |
glcpp_parser_t *parser = yyextra; |
if (YY_START == 0 || YY_START == SKIP) { |
if (parser->lexing_if || parser->skip_stack == NULL || parser->skip_stack->type == SKIP_NO_SKIP) { |
BEGIN 0; |
} else { |
BEGIN SKIP; |
} |
} |
|
/* Single-line comments */ |
#line 1165 "<stdout>" |
|
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ |
{ |
yy_cp = yyg->yy_c_buf_p; |
|
/* Support of yytext. */ |
961,7 → 1181,7 |
yy_match: |
do |
{ |
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; |
YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; |
if ( yy_accept[yy_current_state] ) |
{ |
yyg->yy_last_accepting_state = yy_current_state; |
971,9 → 1191,9 |
{ |
yy_current_state = (int) yy_def[yy_current_state]; |
if ( yy_current_state >= 150 ) |
yy_c = yy_meta[(unsigned int) yy_c]; |
yy_c = yy_meta[yy_c]; |
} |
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; |
++yy_cp; |
} |
while ( yy_current_state != 149 ); |
998,7 → 1218,7 |
|
case 1: |
YY_RULE_SETUP |
#line 108 "glcpp/glcpp-lex.l" |
#line 109 "glcpp/glcpp-lex.l" |
{ |
} |
YY_BREAK |
1005,34 → 1225,34 |
/* Multi-line comments */ |
case 2: |
YY_RULE_SETUP |
#line 112 "glcpp/glcpp-lex.l" |
#line 113 "glcpp/glcpp-lex.l" |
{ yy_push_state(COMMENT, yyscanner); } |
YY_BREAK |
case 3: |
YY_RULE_SETUP |
#line 113 "glcpp/glcpp-lex.l" |
#line 114 "glcpp/glcpp-lex.l" |
|
YY_BREAK |
case 4: |
/* rule 4 can match eol */ |
YY_RULE_SETUP |
#line 114 "glcpp/glcpp-lex.l" |
#line 115 "glcpp/glcpp-lex.l" |
{ yylineno++; yycolumn = 0; return NEWLINE; } |
YY_BREAK |
case 5: |
YY_RULE_SETUP |
#line 115 "glcpp/glcpp-lex.l" |
#line 116 "glcpp/glcpp-lex.l" |
|
YY_BREAK |
case 6: |
/* rule 6 can match eol */ |
YY_RULE_SETUP |
#line 116 "glcpp/glcpp-lex.l" |
#line 117 "glcpp/glcpp-lex.l" |
{ yylineno++; yycolumn = 0; return NEWLINE; } |
YY_BREAK |
case 7: |
YY_RULE_SETUP |
#line 117 "glcpp/glcpp-lex.l" |
#line 118 "glcpp/glcpp-lex.l" |
{ |
yy_pop_state(yyscanner); |
if (yyextra->space_tokens) |
1041,7 → 1261,7 |
YY_BREAK |
case 8: |
YY_RULE_SETUP |
#line 123 "glcpp/glcpp-lex.l" |
#line 124 "glcpp/glcpp-lex.l" |
{ |
yylval->str = ralloc_strdup (yyextra, yytext); |
yyextra->space_tokens = 0; |
1052,7 → 1272,7 |
* Simply pass them through to the main compiler's lexer/parser. */ |
case 9: |
YY_RULE_SETUP |
#line 131 "glcpp/glcpp-lex.l" |
#line 132 "glcpp/glcpp-lex.l" |
{ |
yylval->str = ralloc_strdup (yyextra, yytext); |
yylineno++; |
1062,7 → 1282,7 |
YY_BREAK |
case 10: |
YY_RULE_SETUP |
#line 138 "glcpp/glcpp-lex.l" |
#line 139 "glcpp/glcpp-lex.l" |
{ |
return HASH_LINE; |
} |
1070,7 → 1290,7 |
|
case 11: |
YY_RULE_SETUP |
#line 143 "glcpp/glcpp-lex.l" |
#line 144 "glcpp/glcpp-lex.l" |
{ |
yyextra->lexing_if = 1; |
yyextra->space_tokens = 0; |
1079,7 → 1299,7 |
YY_BREAK |
case 12: |
YY_RULE_SETUP |
#line 149 "glcpp/glcpp-lex.l" |
#line 150 "glcpp/glcpp-lex.l" |
{ |
yyextra->lexing_if = 1; |
yyextra->space_tokens = 0; |
1089,10 → 1309,11 |
case 13: |
/* rule 13 can match eol */ |
*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ |
YY_LINENO_REWIND_TO(yy_cp - 1); |
yyg->yy_c_buf_p = yy_cp -= 1; |
YY_DO_BEFORE_ACTION; /* set up yytext again */ |
YY_RULE_SETUP |
#line 155 "glcpp/glcpp-lex.l" |
#line 156 "glcpp/glcpp-lex.l" |
{ |
yyextra->lexing_if = 1; |
yyextra->space_tokens = 0; |
1102,10 → 1323,11 |
case 14: |
/* rule 14 can match eol */ |
*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ |
YY_LINENO_REWIND_TO(yy_cp - 1); |
yyg->yy_c_buf_p = yy_cp -= 1; |
YY_DO_BEFORE_ACTION; /* set up yytext again */ |
YY_RULE_SETUP |
#line 161 "glcpp/glcpp-lex.l" |
#line 162 "glcpp/glcpp-lex.l" |
{ |
yyextra->lexing_if = 1; |
yyextra->space_tokens = 0; |
1114,7 → 1336,7 |
YY_BREAK |
case 15: |
YY_RULE_SETUP |
#line 167 "glcpp/glcpp-lex.l" |
#line 168 "glcpp/glcpp-lex.l" |
{ |
yyextra->space_tokens = 0; |
return HASH_ELSE; |
1122,7 → 1344,7 |
YY_BREAK |
case 16: |
YY_RULE_SETUP |
#line 172 "glcpp/glcpp-lex.l" |
#line 173 "glcpp/glcpp-lex.l" |
{ |
yyextra->space_tokens = 0; |
return HASH_ENDIF; |
1131,12 → 1353,12 |
|
case 17: |
YY_RULE_SETUP |
#line 178 "glcpp/glcpp-lex.l" |
#line 179 "glcpp/glcpp-lex.l" |
; |
YY_BREAK |
case 18: |
YY_RULE_SETUP |
#line 180 "glcpp/glcpp-lex.l" |
#line 181 "glcpp/glcpp-lex.l" |
{ |
char *p; |
for (p = yytext; !isalpha(p[0]); p++); /* skip " # " */ |
1146,7 → 1368,7 |
YY_BREAK |
case 19: |
YY_RULE_SETUP |
#line 187 "glcpp/glcpp-lex.l" |
#line 188 "glcpp/glcpp-lex.l" |
{ |
yyextra->space_tokens = 0; |
yy_push_state(DEFINE, yyscanner); |
1158,7 → 1380,7 |
yyg->yy_c_buf_p = yy_cp -= 1; |
YY_DO_BEFORE_ACTION; /* set up yytext again */ |
YY_RULE_SETUP |
#line 193 "glcpp/glcpp-lex.l" |
#line 194 "glcpp/glcpp-lex.l" |
{ |
yy_pop_state(yyscanner); |
yylval->str = ralloc_strdup (yyextra, yytext); |
1167,7 → 1389,7 |
YY_BREAK |
case 21: |
YY_RULE_SETUP |
#line 199 "glcpp/glcpp-lex.l" |
#line 200 "glcpp/glcpp-lex.l" |
{ |
yy_pop_state(yyscanner); |
yylval->str = ralloc_strdup (yyextra, yytext); |
1176,7 → 1398,7 |
YY_BREAK |
case 22: |
YY_RULE_SETUP |
#line 205 "glcpp/glcpp-lex.l" |
#line 206 "glcpp/glcpp-lex.l" |
{ |
yyextra->space_tokens = 0; |
return HASH_UNDEF; |
1184,7 → 1406,7 |
YY_BREAK |
case 23: |
YY_RULE_SETUP |
#line 210 "glcpp/glcpp-lex.l" |
#line 211 "glcpp/glcpp-lex.l" |
{ |
yyextra->space_tokens = 0; |
return HASH; |
1192,7 → 1414,7 |
YY_BREAK |
case 24: |
YY_RULE_SETUP |
#line 215 "glcpp/glcpp-lex.l" |
#line 216 "glcpp/glcpp-lex.l" |
{ |
yylval->str = ralloc_strdup (yyextra, yytext); |
return INTEGER_STRING; |
1200,7 → 1422,7 |
YY_BREAK |
case 25: |
YY_RULE_SETUP |
#line 220 "glcpp/glcpp-lex.l" |
#line 221 "glcpp/glcpp-lex.l" |
{ |
yylval->str = ralloc_strdup (yyextra, yytext); |
return INTEGER_STRING; |
1208,7 → 1430,7 |
YY_BREAK |
case 26: |
YY_RULE_SETUP |
#line 225 "glcpp/glcpp-lex.l" |
#line 226 "glcpp/glcpp-lex.l" |
{ |
yylval->str = ralloc_strdup (yyextra, yytext); |
return INTEGER_STRING; |
1216,7 → 1438,7 |
YY_BREAK |
case 27: |
YY_RULE_SETUP |
#line 230 "glcpp/glcpp-lex.l" |
#line 231 "glcpp/glcpp-lex.l" |
{ |
return LEFT_SHIFT; |
} |
1223,7 → 1445,7 |
YY_BREAK |
case 28: |
YY_RULE_SETUP |
#line 234 "glcpp/glcpp-lex.l" |
#line 235 "glcpp/glcpp-lex.l" |
{ |
return RIGHT_SHIFT; |
} |
1230,7 → 1452,7 |
YY_BREAK |
case 29: |
YY_RULE_SETUP |
#line 238 "glcpp/glcpp-lex.l" |
#line 239 "glcpp/glcpp-lex.l" |
{ |
return LESS_OR_EQUAL; |
} |
1237,7 → 1459,7 |
YY_BREAK |
case 30: |
YY_RULE_SETUP |
#line 242 "glcpp/glcpp-lex.l" |
#line 243 "glcpp/glcpp-lex.l" |
{ |
return GREATER_OR_EQUAL; |
} |
1244,7 → 1466,7 |
YY_BREAK |
case 31: |
YY_RULE_SETUP |
#line 246 "glcpp/glcpp-lex.l" |
#line 247 "glcpp/glcpp-lex.l" |
{ |
return EQUAL; |
} |
1251,7 → 1473,7 |
YY_BREAK |
case 32: |
YY_RULE_SETUP |
#line 250 "glcpp/glcpp-lex.l" |
#line 251 "glcpp/glcpp-lex.l" |
{ |
return NOT_EQUAL; |
} |
1258,7 → 1480,7 |
YY_BREAK |
case 33: |
YY_RULE_SETUP |
#line 254 "glcpp/glcpp-lex.l" |
#line 255 "glcpp/glcpp-lex.l" |
{ |
return AND; |
} |
1265,7 → 1487,7 |
YY_BREAK |
case 34: |
YY_RULE_SETUP |
#line 258 "glcpp/glcpp-lex.l" |
#line 259 "glcpp/glcpp-lex.l" |
{ |
return OR; |
} |
1272,7 → 1494,7 |
YY_BREAK |
case 35: |
YY_RULE_SETUP |
#line 262 "glcpp/glcpp-lex.l" |
#line 263 "glcpp/glcpp-lex.l" |
{ |
if (parser->is_gles) |
glcpp_error(yylloc, yyextra, "Token pasting (##) is illegal in GLES"); |
1281,7 → 1503,7 |
YY_BREAK |
case 36: |
YY_RULE_SETUP |
#line 268 "glcpp/glcpp-lex.l" |
#line 269 "glcpp/glcpp-lex.l" |
{ |
return DEFINED; |
} |
1288,7 → 1510,7 |
YY_BREAK |
case 37: |
YY_RULE_SETUP |
#line 272 "glcpp/glcpp-lex.l" |
#line 273 "glcpp/glcpp-lex.l" |
{ |
yylval->str = ralloc_strdup (yyextra, yytext); |
return IDENTIFIER; |
1296,7 → 1518,7 |
YY_BREAK |
case 38: |
YY_RULE_SETUP |
#line 277 "glcpp/glcpp-lex.l" |
#line 278 "glcpp/glcpp-lex.l" |
{ |
return yytext[0]; |
} |
1303,7 → 1525,7 |
YY_BREAK |
case 39: |
YY_RULE_SETUP |
#line 281 "glcpp/glcpp-lex.l" |
#line 282 "glcpp/glcpp-lex.l" |
{ |
yylval->str = ralloc_strdup (yyextra, yytext); |
return OTHER; |
1311,7 → 1533,7 |
YY_BREAK |
case 40: |
YY_RULE_SETUP |
#line 286 "glcpp/glcpp-lex.l" |
#line 287 "glcpp/glcpp-lex.l" |
{ |
if (yyextra->space_tokens) { |
return SPACE; |
1321,7 → 1543,7 |
case 41: |
/* rule 41 can match eol */ |
YY_RULE_SETUP |
#line 292 "glcpp/glcpp-lex.l" |
#line 293 "glcpp/glcpp-lex.l" |
{ |
yyextra->lexing_if = 0; |
yylineno++; |
1331,7 → 1553,7 |
YY_BREAK |
/* Handle missing newline at EOF. */ |
case YY_STATE_EOF(INITIAL): |
#line 300 "glcpp/glcpp-lex.l" |
#line 301 "glcpp/glcpp-lex.l" |
{ |
BEGIN DONE; /* Don't keep matching this rule forever. */ |
yyextra->lexing_if = 0; |
1344,7 → 1566,7 |
warnings. */ |
case 42: |
YY_RULE_SETUP |
#line 310 "glcpp/glcpp-lex.l" |
#line 311 "glcpp/glcpp-lex.l" |
{ |
unput('.'); |
yy_top_state(yyextra); |
1352,10 → 1574,10 |
YY_BREAK |
case 43: |
YY_RULE_SETUP |
#line 315 "glcpp/glcpp-lex.l" |
#line 316 "glcpp/glcpp-lex.l" |
ECHO; |
YY_BREAK |
#line 1359 "glcpp/glcpp-lex.c" |
#line 1580 "<stdout>" |
case YY_STATE_EOF(DONE): |
case YY_STATE_EOF(COMMENT): |
case YY_STATE_EOF(UNREACHABLE): |
1377,7 → 1599,7 |
/* We're scanning a new file or input source. It's |
* possible that this happened because the user |
* just pointed yyin at a new source and called |
* glcpp_lex(). If so, then we have to assure |
* 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 |
1438,7 → 1660,7 |
{ |
yyg->yy_did_buffer_switch_on_eof = 0; |
|
if ( glcpp_wrap(yyscanner ) ) |
if ( yywrap( yyscanner ) ) |
{ |
/* Note: because we've taken care in |
* yy_get_next_buffer() to have set up |
1491,7 → 1713,8 |
"fatal flex scanner internal error--no action found" ); |
} /* end of action switch */ |
} /* end of scanning one token */ |
} /* end of glcpp_lex */ |
} /* end of user's declarations */ |
} /* end of yylex */ |
|
/* yy_get_next_buffer - try to read in a new buffer |
* |
1503,9 → 1726,9 |
static int yy_get_next_buffer (yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; |
register char *source = yyg->yytext_ptr; |
register int number_to_move, i; |
char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; |
char *source = yyg->yytext_ptr; |
int number_to_move, i; |
int ret_val; |
|
if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) |
1534,7 → 1757,7 |
/* Try to read more data. */ |
|
/* First move last chars to start of buffer. */ |
number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; |
number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); |
|
for ( i = 0; i < number_to_move; ++i ) |
*(dest++) = *(source++); |
1554,7 → 1777,7 |
{ /* Not enough room in the buffer - grow it. */ |
|
/* just a shorter name for the current buffer */ |
YY_BUFFER_STATE b = YY_CURRENT_BUFFER; |
YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; |
|
int yy_c_buf_p_offset = |
(int) (yyg->yy_c_buf_p - b->yy_ch_buf); |
1570,11 → 1793,12 |
|
b->yy_ch_buf = (char *) |
/* Include room in for 2 EOB chars. */ |
glcpp_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); |
yyrealloc( (void *) b->yy_ch_buf, |
(yy_size_t) (b->yy_buf_size + 2) , yyscanner ); |
} |
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( |
1592,7 → 1816,7 |
|
/* Read in more data. */ |
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), |
yyg->yy_n_chars, (size_t) num_to_read ); |
yyg->yy_n_chars, num_to_read ); |
|
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; |
} |
1602,7 → 1826,7 |
if ( number_to_move == YY_MORE_ADJ ) |
{ |
ret_val = EOB_ACT_END_OF_FILE; |
glcpp_restart(yyin ,yyscanner); |
yyrestart( yyin , yyscanner); |
} |
|
else |
1616,12 → 1840,15 |
else |
ret_val = EOB_ACT_CONTINUE_SCAN; |
|
if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { |
if ((yyg->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 = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); |
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) glcpp_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); |
int new_size = yyg->yy_n_chars + number_to_move + (yyg->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 , yyscanner ); |
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); |
} |
|
yyg->yy_n_chars += number_to_move; |
1637,8 → 1864,8 |
|
static yy_state_type yy_get_previous_state (yyscan_t yyscanner) |
{ |
register yy_state_type yy_current_state; |
register char *yy_cp; |
yy_state_type yy_current_state; |
char *yy_cp; |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
|
yy_current_state = yyg->yy_start; |
1646,7 → 1873,7 |
|
for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) |
{ |
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); |
YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); |
if ( yy_accept[yy_current_state] ) |
{ |
yyg->yy_last_accepting_state = yy_current_state; |
1656,9 → 1883,9 |
{ |
yy_current_state = (int) yy_def[yy_current_state]; |
if ( yy_current_state >= 150 ) |
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; |
1671,11 → 1898,11 |
*/ |
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) |
{ |
register int yy_is_jam; |
int yy_is_jam; |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ |
register char *yy_cp = yyg->yy_c_buf_p; |
char *yy_cp = yyg->yy_c_buf_p; |
|
register YY_CHAR yy_c = 1; |
YY_CHAR yy_c = 1; |
if ( yy_accept[yy_current_state] ) |
{ |
yyg->yy_last_accepting_state = yy_current_state; |
1685,17 → 1912,20 |
{ |
yy_current_state = (int) yy_def[yy_current_state]; |
if ( yy_current_state >= 150 ) |
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 == 149); |
|
(void)yyg; |
return yy_is_jam ? 0 : yy_current_state; |
} |
|
static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner) |
#ifndef YY_NO_UNPUT |
|
static void yyunput (int c, char * yy_bp , yyscan_t yyscanner) |
{ |
register char *yy_cp; |
char *yy_cp; |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
|
yy_cp = yyg->yy_c_buf_p; |
1706,10 → 1936,10 |
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) |
{ /* need to shift things up to make room */ |
/* +2 for EOB chars. */ |
register int number_to_move = yyg->yy_n_chars + 2; |
register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ |
int number_to_move = yyg->yy_n_chars + 2; |
char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ |
YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; |
register char *source = |
char *source = |
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; |
|
while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) |
1718,7 → 1948,7 |
yy_cp += (int) (dest - source); |
yy_bp += (int) (dest - source); |
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = |
yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; |
yyg->yy_n_chars = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; |
|
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) |
YY_FATAL_ERROR( "flex scanner push-back overflow" ); |
1731,6 → 1961,8 |
yyg->yy_c_buf_p = yy_cp; |
} |
|
#endif |
|
#ifndef YY_NO_INPUT |
#ifdef __cplusplus |
static int yyinput (yyscan_t yyscanner) |
1756,7 → 1988,7 |
|
else |
{ /* need more input */ |
int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; |
int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); |
++yyg->yy_c_buf_p; |
|
switch ( yy_get_next_buffer( yyscanner ) ) |
1773,14 → 2005,14 |
*/ |
|
/* Reset buffer status. */ |
glcpp_restart(yyin ,yyscanner); |
yyrestart( yyin , yyscanner); |
|
/*FALLTHROUGH*/ |
|
case EOB_ACT_END_OF_FILE: |
{ |
if ( glcpp_wrap(yyscanner ) ) |
return EOF; |
if ( yywrap( yyscanner ) ) |
return 0; |
|
if ( ! yyg->yy_did_buffer_switch_on_eof ) |
YY_NEW_FILE; |
1813,18 → 2045,18 |
* @param yyscanner The scanner object. |
* @note This function does not reset the start condition to @c INITIAL . |
*/ |
void glcpp_restart (FILE * input_file , yyscan_t yyscanner) |
void yyrestart (FILE * input_file , yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
|
if ( ! YY_CURRENT_BUFFER ){ |
glcpp_ensure_buffer_stack (yyscanner); |
yyensure_buffer_stack (yyscanner); |
YY_CURRENT_BUFFER_LVALUE = |
glcpp__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); |
yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); |
} |
|
glcpp__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); |
glcpp__load_buffer_state(yyscanner ); |
yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); |
yy_load_buffer_state( yyscanner ); |
} |
|
/** Switch to a different input buffer. |
1831,16 → 2063,16 |
* @param new_buffer The new input buffer. |
* @param yyscanner The scanner object. |
*/ |
void glcpp__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) |
void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
|
/* TODO. We should be able to replace this entire function body |
* with |
* glcpp_pop_buffer_state(); |
* glcpp_push_buffer_state(new_buffer); |
* yypop_buffer_state(); |
* yypush_buffer_state(new_buffer); |
*/ |
glcpp_ensure_buffer_stack (yyscanner); |
yyensure_buffer_stack (yyscanner); |
if ( YY_CURRENT_BUFFER == new_buffer ) |
return; |
|
1853,17 → 2085,17 |
} |
|
YY_CURRENT_BUFFER_LVALUE = new_buffer; |
glcpp__load_buffer_state(yyscanner ); |
yy_load_buffer_state( yyscanner ); |
|
/* We don't actually know whether we did this switch during |
* EOF (glcpp_wrap()) processing, but the only time this flag |
* is looked at is after glcpp_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. |
*/ |
yyg->yy_did_buffer_switch_on_eof = 1; |
} |
|
static void glcpp__load_buffer_state (yyscan_t yyscanner) |
static void yy_load_buffer_state (yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; |
1878,13 → 2110,13 |
* @param yyscanner The scanner object. |
* @return the allocated buffer state. |
*/ |
YY_BUFFER_STATE glcpp__create_buffer (FILE * file, int size , yyscan_t yyscanner) |
YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) |
{ |
YY_BUFFER_STATE b; |
|
b = (YY_BUFFER_STATE) glcpp_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); |
b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); |
if ( ! b ) |
YY_FATAL_ERROR( "out of dynamic memory in glcpp__create_buffer()" ); |
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); |
|
b->yy_buf_size = size; |
|
1891,22 → 2123,22 |
/* 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 *) glcpp_alloc(b->yy_buf_size + 2 ,yyscanner ); |
b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); |
if ( ! b->yy_ch_buf ) |
YY_FATAL_ERROR( "out of dynamic memory in glcpp__create_buffer()" ); |
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); |
|
b->yy_is_our_buffer = 1; |
|
glcpp__init_buffer(b,file ,yyscanner); |
yy_init_buffer( b, file , yyscanner); |
|
return b; |
} |
|
/** Destroy the buffer. |
* @param b a buffer created with glcpp__create_buffer() |
* @param b a buffer created with yy_create_buffer() |
* @param yyscanner The scanner object. |
*/ |
void glcpp__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) |
void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
|
1917,28 → 2149,28 |
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; |
|
if ( b->yy_is_our_buffer ) |
glcpp_free((void *) b->yy_ch_buf ,yyscanner ); |
yyfree( (void *) b->yy_ch_buf , yyscanner ); |
|
glcpp_free((void *) b ,yyscanner ); |
yyfree( (void *) b , yyscanner ); |
} |
|
/* Initializes or reinitializes a buffer. |
* This function is sometimes called more than once on the same buffer, |
* such as during a glcpp_restart() or at EOF. |
* such as during a yyrestart() or at EOF. |
*/ |
static void glcpp__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) |
static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) |
|
{ |
int oerrno = errno; |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
|
glcpp__flush_buffer(b ,yyscanner); |
yy_flush_buffer( b , yyscanner); |
|
b->yy_input_file = file; |
b->yy_fill_buffer = 1; |
|
/* If b is the current buffer, then glcpp__init_buffer was _probably_ |
* called from glcpp_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){ |
1955,7 → 2187,7 |
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. |
* @param yyscanner The scanner object. |
*/ |
void glcpp__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) |
void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
if ( ! b ) |
1976,7 → 2208,7 |
b->yy_buffer_status = YY_BUFFER_NEW; |
|
if ( b == YY_CURRENT_BUFFER ) |
glcpp__load_buffer_state(yyscanner ); |
yy_load_buffer_state( yyscanner ); |
} |
|
/** Pushes the new state onto the stack. The new state becomes |
1985,15 → 2217,15 |
* @param new_buffer The new state. |
* @param yyscanner The scanner object. |
*/ |
void glcpp_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) |
void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
if (new_buffer == NULL) |
return; |
|
glcpp_ensure_buffer_stack(yyscanner); |
yyensure_buffer_stack(yyscanner); |
|
/* This block is copied from glcpp__switch_to_buffer. */ |
/* This block is copied from yy_switch_to_buffer. */ |
if ( YY_CURRENT_BUFFER ) |
{ |
/* Flush out information for old buffer. */ |
2007,8 → 2239,8 |
yyg->yy_buffer_stack_top++; |
YY_CURRENT_BUFFER_LVALUE = new_buffer; |
|
/* copied from glcpp__switch_to_buffer. */ |
glcpp__load_buffer_state(yyscanner ); |
/* copied from yy_switch_to_buffer. */ |
yy_load_buffer_state( yyscanner ); |
yyg->yy_did_buffer_switch_on_eof = 1; |
} |
|
2016,19 → 2248,19 |
* The next element becomes the new top. |
* @param yyscanner The scanner object. |
*/ |
void glcpp_pop_buffer_state (yyscan_t yyscanner) |
void yypop_buffer_state (yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
if (!YY_CURRENT_BUFFER) |
return; |
|
glcpp__delete_buffer(YY_CURRENT_BUFFER ,yyscanner); |
yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); |
YY_CURRENT_BUFFER_LVALUE = NULL; |
if (yyg->yy_buffer_stack_top > 0) |
--yyg->yy_buffer_stack_top; |
|
if (YY_CURRENT_BUFFER) { |
glcpp__load_buffer_state(yyscanner ); |
yy_load_buffer_state( yyscanner ); |
yyg->yy_did_buffer_switch_on_eof = 1; |
} |
} |
2036,9 → 2268,9 |
/* Allocates the stack if it does not exist. |
* Guarantees space for at least one push. |
*/ |
static void glcpp_ensure_buffer_stack (yyscan_t yyscanner) |
static void yyensure_buffer_stack (yyscan_t yyscanner) |
{ |
int num_to_alloc; |
yy_size_t num_to_alloc; |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
|
if (!yyg->yy_buffer_stack) { |
2047,12 → 2279,12 |
* scanner will even need a stack. We use 2 instead of 1 to avoid an |
* immediate realloc on the next call. |
*/ |
num_to_alloc = 1; |
yyg->yy_buffer_stack = (struct yy_buffer_state**)glcpp_alloc |
num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ |
yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc |
(num_to_alloc * sizeof(struct yy_buffer_state*) |
, yyscanner); |
if ( ! yyg->yy_buffer_stack ) |
YY_FATAL_ERROR( "out of dynamic memory in glcpp_ensure_buffer_stack()" ); |
YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); |
|
memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); |
|
2064,15 → 2296,15 |
if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ |
|
/* Increase the buffer to prepare for a possible push. */ |
int grow_size = 8 /* arbitrary grow size */; |
yy_size_t grow_size = 8 /* arbitrary grow size */; |
|
num_to_alloc = yyg->yy_buffer_stack_max + grow_size; |
yyg->yy_buffer_stack = (struct yy_buffer_state**)glcpp_realloc |
yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc |
(yyg->yy_buffer_stack, |
num_to_alloc * sizeof(struct yy_buffer_state*) |
, yyscanner); |
if ( ! yyg->yy_buffer_stack ) |
YY_FATAL_ERROR( "out of dynamic memory in glcpp_ensure_buffer_stack()" ); |
YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); |
|
/* zero only the new slots.*/ |
memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); |
2086,7 → 2318,7 |
* @param yyscanner The scanner object. |
* @return the newly allocated buffer state object. |
*/ |
YY_BUFFER_STATE glcpp__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) |
YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) |
{ |
YY_BUFFER_STATE b; |
|
2094,16 → 2326,16 |
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) glcpp_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); |
b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); |
if ( ! b ) |
YY_FATAL_ERROR( "out of dynamic memory in glcpp__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; |
2110,26 → 2342,26 |
b->yy_fill_buffer = 0; |
b->yy_buffer_status = YY_BUFFER_NEW; |
|
glcpp__switch_to_buffer(b ,yyscanner ); |
yy_switch_to_buffer( b , yyscanner ); |
|
return b; |
} |
|
/** Setup the input buffer state to scan a string. The next call to glcpp_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 |
* @param yyscanner The scanner object. |
* @return the newly allocated buffer state object. |
* @note If you want to scan bytes that may contain NUL values, then use |
* glcpp__scan_bytes() instead. |
* yy_scan_bytes() instead. |
*/ |
YY_BUFFER_STATE glcpp__scan_string (yyconst char * yystr , yyscan_t yyscanner) |
YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) |
{ |
|
return glcpp__scan_bytes(yystr,strlen(yystr) ,yyscanner); |
return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); |
} |
|
/** Setup the input buffer state to scan the given bytes. The next call to glcpp_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. |
2136,7 → 2368,7 |
* @param yyscanner The scanner object. |
* @return the newly allocated buffer state object. |
*/ |
YY_BUFFER_STATE glcpp__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner) |
YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) |
{ |
YY_BUFFER_STATE b; |
char *buf; |
2144,10 → 2376,10 |
int i; |
|
/* Get memory for full buffer, including space for trailing EOB's. */ |
n = _yybytes_len + 2; |
buf = (char *) glcpp_alloc(n ,yyscanner ); |
n = (yy_size_t) (_yybytes_len + 2); |
buf = (char *) yyalloc( n , yyscanner ); |
if ( ! buf ) |
YY_FATAL_ERROR( "out of dynamic memory in glcpp__scan_bytes()" ); |
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); |
|
for ( i = 0; i < _yybytes_len; ++i ) |
buf[i] = yybytes[i]; |
2154,9 → 2386,9 |
|
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; |
|
b = glcpp__scan_buffer(buf,n ,yyscanner); |
b = yy_scan_buffer( buf, n , yyscanner); |
if ( ! b ) |
YY_FATAL_ERROR( "bad buffer in glcpp__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. |
2166,7 → 2398,7 |
return b; |
} |
|
static void yy_push_state (int new_state , yyscan_t yyscanner) |
static void yy_push_state (int _new_state , yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
if ( yyg->yy_start_stack_ptr >= yyg->yy_start_stack_depth ) |
2174,13 → 2406,14 |
yy_size_t new_size; |
|
yyg->yy_start_stack_depth += YY_START_STACK_INCR; |
new_size = yyg->yy_start_stack_depth * sizeof( int ); |
new_size = (yy_size_t) yyg->yy_start_stack_depth * sizeof( int ); |
|
if ( ! yyg->yy_start_stack ) |
yyg->yy_start_stack = (int *) glcpp_alloc(new_size ,yyscanner ); |
yyg->yy_start_stack = (int *) yyalloc( new_size , yyscanner ); |
|
else |
yyg->yy_start_stack = (int *) glcpp_realloc((void *) yyg->yy_start_stack,new_size ,yyscanner ); |
yyg->yy_start_stack = (int *) yyrealloc( |
(void *) yyg->yy_start_stack, new_size , yyscanner ); |
|
if ( ! yyg->yy_start_stack ) |
YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); |
2188,7 → 2421,7 |
|
yyg->yy_start_stack[yyg->yy_start_stack_ptr++] = YY_START; |
|
BEGIN(new_state); |
BEGIN(_new_state); |
} |
|
static void yy_pop_state (yyscan_t yyscanner) |
2210,9 → 2443,11 |
#define YY_EXIT_FAILURE 2 |
#endif |
|
static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) |
static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) |
{ |
(void) fprintf( stderr, "%s\n", msg ); |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
(void)yyg; |
fprintf( stderr, "%s\n", msg ); |
exit( YY_EXIT_FAILURE ); |
} |
|
2238,7 → 2473,7 |
/** Get the user-defined data for this scanner. |
* @param yyscanner The scanner object. |
*/ |
YY_EXTRA_TYPE glcpp_get_extra (yyscan_t yyscanner) |
YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
return yyextra; |
2247,7 → 2482,7 |
/** Get the current line number. |
* @param yyscanner The scanner object. |
*/ |
int glcpp_get_lineno (yyscan_t yyscanner) |
int yyget_lineno (yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
|
2260,7 → 2495,7 |
/** Get the current column number. |
* @param yyscanner The scanner object. |
*/ |
int glcpp_get_column (yyscan_t yyscanner) |
int yyget_column (yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
|
2273,7 → 2508,7 |
/** Get the input stream. |
* @param yyscanner The scanner object. |
*/ |
FILE *glcpp_get_in (yyscan_t yyscanner) |
FILE *yyget_in (yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
return yyin; |
2282,7 → 2517,7 |
/** Get the output stream. |
* @param yyscanner The scanner object. |
*/ |
FILE *glcpp_get_out (yyscan_t yyscanner) |
FILE *yyget_out (yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
return yyout; |
2291,7 → 2526,7 |
/** Get the length of the current token. |
* @param yyscanner The scanner object. |
*/ |
int glcpp_get_leng (yyscan_t yyscanner) |
int yyget_leng (yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
return yyleng; |
2301,7 → 2536,7 |
* @param yyscanner The scanner object. |
*/ |
|
char *glcpp_get_text (yyscan_t yyscanner) |
char *yyget_text (yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
return yytext; |
2311,7 → 2546,7 |
* @param user_defined The data to be associated with this scanner. |
* @param yyscanner The scanner object. |
*/ |
void glcpp_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) |
void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
yyextra = user_defined ; |
2318,86 → 2553,86 |
} |
|
/** Set the current line number. |
* @param line_number |
* @param _line_number line number |
* @param yyscanner The scanner object. |
*/ |
void glcpp_set_lineno (int line_number , yyscan_t yyscanner) |
void yyset_lineno (int _line_number , yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
|
/* lineno is only valid if an input buffer exists. */ |
if (! YY_CURRENT_BUFFER ) |
yy_fatal_error( "glcpp_set_lineno called with no buffer" , yyscanner); |
YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); |
|
yylineno = line_number; |
yylineno = _line_number; |
} |
|
/** Set the current column. |
* @param line_number |
* @param _column_no column number |
* @param yyscanner The scanner object. |
*/ |
void glcpp_set_column (int column_no , yyscan_t yyscanner) |
void yyset_column (int _column_no , yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
|
/* column is only valid if an input buffer exists. */ |
if (! YY_CURRENT_BUFFER ) |
yy_fatal_error( "glcpp_set_column called with no buffer" , yyscanner); |
YY_FATAL_ERROR( "yyset_column called with no buffer" ); |
|
yycolumn = column_no; |
yycolumn = _column_no; |
} |
|
/** Set the input stream. This does not discard the current |
* input buffer. |
* @param in_str A readable stream. |
* @param _in_str A readable stream. |
* @param yyscanner The scanner object. |
* @see glcpp__switch_to_buffer |
* @see yy_switch_to_buffer |
*/ |
void glcpp_set_in (FILE * in_str , yyscan_t yyscanner) |
void yyset_in (FILE * _in_str , yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
yyin = in_str ; |
yyin = _in_str ; |
} |
|
void glcpp_set_out (FILE * out_str , yyscan_t yyscanner) |
void yyset_out (FILE * _out_str , yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
yyout = out_str ; |
yyout = _out_str ; |
} |
|
int glcpp_get_debug (yyscan_t yyscanner) |
int yyget_debug (yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
return yy_flex_debug; |
} |
|
void glcpp_set_debug (int bdebug , yyscan_t yyscanner) |
void yyset_debug (int _bdebug , yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
yy_flex_debug = bdebug ; |
yy_flex_debug = _bdebug ; |
} |
|
/* Accessor methods for yylval and yylloc */ |
|
YYSTYPE * glcpp_get_lval (yyscan_t yyscanner) |
YYSTYPE * yyget_lval (yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
return yylval; |
} |
|
void glcpp_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) |
void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
yylval = yylval_param; |
} |
|
YYLTYPE *glcpp_get_lloc (yyscan_t yyscanner) |
YYLTYPE *yyget_lloc (yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
return yylloc; |
} |
|
void glcpp_set_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) |
void yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
yylloc = yylloc_param; |
2405,13 → 2640,11 |
|
/* User-visible API */ |
|
/* glcpp_lex_init is special because it creates the scanner itself, so it is |
/* yylex_init is special because it creates the scanner itself, so it is |
* the ONLY reentrant function that doesn't take the scanner as the last argument. |
* That's why we explicitly handle the declaration, instead of using our macros. |
*/ |
|
int glcpp_lex_init(yyscan_t* ptr_yy_globals) |
|
int yylex_init(yyscan_t* ptr_yy_globals) |
{ |
if (ptr_yy_globals == NULL){ |
errno = EINVAL; |
2418,7 → 2651,7 |
return 1; |
} |
|
*ptr_yy_globals = (yyscan_t) glcpp_alloc ( sizeof( struct yyguts_t ), NULL ); |
*ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); |
|
if (*ptr_yy_globals == NULL){ |
errno = ENOMEM; |
2431,20 → 2664,18 |
return yy_init_globals ( *ptr_yy_globals ); |
} |
|
/* glcpp_lex_init_extra has the same functionality as glcpp_lex_init, but follows the |
/* yylex_init_extra has the same functionality as yylex_init, but follows the |
* convention of taking the scanner as the last argument. Note however, that |
* this is a *pointer* to a scanner, as it will be allocated by this call (and |
* is the reason, too, why this function also must handle its own declaration). |
* The user defined value in the first argument will be available to glcpp_alloc in |
* The user defined value in the first argument will be available to yyalloc in |
* the yyextra field. |
*/ |
|
int glcpp_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) |
|
int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) |
{ |
struct yyguts_t dummy_yyguts; |
|
glcpp_set_extra (yy_user_defined, &dummy_yyguts); |
yyset_extra (yy_user_defined, &dummy_yyguts); |
|
if (ptr_yy_globals == NULL){ |
errno = EINVAL; |
2451,7 → 2682,7 |
return 1; |
} |
|
*ptr_yy_globals = (yyscan_t) glcpp_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); |
*ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); |
|
if (*ptr_yy_globals == NULL){ |
errno = ENOMEM; |
2462,7 → 2693,7 |
yy_init_globals. Leave at 0x00 for releases. */ |
memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); |
|
glcpp_set_extra (yy_user_defined, *ptr_yy_globals); |
yyset_extra (yy_user_defined, *ptr_yy_globals); |
|
return yy_init_globals ( *ptr_yy_globals ); |
} |
2471,13 → 2702,13 |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
/* Initialization is the same as for the non-reentrant scanner. |
* This function is called from glcpp_lex_destroy(), so don't allocate here. |
* This function is called from yylex_destroy(), so don't allocate here. |
*/ |
|
yyg->yy_buffer_stack = 0; |
yyg->yy_buffer_stack = NULL; |
yyg->yy_buffer_stack_top = 0; |
yyg->yy_buffer_stack_max = 0; |
yyg->yy_c_buf_p = (char *) 0; |
yyg->yy_c_buf_p = NULL; |
yyg->yy_init = 0; |
yyg->yy_start = 0; |
|
2490,42 → 2721,42 |
yyin = stdin; |
yyout = stdout; |
#else |
yyin = (FILE *) 0; |
yyout = (FILE *) 0; |
yyin = NULL; |
yyout = NULL; |
#endif |
|
/* For future reference: Set errno on error, since we are called by |
* glcpp_lex_init() |
* yylex_init() |
*/ |
return 0; |
} |
|
/* glcpp_lex_destroy is for both reentrant and non-reentrant scanners. */ |
int glcpp_lex_destroy (yyscan_t yyscanner) |
/* yylex_destroy is for both reentrant and non-reentrant scanners. */ |
int yylex_destroy (yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
|
/* Pop the buffer stack, destroying each element. */ |
while(YY_CURRENT_BUFFER){ |
glcpp__delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); |
yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); |
YY_CURRENT_BUFFER_LVALUE = NULL; |
glcpp_pop_buffer_state(yyscanner); |
yypop_buffer_state(yyscanner); |
} |
|
/* Destroy the stack itself. */ |
glcpp_free(yyg->yy_buffer_stack ,yyscanner); |
yyfree(yyg->yy_buffer_stack , yyscanner); |
yyg->yy_buffer_stack = NULL; |
|
/* Destroy the start condition stack. */ |
glcpp_free(yyg->yy_start_stack ,yyscanner ); |
yyfree( yyg->yy_start_stack , yyscanner ); |
yyg->yy_start_stack = NULL; |
|
/* Reset the globals. This is important in a non-reentrant scanner so the next time |
* glcpp_lex() is called, initialization will occur. */ |
* yylex() is called, initialization will occur. */ |
yy_init_globals( yyscanner); |
|
/* Destroy the main struct (reentrant only). */ |
glcpp_free ( yyscanner , yyscanner ); |
yyfree ( yyscanner , yyscanner ); |
yyscanner = NULL; |
return 0; |
} |
2535,9 → 2766,12 |
*/ |
|
#ifndef yytext_ptr |
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) |
static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) |
{ |
register int i; |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
(void)yyg; |
|
int i; |
for ( i = 0; i < n; ++i ) |
s1[i] = s2[i]; |
} |
2544,9 → 2778,9 |
#endif |
|
#ifdef YY_NEED_STRLEN |
static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) |
static int yy_flex_strlen (const char * s , yyscan_t yyscanner) |
{ |
register int n; |
int n; |
for ( n = 0; s[n]; ++n ) |
; |
|
2554,13 → 2788,18 |
} |
#endif |
|
void *glcpp_alloc (yy_size_t size , yyscan_t yyscanner) |
void *yyalloc (yy_size_t size , yyscan_t yyscanner) |
{ |
return (void *) malloc( size ); |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
(void)yyg; |
return malloc(size); |
} |
|
void *glcpp_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner) |
void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) |
{ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
(void)yyg; |
|
/* The cast to (char *) in the following accommodates both |
* implementations that use char* generic pointers, and those |
* that use void* generic pointers. It works with the latter |
2568,23 → 2807,24 |
* 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 glcpp_free (void * ptr , yyscan_t yyscanner) |
void yyfree (void * ptr , yyscan_t yyscanner) |
{ |
free( (char *) ptr ); /* see glcpp_realloc() for (char *) cast */ |
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
(void)yyg; |
free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ |
} |
|
#define YYTABLES_NAME "yytables" |
|
#line 315 "glcpp/glcpp-lex.l" |
#line 316 "glcpp/glcpp-lex.l" |
|
|
|
void |
glcpp_lex_set_source_string(glcpp_parser_t *parser, const char *shader) |
{ |
glcpp__scan_string(shader,parser->scanner); |
yy_scan_string(shader, parser->scanner); |
} |
|