Commit 91627bc7 by alokp@chromium.org

Removed code for unsupported pack-unpack language.

Review URL: https://codereview.appspot.com/9685045 git-svn-id: https://angleproject.googlecode.com/svn/trunk@2246 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 19aa9265
...@@ -90,10 +90,6 @@ enum TQualifier ...@@ -90,10 +90,6 @@ enum TQualifier
EvqInvariantVaryingOut, // vertex shaders only read/write EvqInvariantVaryingOut, // vertex shaders only read/write
EvqUniform, // Readonly, vertex and fragment EvqUniform, // Readonly, vertex and fragment
// pack/unpack input and output
EvqInput,
EvqOutput,
// parameters // parameters
EvqIn, EvqIn,
EvqOut, EvqOut,
...@@ -137,8 +133,6 @@ inline const char* getQualifierString(TQualifier q) ...@@ -137,8 +133,6 @@ inline const char* getQualifierString(TQualifier q)
case EvqIn: return "in"; break; case EvqIn: return "in"; break;
case EvqOut: return "out"; break; case EvqOut: return "out"; break;
case EvqInOut: return "inout"; break; case EvqInOut: return "inout"; break;
case EvqInput: return "input"; break;
case EvqOutput: return "output"; break;
case EvqPosition: return "Position"; break; case EvqPosition: return "Position"; break;
case EvqPointSize: return "PointSize"; break; case EvqPointSize: return "PointSize"; break;
case EvqFragCoord: return "FragCoord"; break; case EvqFragCoord: return "FragCoord"; break;
......
...@@ -319,7 +319,6 @@ bool TParseContext::lValueErrorCheck(const TSourceLoc& line, const char* op, TIn ...@@ -319,7 +319,6 @@ bool TParseContext::lValueErrorCheck(const TSourceLoc& line, const char* op, TIn
case EvqAttribute: message = "can't modify an attribute"; break; case EvqAttribute: message = "can't modify an attribute"; break;
case EvqUniform: message = "can't modify a uniform"; break; case EvqUniform: message = "can't modify a uniform"; break;
case EvqVaryingIn: message = "can't modify a varying"; break; case EvqVaryingIn: message = "can't modify a varying"; break;
case EvqInput: message = "can't modify an input"; break;
case EvqFragCoord: message = "can't modify gl_FragCoord"; break; case EvqFragCoord: message = "can't modify gl_FragCoord"; break;
case EvqFrontFacing: message = "can't modify gl_FrontFacing"; break; case EvqFrontFacing: message = "can't modify gl_FrontFacing"; break;
case EvqPointCoord: message = "can't modify gl_PointCoord"; break; case EvqPointCoord: message = "can't modify gl_PointCoord"; break;
......
...@@ -103,14 +103,6 @@ static void yyerror(YYLTYPE* yylloc, TParseContext* context, const char* reason) ...@@ -103,14 +103,6 @@ static void yyerror(YYLTYPE* yylloc, TParseContext* context, const char* reason)
} \ } \
} while (0) } while (0)
#define FRAG_VERT_ONLY(S, L) { \
if (context->shaderType != SH_FRAGMENT_SHADER && \
context->shaderType != SH_VERTEX_SHADER) { \
context->error(L, " supported in vertex/fragment shaders only ", S); \
context->recover(); \
} \
}
#define VERTEX_ONLY(S, L) { \ #define VERTEX_ONLY(S, L) { \
if (context->shaderType != SH_VERTEX_SHADER) { \ if (context->shaderType != SH_VERTEX_SHADER) { \
context->error(L, " supported in vertex shaders only ", S); \ context->error(L, " supported in vertex shaders only ", S); \
...@@ -663,17 +655,17 @@ function_identifier ...@@ -663,17 +655,17 @@ function_identifier
case EbtInt: case EbtInt:
switch($1.size) { switch($1.size) {
case 1: op = EOpConstructInt; break; case 1: op = EOpConstructInt; break;
case 2: FRAG_VERT_ONLY("ivec2", @1); op = EOpConstructIVec2; break; case 2: op = EOpConstructIVec2; break;
case 3: FRAG_VERT_ONLY("ivec3", @1); op = EOpConstructIVec3; break; case 3: op = EOpConstructIVec3; break;
case 4: FRAG_VERT_ONLY("ivec4", @1); op = EOpConstructIVec4; break; case 4: op = EOpConstructIVec4; break;
} }
break; break;
case EbtBool: case EbtBool:
switch($1.size) { switch($1.size) {
case 1: op = EOpConstructBool; break; case 1: op = EOpConstructBool; break;
case 2: FRAG_VERT_ONLY("bvec2", @1); op = EOpConstructBVec2; break; case 2: op = EOpConstructBVec2; break;
case 3: FRAG_VERT_ONLY("bvec3", @1); op = EOpConstructBVec3; break; case 3: op = EOpConstructBVec3; break;
case 4: FRAG_VERT_ONLY("bvec4", @1); op = EOpConstructBVec4; break; case 4: op = EOpConstructBVec4; break;
} }
break; break;
default: break; default: break;
...@@ -753,7 +745,6 @@ unary_operator ...@@ -753,7 +745,6 @@ unary_operator
multiplicative_expression multiplicative_expression
: unary_expression { $$ = $1; } : unary_expression { $$ = $1; }
| multiplicative_expression STAR unary_expression { | multiplicative_expression STAR unary_expression {
FRAG_VERT_ONLY("*", @2);
$$ = context->intermediate.addBinaryMath(EOpMul, $1, $3, @2, context->symbolTable); $$ = context->intermediate.addBinaryMath(EOpMul, $1, $3, @2, context->symbolTable);
if ($$ == 0) { if ($$ == 0) {
context->binaryOpError(@2, "*", $1->getCompleteString(), $3->getCompleteString()); context->binaryOpError(@2, "*", $1->getCompleteString(), $3->getCompleteString());
...@@ -762,7 +753,6 @@ multiplicative_expression ...@@ -762,7 +753,6 @@ multiplicative_expression
} }
} }
| multiplicative_expression SLASH unary_expression { | multiplicative_expression SLASH unary_expression {
FRAG_VERT_ONLY("/", @2);
$$ = context->intermediate.addBinaryMath(EOpDiv, $1, $3, @2, context->symbolTable); $$ = context->intermediate.addBinaryMath(EOpDiv, $1, $3, @2, context->symbolTable);
if ($$ == 0) { if ($$ == 0) {
context->binaryOpError(@2, "/", $1->getCompleteString(), $3->getCompleteString()); context->binaryOpError(@2, "/", $1->getCompleteString(), $3->getCompleteString());
...@@ -952,8 +942,8 @@ assignment_expression ...@@ -952,8 +942,8 @@ assignment_expression
assignment_operator assignment_operator
: EQUAL { $$.op = EOpAssign; } : EQUAL { $$.op = EOpAssign; }
| MUL_ASSIGN { FRAG_VERT_ONLY("*=", @1); $$.op = EOpMulAssign; } | MUL_ASSIGN { $$.op = EOpMulAssign; }
| DIV_ASSIGN { FRAG_VERT_ONLY("/=", @1); $$.op = EOpDivAssign; } | DIV_ASSIGN { $$.op = EOpDivAssign; }
| ADD_ASSIGN { $$.op = EOpAddAssign; } | ADD_ASSIGN { $$.op = EOpAddAssign; }
| SUB_ASSIGN { $$.op = EOpSubAssign; } | SUB_ASSIGN { $$.op = EOpSubAssign; }
; ;
...@@ -1404,76 +1394,8 @@ single_declaration ...@@ -1404,76 +1394,8 @@ single_declaration
$$.intermAggregate = context->intermediate.makeAggregate(symbol, @2); $$.intermAggregate = context->intermediate.makeAggregate(symbol, @2);
} }
} }
//
// Place holder for the pack/unpack languages.
//
// | buffer_specifier {
// $$.intermAggregate = 0;
// }
; ;
// Grammar Note: No 'enum', or 'typedef'.
//
// Place holder for the pack/unpack languages.
//
//%type <interm> buffer_declaration
//%type <interm.type> buffer_specifier input_or_output buffer_declaration_list
//buffer_specifier
// : input_or_output LEFT_BRACE buffer_declaration_list RIGHT_BRACE {
// }
// ;
//
//input_or_output
// : INPUT {
// if (context->globalErrorCheck(@1, context->symbolTable.atGlobalLevel(), "input"))
// context->recover();
// UNPACK_ONLY("input", @1);
// $$.qualifier = EvqInput;
// }
// | OUTPUT {
// if (context->globalErrorCheck(@1, context->symbolTable.atGlobalLevel(), "output"))
// context->recover();
// PACK_ONLY("output", @1);
// $$.qualifier = EvqOutput;
// }
// ;
//
// Place holder for the pack/unpack languages.
//
//buffer_declaration_list
// : buffer_declaration {
// }
// | buffer_declaration_list buffer_declaration {
// }
// ;
//
// Input/output semantics:
// float must be 16 or 32 bits
// float alignment restrictions?
// check for only one input and only one output
// sum of bitfields has to be multiple of 32
//
//
// Place holder for the pack/unpack languages.
//
//buffer_declaration
// : type_specifier IDENTIFIER COLON constant_expression SEMICOLON {
// if (context->reservedErrorCheck(@2, *$2.string, context))
// context->recover();
// $$.variable = new TVariable($2.string, $1);
// if (! context->symbolTable.insert(*$$.variable)) {
// context->error(@2, "redefinition", $$.variable->getName().c_str());
// context->recover();
// // don't have to delete $$.variable, the pool pop will take care of it
// }
// }
// ;
fully_specified_type fully_specified_type
: type_specifier { : type_specifier {
$$ = $1; $$ = $1;
...@@ -1603,11 +1525,6 @@ type_specifier_nonarray ...@@ -1603,11 +1525,6 @@ type_specifier_nonarray
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
$$.setBasic(EbtBool, qual, @1); $$.setBasic(EbtBool, qual, @1);
} }
// | UNSIGNED INT_TYPE {
// PACK_UNPACK_ONLY("unsigned", @1);
// TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
// $$.setBasic(EbtInt, qual, @1);
// }
| VEC2 { | VEC2 {
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
$$.setBasic(EbtFloat, qual, @1); $$.setBasic(EbtFloat, qual, @1);
...@@ -1654,30 +1571,25 @@ type_specifier_nonarray ...@@ -1654,30 +1571,25 @@ type_specifier_nonarray
$$.setAggregate(4); $$.setAggregate(4);
} }
| MATRIX2 { | MATRIX2 {
FRAG_VERT_ONLY("mat2", @1);
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
$$.setBasic(EbtFloat, qual, @1); $$.setBasic(EbtFloat, qual, @1);
$$.setAggregate(2, true); $$.setAggregate(2, true);
} }
| MATRIX3 { | MATRIX3 {
FRAG_VERT_ONLY("mat3", @1);
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
$$.setBasic(EbtFloat, qual, @1); $$.setBasic(EbtFloat, qual, @1);
$$.setAggregate(3, true); $$.setAggregate(3, true);
} }
| MATRIX4 { | MATRIX4 {
FRAG_VERT_ONLY("mat4", @1);
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
$$.setBasic(EbtFloat, qual, @1); $$.setBasic(EbtFloat, qual, @1);
$$.setAggregate(4, true); $$.setAggregate(4, true);
} }
| SAMPLER2D { | SAMPLER2D {
FRAG_VERT_ONLY("sampler2D", @1);
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
$$.setBasic(EbtSampler2D, qual, @1); $$.setBasic(EbtSampler2D, qual, @1);
} }
| SAMPLERCUBE { | SAMPLERCUBE {
FRAG_VERT_ONLY("samplerCube", @1);
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
$$.setBasic(EbtSamplerCube, qual, @1); $$.setBasic(EbtSamplerCube, qual, @1);
} }
...@@ -1686,7 +1598,6 @@ type_specifier_nonarray ...@@ -1686,7 +1598,6 @@ type_specifier_nonarray
context->error(@1, "unsupported type", "samplerExternalOES"); context->error(@1, "unsupported type", "samplerExternalOES");
context->recover(); context->recover();
} }
FRAG_VERT_ONLY("samplerExternalOES", @1);
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
$$.setBasic(EbtSamplerExternalOES, qual, @1); $$.setBasic(EbtSamplerExternalOES, qual, @1);
} }
...@@ -1695,12 +1606,10 @@ type_specifier_nonarray ...@@ -1695,12 +1606,10 @@ type_specifier_nonarray
context->error(@1, "unsupported type", "sampler2DRect"); context->error(@1, "unsupported type", "sampler2DRect");
context->recover(); context->recover();
} }
FRAG_VERT_ONLY("sampler2DRect", @1);
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
$$.setBasic(EbtSampler2DRect, qual, @1); $$.setBasic(EbtSampler2DRect, qual, @1);
} }
| struct_specifier { | struct_specifier {
FRAG_VERT_ONLY("struct", @1);
$$ = $1; $$ = $1;
$$.qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; $$.qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
} }
......
/* A Bison parser, made by GNU Bison 2.4.2. */ /* A Bison parser, made by GNU Bison 2.7. */
/* Skeleton implementation for Bison's Yacc-like parsers in C /* Bison implementation for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 Free Software Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
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
...@@ -45,7 +44,7 @@ ...@@ -45,7 +44,7 @@
#define YYBISON 1 #define YYBISON 1
/* Bison version. */ /* Bison version. */
#define YYBISON_VERSION "2.4.2" #define YYBISON_VERSION "2.7"
/* Skeleton name. */ /* Skeleton name. */
#define YYSKELETON_NAME "yacc.c" #define YYSKELETON_NAME "yacc.c"
...@@ -59,8 +58,6 @@ ...@@ -59,8 +58,6 @@
/* Pull parsers. */ /* Pull parsers. */
#define YYPULL 1 #define YYPULL 1
/* Using locations. */
#define YYLSP_NEEDED 1
...@@ -97,10 +94,13 @@ ...@@ -97,10 +94,13 @@
/* Enabling traces. */ # ifndef YY_NULL
#ifndef YYDEBUG # if defined __cplusplus && 201103L <= __cplusplus
# define YYDEBUG 0 # define YY_NULL nullptr
#endif # else
# define YY_NULL 0
# endif
# endif
/* Enabling verbose error messages. */ /* Enabling verbose error messages. */
#ifdef YYERROR_VERBOSE #ifdef YYERROR_VERBOSE
...@@ -110,11 +110,17 @@ ...@@ -110,11 +110,17 @@
# define YYERROR_VERBOSE 0 # define YYERROR_VERBOSE 0
#endif #endif
/* Enabling the token table. */ /* In a future release of Bison, this section will be replaced
#ifndef YYTOKEN_TABLE by #include "glslang_tab.h". */
# define YYTOKEN_TABLE 0 #ifndef YY_YY_GLSLANG_TAB_H_INCLUDED
# define YY_YY_GLSLANG_TAB_H_INCLUDED
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int yydebug;
#endif #endif
/* "%code requires" blocks. */ /* "%code requires" blocks. */
...@@ -226,7 +232,6 @@ ...@@ -226,7 +232,6 @@
#endif #endif
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE typedef union YYSTYPE
{ {
...@@ -282,6 +287,22 @@ typedef struct YYLTYPE ...@@ -282,6 +287,22 @@ typedef struct YYLTYPE
#endif #endif
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
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 */
/* Copy the second part of user declarations. */ /* Copy the second part of user declarations. */
...@@ -304,14 +325,6 @@ static void yyerror(YYLTYPE* yylloc, TParseContext* context, const char* reason) ...@@ -304,14 +325,6 @@ static void yyerror(YYLTYPE* yylloc, TParseContext* context, const char* reason)
} \ } \
} while (0) } while (0)
#define FRAG_VERT_ONLY(S, L) { \
if (context->shaderType != SH_FRAGMENT_SHADER && \
context->shaderType != SH_VERTEX_SHADER) { \
context->error(L, " supported in vertex/fragment shaders only ", S); \
context->recover(); \
} \
}
#define VERTEX_ONLY(S, L) { \ #define VERTEX_ONLY(S, L) { \
if (context->shaderType != SH_VERTEX_SHADER) { \ if (context->shaderType != SH_VERTEX_SHADER) { \
context->error(L, " supported in vertex shaders only ", S); \ context->error(L, " supported in vertex shaders only ", S); \
...@@ -379,24 +392,24 @@ typedef short int yytype_int16; ...@@ -379,24 +392,24 @@ typedef short int yytype_int16;
# if defined YYENABLE_NLS && YYENABLE_NLS # if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS # if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
# define YY_(msgid) dgettext ("bison-runtime", msgid) # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
# endif # endif
# endif # endif
# ifndef YY_ # ifndef YY_
# define YY_(msgid) msgid # define YY_(Msgid) Msgid
# endif # endif
#endif #endif
/* Suppress unused-variable warnings by "using" E. */ /* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__ #if ! defined lint || defined __GNUC__
# define YYUSE(e) ((void) (e)) # define YYUSE(E) ((void) (E))
#else #else
# define YYUSE(e) /* empty */ # define YYUSE(E) /* empty */
#endif #endif
/* Identity function, used to suppress warnings about constant conditions. */ /* Identity function, used to suppress warnings about constant conditions. */
#ifndef lint #ifndef lint
# define YYID(n) (n) # define YYID(N) (N)
#else #else
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
...@@ -429,11 +442,12 @@ YYID (yyi) ...@@ -429,11 +442,12 @@ YYID (yyi)
# define alloca _alloca # define alloca _alloca
# else # else
# define YYSTACK_ALLOC alloca # define YYSTACK_ALLOC alloca
# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# ifndef _STDLIB_H /* Use EXIT_SUCCESS as a witness for stdlib.h. */
# define _STDLIB_H 1 # ifndef EXIT_SUCCESS
# define EXIT_SUCCESS 0
# endif # endif
# endif # endif
# endif # endif
...@@ -456,24 +470,24 @@ YYID (yyi) ...@@ -456,24 +470,24 @@ YYID (yyi)
# ifndef YYSTACK_ALLOC_MAXIMUM # ifndef YYSTACK_ALLOC_MAXIMUM
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
# endif # endif
# if (defined __cplusplus && ! defined _STDLIB_H \ # if (defined __cplusplus && ! defined EXIT_SUCCESS \
&& ! ((defined YYMALLOC || defined malloc) \ && ! ((defined YYMALLOC || defined malloc) \
&& (defined YYFREE || defined free))) && (defined YYFREE || defined free)))
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# ifndef _STDLIB_H # ifndef EXIT_SUCCESS
# define _STDLIB_H 1 # define EXIT_SUCCESS 0
# endif # endif
# endif # endif
# ifndef YYMALLOC # ifndef YYMALLOC
# define YYMALLOC malloc # define YYMALLOC malloc
# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif # endif
# endif # endif
# ifndef YYFREE # ifndef YYFREE
# define YYFREE free # define YYFREE free
# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
void free (void *); /* INFRINGES ON USER NAME SPACE */ void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif # endif
...@@ -504,23 +518,7 @@ union yyalloc ...@@ -504,23 +518,7 @@ union yyalloc
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
+ 2 * YYSTACK_GAP_MAXIMUM) + 2 * YYSTACK_GAP_MAXIMUM)
/* Copy COUNT objects from FROM to TO. The source and destination do # define YYCOPY_NEEDED 1
not overlap. */
# ifndef YYCOPY
# if defined __GNUC__ && 1 < __GNUC__
# define YYCOPY(To, From, Count) \
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
# else
# define YYCOPY(To, From, Count) \
do \
{ \
YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(To)[yyi] = (From)[yyi]; \
} \
while (YYID (0))
# endif
# endif
/* Relocate STACK from its old location to the new one. The /* Relocate STACK from its old location to the new one. The
local variables YYSIZE and YYSTACKSIZE give the old and new number of local variables YYSIZE and YYSTACKSIZE give the old and new number of
...@@ -540,6 +538,26 @@ union yyalloc ...@@ -540,6 +538,26 @@ union yyalloc
#endif #endif
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
/* Copy COUNT objects from SRC to DST. The source and destination do
not overlap. */
# ifndef YYCOPY
# if defined __GNUC__ && 1 < __GNUC__
# define YYCOPY(Dst, Src, Count) \
__builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
# else
# define YYCOPY(Dst, Src, Count) \
do \
{ \
YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(Dst)[yyi] = (Src)[yyi]; \
} \
while (YYID (0))
# endif
# endif
#endif /* !YYCOPY_NEEDED */
/* YYFINAL -- State number of the termination state. */ /* YYFINAL -- State number of the termination state. */
#define YYFINAL 74 #define YYFINAL 74
/* YYLAST -- Last index in YYTABLE. */ /* YYLAST -- Last index in YYTABLE. */
...@@ -695,31 +713,31 @@ static const yytype_int16 yyrhs[] = ...@@ -695,31 +713,31 @@ static const yytype_int16 yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] = static const yytype_uint16 yyrline[] =
{ {
0, 187, 187, 188, 191, 227, 230, 243, 248, 253, 0, 179, 179, 180, 183, 219, 222, 235, 240, 245,
259, 262, 349, 352, 453, 463, 476, 484, 584, 587, 251, 254, 341, 344, 445, 455, 468, 476, 576, 579,
595, 598, 604, 608, 615, 621, 630, 638, 693, 703, 587, 590, 596, 600, 607, 613, 622, 630, 685, 695,
706, 716, 726, 747, 748, 749, 754, 755, 764, 776, 698, 708, 718, 739, 740, 741, 746, 747, 755, 766,
777, 785, 796, 800, 801, 811, 821, 831, 844, 845, 767, 775, 786, 790, 791, 801, 811, 821, 834, 835,
855, 868, 872, 876, 880, 881, 894, 895, 908, 909, 845, 858, 862, 866, 870, 871, 884, 885, 898, 899,
922, 923, 940, 941, 954, 955, 956, 957, 958, 962, 912, 913, 930, 931, 944, 945, 946, 947, 948, 952,
965, 976, 984, 1011, 1016, 1030, 1067, 1070, 1077, 1085, 955, 966, 974, 1001, 1006, 1020, 1057, 1060, 1067, 1075,
1106, 1127, 1137, 1165, 1170, 1180, 1185, 1195, 1198, 1201, 1096, 1117, 1127, 1155, 1160, 1170, 1175, 1185, 1188, 1191,
1204, 1210, 1217, 1220, 1242, 1260, 1284, 1307, 1311, 1329, 1194, 1200, 1207, 1210, 1232, 1250, 1274, 1297, 1301, 1319,
1337, 1369, 1389, 1478, 1487, 1510, 1513, 1519, 1527, 1535, 1327, 1359, 1379, 1400, 1409, 1432, 1435, 1441, 1449, 1457,
1543, 1553, 1560, 1563, 1566, 1572, 1575, 1590, 1594, 1598, 1465, 1475, 1482, 1485, 1488, 1494, 1497, 1512, 1516, 1520,
1602, 1611, 1616, 1621, 1626, 1631, 1636, 1641, 1646, 1651, 1524, 1528, 1533, 1538, 1543, 1548, 1553, 1558, 1563, 1568,
1656, 1662, 1668, 1674, 1679, 1684, 1693, 1702, 1707, 1720, 1573, 1578, 1583, 1588, 1592, 1596, 1604, 1612, 1616, 1629,
1720, 1734, 1734, 1743, 1746, 1762, 1798, 1802, 1808, 1815, 1629, 1643, 1643, 1652, 1655, 1671, 1707, 1711, 1717, 1724,
1830, 1834, 1838, 1839, 1845, 1846, 1847, 1848, 1849, 1853, 1739, 1743, 1747, 1748, 1754, 1755, 1756, 1757, 1758, 1762,
1854, 1854, 1854, 1864, 1865, 1869, 1869, 1870, 1870, 1875, 1763, 1763, 1763, 1773, 1774, 1778, 1778, 1779, 1779, 1784,
1878, 1888, 1891, 1897, 1898, 1902, 1910, 1914, 1924, 1929, 1787, 1797, 1800, 1806, 1807, 1811, 1819, 1823, 1833, 1838,
1946, 1946, 1951, 1951, 1958, 1958, 1966, 1969, 1975, 1978, 1855, 1855, 1860, 1860, 1867, 1867, 1875, 1878, 1884, 1887,
1984, 1988, 1995, 2002, 2009, 2016, 2027, 2036, 2040, 2047, 1893, 1897, 1904, 1911, 1918, 1925, 1936, 1945, 1949, 1956,
2050, 2056, 2056 1959, 1965, 1965
}; };
#endif #endif
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE #if YYDEBUG || YYERROR_VERBOSE || 0
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] = static const char *const yytname[] =
...@@ -768,7 +786,7 @@ static const char *const yytname[] = ...@@ -768,7 +786,7 @@ static const char *const yytname[] =
"selection_rest_statement", "condition", "iteration_statement", "$@7", "selection_rest_statement", "condition", "iteration_statement", "$@7",
"$@8", "$@9", "for_init_statement", "conditionopt", "for_rest_statement", "$@8", "$@9", "for_init_statement", "conditionopt", "for_rest_statement",
"jump_statement", "translation_unit", "external_declaration", "jump_statement", "translation_unit", "external_declaration",
"function_definition", "$@10", 0 "function_definition", "$@10", YY_NULL
}; };
#endif #endif
...@@ -842,8 +860,8 @@ static const yytype_uint8 yyr2[] = ...@@ -842,8 +860,8 @@ static const yytype_uint8 yyr2[] =
1, 0, 3 1, 0, 3
}; };
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
STATE-NUM when YYTABLE doesn't specify something else to do. Zero Performed when YYTABLE doesn't specify something else to do. Zero
means the default is an error. */ means the default is an error. */
static const yytype_uint8 yydefact[] = static const yytype_uint8 yydefact[] =
{ {
...@@ -948,8 +966,7 @@ static const yytype_int16 yypgoto[] = ...@@ -948,8 +966,7 @@ static const yytype_int16 yypgoto[] =
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which positive, shift that token. If negative, reduce the rule which
number is the opposite. If zero, do what YYDEFACT says. number is the opposite. If YYTABLE_NINF, syntax error. */
If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF -166 #define YYTABLE_NINF -166
static const yytype_int16 yytable[] = static const yytype_int16 yytable[] =
{ {
...@@ -1105,6 +1122,12 @@ static const yytype_int16 yytable[] = ...@@ -1105,6 +1122,12 @@ static const yytype_int16 yytable[] =
31 31
}; };
#define yypact_value_is_default(Yystate) \
(!!((Yystate) == (-261)))
#define yytable_value_is_error(Yytable_value) \
YYID (0)
static const yytype_int16 yycheck[] = static const yytype_int16 yycheck[] =
{ {
0, 25, 89, 88, 96, 57, 162, 73, 153, 128, 0, 25, 89, 88, 96, 57, 162, 73, 153, 128,
...@@ -1325,12 +1348,12 @@ static const yytype_uint8 yystos[] = ...@@ -1325,12 +1348,12 @@ static const yytype_uint8 yystos[] =
#define YYBACKUP(Token, Value) \ #define YYBACKUP(Token, Value) \
do \ do \
if (yychar == YYEMPTY && yylen == 1) \ if (yychar == YYEMPTY) \
{ \ { \
yychar = (Token); \ yychar = (Token); \
yylval = (Value); \ yylval = (Value); \
yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (yylen); \
YYPOPSTACK (1); \ yystate = *yyssp; \
goto yybackup; \ goto yybackup; \
} \ } \
else \ else \
...@@ -1340,7 +1363,7 @@ do \ ...@@ -1340,7 +1363,7 @@ do \
} \ } \
while (YYID (0)) while (YYID (0))
/* Error token number */
#define YYTERROR 1 #define YYTERROR 1
#define YYERRCODE 256 #define YYERRCODE 256
...@@ -1349,7 +1372,6 @@ while (YYID (0)) ...@@ -1349,7 +1372,6 @@ while (YYID (0))
If N is 0, then set CURRENT to the empty location which ends If N is 0, then set CURRENT to the empty location which ends
the previous symbol: RHS[0] (always defined). */ the previous symbol: RHS[0] (always defined). */
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
#ifndef YYLLOC_DEFAULT #ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N) \ # define YYLLOC_DEFAULT(Current, Rhs, N) \
do \ do \
...@@ -1370,6 +1392,8 @@ while (YYID (0)) ...@@ -1370,6 +1392,8 @@ while (YYID (0))
while (YYID (0)) while (YYID (0))
#endif #endif
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
/* YY_LOCATION_PRINT -- Print the location on the stream. /* YY_LOCATION_PRINT -- Print the location on the stream.
This macro was not mandated originally: define only if we know This macro was not mandated originally: define only if we know
...@@ -1377,10 +1401,46 @@ while (YYID (0)) ...@@ -1377,10 +1401,46 @@ while (YYID (0))
#ifndef YY_LOCATION_PRINT #ifndef YY_LOCATION_PRINT
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
__attribute__((__unused__))
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static unsigned
yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
#else
static unsigned
yy_location_print_ (yyo, yylocp)
FILE *yyo;
YYLTYPE const * const yylocp;
#endif
{
unsigned res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
# define YY_LOCATION_PRINT(File, Loc) \ # define YY_LOCATION_PRINT(File, Loc) \
fprintf (File, "%d.%d-%d.%d", \ yy_location_print_ (File, &(Loc))
(Loc).first_line, (Loc).first_column, \
(Loc).last_line, (Loc).last_column)
# else # else
# define YY_LOCATION_PRINT(File, Loc) ((void) 0) # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
# endif # endif
...@@ -1388,7 +1448,6 @@ while (YYID (0)) ...@@ -1388,7 +1448,6 @@ while (YYID (0))
/* YYLEX -- calling `yylex' with the right arguments. */ /* YYLEX -- calling `yylex' with the right arguments. */
#ifdef YYLEX_PARAM #ifdef YYLEX_PARAM
# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
#else #else
...@@ -1440,6 +1499,8 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, context) ...@@ -1440,6 +1499,8 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, context)
TParseContext* context; TParseContext* context;
#endif #endif
{ {
FILE *yyo = yyoutput;
YYUSE (yyo);
if (!yyvaluep) if (!yyvaluep)
return; return;
YYUSE (yylocationp); YYUSE (yylocationp);
...@@ -1586,7 +1647,6 @@ int yydebug; ...@@ -1586,7 +1647,6 @@ int yydebug;
#endif #endif
#if YYERROR_VERBOSE #if YYERROR_VERBOSE
# ifndef yystrlen # ifndef yystrlen
...@@ -1688,116 +1748,146 @@ yytnamerr (char *yyres, const char *yystr) ...@@ -1688,116 +1748,146 @@ yytnamerr (char *yyres, const char *yystr)
} }
# endif # endif
/* Copy into YYRESULT an error message about the unexpected token /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
YYCHAR while in state YYSTATE. Return the number of bytes copied, about the unexpected token YYTOKEN for the state stack whose top is
including the terminating null byte. If YYRESULT is null, do not YYSSP.
copy anything; just return the number of bytes that would be
copied. As a special case, return 0 if an ordinary "syntax error"
message will do. Return YYSIZE_MAXIMUM if overflow occurs during
size calculation. */
static YYSIZE_T
yysyntax_error (char *yyresult, int yystate, int yychar)
{
int yyn = yypact[yystate];
if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
return 0; not large enough to hold the message. In that case, also set
else *YYMSG_ALLOC to the required number of bytes. Return 2 if the
{ required number of bytes is too large to store. */
int yytype = YYTRANSLATE (yychar); static int
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
yytype_int16 *yyssp, int yytoken)
{
YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
YYSIZE_T yysize = yysize0; YYSIZE_T yysize = yysize0;
YYSIZE_T yysize1;
int yysize_overflow = 0;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */
const char *yyformat = YY_NULL;
/* Arguments of yyformat. */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
int yyx; /* Number of reported tokens (one for the "unexpected", one per
"expected"). */
# if 0 int yycount = 0;
/* This is so xgettext sees the translatable formats that are
constructed on the fly. */ /* There are many possibilities here to consider:
YY_("syntax error, unexpected %s"); - Assume YYFAIL is not used. It's too flawed to consider. See
YY_("syntax error, unexpected %s, expecting %s"); <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
YY_("syntax error, unexpected %s, expecting %s or %s"); for details. YYERROR is fine as it does not invoke this
YY_("syntax error, unexpected %s, expecting %s or %s or %s"); function.
YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); - If this state is a consistent state with a default action, then
# endif the only way this function was invoked is if the default action
char *yyfmt; is an error action. In that case, don't check for expected
char const *yyf; tokens because there are none.
static char const yyunexpected[] = "syntax error, unexpected %s"; - The only way there can be no lookahead present (in yychar) is if
static char const yyexpecting[] = ", expecting %s"; this state is a consistent state with a default action. Thus,
static char const yyor[] = " or %s"; detecting the absence of a lookahead is sufficient to determine
char yyformat[sizeof yyunexpected that there is no unexpected or expected token to report. In that
+ sizeof yyexpecting - 1 case, just report a simple "syntax error".
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - Don't assume there isn't a lookahead just because this state is a
* (sizeof yyor - 1))]; consistent state with a default action. There might have been a
char const *yyprefix = yyexpecting; previous inconsistent state, consistent state with a non-default
action, or user semantic action that manipulated yychar.
- Of course, the expected token list depends on states to have
correct lookahead information, and it depends on the parser not
to perform extra reductions after fetching a lookahead from the
scanner and before detecting a syntax error. Thus, state merging
(from LALR or IELR) and default reductions corrupt the expected
token list. However, the list is correct for canonical LR with
one exception: it will still contain any token that will not be
accepted due to an error action in a later state.
*/
if (yytoken != YYEMPTY)
{
int yyn = yypact[*yyssp];
yyarg[yycount++] = yytname[yytoken];
if (!yypact_value_is_default (yyn))
{
/* Start YYX at -YYN if negative to avoid negative indexes in /* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. */ YYCHECK. In other words, skip the first -YYN actions for
this state because they are default actions. */
int yyxbegin = yyn < 0 ? -yyn : 0; int yyxbegin = yyn < 0 ? -yyn : 0;
/* Stay within bounds of both yycheck and yytname. */ /* Stay within bounds of both yycheck and yytname. */
int yychecklim = YYLAST - yyn + 1; int yychecklim = YYLAST - yyn + 1;
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
int yycount = 1; int yyx;
yyarg[0] = yytname[yytype];
yyfmt = yystpcpy (yyformat, yyunexpected);
for (yyx = yyxbegin; yyx < yyxend; ++yyx) for (yyx = yyxbegin; yyx < yyxend; ++yyx)
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
&& !yytable_value_is_error (yytable[yyx + yyn]))
{ {
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
{ {
yycount = 1; yycount = 1;
yysize = yysize0; yysize = yysize0;
yyformat[sizeof yyunexpected - 1] = '\0';
break; break;
} }
yyarg[yycount++] = yytname[yyx]; yyarg[yycount++] = yytname[yyx];
yysize1 = yysize + yytnamerr (0, yytname[yyx]); {
yysize_overflow |= (yysize1 < yysize); YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
if (! (yysize <= yysize1
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
return 2;
yysize = yysize1; yysize = yysize1;
yyfmt = yystpcpy (yyfmt, yyprefix); }
yyprefix = yyor; }
}
} }
yyf = YY_(yyformat); switch (yycount)
yysize1 = yysize + yystrlen (yyf); {
yysize_overflow |= (yysize1 < yysize); # define YYCASE_(N, S) \
yysize = yysize1; case N: \
yyformat = S; \
break
YYCASE_(0, YY_("syntax error"));
YYCASE_(1, YY_("syntax error, unexpected %s"));
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
# undef YYCASE_
}
if (yysize_overflow) {
return YYSIZE_MAXIMUM; YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
return 2;
yysize = yysize1;
}
if (yyresult) if (*yymsg_alloc < yysize)
{ {
*yymsg_alloc = 2 * yysize;
if (! (yysize <= *yymsg_alloc
&& *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
*yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
return 1;
}
/* Avoid sprintf, as that infringes on the user's name space. /* Avoid sprintf, as that infringes on the user's name space.
Don't have undefined behavior even if the translation Don't have undefined behavior even if the translation
produced a string with the wrong number of "%s"s. */ produced a string with the wrong number of "%s"s. */
char *yyp = yyresult;
int yyi = 0;
while ((*yyp = *yyf) != '\0')
{ {
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) char *yyp = *yymsg;
int yyi = 0;
while ((*yyp = *yyformat) != '\0')
if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
{ {
yyp += yytnamerr (yyp, yyarg[yyi++]); yyp += yytnamerr (yyp, yyarg[yyi++]);
yyf += 2; yyformat += 2;
} }
else else
{ {
yyp++; yyp++;
yyf++; yyformat++;
}
}
} }
return yysize;
} }
return 0;
} }
#endif /* YYERROR_VERBOSE */ #endif /* YYERROR_VERBOSE */
/*-----------------------------------------------. /*-----------------------------------------------.
| Release the memory associated to this symbol. | | Release the memory associated to this symbol. |
`-----------------------------------------------*/ `-----------------------------------------------*/
...@@ -1833,28 +1923,12 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, context) ...@@ -1833,28 +1923,12 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, context)
} }
} }
/* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
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 */
/*-------------------------. /*----------.
| yyparse or yypush_parse. | | yyparse. |
`-------------------------*/ `----------*/
#ifdef YYPARSE_PARAM #ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
...@@ -1881,11 +1955,40 @@ yyparse (context) ...@@ -1881,11 +1955,40 @@ yyparse (context)
/* The lookahead symbol. */ /* The lookahead symbol. */
int yychar; int yychar;
#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
_Pragma ("GCC diagnostic pop")
#else
/* Default value used for initialization, for pacifying older GCCs
or non-GCC compilers. */
static YYSTYPE yyval_default;
# define YY_INITIAL_VALUE(Value) = Value
#endif
static YYLTYPE yyloc_default
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
= { 1, 1, 1, 1 }
# endif
;
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
#endif
#ifndef YY_INITIAL_VALUE
# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif
/* The semantic value of the lookahead symbol. */ /* The semantic value of the lookahead symbol. */
YYSTYPE yylval; YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
/* Location data for the lookahead symbol. */ /* Location data for the lookahead symbol. */
YYLTYPE yylloc; YYLTYPE yylloc = yyloc_default;
/* Number of syntax errors so far. */ /* Number of syntax errors so far. */
int yynerrs; int yynerrs;
...@@ -1899,7 +2002,7 @@ YYLTYPE yylloc; ...@@ -1899,7 +2002,7 @@ YYLTYPE yylloc;
`yyvs': related to semantic values. `yyvs': related to semantic values.
`yyls': related to locations. `yyls': related to locations.
Refer to the stacks thru separate pointers, to allow yyoverflow Refer to the stacks through separate pointers, to allow yyoverflow
to reallocate them elsewhere. */ to reallocate them elsewhere. */
/* The state stack. */ /* The state stack. */
...@@ -1918,14 +2021,14 @@ YYLTYPE yylloc; ...@@ -1918,14 +2021,14 @@ YYLTYPE yylloc;
YYLTYPE *yylsp; YYLTYPE *yylsp;
/* The locations where the error started and ended. */ /* The locations where the error started and ended. */
YYLTYPE yyerror_range[2]; YYLTYPE yyerror_range[3];
YYSIZE_T yystacksize; YYSIZE_T yystacksize;
int yyn; int yyn;
int yyresult; int yyresult;
/* Lookahead token as an internal (translated) token number. */ /* Lookahead token as an internal (translated) token number. */
int yytoken; int yytoken = 0;
/* The variables used to return semantic value and location from the /* The variables used to return semantic value and location from the
action routines. */ action routines. */
YYSTYPE yyval; YYSTYPE yyval;
...@@ -1944,10 +2047,9 @@ YYLTYPE yylloc; ...@@ -1944,10 +2047,9 @@ YYLTYPE yylloc;
Keep to zero when no symbol should be popped. */ Keep to zero when no symbol should be popped. */
int yylen = 0; int yylen = 0;
yytoken = 0; yyssp = yyss = yyssa;
yyss = yyssa; yyvsp = yyvs = yyvsa;
yyvs = yyvsa; yylsp = yyls = yylsa;
yyls = yylsa;
yystacksize = YYINITDEPTH; yystacksize = YYINITDEPTH;
YYDPRINTF ((stderr, "Starting parse\n")); YYDPRINTF ((stderr, "Starting parse\n"));
...@@ -1956,21 +2058,7 @@ YYLTYPE yylloc; ...@@ -1956,21 +2058,7 @@ YYLTYPE yylloc;
yyerrstatus = 0; yyerrstatus = 0;
yynerrs = 0; yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */ yychar = YYEMPTY; /* Cause a token to be read. */
yylsp[0] = yylloc;
/* Initialize stack pointers.
Waste one element of value and location stack
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
yyssp = yyss;
yyvsp = yyvs;
yylsp = yyls;
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Initialize the default location before parsing starts. */
yylloc.first_line = yylloc.last_line = 1;
yylloc.first_column = yylloc.last_column = 1;
#endif
goto yysetstate; goto yysetstate;
/*------------------------------------------------------------. /*------------------------------------------------------------.
...@@ -2067,7 +2155,7 @@ yybackup: ...@@ -2067,7 +2155,7 @@ yybackup:
/* First try to decide what to do without reference to lookahead token. */ /* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate]; yyn = yypact[yystate];
if (yyn == YYPACT_NINF) if (yypact_value_is_default (yyn))
goto yydefault; goto yydefault;
/* Not known => get a lookahead token if don't already have one. */ /* Not known => get a lookahead token if don't already have one. */
...@@ -2098,7 +2186,7 @@ yybackup: ...@@ -2098,7 +2186,7 @@ yybackup:
yyn = yytable[yyn]; yyn = yytable[yyn];
if (yyn <= 0) if (yyn <= 0)
{ {
if (yyn == 0 || yyn == YYTABLE_NINF) if (yytable_value_is_error (yyn))
goto yyerrlab; goto yyerrlab;
yyn = -yyn; yyn = -yyn;
goto yyreduce; goto yyreduce;
...@@ -2116,7 +2204,9 @@ yybackup: ...@@ -2116,7 +2204,9 @@ yybackup:
yychar = YYEMPTY; yychar = YYEMPTY;
yystate = yyn; yystate = yyn;
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval; *++yyvsp = yylval;
YY_IGNORE_MAYBE_UNINITIALIZED_END
*++yylsp = yylloc; *++yylsp = yylloc;
goto yynewstate; goto yynewstate;
...@@ -2690,17 +2780,17 @@ yyreduce: ...@@ -2690,17 +2780,17 @@ yyreduce:
case EbtInt: case EbtInt:
switch((yyvsp[(1) - (1)].interm.type).size) { switch((yyvsp[(1) - (1)].interm.type).size) {
case 1: op = EOpConstructInt; break; case 1: op = EOpConstructInt; break;
case 2: FRAG_VERT_ONLY("ivec2", (yylsp[(1) - (1)])); op = EOpConstructIVec2; break; case 2: op = EOpConstructIVec2; break;
case 3: FRAG_VERT_ONLY("ivec3", (yylsp[(1) - (1)])); op = EOpConstructIVec3; break; case 3: op = EOpConstructIVec3; break;
case 4: FRAG_VERT_ONLY("ivec4", (yylsp[(1) - (1)])); op = EOpConstructIVec4; break; case 4: op = EOpConstructIVec4; break;
} }
break; break;
case EbtBool: case EbtBool:
switch((yyvsp[(1) - (1)].interm.type).size) { switch((yyvsp[(1) - (1)].interm.type).size) {
case 1: op = EOpConstructBool; break; case 1: op = EOpConstructBool; break;
case 2: FRAG_VERT_ONLY("bvec2", (yylsp[(1) - (1)])); op = EOpConstructBVec2; break; case 2: op = EOpConstructBVec2; break;
case 3: FRAG_VERT_ONLY("bvec3", (yylsp[(1) - (1)])); op = EOpConstructBVec3; break; case 3: op = EOpConstructBVec3; break;
case 4: FRAG_VERT_ONLY("bvec4", (yylsp[(1) - (1)])); op = EOpConstructBVec4; break; case 4: op = EOpConstructBVec4; break;
} }
break; break;
default: break; default: break;
...@@ -2809,7 +2899,6 @@ yyreduce: ...@@ -2809,7 +2899,6 @@ yyreduce:
case 37: case 37:
{ {
FRAG_VERT_ONLY("*", (yylsp[(2) - (3)]));
(yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpMul, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]), context->symbolTable); (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpMul, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]), context->symbolTable);
if ((yyval.interm.intermTypedNode) == 0) { if ((yyval.interm.intermTypedNode) == 0) {
context->binaryOpError((yylsp[(2) - (3)]), "*", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); context->binaryOpError((yylsp[(2) - (3)]), "*", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
...@@ -2822,7 +2911,6 @@ yyreduce: ...@@ -2822,7 +2911,6 @@ yyreduce:
case 38: case 38:
{ {
FRAG_VERT_ONLY("/", (yylsp[(2) - (3)]));
(yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpDiv, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]), context->symbolTable); (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpDiv, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]), context->symbolTable);
if ((yyval.interm.intermTypedNode) == 0) { if ((yyval.interm.intermTypedNode) == 0) {
context->binaryOpError((yylsp[(2) - (3)]), "/", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); context->binaryOpError((yylsp[(2) - (3)]), "/", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
...@@ -3081,12 +3169,12 @@ yyreduce: ...@@ -3081,12 +3169,12 @@ yyreduce:
case 65: case 65:
{ FRAG_VERT_ONLY("*=", (yylsp[(1) - (1)])); (yyval.interm).op = EOpMulAssign; } { (yyval.interm).op = EOpMulAssign; }
break; break;
case 66: case 66:
{ FRAG_VERT_ONLY("/=", (yylsp[(1) - (1)])); (yyval.interm).op = EOpDivAssign; } { (yyval.interm).op = EOpDivAssign; }
break; break;
case 67: case 67:
...@@ -3900,7 +3988,6 @@ yyreduce: ...@@ -3900,7 +3988,6 @@ yyreduce:
case 130: case 130:
{ {
FRAG_VERT_ONLY("mat2", (yylsp[(1) - (1)]));
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
(yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)])); (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
(yyval.interm.type).setAggregate(2, true); (yyval.interm.type).setAggregate(2, true);
...@@ -3910,7 +3997,6 @@ yyreduce: ...@@ -3910,7 +3997,6 @@ yyreduce:
case 131: case 131:
{ {
FRAG_VERT_ONLY("mat3", (yylsp[(1) - (1)]));
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
(yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)])); (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
(yyval.interm.type).setAggregate(3, true); (yyval.interm.type).setAggregate(3, true);
...@@ -3920,7 +4006,6 @@ yyreduce: ...@@ -3920,7 +4006,6 @@ yyreduce:
case 132: case 132:
{ {
FRAG_VERT_ONLY("mat4", (yylsp[(1) - (1)]));
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
(yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)])); (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
(yyval.interm.type).setAggregate(4, true); (yyval.interm.type).setAggregate(4, true);
...@@ -3930,7 +4015,6 @@ yyreduce: ...@@ -3930,7 +4015,6 @@ yyreduce:
case 133: case 133:
{ {
FRAG_VERT_ONLY("sampler2D", (yylsp[(1) - (1)]));
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
(yyval.interm.type).setBasic(EbtSampler2D, qual, (yylsp[(1) - (1)])); (yyval.interm.type).setBasic(EbtSampler2D, qual, (yylsp[(1) - (1)]));
} }
...@@ -3939,7 +4023,6 @@ yyreduce: ...@@ -3939,7 +4023,6 @@ yyreduce:
case 134: case 134:
{ {
FRAG_VERT_ONLY("samplerCube", (yylsp[(1) - (1)]));
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
(yyval.interm.type).setBasic(EbtSamplerCube, qual, (yylsp[(1) - (1)])); (yyval.interm.type).setBasic(EbtSamplerCube, qual, (yylsp[(1) - (1)]));
} }
...@@ -3952,7 +4035,6 @@ yyreduce: ...@@ -3952,7 +4035,6 @@ yyreduce:
context->error((yylsp[(1) - (1)]), "unsupported type", "samplerExternalOES"); context->error((yylsp[(1) - (1)]), "unsupported type", "samplerExternalOES");
context->recover(); context->recover();
} }
FRAG_VERT_ONLY("samplerExternalOES", (yylsp[(1) - (1)]));
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
(yyval.interm.type).setBasic(EbtSamplerExternalOES, qual, (yylsp[(1) - (1)])); (yyval.interm.type).setBasic(EbtSamplerExternalOES, qual, (yylsp[(1) - (1)]));
} }
...@@ -3965,7 +4047,6 @@ yyreduce: ...@@ -3965,7 +4047,6 @@ yyreduce:
context->error((yylsp[(1) - (1)]), "unsupported type", "sampler2DRect"); context->error((yylsp[(1) - (1)]), "unsupported type", "sampler2DRect");
context->recover(); context->recover();
} }
FRAG_VERT_ONLY("sampler2DRect", (yylsp[(1) - (1)]));
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
(yyval.interm.type).setBasic(EbtSampler2DRect, qual, (yylsp[(1) - (1)])); (yyval.interm.type).setBasic(EbtSampler2DRect, qual, (yylsp[(1) - (1)]));
} }
...@@ -3974,7 +4055,6 @@ yyreduce: ...@@ -3974,7 +4055,6 @@ yyreduce:
case 137: case 137:
{ {
FRAG_VERT_ONLY("struct", (yylsp[(1) - (1)]));
(yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
(yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
} }
...@@ -4622,6 +4702,17 @@ yyreduce: ...@@ -4622,6 +4702,17 @@ yyreduce:
default: break; default: break;
} }
/* User semantic actions sometimes alter yychar, and that requires
that yytoken be updated with the new translation. We take the
approach of translating immediately before every use of yytoken.
One alternative is translating here after every semantic action,
but that translation would be missed if the semantic action invokes
YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
incorrect destructor might then be invoked immediately. In the
case of YYERROR or YYBACKUP, subsequent parser actions might lead
to an incorrect destructor call or verbose syntax error message
before the lookahead is translated. */
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
YYPOPSTACK (yylen); YYPOPSTACK (yylen);
...@@ -4650,6 +4741,10 @@ yyreduce: ...@@ -4650,6 +4741,10 @@ yyreduce:
| yyerrlab -- here on detecting error | | yyerrlab -- here on detecting error |
`------------------------------------*/ `------------------------------------*/
yyerrlab: yyerrlab:
/* Make sure we have latest lookahead translation. See comments at
user semantic actions for why this is necessary. */
yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
/* If not already recovering from an error, report this error. */ /* If not already recovering from an error, report this error. */
if (!yyerrstatus) if (!yyerrstatus)
{ {
...@@ -4657,41 +4752,40 @@ yyerrlab: ...@@ -4657,41 +4752,40 @@ yyerrlab:
#if ! YYERROR_VERBOSE #if ! YYERROR_VERBOSE
yyerror (&yylloc, context, YY_("syntax error")); yyerror (&yylloc, context, YY_("syntax error"));
#else #else
# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
yyssp, yytoken)
{ {
YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); char const *yymsgp = YY_("syntax error");
if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) int yysyntax_error_status;
yysyntax_error_status = YYSYNTAX_ERROR;
if (yysyntax_error_status == 0)
yymsgp = yymsg;
else if (yysyntax_error_status == 1)
{ {
YYSIZE_T yyalloc = 2 * yysize;
if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
yyalloc = YYSTACK_ALLOC_MAXIMUM;
if (yymsg != yymsgbuf) if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg); YYSTACK_FREE (yymsg);
yymsg = (char *) YYSTACK_ALLOC (yyalloc); yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
if (yymsg) if (!yymsg)
yymsg_alloc = yyalloc;
else
{ {
yymsg = yymsgbuf; yymsg = yymsgbuf;
yymsg_alloc = sizeof yymsgbuf; yymsg_alloc = sizeof yymsgbuf;
} yysyntax_error_status = 2;
}
if (0 < yysize && yysize <= yymsg_alloc)
{
(void) yysyntax_error (yymsg, yystate, yychar);
yyerror (&yylloc, context, yymsg);
} }
else else
{ {
yyerror (&yylloc, context, YY_("syntax error")); yysyntax_error_status = YYSYNTAX_ERROR;
if (yysize != 0) yymsgp = yymsg;
goto yyexhaustedlab; }
} }
yyerror (&yylloc, context, yymsgp);
if (yysyntax_error_status == 2)
goto yyexhaustedlab;
} }
# undef YYSYNTAX_ERROR
#endif #endif
} }
yyerror_range[0] = yylloc; yyerror_range[1] = yylloc;
if (yyerrstatus == 3) if (yyerrstatus == 3)
{ {
...@@ -4728,7 +4822,7 @@ yyerrorlab: ...@@ -4728,7 +4822,7 @@ yyerrorlab:
if (/*CONSTCOND*/ 0) if (/*CONSTCOND*/ 0)
goto yyerrorlab; goto yyerrorlab;
yyerror_range[0] = yylsp[1-yylen]; yyerror_range[1] = yylsp[1-yylen];
/* Do not reclaim the symbols of the rule which action triggered /* Do not reclaim the symbols of the rule which action triggered
this YYERROR. */ this YYERROR. */
YYPOPSTACK (yylen); YYPOPSTACK (yylen);
...@@ -4747,7 +4841,7 @@ yyerrlab1: ...@@ -4747,7 +4841,7 @@ yyerrlab1:
for (;;) for (;;)
{ {
yyn = yypact[yystate]; yyn = yypact[yystate];
if (yyn != YYPACT_NINF) if (!yypact_value_is_default (yyn))
{ {
yyn += YYTERROR; yyn += YYTERROR;
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
...@@ -4762,7 +4856,7 @@ yyerrlab1: ...@@ -4762,7 +4856,7 @@ yyerrlab1:
if (yyssp == yyss) if (yyssp == yyss)
YYABORT; YYABORT;
yyerror_range[0] = *yylsp; yyerror_range[1] = *yylsp;
yydestruct ("Error: popping", yydestruct ("Error: popping",
yystos[yystate], yyvsp, yylsp, context); yystos[yystate], yyvsp, yylsp, context);
YYPOPSTACK (1); YYPOPSTACK (1);
...@@ -4770,12 +4864,14 @@ yyerrlab1: ...@@ -4770,12 +4864,14 @@ yyerrlab1:
YY_STACK_PRINT (yyss, yyssp); YY_STACK_PRINT (yyss, yyssp);
} }
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval; *++yyvsp = yylval;
YY_IGNORE_MAYBE_UNINITIALIZED_END
yyerror_range[1] = yylloc; yyerror_range[2] = yylloc;
/* Using YYLLOC is tempting, but would change the location of /* Using YYLLOC is tempting, but would change the location of
the lookahead. YYLOC is available though. */ the lookahead. YYLOC is available though. */
YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
*++yylsp = yyloc; *++yylsp = yyloc;
/* Shift the error token. */ /* Shift the error token. */
...@@ -4799,7 +4895,7 @@ yyabortlab: ...@@ -4799,7 +4895,7 @@ yyabortlab:
yyresult = 1; yyresult = 1;
goto yyreturn; goto yyreturn;
#if !defined(yyoverflow) || YYERROR_VERBOSE #if !defined yyoverflow || YYERROR_VERBOSE
/*-------------------------------------------------. /*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. | | yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/ `-------------------------------------------------*/
...@@ -4811,8 +4907,13 @@ yyexhaustedlab: ...@@ -4811,8 +4907,13 @@ yyexhaustedlab:
yyreturn: yyreturn:
if (yychar != YYEMPTY) if (yychar != YYEMPTY)
{
/* Make sure we have latest lookahead translation. See comments at
user semantic actions for why this is necessary. */
yytoken = YYTRANSLATE (yychar);
yydestruct ("Cleanup: discarding lookahead", yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval, &yylloc, context); yytoken, &yylval, &yylloc, context);
}
/* Do not reclaim the symbols of the rule which action triggered /* Do not reclaim the symbols of the rule which action triggered
this YYABORT or YYACCEPT. */ this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen); YYPOPSTACK (yylen);
...@@ -4847,4 +4948,3 @@ void yyerror(YYLTYPE* yylloc, TParseContext* context, const char* reason) { ...@@ -4847,4 +4948,3 @@ void yyerror(YYLTYPE* yylloc, TParseContext* context, const char* reason) {
int glslang_parse(TParseContext* context) { int glslang_parse(TParseContext* context) {
return yyparse(context); return yyparse(context);
} }
/* A Bison parser, made by GNU Bison 2.4.2. */ /* A Bison parser, made by GNU Bison 2.7. */
/* Skeleton interface for Bison's Yacc-like parsers in C /* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 Free Software Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
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
...@@ -31,6 +30,15 @@ ...@@ -31,6 +30,15 @@
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
# define YY_YY_GLSLANG_TAB_H_INCLUDED
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int yydebug;
#endif
/* "%code requires" blocks. */ /* "%code requires" blocks. */
...@@ -142,7 +150,6 @@ ...@@ -142,7 +150,6 @@
#endif #endif
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE typedef union YYSTYPE
{ {
...@@ -184,8 +191,6 @@ typedef union YYSTYPE ...@@ -184,8 +191,6 @@ typedef union YYSTYPE
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
#endif #endif
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
typedef struct YYLTYPE typedef struct YYLTYPE
{ {
...@@ -200,4 +205,18 @@ typedef struct YYLTYPE ...@@ -200,4 +205,18 @@ typedef struct YYLTYPE
#endif #endif
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
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 */
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