Modified: trunk/Source/ThirdParty/ANGLE/src/compiler/preprocessor/ExpressionParser.cpp (143762 => 143763)
--- trunk/Source/ThirdParty/ANGLE/src/compiler/preprocessor/ExpressionParser.cpp 2013-02-22 19:40:43 UTC (rev 143762)
+++ trunk/Source/ThirdParty/ANGLE/src/compiler/preprocessor/ExpressionParser.cpp 2013-02-22 19:44:44 UTC (rev 143763)
@@ -1,22 +1,24 @@
-/* A Bison parser, made by GNU Bison 2.4.2. */
+/* A Bison parser, made by GNU Bison 2.3. */
/* Skeleton implementation for Bison's Yacc-like parsers in C
-
- Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 Free Software
- Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
+
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
+
+ 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
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -27,7 +29,7 @@
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
-
+
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
@@ -45,7 +47,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.4.2"
+#define YYBISON_VERSION "2.3"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -53,25 +55,52 @@
/* Pure parsers. */
#define YYPURE 1
-/* Push parsers. */
-#define YYPUSH 0
-
-/* Pull parsers. */
-#define YYPULL 1
-
/* Using locations. */
#define YYLSP_NEEDED 0
/* Substitute the variable and function names. */
-#define yyparse ppparse
-#define yylex pplex
-#define yyerror pperror
-#define yylval pplval
-#define yychar ppchar
-#define yydebug ppdebug
-#define yynerrs ppnerrs
+#define yyparse ppparse
+#define yylex pplex
+#define yyerror pperror
+#define yylval pplval
+#define yychar ppchar
+#define yydebug ppdebug
+#define yynerrs ppnerrs
+/* Tokens. */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+ /* Put the tokens into the symbol table, so that GDB and other debuggers
+ know about them. */
+ enum yytokentype {
+ TOK_CONST_INT = 258,
+ TOK_OP_OR = 259,
+ TOK_OP_AND = 260,
+ TOK_OP_NE = 261,
+ TOK_OP_EQ = 262,
+ TOK_OP_GE = 263,
+ TOK_OP_LE = 264,
+ TOK_OP_RIGHT = 265,
+ TOK_OP_LEFT = 266,
+ TOK_UNARY = 267
+ };
+#endif
+/* Tokens. */
+#define TOK_CONST_INT 258
+#define TOK_OP_OR 259
+#define TOK_OP_AND 260
+#define TOK_OP_NE 261
+#define TOK_OP_EQ 262
+#define TOK_OP_GE 263
+#define TOK_OP_LE 264
+#define TOK_OP_RIGHT 265
+#define TOK_OP_LEFT 266
+#define TOK_UNARY 267
+
+
+
+
/* Copy the first part of user declarations. */
@@ -129,7 +158,6 @@
static void yyerror(Context* context, const char* reason);
-
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
@@ -148,40 +176,21 @@
# define YYTOKEN_TABLE 0
#endif
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- TOK_CONST_INT = 258,
- TOK_OP_OR = 259,
- TOK_OP_AND = 260,
- TOK_OP_NE = 261,
- TOK_OP_EQ = 262,
- TOK_OP_GE = 263,
- TOK_OP_LE = 264,
- TOK_OP_RIGHT = 265,
- TOK_OP_LEFT = 266,
- TOK_UNARY = 267
- };
-#endif
-
-
-
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef int YYSTYPE;
-# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
#endif
+
/* Copy the second part of user declarations. */
+/* Line 216 of yacc.c. */
+
#ifdef short
# undef short
#endif
@@ -255,14 +264,14 @@
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static int
-YYID (int yyi)
+YYID (int i)
#else
static int
-YYID (yyi)
- int yyi;
+YYID (i)
+ int i;
#endif
{
- return yyi;
+ return i;
}
#endif
@@ -343,9 +352,9 @@
/* A type that is properly aligned for any stack member. */
union yyalloc
{
- yytype_int16 yyss_alloc;
- YYSTYPE yyvs_alloc;
-};
+ yytype_int16 yyss;
+ YYSTYPE yyvs;
+ };
/* The size of the maximum gap between one aligned stack and the next. */
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
@@ -379,12 +388,12 @@
elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next
stack. */
-# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
+# define YYSTACK_RELOCATE(Stack) \
do \
{ \
YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
- Stack = &yyptr->Stack_alloc; \
+ YYCOPY (&yyptr->Stack, Stack, yysize); \
+ Stack = &yyptr->Stack; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
@@ -473,9 +482,9 @@
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint8 yyrline[] =
{
- 0, 90, 90, 97, 98, 101, 104, 107, 110, 113,
- 116, 119, 122, 125, 128, 131, 134, 137, 140, 143,
- 156, 169, 172, 175, 178, 181, 184
+ 0, 91, 91, 98, 99, 102, 105, 108, 111, 114,
+ 117, 120, 123, 126, 129, 132, 135, 138, 141, 144,
+ 157, 170, 173, 176, 179, 182, 185
};
#endif
@@ -630,18 +639,9 @@
/* Like YYERROR except do call yyerror. This remains here temporarily
to ease the transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. However,
- YYFAIL appears to be in use. Nevertheless, it is formally deprecated
- in Bison 2.4.2's NEWS entry, where a plan to phase it out is
- discussed. */
+ Once GCC version 2 has supplanted version 1, this can go. */
#define YYFAIL goto yyerrlab
-#if defined YYFAIL
- /* This is here to suppress warnings from the GCC cpp's
- -Wunused-macros. Normally we don't worry about that warning, but
- some users do, and we want to make it easy for users to remove
- YYFAIL uses, which will produce warnings from Bison 2.5. */
-#endif
#define YYRECOVERING() (!!yyerrstatus)
@@ -812,20 +812,17 @@
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
-yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
+yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
#else
static void
-yy_stack_print (yybottom, yytop)
- yytype_int16 *yybottom;
- yytype_int16 *yytop;
+yy_stack_print (bottom, top)
+ yytype_int16 *bottom;
+ yytype_int16 *top;
#endif
{
YYFPRINTF (stderr, "Stack now");
- for (; yybottom <= yytop; yybottom++)
- {
- int yybot = *yybottom;
- YYFPRINTF (stderr, " %d", yybot);
- }
+ for (; bottom <= top; ++bottom)
+ YYFPRINTF (stderr, " %d", *bottom);
YYFPRINTF (stderr, "\n");
}
@@ -860,11 +857,11 @@
/* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++)
{
- YYFPRINTF (stderr, " $%d = ", yyi + 1);
+ fprintf (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
&(yyvsp[(yyi + 1) - (yynrhs)])
, context);
- YYFPRINTF (stderr, "\n");
+ fprintf (stderr, "\n");
}
}
@@ -1146,8 +1143,10 @@
break;
}
}
+
/* Prevent warnings from -Wmissing-prototypes. */
+
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
@@ -1166,10 +1165,11 @@
-/*-------------------------.
-| yyparse or yypush_parse. |
-`-------------------------*/
+/*----------.
+| yyparse. |
+`----------*/
+
#ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
@@ -1192,75 +1192,74 @@
#endif
#endif
{
-/* The lookahead symbol. */
+ /* The look-ahead symbol. */
int yychar;
-/* The semantic value of the lookahead symbol. */
+/* The semantic value of the look-ahead symbol. */
YYSTYPE yylval;
- /* Number of syntax errors so far. */
- int yynerrs;
+/* Number of syntax errors so far. */
+int yynerrs;
- int yystate;
- /* Number of tokens to shift before error messages enabled. */
- int yyerrstatus;
+ int yystate;
+ int yyn;
+ int yyresult;
+ /* Number of tokens to shift before error messages enabled. */
+ int yyerrstatus;
+ /* Look-ahead token as an internal (translated) token number. */
+ int yytoken = 0;
+#if YYERROR_VERBOSE
+ /* Buffer for error messages, and its allocated size. */
+ char yymsgbuf[128];
+ char *yymsg = yymsgbuf;
+ YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
- /* The stacks and their tools:
- `yyss': related to states.
- `yyvs': related to semantic values.
+ /* Three stacks and their tools:
+ `yyss': related to states,
+ `yyvs': related to semantic values,
+ `yyls': related to locations.
- Refer to the stacks thru separate pointers, to allow yyoverflow
- to reallocate them elsewhere. */
+ Refer to the stacks thru separate pointers, to allow yyoverflow
+ to reallocate them elsewhere. */
- /* The state stack. */
- yytype_int16 yyssa[YYINITDEPTH];
- yytype_int16 *yyss;
- yytype_int16 *yyssp;
+ /* The state stack. */
+ yytype_int16 yyssa[YYINITDEPTH];
+ yytype_int16 *yyss = yyssa;
+ yytype_int16 *yyssp;
- /* The semantic value stack. */
- YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs;
- YYSTYPE *yyvsp;
+ /* The semantic value stack. */
+ YYSTYPE yyvsa[YYINITDEPTH];
+ YYSTYPE *yyvs = yyvsa;
+ YYSTYPE *yyvsp;
- YYSIZE_T yystacksize;
- int yyn;
- int yyresult;
- /* Lookahead token as an internal (translated) token number. */
- int yytoken;
+
+#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
+
+ YYSIZE_T yystacksize = YYINITDEPTH;
+
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
-#if YYERROR_VERBOSE
- /* Buffer for error messages, and its allocated size. */
- char yymsgbuf[128];
- char *yymsg = yymsgbuf;
- YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
-#endif
-#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
-
/* The number of symbols on the RHS of the reduced rule.
Keep to zero when no symbol should be popped. */
int yylen = 0;
- yytoken = 0;
- yyss = yyssa;
- yyvs = yyvsa;
- yystacksize = YYINITDEPTH;
-
YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0;
yyerrstatus = 0;
yynerrs = 0;
- yychar = YYEMPTY; /* Cause a token to be read. */
+ yychar = YYEMPTY; /* Cause a token to be read. */
/* 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;
@@ -1290,6 +1289,7 @@
YYSTYPE *yyvs1 = yyvs;
yytype_int16 *yyss1 = yyss;
+
/* Each stack pointer address is followed by the size of the
data in use in that stack, in bytes. This used to be a
conditional around just the two extra args, but that might
@@ -1297,6 +1297,7 @@
yyoverflow (YY_("memory exhausted"),
&yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp),
+
&yystacksize);
yyss = yyss1;
@@ -1319,8 +1320,9 @@
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr)
goto yyexhaustedlab;
- YYSTACK_RELOCATE (yyss_alloc, yyss);
- YYSTACK_RELOCATE (yyvs_alloc, yyvs);
+ YYSTACK_RELOCATE (yyss);
+ YYSTACK_RELOCATE (yyvs);
+
# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
@@ -1331,6 +1333,7 @@
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
+
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
(unsigned long int) yystacksize));
@@ -1340,9 +1343,6 @@
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
- if (yystate == YYFINAL)
- YYACCEPT;
-
goto yybackup;
/*-----------.
@@ -1351,16 +1351,16 @@
yybackup:
/* Do appropriate processing given the current state. Read a
- lookahead token if we need one and don't already have one. */
+ look-ahead token if we need one and don't already have one. */
- /* First try to decide what to do without reference to lookahead token. */
+ /* First try to decide what to do without reference to look-ahead token. */
yyn = yypact[yystate];
if (yyn == YYPACT_NINF)
goto yydefault;
- /* Not known => get a lookahead token if don't already have one. */
+ /* Not known => get a look-ahead token if don't already have one. */
- /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
+ /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
@@ -1392,16 +1392,20 @@
goto yyreduce;
}
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
/* Count tokens shifted since error; after three, turn off error
status. */
if (yyerrstatus)
yyerrstatus--;
- /* Shift the lookahead token. */
+ /* Shift the look-ahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
- /* Discard the shifted token. */
- yychar = YYEMPTY;
+ /* Discard the shifted token unless it is eof. */
+ if (yychar != YYEOF)
+ yychar = YYEMPTY;
yystate = yyn;
*++yyvsp = yylval;
@@ -1445,112 +1449,112 @@
{
*(context->result) = static_cast<int>((yyvsp[(1) - (1)]));
YYACCEPT;
- }
+ ;}
break;
case 4:
{
(yyval) = (yyvsp[(1) - (3)]) || (yyvsp[(3) - (3)]);
- }
+ ;}
break;
case 5:
{
(yyval) = (yyvsp[(1) - (3)]) && (yyvsp[(3) - (3)]);
- }
+ ;}
break;
case 6:
{
(yyval) = (yyvsp[(1) - (3)]) | (yyvsp[(3) - (3)]);
- }
+ ;}
break;
case 7:
{
(yyval) = (yyvsp[(1) - (3)]) ^ (yyvsp[(3) - (3)]);
- }
+ ;}
break;
case 8:
{
(yyval) = (yyvsp[(1) - (3)]) & (yyvsp[(3) - (3)]);
- }
+ ;}
break;
case 9:
{
(yyval) = (yyvsp[(1) - (3)]) != (yyvsp[(3) - (3)]);
- }
+ ;}
break;
case 10:
{
(yyval) = (yyvsp[(1) - (3)]) == (yyvsp[(3) - (3)]);
- }
+ ;}
break;
case 11:
{
(yyval) = (yyvsp[(1) - (3)]) >= (yyvsp[(3) - (3)]);
- }
+ ;}
break;
case 12:
{
(yyval) = (yyvsp[(1) - (3)]) <= (yyvsp[(3) - (3)]);
- }
+ ;}
break;
case 13:
{
(yyval) = (yyvsp[(1) - (3)]) > (yyvsp[(3) - (3)]);
- }
+ ;}
break;
case 14:
{
(yyval) = (yyvsp[(1) - (3)]) < (yyvsp[(3) - (3)]);
- }
+ ;}
break;
case 15:
{
(yyval) = (yyvsp[(1) - (3)]) >> (yyvsp[(3) - (3)]);
- }
+ ;}
break;
case 16:
{
(yyval) = (yyvsp[(1) - (3)]) << (yyvsp[(3) - (3)]);
- }
+ ;}
break;
case 17:
{
(yyval) = (yyvsp[(1) - (3)]) - (yyvsp[(3) - (3)]);
- }
+ ;}
break;
case 18:
{
(yyval) = (yyvsp[(1) - (3)]) + (yyvsp[(3) - (3)]);
- }
+ ;}
break;
case 19:
@@ -1567,7 +1571,7 @@
} else {
(yyval) = (yyvsp[(1) - (3)]) % (yyvsp[(3) - (3)]);
}
- }
+ ;}
break;
case 20:
@@ -1584,52 +1588,53 @@
} else {
(yyval) = (yyvsp[(1) - (3)]) / (yyvsp[(3) - (3)]);
}
- }
+ ;}
break;
case 21:
{
(yyval) = (yyvsp[(1) - (3)]) * (yyvsp[(3) - (3)]);
- }
+ ;}
break;
case 22:
{
(yyval) = ! (yyvsp[(2) - (2)]);
- }
+ ;}
break;
case 23:
{
(yyval) = ~ (yyvsp[(2) - (2)]);
- }
+ ;}
break;
case 24:
{
(yyval) = - (yyvsp[(2) - (2)]);
- }
+ ;}
break;
case 25:
{
(yyval) = + (yyvsp[(2) - (2)]);
- }
+ ;}
break;
case 26:
{
(yyval) = (yyvsp[(2) - (3)]);
- }
+ ;}
break;
+/* Line 1267 of yacc.c. */
default: break;
}
@@ -1641,6 +1646,7 @@
*++yyvsp = yyval;
+
/* Now `shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule
number reduced by. */
@@ -1705,7 +1711,7 @@
if (yyerrstatus == 3)
{
- /* If just tried and failed to reuse lookahead token after an
+ /* If just tried and failed to reuse look-ahead token after an
error, discard it. */
if (yychar <= YYEOF)
@@ -1722,7 +1728,7 @@
}
}
- /* Else will try to reuse lookahead token after shifting the error
+ /* Else will try to reuse look-ahead token after shifting the error
token. */
goto yyerrlab1;
@@ -1779,6 +1785,9 @@
YY_STACK_PRINT (yyss, yyssp);
}
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
*++yyvsp = yylval;
@@ -1803,7 +1812,7 @@
yyresult = 1;
goto yyreturn;
-#if !defined(yyoverflow) || YYERROR_VERBOSE
+#ifndef yyoverflow
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
@@ -1814,7 +1823,7 @@
#endif
yyreturn:
- if (yychar != YYEMPTY)
+ if (yychar != YYEOF && yychar != YYEMPTY)
yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval, context);
/* Do not reclaim the symbols of the rule which action triggered