Flex update
Updated Flex version from 2.6.0 to 2.6.4 and regenerated files.
Change-Id: I7bae30e1f0e1dc16de2bc27f908a1114449d756c
Reviewed-on: https://swiftshader-review.googlesource.com/16768
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/OpenGL/compiler/glslang_lex.cpp b/src/OpenGL/compiler/glslang_lex.cpp
index 2316c51..f9785cc 100644
--- a/src/OpenGL/compiler/glslang_lex.cpp
+++ b/src/OpenGL/compiler/glslang_lex.cpp
@@ -29,20 +29,84 @@
-#line 33 "./glslang_lex.cpp"
-
#define YY_INT_ALIGNED short int
/* A lexical scanner generated by flex */
+
+
+
+
+
+
+
+
+
#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 yyget_lval
+#define yyget_lval_ALREADY_DEFINED
+#else
+#define yyget_lval yyget_lval
+#endif
+
+
+#ifdef yyset_lval
+#define yyset_lval_ALREADY_DEFINED
+#else
+#define yyset_lval yyset_lval
+#endif
+
+
+
+
+
+#ifdef yyget_lloc
+#define yyget_lloc_ALREADY_DEFINED
+#else
+#define yyget_lloc yyget_lloc
+#endif
+
+
+#ifdef yyset_lloc
+#define yyset_lloc_ALREADY_DEFINED
+#else
+#define yyset_lloc yyset_lloc
+#endif
+
+
+
+
+
+
+
+
+
+
+
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
@@ -113,40 +177,38 @@
#define UINT32_MAX (4294967295U)
#endif
+#ifndef SIZE_MAX
+#define SIZE_MAX (~(size_t)0)
+#endif
+
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
-#ifdef __cplusplus
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
+/* begin standard C++ headers. */
-#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))
+
+
+
+
/* An opaque pointer. */
#ifndef YY_TYPEDEF_YY_SCANNER_T
@@ -154,6 +216,22 @@
typedef void* yyscan_t;
#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
/* For convenience, these vars (plus the bison vars far below)
are macros in the reentrant scanner. */
#define yyin yyg->yyin_r
@@ -165,27 +243,36 @@
#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
#define yy_flex_debug yyg->yy_flex_debug_r
+
+
+
+
+
+
+
+
+
+
+
+
/* 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 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.
*/
#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 yyrestart(yyin ,yyscanner )
-
+#define YY_NEW_FILE yyrestart( yyin , yyscanner )
#define YY_END_OF_BUFFER_CHAR 0
+
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
#ifdef __ia64__
@@ -199,10 +286,13 @@
#endif /* __ia64__ */
#endif
+
/* The state buf must be large enough to hold one state per character in the main buffer.
*/
#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
+
+
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
#define YY_TYPEDEF_YY_BUFFER_STATE
typedef struct yy_buffer_state *YY_BUFFER_STATE;
@@ -213,13 +303,16 @@
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
-
+
/* 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 yylex.
+ * 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-yylineno scanner, because yy_act is
* normally declared as a register variable-- so it is not worth it.
@@ -252,27 +345,29 @@
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )
-
#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
+
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
{
FILE *yy_input_file;
+
+
char *yy_ch_buf; /* input buffer */
char *yy_buf_pos; /* current position in input buffer */
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
- yy_size_t yy_buf_size;
+ 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
@@ -295,7 +390,8 @@
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.
*/
@@ -320,6 +416,9 @@
};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+
+
/* We provide macros for accessing buffer states in case in the
* future we want to put the buffer states in a more general
* "scanner state".
@@ -329,87 +428,95 @@
#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 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 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)
-YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
-YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t 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 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 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)
+
+
+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 );
+
+
+void *yyalloc ( yy_size_t , yyscan_t yyscanner );
+void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
+void yyfree ( void * , yyscan_t yyscanner );
+
#define yy_new_buffer yy_create_buffer
-
#define yy_set_interactive(is_interactive) \
{ \
if ( ! YY_CURRENT_BUFFER ){ \
yyensure_buffer_stack (yyscanner); \
YY_CURRENT_BUFFER_LVALUE = \
- yy_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 ){\
yyensure_buffer_stack (yyscanner); \
YY_CURRENT_BUFFER_LVALUE = \
- yy_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 yywrap(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
-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 );
-#if defined(__GNUC__) && __GNUC__ >= 3
-__attribute__((__noreturn__))
-#endif
-static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
+
+
+
+
+
+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 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.
*/
#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 239
#define YY_END_OF_BUFFER 240
/* This struct is not used in this scanner,
@@ -419,7 +526,7 @@
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[821] =
+static const flex_int16_t yy_accept[821] =
{ 0,
0, 0, 0, 0, 0, 0, 240, 238, 237, 237,
222, 228, 233, 217, 218, 226, 225, 214, 223, 221,
@@ -513,7 +620,7 @@
177, 177, 177, 61, 177, 177, 172, 118, 75, 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,
2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
@@ -545,7 +652,7 @@
1, 1, 1, 1, 1
} ;
-static yyconst YY_CHAR yy_meta[73] =
+static const YY_CHAR yy_meta[73] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
@@ -557,7 +664,7 @@
1, 1
} ;
-static yyconst flex_uint16_t yy_base[827] =
+static const flex_int16_t yy_base[827] =
{ 0,
0, 0, 1019, 1018, 72, 0, 1020, 1023, 1023, 1023,
994, 120, 141, 1023, 1023, 993, 138, 1023, 137, 135,
@@ -652,7 +759,7 @@
509, 512, 515, 518, 519, 520
} ;
-static yyconst flex_int16_t yy_def[827] =
+static const flex_int16_t yy_def[827] =
{ 0,
820, 1, 821, 821, 820, 5, 820, 820, 820, 820,
820, 820, 820, 820, 820, 820, 820, 820, 820, 820,
@@ -747,7 +854,7 @@
820, 820, 820, 820, 820, 820
} ;
-static yyconst flex_uint16_t yy_nxt[1096] =
+static const flex_int16_t yy_nxt[1096] =
{ 0,
8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 23, 23, 23, 23,
@@ -872,7 +979,7 @@
} ;
-static yyconst flex_int16_t yy_chk[1096] =
+static const flex_int16_t yy_chk[1096] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -997,8 +1104,9 @@
} ;
+
/* Table of booleans, true if rule could match eol. */
-static yyconst flex_int32_t yy_rule_can_match_eol[240] =
+static const flex_int32_t yy_rule_can_match_eol[240] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -1073,12 +1181,23 @@
static int float_constant(yyscan_t yyscanner);
static int floatsuffix_check(TParseContext* context);
+
+
+
#define INITIAL 0
#define COMMENT 1
#define FIELDS 2
+
+
+
+
+
#define YY_EXTRA_TYPE TParseContext*
+
+
+
/* Holds the entire state of the reentrant scanner. */
struct yyguts_t
{
@@ -1092,8 +1211,8 @@
size_t yy_buffer_stack_max; /**< capacity of stack. */
YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
char yy_hold_char;
- yy_size_t yy_n_chars;
- yy_size_t yyleng_r;
+ int yy_n_chars;
+ int yyleng_r;
char *yy_c_buf_p;
int yy_init;
int yy_start;
@@ -1107,78 +1226,141 @@
int yylineno_r;
int yy_flex_debug_r;
+
+
+
char *yytext_r;
int yy_more_flag;
int yy_more_len;
+
+
YYSTYPE * yylval_r;
+
+
YYLTYPE * yylloc_r;
+
}; /* end struct yyguts_t */
-static int yy_init_globals (yyscan_t yyscanner );
+
+
+static int yy_init_globals ( yyscan_t yyscanner );
+
+
+
+
+
/* This must go here because YYSTYPE and YYLTYPE are included
* from bison output in section 1.*/
# define yylval yyg->yylval_r
+
+
# define yylloc yyg->yylloc_r
+
+
int yylex_init (yyscan_t* scanner);
-int yylex_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 yylex_destroy (yyscan_t yyscanner );
-int yyget_debug (yyscan_t yyscanner );
+int yylex_destroy ( yyscan_t yyscanner );
-void yyset_debug (int debug_flag ,yyscan_t yyscanner );
-YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner );
-void yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
+int yyget_debug ( yyscan_t yyscanner );
-FILE *yyget_in (yyscan_t yyscanner );
-void yyset_in (FILE * _in_str ,yyscan_t yyscanner );
-FILE *yyget_out (yyscan_t yyscanner );
+void yyset_debug ( int debug_flag , yyscan_t yyscanner );
-void yyset_out (FILE * _out_str ,yyscan_t yyscanner );
-yy_size_t yyget_leng (yyscan_t yyscanner );
-char *yyget_text (yyscan_t yyscanner );
+YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
-int yyget_lineno (yyscan_t yyscanner );
-void yyset_lineno (int _line_number ,yyscan_t yyscanner );
-int yyget_column (yyscan_t yyscanner );
+void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
-void yyset_column (int _column_no ,yyscan_t yyscanner );
-YYSTYPE * yyget_lval (yyscan_t yyscanner );
-void yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
+FILE *yyget_in ( yyscan_t yyscanner );
- YYLTYPE *yyget_lloc (yyscan_t yyscanner );
+
+
+void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
+
+
+
+FILE *yyget_out ( yyscan_t yyscanner );
+
+
+
+void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
+
+
+
+ int yyget_leng ( yyscan_t yyscanner );
+
+
+
+char *yyget_text ( yyscan_t yyscanner );
+
+
+
+int yyget_lineno ( yyscan_t yyscanner );
+
+
+
+void yyset_lineno ( int _line_number , yyscan_t yyscanner );
+
+
+
+
+int yyget_column ( yyscan_t yyscanner );
+
+
+
+
+
+void yyset_column ( int _column_no , yyscan_t yyscanner );
+
+
+
+
+YYSTYPE * yyget_lval ( yyscan_t yyscanner );
+
+
+void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );
+
+
- void yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
+ YYLTYPE *yyget_lloc ( 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.
*/
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int yywrap (yyscan_t yyscanner );
+extern "C" int yywrap ( yyscan_t yyscanner );
#else
-extern int yywrap (yyscan_t yyscanner );
+extern int yywrap ( yyscan_t yyscanner );
#endif
#endif
@@ -1186,24 +1368,31 @@
#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 );
+static int yyinput ( yyscan_t yyscanner );
#else
-static int input (yyscan_t yyscanner );
+static int input ( yyscan_t yyscanner );
#endif
#endif
+
+
+
+
+
+
+
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#ifdef __ia64__
@@ -1214,14 +1403,17 @@
#endif /* __ia64__ */
#endif
+
/* Copy whatever the last rule matched to the standard output. */
#ifndef ECHO
/* 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,
* is returned in "result".
*/
@@ -1230,7 +1422,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; \
@@ -1243,7 +1435,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) \
{ \
@@ -1258,6 +1450,8 @@
#endif
+
+
/* No semi-colon after return; correct usage is to write "yyterminate();" -
* we don't want an extra ';' after the "return" because that will cause
* some compilers to complain about unreachable statements.
@@ -1266,31 +1460,54 @@
#define yyterminate() return YY_NULL
#endif
+
/* Number of entries by which start-condition stack grows. */
#ifndef YY_START_STACK_INCR
#define YY_START_STACK_INCR 25
#endif
+
/* Report a fatal error. */
#ifndef YY_FATAL_ERROR
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
#endif
+
+
/* end tables serialization structures and prototypes */
+
+
/* Default declaration of generated scanner - a define so the user can
* easily add parameters.
*/
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
extern int yylex \
- (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
+ (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner);
#define YY_DECL int yylex \
(YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
#endif /* !YY_DECL */
+
/* Code executed at the beginning of each rule, after yytext and yyleng
* have been set up.
*/
@@ -1298,14 +1515,19 @@
#define YY_USER_ACTION
#endif
+
+
/* Code executed at the end of each rule. */
#ifndef YY_BREAK
#define YY_BREAK /*LINTED*/break;
#endif
+
+
#define YY_RULE_SETUP \
YY_USER_ACTION
+
/** The main scanner function which does all the work.
*/
YY_DECL
@@ -1315,10 +1537,16 @@
int yy_act;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+
+
yylval = yylval_param;
+
+
yylloc = yylloc_param;
+
if ( !yyg->yy_init )
{
yyg->yy_init = 1;
@@ -1327,6 +1555,8 @@
YY_USER_INIT;
#endif
+
+
if ( ! yyg->yy_start )
yyg->yy_start = 1; /* first start state */
@@ -1339,16 +1569,20 @@
if ( ! YY_CURRENT_BUFFER ) {
yyensure_buffer_stack (yyscanner);
YY_CURRENT_BUFFER_LVALUE =
- yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
}
- yy_load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
}
{
+
+
TParseContext* context = yyextra;
+
+
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
yy_cp = yyg->yy_c_buf_p;
@@ -1375,9 +1609,9 @@
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 821 )
- 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 != 820 );
@@ -1389,20 +1623,23 @@
YY_DO_BEFORE_ACTION;
+
if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
{
- yy_size_t yyl;
+ int yyl;
for ( yyl = 0; yyl < yyleng; ++yyl )
if ( yytext[yyl] == '\n' )
-
+
do{ yylineno++;
yycolumn=0;
}while(0)
;
}
+
do_action: /* This label is used only to access EOF actions. */
+
switch ( yy_act )
{ /* beginning of action switch */
case 0: /* must back up */
@@ -2186,7 +2423,7 @@
{
yyg->yy_did_buffer_switch_on_eof = 0;
- if ( yywrap(yyscanner ) )
+ if ( yywrap( yyscanner ) )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
@@ -2242,6 +2479,10 @@
} /* end of user's declarations */
} /* end of yylex */
+
+
+
+
/* yy_get_next_buffer - try to read in a new buffer
*
* Returns a code representing an action:
@@ -2254,7 +2495,7 @@
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
char *source = yyg->yytext_ptr;
- yy_size_t number_to_move, i;
+ 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] )
@@ -2283,7 +2524,7 @@
/* Try to read more data. */
/* First move last chars to start of buffer. */
- number_to_move = (yy_size_t) (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++);
@@ -2296,7 +2537,7 @@
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 )
@@ -2310,7 +2551,7 @@
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;
@@ -2319,11 +2560,12 @@
b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
- yyrealloc((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(
@@ -2351,7 +2593,7 @@
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
- yyrestart(yyin ,yyscanner);
+ yyrestart( yyin , yyscanner);
}
else
@@ -2365,12 +2607,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 *) yyrealloc((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;
@@ -2382,6 +2627,7 @@
return ret_val;
}
+
/* yy_get_previous_state - get the state just before the EOB char was reached */
static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
@@ -2404,14 +2650,15 @@
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 821 )
- 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;
}
+
/* yy_try_NUL_trans - try to make a transition on the NUL character
*
* synopsis
@@ -2433,15 +2680,16 @@
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 821 )
- 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 == 820);
(void)yyg;
return yy_is_jam ? 0 : yy_current_state;
}
+
#ifndef YY_NO_UNPUT
#endif
@@ -2471,7 +2719,7 @@
else
{ /* need more input */
- yy_size_t 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 ) )
@@ -2488,14 +2736,14 @@
*/
/* Reset buffer status. */
- yyrestart(yyin ,yyscanner);
+ yyrestart( yyin , yyscanner);
/*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{
- if ( yywrap(yyscanner ) )
- return EOF;
+ if ( yywrap( yyscanner ) )
+ return 0;
if ( ! yyg->yy_did_buffer_switch_on_eof )
YY_NEW_FILE;
@@ -2518,7 +2766,7 @@
yyg->yy_hold_char = *++yyg->yy_c_buf_p;
if ( c == '\n' )
-
+
do{ yylineno++;
yycolumn=0;
}while(0)
@@ -2540,13 +2788,14 @@
if ( ! YY_CURRENT_BUFFER ){
yyensure_buffer_stack (yyscanner);
YY_CURRENT_BUFFER_LVALUE =
- yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
}
- yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
- yy_load_buffer_state(yyscanner );
+ yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
+ yy_load_buffer_state( yyscanner );
}
+
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
* @param yyscanner The scanner object.
@@ -2573,7 +2822,7 @@
}
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- yy_load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
/* We don't actually know whether we did this switch during
* EOF (yywrap()) processing, but the only time this flag
@@ -2583,6 +2832,7 @@
yyg->yy_did_buffer_switch_on_eof = 1;
}
+
static void yy_load_buffer_state (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -2602,26 +2852,27 @@
{
YY_BUFFER_STATE b;
- b = (YY_BUFFER_STATE) yyalloc(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 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 *) yyalloc(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 yy_create_buffer()" );
b->yy_is_our_buffer = 1;
- yy_init_buffer(b,file ,yyscanner);
+ yy_init_buffer( b, file , yyscanner);
return b;
}
+
/** Destroy the buffer.
* @param b a buffer created with yy_create_buffer()
* @param yyscanner The scanner object.
@@ -2637,11 +2888,12 @@
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
- yyfree((void *) b->yy_ch_buf ,yyscanner );
+ yyfree( (void *) b->yy_ch_buf , yyscanner );
- yyfree((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 yyrestart() or at EOF.
@@ -2652,7 +2904,7 @@
int oerrno = errno;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- yy_flush_buffer(b ,yyscanner);
+ yy_flush_buffer( b , yyscanner);
b->yy_input_file = file;
b->yy_fill_buffer = 1;
@@ -2666,8 +2918,11 @@
b->yy_bs_column = 0;
}
+
+
b->yy_is_interactive = 0;
+
errno = oerrno;
}
@@ -2696,7 +2951,7 @@
b->yy_buffer_status = YY_BUFFER_NEW;
if ( b == YY_CURRENT_BUFFER )
- yy_load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
}
/** Pushes the new state onto the stack. The new state becomes
@@ -2728,10 +2983,11 @@
YY_CURRENT_BUFFER_LVALUE = new_buffer;
/* copied from yy_switch_to_buffer. */
- yy_load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
yyg->yy_did_buffer_switch_on_eof = 1;
}
+
/** Removes and deletes the top of the stack, if present.
* The next element becomes the new top.
* @param yyscanner The scanner object.
@@ -2742,17 +2998,18 @@
if (!YY_CURRENT_BUFFER)
return;
- yy_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) {
- yy_load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
yyg->yy_did_buffer_switch_on_eof = 1;
}
}
+
/* Allocates the stack if it does not exist.
* Guarantees space for at least one push.
*/
@@ -2767,15 +3024,16 @@
* 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; // After all that talk, this was set to 1 anyways...
+ 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 yyensure_buffer_stack()" );
-
+
+
memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-
+
yyg->yy_buffer_stack_max = num_to_alloc;
yyg->yy_buffer_stack_top = 0;
return;
@@ -2800,11 +3058,15 @@
}
}
+
+
+
+
/** Setup the input buffer state to scan directly from a user-specified character buffer.
* @param base the character buffer
* @param size the size in bytes of the character buffer
* @param yyscanner The scanner object.
- * @return the newly allocated buffer state object.
+ * @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
{
@@ -2814,27 +3076,30 @@
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) yyalloc(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 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;
- yy_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 yylex() will
* scan from a @e copy of @a str.
* @param yystr a NUL-terminated string to scan
@@ -2843,12 +3108,15 @@
* @note If you want to scan bytes that may contain NUL values, then use
* yy_scan_bytes() instead.
*/
-YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
{
- return yy_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 yylex() will
* scan from a @e copy of @a bytes.
* @param yybytes the byte buffer to scan
@@ -2856,16 +3124,16 @@
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _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;
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 *) yyalloc(n ,yyscanner );
+ n = (yy_size_t) (_yybytes_len + 2);
+ buf = (char *) yyalloc( n , yyscanner );
if ( ! buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
@@ -2874,7 +3142,7 @@
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
- b = yy_scan_buffer(buf,n ,yyscanner);
+ b = yy_scan_buffer( buf, n , yyscanner);
if ( ! b )
YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
@@ -2886,15 +3154,25 @@
return b;
}
+
+
+
+
+
+
+
+
+
+
#ifndef YY_EXIT_FAILURE
#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)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
- (void) fprintf( stderr, "%s\n", msg );
+ fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
@@ -2915,8 +3193,11 @@
} \
while ( 0 )
+
+
/* Accessor methods (get/set functions) to struct members. */
+
/** Get the user-defined data for this scanner.
* @param yyscanner The scanner object.
*/
@@ -2926,12 +3207,15 @@
return yyextra;
}
+
+
/** Get the current line number.
* @param yyscanner The scanner object.
*/
int yyget_lineno (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
if (! YY_CURRENT_BUFFER)
return 0;
@@ -2939,12 +3223,16 @@
return yylineno;
}
+
+
+
/** Get the current column number.
* @param yyscanner The scanner object.
*/
int yyget_column (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
if (! YY_CURRENT_BUFFER)
return 0;
@@ -2952,6 +3240,9 @@
return yycolumn;
}
+
+
+
/** Get the input stream.
* @param yyscanner The scanner object.
*/
@@ -2961,6 +3252,8 @@
return yyin;
}
+
+
/** Get the output stream.
* @param yyscanner The scanner object.
*/
@@ -2970,15 +3263,18 @@
return yyout;
}
+
+
/** Get the length of the current token.
* @param yyscanner The scanner object.
*/
-yy_size_t yyget_leng (yyscan_t yyscanner)
+int yyget_leng (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyleng;
}
+
/** Get the current token.
* @param yyscanner The scanner object.
*/
@@ -2989,6 +3285,8 @@
return yytext;
}
+
+
/** Set the user-defined data. This data is never touched by the scanner.
* @param user_defined The data to be associated with this scanner.
* @param yyscanner The scanner object.
@@ -2999,6 +3297,8 @@
yyextra = user_defined ;
}
+
+
/** Set the current line number.
* @param _line_number line number
* @param yyscanner The scanner object.
@@ -3007,6 +3307,7 @@
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
/* lineno is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
@@ -3014,6 +3315,9 @@
yylineno = _line_number;
}
+
+
+
/** Set the current column.
* @param _column_no column number
* @param yyscanner The scanner object.
@@ -3022,6 +3326,7 @@
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
/* column is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
YY_FATAL_ERROR( "yyset_column called with no buffer" );
@@ -3029,6 +3334,10 @@
yycolumn = _column_no;
}
+
+
+
+
/** Set the input stream. This does not discard the current
* input buffer.
* @param _in_str A readable stream.
@@ -3041,59 +3350,77 @@
yyin = _in_str ;
}
+
+
void yyset_out (FILE * _out_str , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyout = _out_str ;
}
+
+
+
int yyget_debug (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yy_flex_debug;
}
+
+
void yyset_debug (int _bdebug , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yy_flex_debug = _bdebug ;
}
+
/* Accessor methods for yylval and yylloc */
+
YYSTYPE * yyget_lval (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yylval;
}
+
+
void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yylval = yylval_param;
}
+
+
+
YYLTYPE *yyget_lloc (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yylloc;
}
+
+
void yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yylloc = yylloc_param;
}
+
+
+
+
/* User-visible API */
/* 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 yylex_init(yyscan_t* ptr_yy_globals)
-
{
if (ptr_yy_globals == NULL){
errno = EINVAL;
@@ -3113,6 +3440,7 @@
return yy_init_globals ( *ptr_yy_globals );
}
+
/* 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
@@ -3120,9 +3448,7 @@
* The user defined value in the first argument will be available to yyalloc in
* the yyextra field.
*/
-
-int yylex_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;
@@ -3132,23 +3458,24 @@
errno = EINVAL;
return 1;
}
-
+
*ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
-
+
if (*ptr_yy_globals == NULL){
errno = ENOMEM;
return 1;
}
-
+
/* By setting to 0xAA, we expose bugs in
yy_init_globals. Leave at 0x00 for releases. */
memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
-
+
yyset_extra (yy_user_defined, *ptr_yy_globals);
-
+
return yy_init_globals ( *ptr_yy_globals );
}
+
static int yy_init_globals (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -3156,24 +3483,33 @@
* 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;
+
yyg->yy_start_stack_ptr = 0;
yyg->yy_start_stack_depth = 0;
yyg->yy_start_stack = NULL;
+
+
+
+
+
/* Defined in main.c */
#ifdef YY_STDINIT
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
@@ -3182,6 +3518,7 @@
return 0;
}
+
/* yylex_destroy is for both reentrant and non-reentrant scanners. */
int yylex_destroy (yyscan_t yyscanner)
{
@@ -3189,19 +3526,23 @@
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
- yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
+ yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
YY_CURRENT_BUFFER_LVALUE = NULL;
yypop_buffer_state(yyscanner);
}
/* Destroy the stack itself. */
- yyfree(yyg->yy_buffer_stack ,yyscanner);
+ yyfree(yyg->yy_buffer_stack , yyscanner);
yyg->yy_buffer_stack = NULL;
+
/* Destroy the start condition stack. */
- yyfree(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
* yylex() is called, initialization will occur. */
yy_init_globals( yyscanner);
@@ -3212,12 +3553,16 @@
return 0;
}
+
+
/*
* Internal utility routines.
*/
+
+
#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)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
@@ -3228,8 +3573,10 @@
}
#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)
{
int n;
for ( n = 0; s[n]; ++n )
@@ -3239,13 +3586,17 @@
}
#endif
+
+
void *yyalloc (yy_size_t size , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
- return (void *) malloc( size );
+ return malloc(size);
}
+
+
void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -3258,9 +3609,11 @@
* 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 yyfree (void * ptr , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -3268,16 +3621,24 @@
free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
}
+
#define YYTABLES_NAME "yytables"
+
+
+
+
+
+
+
yy_size_t string_input(char* buf, yy_size_t max_size, yyscan_t yyscanner) {
pp::Token token;
yyget_extra(yyscanner)->getPreprocessor().lex(&token);
yy_size_t len = token.type == pp::Token::LAST ? 0 : token.text.size();
if (len < max_size)
memcpy(buf, token.text.c_str(), len);
- yyset_column(token.location.file,yyscanner);
- yyset_lineno(token.location.line,yyscanner);
+ yyset_column(token.location.file, yyscanner);
+ yyset_lineno(token.location.line, yyscanner);
if (len >= max_size)
YY_FATAL_ERROR("Input buffer overflow");
@@ -3412,7 +3773,7 @@
int glslang_initialize(TParseContext* context) {
yyscan_t scanner = NULL;
- if (yylex_init_extra(context,&scanner))
+ if (yylex_init_extra(context, &scanner))
return 1;
context->setScanner(scanner);
@@ -3431,9 +3792,9 @@
int glslang_scan(size_t count, const char* const string[], const int length[],
TParseContext* context) {
- yyrestart(NULL,context->getScanner());
- yyset_column(0,context->getScanner());
- yyset_lineno(1,context->getScanner());
+ yyrestart(NULL, context->getScanner());
+ yyset_column(0, context->getScanner());
+ yyset_lineno(1, context->getScanner());
context->AfterEOF = false;
// Initialize preprocessor.
@@ -3453,3 +3814,4 @@
return 0;
}
+
diff --git a/src/OpenGL/compiler/glslang_tab.cpp b/src/OpenGL/compiler/glslang_tab.cpp
index 0101b0e..17f40e8 100644
--- a/src/OpenGL/compiler/glslang_tab.cpp
+++ b/src/OpenGL/compiler/glslang_tab.cpp
@@ -704,34 +704,34 @@
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 229, 229, 248, 251, 256, 261, 266, 271, 277,
- 280, 283, 286, 289, 292, 298, 306, 317, 321, 329,
- 332, 338, 342, 349, 355, 364, 372, 378, 385, 395,
- 398, 401, 404, 414, 415, 416, 417, 425, 426, 430,
- 434, 442, 443, 446, 452, 453, 457, 464, 465, 468,
- 471, 474, 480, 481, 484, 490, 491, 498, 499, 506,
- 507, 514, 515, 521, 522, 528, 529, 535, 536, 542,
- 543, 551, 552, 553, 554, 556, 557, 558, 561, 564,
- 567, 570, 576, 579, 590, 598, 606, 609, 615, 622,
- 626, 630, 634, 641, 647, 650, 657, 665, 686, 712,
- 722, 750, 755, 765, 770, 780, 783, 786, 789, 795,
- 802, 805, 809, 813, 818, 823, 830, 834, 838, 842,
- 847, 852, 856, 863, 873, 879, 882, 888, 894, 901,
- 910, 919, 927, 930, 937, 941, 945, 950, 958, 961,
- 965, 969, 978, 987, 995, 1005, 1017, 1020, 1023, 1029,
- 1036, 1039, 1045, 1048, 1051, 1057, 1060, 1065, 1080, 1084,
- 1088, 1092, 1096, 1100, 1105, 1110, 1115, 1120, 1125, 1130,
- 1135, 1140, 1145, 1150, 1155, 1160, 1166, 1172, 1178, 1184,
- 1190, 1196, 1202, 1208, 1214, 1219, 1224, 1233, 1238, 1243,
- 1248, 1253, 1258, 1263, 1268, 1273, 1278, 1283, 1288, 1293,
- 1298, 1303, 1316, 1316, 1319, 1319, 1325, 1328, 1344, 1347,
- 1356, 1360, 1366, 1373, 1388, 1392, 1396, 1397, 1403, 1404,
- 1405, 1406, 1407, 1408, 1409, 1413, 1414, 1414, 1414, 1424,
- 1425, 1429, 1429, 1430, 1430, 1435, 1438, 1448, 1451, 1457,
- 1458, 1462, 1470, 1474, 1481, 1481, 1488, 1491, 1498, 1503,
- 1518, 1518, 1523, 1523, 1530, 1530, 1538, 1541, 1547, 1550,
- 1556, 1560, 1567, 1570, 1573, 1576, 1579, 1588, 1592, 1599,
- 1602, 1608, 1608
+ 0, 229, 229, 249, 252, 257, 262, 267, 272, 278,
+ 281, 284, 287, 290, 293, 299, 307, 318, 322, 330,
+ 333, 339, 343, 350, 356, 365, 373, 379, 386, 396,
+ 399, 402, 405, 415, 416, 417, 418, 426, 427, 431,
+ 435, 443, 444, 447, 453, 454, 458, 465, 466, 469,
+ 472, 475, 481, 482, 485, 491, 492, 499, 500, 507,
+ 508, 515, 516, 522, 523, 529, 530, 536, 537, 543,
+ 544, 552, 553, 554, 555, 557, 558, 559, 562, 565,
+ 568, 571, 577, 580, 591, 599, 607, 610, 616, 623,
+ 627, 631, 635, 642, 648, 651, 658, 666, 687, 713,
+ 723, 751, 756, 766, 771, 781, 784, 787, 790, 796,
+ 803, 806, 810, 814, 819, 824, 831, 835, 839, 843,
+ 848, 853, 857, 864, 874, 880, 883, 889, 895, 902,
+ 911, 920, 928, 931, 938, 942, 946, 951, 959, 962,
+ 966, 970, 979, 988, 996, 1006, 1018, 1021, 1024, 1030,
+ 1037, 1040, 1046, 1049, 1052, 1058, 1061, 1066, 1081, 1085,
+ 1089, 1093, 1097, 1101, 1106, 1111, 1116, 1121, 1126, 1131,
+ 1136, 1141, 1146, 1151, 1156, 1161, 1167, 1173, 1179, 1185,
+ 1191, 1197, 1203, 1209, 1215, 1220, 1225, 1234, 1239, 1244,
+ 1249, 1254, 1259, 1264, 1269, 1274, 1279, 1284, 1289, 1294,
+ 1299, 1304, 1317, 1317, 1320, 1320, 1326, 1329, 1345, 1348,
+ 1357, 1361, 1367, 1374, 1389, 1393, 1397, 1398, 1404, 1405,
+ 1406, 1407, 1408, 1409, 1410, 1414, 1415, 1415, 1415, 1425,
+ 1426, 1430, 1430, 1431, 1431, 1436, 1439, 1449, 1452, 1458,
+ 1459, 1463, 1471, 1475, 1482, 1482, 1489, 1492, 1499, 1504,
+ 1519, 1519, 1524, 1524, 1531, 1531, 1539, 1542, 1548, 1551,
+ 1557, 1561, 1568, 1571, 1574, 1577, 1580, 1589, 1593, 1600,
+ 1603, 1609, 1609
};
#endif
diff --git a/src/OpenGL/compiler/preprocessor/ExpressionParser.cpp b/src/OpenGL/compiler/preprocessor/ExpressionParser.cpp
index 25f38cb..752252b 100644
--- a/src/OpenGL/compiler/preprocessor/ExpressionParser.cpp
+++ b/src/OpenGL/compiler/preprocessor/ExpressionParser.cpp
@@ -507,9 +507,9 @@
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 124, 124, 131, 132, 143, 143, 164, 164, 185,
- 188, 191, 194, 197, 200, 203, 206, 209, 212, 237,
- 259, 262, 265, 291, 318, 321, 324, 327, 339, 342
+ 0, 125, 125, 132, 133, 144, 144, 165, 165, 186,
+ 189, 192, 195, 198, 201, 204, 207, 210, 213, 238,
+ 260, 263, 266, 292, 319, 322, 325, 328, 340, 343
};
#endif