Commit 185de884 by Jamie Madill

Update ANGLE's translator to Bison 3.

BUG=angle:462 Change-Id: I2c1c18027dee1c3b4efb87374caaadbf58367841 Reviewed-on: https://chromium-review.googlesource.com/236930Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarKenneth Russell <kbr@chromium.org> Reviewed-by: 's avatarZhenyao Mo <zmo@chromium.org>
parent d5663b1c
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
@@ -179,6 +180,11 @@ typedef void* yyscan_t; @@ -179,6 +180,11 @@ typedef void* yyscan_t;
typedef struct yy_buffer_state *YY_BUFFER_STATE; typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif #endif
+#ifndef YY_TYPEDEF_YY_SIZE_T +#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t; +typedef size_t yy_size_t;
...@@ -20,36 +20,6 @@ ...@@ -20,36 +20,6 @@
#define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2 #define EOB_ACT_LAST_MATCH 2
@@ -201,11 +207,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
#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
@@ -223,7 +224,7 @@ struct yy_buffer_state
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
- int yy_n_chars;
+ yy_size_t yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
@@ -302,7 +303,7 @@ static void pp_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
YY_BUFFER_STATE pp_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
YY_BUFFER_STATE pp_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE pp_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+YY_BUFFER_STATE pp_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
void *ppalloc (yy_size_t ,yyscan_t yyscanner );
void *pprealloc (void *,yy_size_t ,yyscan_t yyscanner );
@@ -353,7 +354,7 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); @@ -353,7 +354,7 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
*/ */
#define YY_DO_BEFORE_ACTION \ #define YY_DO_BEFORE_ACTION \
...@@ -59,101 +29,3 @@ ...@@ -59,101 +29,3 @@
yyg->yy_hold_char = *yy_cp; \ yyg->yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \ *yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp; yyg->yy_c_buf_p = yy_cp;
@@ -579,8 +580,8 @@ struct yyguts_t
size_t yy_buffer_stack_max; /**< capacity of stack. */
YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
char yy_hold_char;
- int yy_n_chars;
- int yyleng_r;
+ yy_size_t yy_n_chars;
+ yy_size_t yyleng_r;
char *yy_c_buf_p;
int yy_init;
int yy_start;
@@ -637,7 +638,7 @@ FILE *ppget_out (yyscan_t yyscanner );
void ppset_out (FILE * out_str ,yyscan_t yyscanner );
-int ppget_leng (yyscan_t yyscanner );
+yy_size_t ppget_leng (yyscan_t yyscanner );
char *ppget_text (yyscan_t yyscanner );
@@ -704,7 +705,7 @@ static int input (yyscan_t yyscanner );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
- int n; \
+ yy_size_t n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -1338,7 +1339,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
{
- int num_to_read =
+ yy_size_t num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
@@ -1352,7 +1353,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
if ( b->yy_is_our_buffer )
{
- int new_size = b->yy_buf_size * 2;
+ yy_size_t new_size = b->yy_buf_size * 2;
if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8;
@@ -1383,7 +1384,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
/* 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;
}
@@ -1508,7 +1509,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
{ /* need more input */
- int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+ yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
++yyg->yy_c_buf_p;
switch ( yy_get_next_buffer( yyscanner ) )
@@ -1788,7 +1789,7 @@ void pppop_buffer_state (yyscan_t yyscanner)
*/
static void ppensure_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) {
@@ -1886,12 +1887,11 @@ YY_BUFFER_STATE pp_scan_string (yyconst char * yystr , yyscan_t yyscanner)
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE pp_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
+YY_BUFFER_STATE pp_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
char *buf;
- yy_size_t n;
- int i;
+ yy_size_t n, i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
@@ -2001,7 +2001,7 @@ FILE *ppget_out (yyscan_t yyscanner)
/** Get the length of the current token.
* @param yyscanner The scanner object.
*/
-int ppget_leng (yyscan_t yyscanner)
+yy_size_t ppget_leng (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyleng;
...@@ -69,7 +69,7 @@ struct Context ...@@ -69,7 +69,7 @@ struct Context
%} %}
%pure-parser %pure-parser
%name-prefix="pp" %name-prefix "pp"
%parse-param {Context *context} %parse-param {Context *context}
%lex-param {Context *context} %lex-param {Context *context}
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#define FLEX_SCANNER #define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 37 #define YY_FLEX_SUBMINOR_VERSION 39
#if YY_FLEX_SUBMINOR_VERSION > 0 #if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA #define FLEX_BETA
#endif #endif
...@@ -196,6 +196,7 @@ typedef size_t yy_size_t; ...@@ -196,6 +196,7 @@ typedef size_t yy_size_t;
#define EOB_ACT_LAST_MATCH 2 #define EOB_ACT_LAST_MATCH 2
#define YY_LESS_LINENO(n) #define YY_LESS_LINENO(n)
#define YY_LINENO_REWIND_TO(ptr)
/* Return all but the first "n" matched characters back to the input stream. */ /* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \ #define yyless(n) \
...@@ -814,8 +815,6 @@ YY_DECL ...@@ -814,8 +815,6 @@ YY_DECL
register int yy_act; register int yy_act;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* Line comment */
yylval = yylval_param; yylval = yylval_param;
yylloc = yylloc_param; yylloc = yylloc_param;
...@@ -846,6 +845,10 @@ YY_DECL ...@@ -846,6 +845,10 @@ YY_DECL
pp_load_buffer_state(yyscanner ); pp_load_buffer_state(yyscanner );
} }
{
/* Line comment */
while ( 1 ) /* loops until end-of-file is reached */ while ( 1 ) /* loops until end-of-file is reached */
{ {
yy_cp = yyg->yy_c_buf_p; yy_cp = yyg->yy_c_buf_p;
...@@ -862,7 +865,7 @@ YY_DECL ...@@ -862,7 +865,7 @@ YY_DECL
yy_match: yy_match:
do do
{ {
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
if ( yy_accept[yy_current_state] ) if ( yy_accept[yy_current_state] )
{ {
yyg->yy_last_accepting_state = yy_current_state; yyg->yy_last_accepting_state = yy_current_state;
...@@ -1307,6 +1310,7 @@ ECHO; ...@@ -1307,6 +1310,7 @@ ECHO;
"fatal flex scanner internal error--no action found" ); "fatal flex scanner internal error--no action found" );
} /* end of action switch */ } /* end of action switch */
} /* end of scanning one token */ } /* end of scanning one token */
} /* end of user's declarations */
} /* end of pplex */ } /* end of pplex */
/* yy_get_next_buffer - try to read in a new buffer /* yy_get_next_buffer - try to read in a new buffer
......
...@@ -267,7 +267,9 @@ FRACTIONAL_CONSTANT ({DIGIT}*"."{DIGIT}+)|({DIGIT}+".") ...@@ -267,7 +267,9 @@ FRACTIONAL_CONSTANT ({DIGIT}*"."{DIGIT}+)|({DIGIT}+".")
namespace pp { namespace pp {
Tokenizer::Tokenizer(Diagnostics *diagnostics) : mHandle(0) Tokenizer::Tokenizer(Diagnostics *diagnostics)
: mHandle(0),
mMaxTokenSize(256)
{ {
mContext.diagnostics = diagnostics; mContext.diagnostics = diagnostics;
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
@@ -191,6 +192,11 @@ typedef void* yyscan_t; @@ -191,6 +192,11 @@ typedef void* yyscan_t;
typedef struct yy_buffer_state *YY_BUFFER_STATE; typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif #endif
+#ifndef YY_TYPEDEF_YY_SIZE_T +#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t; +typedef size_t yy_size_t;
...@@ -29,36 +29,6 @@ ...@@ -29,36 +29,6 @@
for ( yyl = n; yyl < yyleng; ++yyl )\ for ( yyl = n; yyl < yyleng; ++yyl )\
if ( yytext[yyl] == '\n' )\ if ( yytext[yyl] == '\n' )\
--yylineno;\ --yylineno;\
@@ -226,11 +232,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
#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
@@ -248,7 +249,7 @@ struct yy_buffer_state
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
- int yy_n_chars;
+ yy_size_t yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
@@ -327,7 +328,7 @@ static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t 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,int len ,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 );
@@ -378,7 +379,7 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); @@ -378,7 +379,7 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
*/ */
#define YY_DO_BEFORE_ACTION \ #define YY_DO_BEFORE_ACTION \
...@@ -68,110 +38,3 @@ ...@@ -68,110 +38,3 @@
yyg->yy_hold_char = *yy_cp; \ yyg->yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \ *yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp; yyg->yy_c_buf_p = yy_cp;
@@ -1035,8 +1036,8 @@ struct yyguts_t
size_t yy_buffer_stack_max; /**< capacity of stack. */
YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
char yy_hold_char;
- int yy_n_chars;
- int yyleng_r;
+ yy_size_t yy_n_chars;
+ yy_size_t yyleng_r;
char *yy_c_buf_p;
int yy_init;
int yy_start;
@@ -1089,7 +1090,7 @@ FILE *yyget_out (yyscan_t yyscanner );
void yyset_out (FILE * out_str ,yyscan_t yyscanner );
-int yyget_leng (yyscan_t yyscanner );
+yy_size_t yyget_leng (yyscan_t yyscanner );
char *yyget_text (yyscan_t yyscanner );
@@ -1158,7 +1159,7 @@ static int input (yyscan_t yyscanner );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
- int n; \
+ yy_size_t n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -1317,7 +1318,7 @@ yy_find_action:
if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
{
- int yyl;
+ yy_size_t yyl;
for ( yyl = 0; yyl < yyleng; ++yyl )
if ( yytext[yyl] == '\n' )
@@ -2203,7 +2204,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
{
- int num_to_read =
+ yy_size_t num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
@@ -2217,7 +2218,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
if ( b->yy_is_our_buffer )
{
- int new_size = b->yy_buf_size * 2;
+ yy_size_t new_size = b->yy_buf_size * 2;
if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8;
@@ -2248,7 +2249,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
/* 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;
}
@@ -2373,7 +2374,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
{ /* need more input */
- int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+ yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
++yyg->yy_c_buf_p;
switch ( yy_get_next_buffer( yyscanner ) )
@@ -2660,7 +2661,7 @@ void yypop_buffer_state (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) {
@@ -2758,12 +2759,11 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
char *buf;
- yy_size_t n;
- int i;
+ yy_size_t n, i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
@@ -2913,7 +2913,7 @@ FILE *yyget_out (yyscan_t yyscanner)
/** Get the length of the current token.
* @param yyscanner The scanner object.
*/
-int yyget_leng (yyscan_t yyscanner)
+yy_size_t yyget_leng (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyleng;
...@@ -492,8 +492,8 @@ int floatsuffix_check(TParseContext* context) ...@@ -492,8 +492,8 @@ int floatsuffix_check(TParseContext* context)
return(FLOATCONSTANT); return(FLOATCONSTANT);
} }
void yyerror(YYLTYPE* lloc, TParseContext* context, const char* reason) { void yyerror(YYLTYPE* lloc, TParseContext* context, void *scanner, const char* reason) {
context->error(*lloc, reason, yyget_text(context->scanner)); context->error(*lloc, reason, yyget_text(scanner));
context->recover(); context->recover();
} }
......
...@@ -41,12 +41,11 @@ WHICH GENERATES THE GLSL ES PARSER (glslang_tab.cpp AND glslang_tab.h). ...@@ -41,12 +41,11 @@ WHICH GENERATES THE GLSL ES PARSER (glslang_tab.cpp AND glslang_tab.h).
#define YYENABLE_NLS 0 #define YYENABLE_NLS 0
#define YYLEX_PARAM context->scanner
%} %}
%expect 1 /* One shift reduce conflict because of if | else */ %expect 1 /* One shift reduce conflict because of if | else */
%pure-parser
%parse-param {TParseContext* context} %parse-param {TParseContext* context}
%param {void *scanner}
%define api.pure full
%locations %locations
%code requires { %code requires {
...@@ -88,11 +87,11 @@ WHICH GENERATES THE GLSL ES PARSER (glslang_tab.cpp AND glslang_tab.h). ...@@ -88,11 +87,11 @@ WHICH GENERATES THE GLSL ES PARSER (glslang_tab.cpp AND glslang_tab.h).
%{ %{
extern int yylex(YYSTYPE* yylval, YYLTYPE* yylloc, void* yyscanner); extern int yylex(YYSTYPE* yylval, YYLTYPE* yylloc, void* yyscanner);
extern void yyerror(YYLTYPE* yylloc, TParseContext* context, const char* reason); extern void yyerror(YYLTYPE* yylloc, TParseContext* context, void *scanner, const char* reason);
#define YYLLOC_DEFAULT(Current, Rhs, N) \ #define YYLLOC_DEFAULT(Current, Rhs, N) \
do { \ do { \
if (YYID(N)) { \ if (N) { \
(Current).first_file = YYRHSLOC(Rhs, 1).first_file; \ (Current).first_file = YYRHSLOC(Rhs, 1).first_file; \
(Current).first_line = YYRHSLOC(Rhs, 1).first_line; \ (Current).first_line = YYRHSLOC(Rhs, 1).first_line; \
(Current).last_file = YYRHSLOC(Rhs, N).last_file; \ (Current).last_file = YYRHSLOC(Rhs, N).last_file; \
...@@ -1923,5 +1922,5 @@ function_definition ...@@ -1923,5 +1922,5 @@ function_definition
%% %%
int glslang_parse(TParseContext* context) { int glslang_parse(TParseContext* context) {
return yyparse(context); return yyparse(context, context->scanner);
} }
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#define FLEX_SCANNER #define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 37 #define YY_FLEX_SUBMINOR_VERSION 39
#if YY_FLEX_SUBMINOR_VERSION > 0 #if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA #define FLEX_BETA
#endif #endif
...@@ -221,6 +221,13 @@ typedef size_t yy_size_t; ...@@ -221,6 +221,13 @@ typedef size_t yy_size_t;
if ( yytext[yyl] == '\n' )\ if ( yytext[yyl] == '\n' )\
--yylineno;\ --yylineno;\
}while(0) }while(0)
#define YY_LINENO_REWIND_TO(dst) \
do {\
const char *p;\
for ( p = yy_cp-1; p >= (dst); --p)\
if ( *p == '\n' )\
--yylineno;\
}while(0)
/* Return all but the first "n" matched characters back to the input stream. */ /* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \ #define yyless(n) \
...@@ -1256,8 +1263,6 @@ YY_DECL ...@@ -1256,8 +1263,6 @@ YY_DECL
register int yy_act; register int yy_act;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
TParseContext* context = yyextra;
yylval = yylval_param; yylval = yylval_param;
yylloc = yylloc_param; yylloc = yylloc_param;
...@@ -1288,6 +1293,10 @@ YY_DECL ...@@ -1288,6 +1293,10 @@ YY_DECL
yy_load_buffer_state(yyscanner ); yy_load_buffer_state(yyscanner );
} }
{
TParseContext* context = yyextra;
while ( 1 ) /* loops until end-of-file is reached */ while ( 1 ) /* loops until end-of-file is reached */
{ {
yy_cp = yyg->yy_c_buf_p; yy_cp = yyg->yy_c_buf_p;
...@@ -1304,7 +1313,7 @@ YY_DECL ...@@ -1304,7 +1313,7 @@ YY_DECL
yy_match: yy_match:
do do
{ {
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
if ( yy_accept[yy_current_state] ) if ( yy_accept[yy_current_state] )
{ {
yyg->yy_last_accepting_state = yy_current_state; yyg->yy_last_accepting_state = yy_current_state;
...@@ -2167,6 +2176,7 @@ ECHO; ...@@ -2167,6 +2176,7 @@ ECHO;
"fatal flex scanner internal error--no action found" ); "fatal flex scanner internal error--no action found" );
} /* end of action switch */ } /* end of action switch */
} /* end of scanning one token */ } /* end of scanning one token */
} /* end of user's declarations */
} /* end of yylex */ } /* end of yylex */
/* yy_get_next_buffer - try to read in a new buffer /* yy_get_next_buffer - try to read in a new buffer
...@@ -3294,8 +3304,8 @@ int floatsuffix_check(TParseContext* context) ...@@ -3294,8 +3304,8 @@ int floatsuffix_check(TParseContext* context)
return(FLOATCONSTANT); return(FLOATCONSTANT);
} }
void yyerror(YYLTYPE* lloc, TParseContext* context, const char* reason) { void yyerror(YYLTYPE* lloc, TParseContext* context, void *scanner, const char* reason) {
context->error(*lloc, reason, yyget_text(context->scanner)); context->error(*lloc, reason, yyget_text(scanner));
context->recover(); context->recover();
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/* A Bison parser, made by GNU Bison 2.7.12-4996. */ /* A Bison parser, made by GNU Bison 3.0.2. */
/* Bison interface for Yacc-like parsers in C /* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */ along with this program. If not, see <http://www.gnu.org/licenses/>. */
...@@ -26,13 +26,13 @@ ...@@ -26,13 +26,13 @@
special exception, which will cause the skeleton and the resulting special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public Bison output files to be licensed under the GNU General Public
License without this special exception. License without this special exception.
This special exception was added by the Free Software Foundation in This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */ version 2.2 of Bison. */
#ifndef YY_YY_GLSLANG_TAB_H_INCLUDED #ifndef YY_YY_GLSLANG_TAB_H_INCLUDED
# define YY_YY_GLSLANG_TAB_H_INCLUDED # define YY_YY_GLSLANG_TAB_H_INCLUDED
/* Enabling traces. */ /* Debug traces. */
#ifndef YYDEBUG #ifndef YYDEBUG
# define YYDEBUG 0 # define YYDEBUG 0
#endif #endif
...@@ -47,144 +47,143 @@ extern int yydebug; ...@@ -47,144 +47,143 @@ extern int yydebug;
/* Token type. */
/* Tokens. */
#ifndef YYTOKENTYPE #ifndef YYTOKENTYPE
# define YYTOKENTYPE # define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers enum yytokentype
know about them. */ {
enum yytokentype { INVARIANT = 258,
INVARIANT = 258, HIGH_PRECISION = 259,
HIGH_PRECISION = 259, MEDIUM_PRECISION = 260,
MEDIUM_PRECISION = 260, LOW_PRECISION = 261,
LOW_PRECISION = 261, PRECISION = 262,
PRECISION = 262, ATTRIBUTE = 263,
ATTRIBUTE = 263, CONST_QUAL = 264,
CONST_QUAL = 264, BOOL_TYPE = 265,
BOOL_TYPE = 265, FLOAT_TYPE = 266,
FLOAT_TYPE = 266, INT_TYPE = 267,
INT_TYPE = 267, UINT_TYPE = 268,
UINT_TYPE = 268, BREAK = 269,
BREAK = 269, CONTINUE = 270,
CONTINUE = 270, DO = 271,
DO = 271, ELSE = 272,
ELSE = 272, FOR = 273,
FOR = 273, IF = 274,
IF = 274, DISCARD = 275,
DISCARD = 275, RETURN = 276,
RETURN = 276, SWITCH = 277,
SWITCH = 277, CASE = 278,
CASE = 278, DEFAULT = 279,
DEFAULT = 279, BVEC2 = 280,
BVEC2 = 280, BVEC3 = 281,
BVEC3 = 281, BVEC4 = 282,
BVEC4 = 282, IVEC2 = 283,
IVEC2 = 283, IVEC3 = 284,
IVEC3 = 284, IVEC4 = 285,
IVEC4 = 285, VEC2 = 286,
VEC2 = 286, VEC3 = 287,
VEC3 = 287, VEC4 = 288,
VEC4 = 288, UVEC2 = 289,
UVEC2 = 289, UVEC3 = 290,
UVEC3 = 290, UVEC4 = 291,
UVEC4 = 291, MATRIX2 = 292,
MATRIX2 = 292, MATRIX3 = 293,
MATRIX3 = 293, MATRIX4 = 294,
MATRIX4 = 294, IN_QUAL = 295,
IN_QUAL = 295, OUT_QUAL = 296,
OUT_QUAL = 296, INOUT_QUAL = 297,
INOUT_QUAL = 297, UNIFORM = 298,
UNIFORM = 298, VARYING = 299,
VARYING = 299, MATRIX2x3 = 300,
MATRIX2x3 = 300, MATRIX3x2 = 301,
MATRIX3x2 = 301, MATRIX2x4 = 302,
MATRIX2x4 = 302, MATRIX4x2 = 303,
MATRIX4x2 = 303, MATRIX3x4 = 304,
MATRIX3x4 = 304, MATRIX4x3 = 305,
MATRIX4x3 = 305, CENTROID = 306,
CENTROID = 306, FLAT = 307,
FLAT = 307, SMOOTH = 308,
SMOOTH = 308, STRUCT = 309,
STRUCT = 309, VOID_TYPE = 310,
VOID_TYPE = 310, WHILE = 311,
WHILE = 311, SAMPLER2D = 312,
SAMPLER2D = 312, SAMPLERCUBE = 313,
SAMPLERCUBE = 313, SAMPLER_EXTERNAL_OES = 314,
SAMPLER_EXTERNAL_OES = 314, SAMPLER2DRECT = 315,
SAMPLER2DRECT = 315, SAMPLER2DARRAY = 316,
SAMPLER2DARRAY = 316, ISAMPLER2D = 317,
ISAMPLER2D = 317, ISAMPLER3D = 318,
ISAMPLER3D = 318, ISAMPLERCUBE = 319,
ISAMPLERCUBE = 319, ISAMPLER2DARRAY = 320,
ISAMPLER2DARRAY = 320, USAMPLER2D = 321,
USAMPLER2D = 321, USAMPLER3D = 322,
USAMPLER3D = 322, USAMPLERCUBE = 323,
USAMPLERCUBE = 323, USAMPLER2DARRAY = 324,
USAMPLER2DARRAY = 324, SAMPLER3D = 325,
SAMPLER3D = 325, SAMPLER3DRECT = 326,
SAMPLER3DRECT = 326, SAMPLER2DSHADOW = 327,
SAMPLER2DSHADOW = 327, SAMPLERCUBESHADOW = 328,
SAMPLERCUBESHADOW = 328, SAMPLER2DARRAYSHADOW = 329,
SAMPLER2DARRAYSHADOW = 329, LAYOUT = 330,
LAYOUT = 330, IDENTIFIER = 331,
IDENTIFIER = 331, TYPE_NAME = 332,
TYPE_NAME = 332, FLOATCONSTANT = 333,
FLOATCONSTANT = 333, INTCONSTANT = 334,
INTCONSTANT = 334, UINTCONSTANT = 335,
UINTCONSTANT = 335, BOOLCONSTANT = 336,
BOOLCONSTANT = 336, FIELD_SELECTION = 337,
FIELD_SELECTION = 337, LEFT_OP = 338,
LEFT_OP = 338, RIGHT_OP = 339,
RIGHT_OP = 339, INC_OP = 340,
INC_OP = 340, DEC_OP = 341,
DEC_OP = 341, LE_OP = 342,
LE_OP = 342, GE_OP = 343,
GE_OP = 343, EQ_OP = 344,
EQ_OP = 344, NE_OP = 345,
NE_OP = 345, AND_OP = 346,
AND_OP = 346, OR_OP = 347,
OR_OP = 347, XOR_OP = 348,
XOR_OP = 348, MUL_ASSIGN = 349,
MUL_ASSIGN = 349, DIV_ASSIGN = 350,
DIV_ASSIGN = 350, ADD_ASSIGN = 351,
ADD_ASSIGN = 351, MOD_ASSIGN = 352,
MOD_ASSIGN = 352, LEFT_ASSIGN = 353,
LEFT_ASSIGN = 353, RIGHT_ASSIGN = 354,
RIGHT_ASSIGN = 354, AND_ASSIGN = 355,
AND_ASSIGN = 355, XOR_ASSIGN = 356,
XOR_ASSIGN = 356, OR_ASSIGN = 357,
OR_ASSIGN = 357, SUB_ASSIGN = 358,
SUB_ASSIGN = 358, LEFT_PAREN = 359,
LEFT_PAREN = 359, RIGHT_PAREN = 360,
RIGHT_PAREN = 360, LEFT_BRACKET = 361,
LEFT_BRACKET = 361, RIGHT_BRACKET = 362,
RIGHT_BRACKET = 362, LEFT_BRACE = 363,
LEFT_BRACE = 363, RIGHT_BRACE = 364,
RIGHT_BRACE = 364, DOT = 365,
DOT = 365, COMMA = 366,
COMMA = 366, COLON = 367,
COLON = 367, EQUAL = 368,
EQUAL = 368, SEMICOLON = 369,
SEMICOLON = 369, BANG = 370,
BANG = 370, DASH = 371,
DASH = 371, TILDE = 372,
TILDE = 372, PLUS = 373,
PLUS = 373, STAR = 374,
STAR = 374, SLASH = 375,
SLASH = 375, PERCENT = 376,
PERCENT = 376, LEFT_ANGLE = 377,
LEFT_ANGLE = 377, RIGHT_ANGLE = 378,
RIGHT_ANGLE = 378, VERTICAL_BAR = 379,
VERTICAL_BAR = 379, CARET = 380,
CARET = 380, AMPERSAND = 381,
AMPERSAND = 381, QUESTION = 382
QUESTION = 382 };
};
#endif #endif
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE typedef union YYSTYPE YYSTYPE;
union YYSTYPE
{ {
...@@ -219,39 +218,27 @@ typedef union YYSTYPE ...@@ -219,39 +218,27 @@ typedef union YYSTYPE
} interm; } interm;
};
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
#endif #endif
/* Location type. */
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
typedef struct YYLTYPE typedef struct YYLTYPE YYLTYPE;
struct YYLTYPE
{ {
int first_line; int first_line;
int first_column; int first_column;
int last_line; int last_line;
int last_column; int last_column;
} YYLTYPE; };
# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
# define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_DECLARED 1
# define YYLTYPE_IS_TRIVIAL 1 # define YYLTYPE_IS_TRIVIAL 1
#endif #endif
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus int yyparse (TParseContext* context, void *scanner);
int yyparse (void *YYPARSE_PARAM);
#else
int yyparse ();
#endif
#else /* ! YYPARSE_PARAM */
#if defined __STDC__ || defined __cplusplus
int yyparse (TParseContext* context);
#else
int yyparse ();
#endif
#endif /* ! YYPARSE_PARAM */
#endif /* !YY_YY_GLSLANG_TAB_H_INCLUDED */ #endif /* !YY_YY_GLSLANG_TAB_H_INCLUDED */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment