Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(38)

Unified Diff: src/cmd/5a/y.tab.c

Issue 11590043: code review 11590043: runtime: cleanup: use ArgsSizeUnknown to mark all functions (Closed)
Patch Set: diff -r 548d6782f20e https://khr%40golang.org@code.google.com/p/go/ Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/cmd/5a/y.tab.h ('k') | src/cmd/5c/sgen.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cmd/5a/y.tab.c
===================================================================
--- a/src/cmd/5a/y.tab.c
+++ b/src/cmd/5a/y.tab.c
@@ -1,24 +1,21 @@
-/* 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, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
+/* A Bison parser, made by GNU Bison 2.5. */
+
+/* Bison implementation for Yacc-like parsers in C
+
+ Copyright (C) 1984, 1989-1990, 2000-2011 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 2, or (at your option)
- any later version.
-
+ the Free Software Foundation, either version 3 of the License, 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, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -29,7 +26,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. */
@@ -47,7 +44,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.3"
+#define YYBISON_VERSION "2.5"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -55,11 +52,51 @@
/* Pure parsers. */
#define YYPURE 0
+/* Push parsers. */
+#define YYPUSH 0
+
+/* Pull parsers. */
+#define YYPULL 1
+
/* Using locations. */
#define YYLSP_NEEDED 0
+/* Copy the first part of user declarations. */
+
+/* Line 268 of yacc.c */
+#line 31 "a.y"
+
+#include <u.h>
+#include <stdio.h> /* if we don't, bison will, and a.h re-#defines getc */
+#include <libc.h>
+#include "a.h"
+#include "../../pkg/runtime/funcdata.h"
+
+
+/* Line 268 of yacc.c */
+#line 80 "y.tab.c"
+
+/* Enabling traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+
+/* Enabling verbose error messages. */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+/* Enabling the token table. */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE 0
+#endif
+
+
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
@@ -169,58 +206,35 @@
-/* Copy the first part of user declarations. */
-#line 31 "a.y"
-
-#include <u.h>
-#include <stdio.h> /* if we don't, bison will, and a.h re-#defines getc */
-#include <libc.h>
-#include "a.h"
-
-
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-
-/* Enabling verbose error messages. */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-/* Enabling the token table. */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
-#endif
-
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
-#line 38 "a.y"
{
+
+/* Line 293 of yacc.c */
+#line 39 "a.y"
+
Sym *sym;
int32 lval;
double dval;
char sval[8];
Gen gen;
-}
-/* Line 193 of yacc.c. */
-#line 211 "y.tab.c"
- YYSTYPE;
+
+
+
+/* Line 293 of yacc.c */
+#line 226 "y.tab.c"
+} 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. */
-#line 224 "y.tab.c"
+/* Line 343 of yacc.c */
+#line 238 "y.tab.c"
#ifdef short
# undef short
@@ -295,14 +309,14 @@
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static int
-YYID (int i)
+YYID (int yyi)
#else
static int
-YYID (i)
- int i;
+YYID (yyi)
+ int yyi;
#endif
{
- return i;
+ return yyi;
}
#endif
@@ -323,11 +337,11 @@
# define alloca _alloca
# else
# 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)
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# ifndef _STDLIB_H
-# define _STDLIB_H 1
+# ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
# endif
# endif
# endif
@@ -350,24 +364,24 @@
# ifndef YYSTACK_ALLOC_MAXIMUM
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
# endif
-# if (defined __cplusplus && ! defined _STDLIB_H \
+# if (defined __cplusplus && ! defined EXIT_SUCCESS \
&& ! ((defined YYMALLOC || defined malloc) \
&& (defined YYFREE || defined free)))
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# ifndef _STDLIB_H
-# define _STDLIB_H 1
+# ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
# endif
# endif
# ifndef YYMALLOC
# 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)
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# ifndef YYFREE
# 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)
void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
@@ -383,9 +397,9 @@
/* A type that is properly aligned for any stack member. */
union yyalloc
{
- yytype_int16 yyss;
- YYSTYPE yyvs;
- };
+ yytype_int16 yyss_alloc;
+ YYSTYPE yyvs_alloc;
+};
/* The size of the maximum gap between one aligned stack and the next. */
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
@@ -396,6 +410,27 @@
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
+# define YYCOPY_NEEDED 1
+
+/* Relocate STACK from its old location to the new one. The
+ local variables YYSIZE and YYSTACKSIZE give the old and new number of
+ 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) \
+ do \
+ { \
+ YYSIZE_T yynewbytes; \
+ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
+ Stack = &yyptr->Stack_alloc; \
+ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+ yyptr += yynewbytes / sizeof (*yyptr); \
+ } \
+ while (YYID (0))
+
+#endif
+
+#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
/* Copy COUNT objects from FROM to TO. The source and destination do
not overlap. */
# ifndef YYCOPY
@@ -413,24 +448,7 @@
while (YYID (0))
# endif
# endif
-
-/* Relocate STACK from its old location to the new one. The
- local variables YYSIZE and YYSTACKSIZE give the old and new number of
- 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) \
- do \
- { \
- YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack, Stack, yysize); \
- Stack = &yyptr->Stack; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
- yyptr += yynewbytes / sizeof (*yyptr); \
- } \
- while (YYID (0))
-
-#endif
+#endif /* !YYCOPY_NEEDED */
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 2
@@ -571,20 +589,20 @@
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 67, 67, 69, 68, 76, 75, 83, 82, 88,
- 93, 99, 100, 101, 107, 111, 115, 122, 129, 136,
- 140, 147, 154, 161, 168, 175, 184, 196, 200, 204,
- 211, 218, 222, 226, 239, 246, 253, 260, 264, 268,
- 272, 279, 301, 309, 318, 325, 334, 345, 351, 354,
- 358, 363, 364, 367, 373, 382, 390, 396, 401, 406,
- 412, 415, 421, 429, 433, 442, 448, 449, 450, 451,
- 456, 462, 468, 474, 475, 478, 479, 487, 496, 497,
- 506, 507, 513, 516, 517, 518, 520, 528, 536, 545,
- 551, 557, 563, 571, 577, 585, 586, 590, 598, 599,
- 605, 606, 614, 615, 618, 624, 632, 640, 648, 658,
- 661, 665, 671, 672, 673, 676, 677, 681, 685, 689,
- 693, 699, 702, 708, 709, 713, 717, 721, 725, 729,
- 733, 737, 741, 745
+ 0, 68, 68, 70, 69, 77, 76, 84, 83, 89,
+ 94, 100, 101, 102, 108, 112, 116, 123, 130, 137,
+ 141, 148, 155, 162, 169, 176, 185, 197, 201, 205,
+ 212, 219, 225, 231, 240, 247, 254, 261, 265, 269,
+ 273, 280, 302, 310, 319, 326, 335, 346, 352, 355,
+ 359, 364, 365, 368, 374, 383, 391, 397, 402, 407,
+ 413, 416, 422, 430, 434, 443, 449, 450, 451, 452,
+ 457, 463, 469, 475, 476, 479, 480, 488, 497, 498,
+ 507, 508, 514, 517, 518, 519, 521, 529, 537, 546,
+ 552, 558, 564, 572, 578, 586, 587, 591, 599, 600,
+ 606, 607, 615, 616, 619, 625, 633, 641, 649, 659,
+ 662, 666, 672, 673, 674, 677, 678, 682, 686, 690,
+ 694, 700, 703, 709, 710, 714, 718, 722, 726, 730,
+ 734, 738, 742, 746
};
#endif
@@ -601,11 +619,11 @@
"LSP", "LSB", "LFP", "LPC", "LTYPEX", "LTYPEPC", "LTYPEF", "LR", "LREG",
"LF", "LFREG", "LC", "LCREG", "LPSR", "LFCR", "LCOND", "LS", "LAT",
"LFCONST", "LSCONST", "LNAME", "LLAB", "LVAR", "':'", "'='", "';'",
- "','", "'['", "']'", "'('", "')'", "'$'", "'~'", "$accept", "prog", "@1",
- "line", "@2", "@3", "inst", "cond", "comma", "rel", "ximm", "fcon",
- "reglist", "gen", "nireg", "ireg", "ioreg", "oreg", "imsr", "imm", "reg",
- "regreg", "shift", "rcon", "sreg", "spreg", "creg", "frcon", "freg",
- "name", "offset", "pointer", "con", "oexpr", "expr", 0
+ "','", "'['", "']'", "'('", "')'", "'$'", "'~'", "$accept", "prog",
+ "$@1", "line", "$@2", "$@3", "inst", "cond", "comma", "rel", "ximm",
+ "fcon", "reglist", "gen", "nireg", "ireg", "ioreg", "oreg", "imsr",
+ "imm", "reg", "regreg", "shift", "rcon", "sreg", "spreg", "creg",
+ "frcon", "freg", "name", "offset", "pointer", "con", "oexpr", "expr", 0
};
#endif
@@ -663,8 +681,8 @@
4, 3, 3, 3
};
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
- STATE-NUM when YYTABLE doesn't specify something else to do. Zero
+/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
+ Performed when YYTABLE doesn't specify something else to do. Zero
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
@@ -765,8 +783,7 @@
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
- number is the opposite. If zero, do what YYDEFACT says.
- If YYTABLE_NINF, syntax error. */
+ number is the opposite. If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF -64
static const yytype_int16 yytable[] =
{
@@ -833,6 +850,12 @@
202, 203, 204, 198, 199, 200, 201, 202, 203, 204
};
+#define yypact_value_is_default(yystate) \
+ ((yystate) == (-128))
+
+#define yytable_value_is_error(yytable_value) \
+ YYID (0)
+
static const yytype_int16 yycheck[] =
{
28, 29, 45, 60, 0, 132, 27, 15, 16, 37,
@@ -950,9 +973,18 @@
/* 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. */
+ 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. */
#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)
@@ -962,7 +994,6 @@
{ \
yychar = (Token); \
yylval = (Value); \
- yytoken = YYTRANSLATE (yychar); \
YYPOPSTACK (1); \
goto yybackup; \
} \
@@ -1004,19 +1035,10 @@
#endif
-/* YY_LOCATION_PRINT -- Print the location on the stream.
- This macro was not mandated originally: define only if we know
- we won't break user code: when these are the locations we know. */
+/* This macro is provided for backward compatibility. */
#ifndef YY_LOCATION_PRINT
-# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
-# define YY_LOCATION_PRINT(File, Loc) \
- fprintf (File, "%d.%d-%d.%d", \
- (Loc).first_line, (Loc).first_column, \
- (Loc).last_line, (Loc).last_column)
-# else
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-# endif
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
#endif
@@ -1120,17 +1142,20 @@
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
-yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
+yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
#else
static void
-yy_stack_print (bottom, top)
- yytype_int16 *bottom;
- yytype_int16 *top;
+yy_stack_print (yybottom, yytop)
+ yytype_int16 *yybottom;
+ yytype_int16 *yytop;
#endif
{
YYFPRINTF (stderr, "Stack now");
- for (; bottom <= top; ++bottom)
- YYFPRINTF (stderr, " %d", *bottom);
+ for (; yybottom <= yytop; yybottom++)
+ {
+ int yybot = *yybottom;
+ YYFPRINTF (stderr, " %d", yybot);
+ }
YYFPRINTF (stderr, "\n");
}
@@ -1164,11 +1189,11 @@
/* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++)
{
- fprintf (stderr, " $%d = ", yyi + 1);
+ YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
&(yyvsp[(yyi + 1) - (yynrhs)])
);
- fprintf (stderr, "\n");
+ YYFPRINTF (stderr, "\n");
}
}
@@ -1205,7 +1230,6 @@
# define YYMAXDEPTH 10000
#endif
-
#if YYERROR_VERBOSE
@@ -1308,115 +1332,142 @@
}
# endif
-/* Copy into YYRESULT an error message about the unexpected token
- YYCHAR while in state YYSTATE. Return the number of bytes copied,
- including the terminating null byte. If YYRESULT is null, do not
- 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)
+/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
+ about the unexpected token YYTOKEN for the state stack whose top is
+ YYSSP.
+
+ Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
+ not large enough to hold the message. In that case, also set
+ *YYMSG_ALLOC to the required number of bytes. Return 2 if the
+ required number of bytes is too large to store. */
+static int
+yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
+ yytype_int16 *yyssp, int yytoken)
{
- int yyn = yypact[yystate];
-
- if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
- return 0;
- else
+ YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
+ YYSIZE_T yysize = yysize0;
+ YYSIZE_T yysize1;
+ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+ /* Internationalized format string. */
+ const char *yyformat = 0;
+ /* Arguments of yyformat. */
+ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+ /* Number of reported tokens (one for the "unexpected", one per
+ "expected"). */
+ int yycount = 0;
+
+ /* There are many possibilities here to consider:
+ - Assume YYFAIL is not used. It's too flawed to consider. See
+ <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
+ for details. YYERROR is fine as it does not invoke this
+ function.
+ - If this state is a consistent state with a default action, then
+ the only way this function was invoked is if the default action
+ is an error action. In that case, don't check for expected
+ tokens because there are none.
+ - The only way there can be no lookahead present (in yychar) is if
+ this state is a consistent state with a default action. Thus,
+ detecting the absence of a lookahead is sufficient to determine
+ that there is no unexpected or expected token to report. In that
+ case, just report a simple "syntax error".
+ - Don't assume there isn't a lookahead just because this state is a
+ consistent state with a default action. There might have been a
+ 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 yytype = YYTRANSLATE (yychar);
- YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
- YYSIZE_T yysize = yysize0;
- YYSIZE_T yysize1;
- int yysize_overflow = 0;
- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
- int yyx;
-
-# if 0
- /* This is so xgettext sees the translatable formats that are
- constructed on the fly. */
- YY_("syntax error, unexpected %s");
- YY_("syntax error, unexpected %s, expecting %s");
- YY_("syntax error, unexpected %s, expecting %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
-# endif
- char *yyfmt;
- char const *yyf;
- static char const yyunexpected[] = "syntax error, unexpected %s";
- static char const yyexpecting[] = ", expecting %s";
- static char const yyor[] = " or %s";
- char yyformat[sizeof yyunexpected
- + sizeof yyexpecting - 1
- + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
- * (sizeof yyor - 1))];
- char const *yyprefix = yyexpecting;
-
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
-
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn + 1;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yycount = 1;
-
- yyarg[0] = yytname[yytype];
- yyfmt = yystpcpy (yyformat, yyunexpected);
-
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
- {
- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
- {
- yycount = 1;
- yysize = yysize0;
- yyformat[sizeof yyunexpected - 1] = '\0';
- break;
- }
- yyarg[yycount++] = yytname[yyx];
- yysize1 = yysize + yytnamerr (0, yytname[yyx]);
- yysize_overflow |= (yysize1 < yysize);
- yysize = yysize1;
- yyfmt = yystpcpy (yyfmt, yyprefix);
- yyprefix = yyor;
- }
-
- yyf = YY_(yyformat);
- yysize1 = yysize + yystrlen (yyf);
- yysize_overflow |= (yysize1 < yysize);
- yysize = yysize1;
-
- if (yysize_overflow)
- return YYSIZE_MAXIMUM;
-
- if (yyresult)
- {
- /* Avoid sprintf, as that infringes on the user's name space.
- Don't have undefined behavior even if the translation
- 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)
- {
- yyp += yytnamerr (yyp, yyarg[yyi++]);
- yyf += 2;
- }
- else
- {
- yyp++;
- yyf++;
- }
- }
- }
- return yysize;
+ 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
+ YYCHECK. In other words, skip the first -YYN actions for
+ this state because they are default actions. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = YYLAST - yyn + 1;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yyx;
+
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
+ && !yytable_value_is_error (yytable[yyx + yyn]))
+ {
+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+ {
+ yycount = 1;
+ yysize = yysize0;
+ break;
+ }
+ yyarg[yycount++] = yytname[yyx];
+ yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+ if (! (yysize <= yysize1
+ && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
+ }
+ }
}
+
+ switch (yycount)
+ {
+# define YYCASE_(N, S) \
+ 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_
+ }
+
+ yysize1 = yysize + yystrlen (yyformat);
+ if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
+
+ 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.
+ Don't have undefined behavior even if the translation
+ produced a string with the wrong number of "%s"s. */
+ {
+ char *yyp = *yymsg;
+ int yyi = 0;
+ while ((*yyp = *yyformat) != '\0')
+ if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
+ {
+ yyp += yytnamerr (yyp, yyarg[yyi++]);
+ yyformat += 2;
+ }
+ else
+ {
+ yyp++;
+ yyformat++;
+ }
+ }
+ return 0;
}
#endif /* YYERROR_VERBOSE */
-
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
@@ -1448,10 +1499,9 @@
break;
}
}
-
+
/* Prevent warnings from -Wmissing-prototypes. */
-
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
@@ -1467,18 +1517,16 @@
#endif /* ! YYPARSE_PARAM */
-
-/* The look-ahead symbol. */
+/* The lookahead symbol. */
int yychar;
-/* The semantic value of the look-ahead symbol. */
+/* The semantic value of the lookahead symbol. */
YYSTYPE yylval;
/* Number of syntax errors so far. */
int yynerrs;
-
/*----------.
| yyparse. |
`----------*/
@@ -1505,14 +1553,37 @@
#endif
#endif
{
-
- int yystate;
+ int yystate;
+ /* Number of tokens to shift before error messages enabled. */
+ int yyerrstatus;
+
+ /* The stacks and their tools:
+ `yyss': related to states.
+ `yyvs': related to semantic values.
+
+ 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 semantic value stack. */
+ YYSTYPE yyvsa[YYINITDEPTH];
+ YYSTYPE *yyvs;
+ YYSTYPE *yyvsp;
+
+ YYSIZE_T yystacksize;
+
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;
+ /* Lookahead token as an internal (translated) token number. */
+ int yytoken;
+ /* 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];
@@ -1520,51 +1591,28 @@
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif
- /* 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. */
-
- /* The state stack. */
- yytype_int16 yyssa[YYINITDEPTH];
- yytype_int16 *yyss = yyssa;
- yytype_int16 *yyssp;
-
- /* The semantic value stack. */
- YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs = yyvsa;
- YYSTYPE *yyvsp;
-
-
-
#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;
-
-
/* 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;
@@ -1594,7 +1642,6 @@
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
@@ -1602,7 +1649,6 @@
yyoverflow (YY_("memory exhausted"),
&yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp),
-
&yystacksize);
yyss = yyss1;
@@ -1625,9 +1671,8 @@
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr)
goto yyexhaustedlab;
- YYSTACK_RELOCATE (yyss);
- YYSTACK_RELOCATE (yyvs);
-
+ YYSTACK_RELOCATE (yyss_alloc, yyss);
+ YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
@@ -1638,7 +1683,6 @@
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
-
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
(unsigned long int) yystacksize));
@@ -1648,6 +1692,9 @@
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+ if (yystate == YYFINAL)
+ YYACCEPT;
+
goto yybackup;
/*-----------.
@@ -1656,16 +1703,16 @@
yybackup:
/* Do appropriate processing given the current state. Read a
- look-ahead token if we need one and don't already have one. */
-
- /* First try to decide what to do without reference to look-ahead token. */
+ lookahead token if we need one and don't already have one. */
+
+ /* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
- if (yyn == YYPACT_NINF)
+ if (yypact_value_is_default (yyn))
goto yydefault;
- /* Not known => get a look-ahead token if don't already have one. */
-
- /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
+ /* Not known => get a lookahead token if don't already have one. */
+
+ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
@@ -1691,26 +1738,22 @@
yyn = yytable[yyn];
if (yyn <= 0)
{
- if (yyn == 0 || yyn == YYTABLE_NINF)
- goto yyerrlab;
+ if (yytable_value_is_error (yyn))
+ goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
- if (yyn == YYFINAL)
- YYACCEPT;
-
/* Count tokens shifted since error; after three, turn off error
status. */
if (yyerrstatus)
yyerrstatus--;
- /* Shift the look-ahead token. */
+ /* Shift the lookahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
- /* Discard the shifted token unless it is eof. */
- if (yychar != YYEOF)
- yychar = YYEMPTY;
+ /* Discard the shifted token. */
+ yychar = YYEMPTY;
yystate = yyn;
*++yyvsp = yylval;
@@ -1750,14 +1793,18 @@
switch (yyn)
{
case 3:
-#line 69 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 70 "a.y"
{
stmtline = lineno;
}
break;
case 5:
-#line 76 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 77 "a.y"
{
if((yyvsp[(1) - (2)].sym)->value != pc)
yyerror("redeclaration of %s", (yyvsp[(1) - (2)].sym)->name);
@@ -1766,7 +1813,9 @@
break;
case 7:
-#line 83 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 84 "a.y"
{
(yyvsp[(1) - (2)].sym)->type = LLAB;
(yyvsp[(1) - (2)].sym)->value = pc;
@@ -1774,7 +1823,9 @@
break;
case 9:
-#line 89 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 90 "a.y"
{
(yyvsp[(1) - (4)].sym)->type = LVAR;
(yyvsp[(1) - (4)].sym)->value = (yyvsp[(3) - (4)].lval);
@@ -1782,7 +1833,9 @@
break;
case 10:
-#line 94 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 95 "a.y"
{
if((yyvsp[(1) - (4)].sym)->value != (yyvsp[(3) - (4)].lval))
yyerror("redeclaration of %s", (yyvsp[(1) - (4)].sym)->name);
@@ -1791,84 +1844,108 @@
break;
case 14:
-#line 108 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 109 "a.y"
{
outcode((yyvsp[(1) - (7)].lval), (yyvsp[(2) - (7)].lval), &(yyvsp[(3) - (7)].gen), (yyvsp[(5) - (7)].lval), &(yyvsp[(7) - (7)].gen));
}
break;
case 15:
-#line 112 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 113 "a.y"
{
outcode((yyvsp[(1) - (6)].lval), (yyvsp[(2) - (6)].lval), &(yyvsp[(3) - (6)].gen), (yyvsp[(5) - (6)].lval), &nullgen);
}
break;
case 16:
-#line 116 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 117 "a.y"
{
outcode((yyvsp[(1) - (5)].lval), (yyvsp[(2) - (5)].lval), &(yyvsp[(3) - (5)].gen), NREG, &(yyvsp[(5) - (5)].gen));
}
break;
case 17:
-#line 123 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 124 "a.y"
{
outcode((yyvsp[(1) - (5)].lval), (yyvsp[(2) - (5)].lval), &(yyvsp[(3) - (5)].gen), NREG, &(yyvsp[(5) - (5)].gen));
}
break;
case 18:
-#line 130 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 131 "a.y"
{
outcode((yyvsp[(1) - (5)].lval), (yyvsp[(2) - (5)].lval), &(yyvsp[(3) - (5)].gen), NREG, &(yyvsp[(5) - (5)].gen));
}
break;
case 19:
-#line 137 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 138 "a.y"
{
outcode((yyvsp[(1) - (4)].lval), (yyvsp[(2) - (4)].lval), &nullgen, NREG, &(yyvsp[(4) - (4)].gen));
}
break;
case 20:
-#line 141 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 142 "a.y"
{
outcode((yyvsp[(1) - (4)].lval), (yyvsp[(2) - (4)].lval), &nullgen, NREG, &(yyvsp[(4) - (4)].gen));
}
break;
case 21:
-#line 148 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 149 "a.y"
{
outcode((yyvsp[(1) - (3)].lval), Always, &nullgen, NREG, &(yyvsp[(3) - (3)].gen));
}
break;
case 22:
-#line 155 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 156 "a.y"
{
outcode((yyvsp[(1) - (3)].lval), Always, &nullgen, NREG, &(yyvsp[(3) - (3)].gen));
}
break;
case 23:
-#line 162 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 163 "a.y"
{
outcode((yyvsp[(1) - (4)].lval), (yyvsp[(2) - (4)].lval), &nullgen, NREG, &(yyvsp[(4) - (4)].gen));
}
break;
case 24:
-#line 169 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 170 "a.y"
{
outcode((yyvsp[(1) - (6)].lval), (yyvsp[(2) - (6)].lval), &(yyvsp[(3) - (6)].gen), (yyvsp[(5) - (6)].lval), &nullgen);
}
break;
case 25:
-#line 176 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 177 "a.y"
{
Gen g;
@@ -1880,7 +1957,9 @@
break;
case 26:
-#line 185 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 186 "a.y"
{
Gen g;
@@ -1892,54 +1971,68 @@
break;
case 27:
-#line 197 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 198 "a.y"
{
outcode((yyvsp[(1) - (7)].lval), (yyvsp[(2) - (7)].lval), &(yyvsp[(5) - (7)].gen), (yyvsp[(3) - (7)].gen).reg, &(yyvsp[(7) - (7)].gen));
}
break;
case 28:
-#line 201 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 202 "a.y"
{
outcode((yyvsp[(1) - (6)].lval), (yyvsp[(2) - (6)].lval), &(yyvsp[(5) - (6)].gen), (yyvsp[(3) - (6)].gen).reg, &(yyvsp[(3) - (6)].gen));
}
break;
case 29:
-#line 205 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 206 "a.y"
{
outcode((yyvsp[(1) - (6)].lval), (yyvsp[(2) - (6)].lval), &(yyvsp[(4) - (6)].gen), (yyvsp[(6) - (6)].gen).reg, &(yyvsp[(6) - (6)].gen));
}
break;
case 30:
-#line 212 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 213 "a.y"
{
outcode((yyvsp[(1) - (3)].lval), (yyvsp[(2) - (3)].lval), &nullgen, NREG, &nullgen);
}
break;
case 31:
-#line 219 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 220 "a.y"
{
+ (yyvsp[(4) - (4)].gen).type = D_CONST2;
+ (yyvsp[(4) - (4)].gen).offset2 = ArgsSizeUnknown;
outcode((yyvsp[(1) - (4)].lval), Always, &(yyvsp[(2) - (4)].gen), 0, &(yyvsp[(4) - (4)].gen));
}
break;
case 32:
-#line 223 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 226 "a.y"
{
+ (yyvsp[(6) - (6)].gen).type = D_CONST2;
+ (yyvsp[(6) - (6)].gen).offset2 = ArgsSizeUnknown;
outcode((yyvsp[(1) - (6)].lval), Always, &(yyvsp[(2) - (6)].gen), (yyvsp[(4) - (6)].lval), &(yyvsp[(6) - (6)].gen));
}
break;
case 33:
-#line 227 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 232 "a.y"
{
- // Change explicit 0 argument size to 1
- // so that we can distinguish it from missing.
- if((yyvsp[(8) - (8)].lval) == 0)
- (yyvsp[(8) - (8)].lval) = 1;
(yyvsp[(6) - (8)].gen).type = D_CONST2;
(yyvsp[(6) - (8)].gen).offset2 = (yyvsp[(8) - (8)].lval);
outcode((yyvsp[(1) - (8)].lval), Always, &(yyvsp[(2) - (8)].gen), (yyvsp[(4) - (8)].lval), &(yyvsp[(6) - (8)].gen));
@@ -1947,56 +2040,72 @@
break;
case 34:
-#line 240 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 241 "a.y"
{
outcode((yyvsp[(1) - (6)].lval), Always, &(yyvsp[(2) - (6)].gen), (yyvsp[(4) - (6)].lval), &(yyvsp[(6) - (6)].gen));
}
break;
case 35:
-#line 247 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 248 "a.y"
{
outcode((yyvsp[(1) - (4)].lval), (yyvsp[(2) - (4)].lval), &(yyvsp[(3) - (4)].gen), NREG, &nullgen);
}
break;
case 36:
-#line 254 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 255 "a.y"
{
outcode((yyvsp[(1) - (3)].lval), Always, &nullgen, NREG, &(yyvsp[(3) - (3)].gen));
}
break;
case 37:
-#line 261 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 262 "a.y"
{
outcode((yyvsp[(1) - (5)].lval), (yyvsp[(2) - (5)].lval), &(yyvsp[(3) - (5)].gen), NREG, &(yyvsp[(5) - (5)].gen));
}
break;
case 38:
-#line 265 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 266 "a.y"
{
outcode((yyvsp[(1) - (5)].lval), (yyvsp[(2) - (5)].lval), &(yyvsp[(3) - (5)].gen), NREG, &(yyvsp[(5) - (5)].gen));
}
break;
case 39:
-#line 269 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 270 "a.y"
{
outcode((yyvsp[(1) - (7)].lval), (yyvsp[(2) - (7)].lval), &(yyvsp[(3) - (7)].gen), (yyvsp[(5) - (7)].lval), &(yyvsp[(7) - (7)].gen));
}
break;
case 40:
-#line 273 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 274 "a.y"
{
outcode((yyvsp[(1) - (6)].lval), (yyvsp[(2) - (6)].lval), &(yyvsp[(3) - (6)].gen), (yyvsp[(5) - (6)].gen).reg, &nullgen);
}
break;
case 41:
-#line 280 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 281 "a.y"
{
Gen g;
@@ -2018,14 +2127,18 @@
break;
case 42:
-#line 302 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 303 "a.y"
{
outcode((yyvsp[(1) - (7)].lval), (yyvsp[(2) - (7)].lval), &(yyvsp[(3) - (7)].gen), (yyvsp[(5) - (7)].gen).reg, &(yyvsp[(7) - (7)].gen));
}
break;
case 43:
-#line 310 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 311 "a.y"
{
(yyvsp[(7) - (9)].gen).type = D_REGREG2;
(yyvsp[(7) - (9)].gen).offset = (yyvsp[(9) - (9)].lval);
@@ -2034,14 +2147,18 @@
break;
case 44:
-#line 319 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 320 "a.y"
{
outcode((yyvsp[(1) - (2)].lval), Always, &(yyvsp[(2) - (2)].gen), NREG, &nullgen);
}
break;
case 45:
-#line 326 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 327 "a.y"
{
if((yyvsp[(2) - (4)].gen).type != D_CONST || (yyvsp[(4) - (4)].gen).type != D_CONST)
yyerror("arguments to PCDATA must be integer constants");
@@ -2050,7 +2167,9 @@
break;
case 46:
-#line 335 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 336 "a.y"
{
if((yyvsp[(2) - (4)].gen).type != D_CONST)
yyerror("index for FUNCDATA must be integer constant");
@@ -2061,35 +2180,45 @@
break;
case 47:
-#line 346 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 347 "a.y"
{
outcode((yyvsp[(1) - (2)].lval), Always, &nullgen, NREG, &nullgen);
}
break;
case 48:
-#line 351 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 352 "a.y"
{
(yyval.lval) = Always;
}
break;
case 49:
-#line 355 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 356 "a.y"
{
(yyval.lval) = ((yyvsp[(1) - (2)].lval) & ~C_SCOND) | (yyvsp[(2) - (2)].lval);
}
break;
case 50:
-#line 359 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 360 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (2)].lval) | (yyvsp[(2) - (2)].lval);
}
break;
case 53:
-#line 368 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 369 "a.y"
{
(yyval.gen) = nullgen;
(yyval.gen).type = D_BRANCH;
@@ -2098,7 +2227,9 @@
break;
case 54:
-#line 374 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 375 "a.y"
{
(yyval.gen) = nullgen;
if(pass == 2)
@@ -2110,7 +2241,9 @@
break;
case 55:
-#line 383 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 384 "a.y"
{
(yyval.gen) = nullgen;
(yyval.gen).type = D_BRANCH;
@@ -2120,7 +2253,9 @@
break;
case 56:
-#line 391 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 392 "a.y"
{
(yyval.gen) = nullgen;
(yyval.gen).type = D_CONST;
@@ -2129,7 +2264,9 @@
break;
case 57:
-#line 397 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 398 "a.y"
{
(yyval.gen) = (yyvsp[(2) - (2)].gen);
(yyval.gen).type = D_CONST;
@@ -2137,7 +2274,9 @@
break;
case 58:
-#line 402 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 403 "a.y"
{
(yyval.gen) = (yyvsp[(4) - (4)].gen);
(yyval.gen).type = D_OCONST;
@@ -2145,7 +2284,9 @@
break;
case 59:
-#line 407 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 408 "a.y"
{
(yyval.gen) = nullgen;
(yyval.gen).type = D_SCONST;
@@ -2154,7 +2295,9 @@
break;
case 61:
-#line 416 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 417 "a.y"
{
(yyval.gen) = nullgen;
(yyval.gen).type = D_FCONST;
@@ -2163,7 +2306,9 @@
break;
case 62:
-#line 422 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 423 "a.y"
{
(yyval.gen) = nullgen;
(yyval.gen).type = D_FCONST;
@@ -2172,14 +2317,18 @@
break;
case 63:
-#line 430 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 431 "a.y"
{
(yyval.lval) = 1 << (yyvsp[(1) - (1)].lval);
}
break;
case 64:
-#line 434 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 435 "a.y"
{
int i;
(yyval.lval)=0;
@@ -2191,14 +2340,18 @@
break;
case 65:
-#line 443 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 444 "a.y"
{
(yyval.lval) = (1<<(yyvsp[(1) - (3)].lval)) | (yyvsp[(3) - (3)].lval);
}
break;
case 69:
-#line 452 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 453 "a.y"
{
(yyval.gen) = (yyvsp[(1) - (4)].gen);
(yyval.gen).reg = (yyvsp[(3) - (4)].lval);
@@ -2206,7 +2359,9 @@
break;
case 70:
-#line 457 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 458 "a.y"
{
(yyval.gen) = nullgen;
(yyval.gen).type = D_PSR;
@@ -2215,7 +2370,9 @@
break;
case 71:
-#line 463 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 464 "a.y"
{
(yyval.gen) = nullgen;
(yyval.gen).type = D_FPCR;
@@ -2224,7 +2381,9 @@
break;
case 72:
-#line 469 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 470 "a.y"
{
(yyval.gen) = nullgen;
(yyval.gen).type = D_OREG;
@@ -2233,7 +2392,9 @@
break;
case 76:
-#line 480 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 481 "a.y"
{
(yyval.gen) = (yyvsp[(1) - (1)].gen);
if((yyvsp[(1) - (1)].gen).name != D_EXTERN && (yyvsp[(1) - (1)].gen).name != D_STATIC) {
@@ -2242,7 +2403,9 @@
break;
case 77:
-#line 488 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 489 "a.y"
{
(yyval.gen) = nullgen;
(yyval.gen).type = D_OREG;
@@ -2252,7 +2415,9 @@
break;
case 79:
-#line 498 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 499 "a.y"
{
(yyval.gen) = nullgen;
(yyval.gen).type = D_OREG;
@@ -2262,7 +2427,9 @@
break;
case 81:
-#line 508 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 509 "a.y"
{
(yyval.gen) = (yyvsp[(1) - (4)].gen);
(yyval.gen).type = D_OREG;
@@ -2271,7 +2438,9 @@
break;
case 86:
-#line 521 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 522 "a.y"
{
(yyval.gen) = nullgen;
(yyval.gen).type = D_CONST;
@@ -2280,7 +2449,9 @@
break;
case 87:
-#line 529 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 530 "a.y"
{
(yyval.gen) = nullgen;
(yyval.gen).type = D_REG;
@@ -2289,7 +2460,9 @@
break;
case 88:
-#line 537 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 538 "a.y"
{
(yyval.gen) = nullgen;
(yyval.gen).type = D_REGREG;
@@ -2299,7 +2472,9 @@
break;
case 89:
-#line 546 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 547 "a.y"
{
(yyval.gen) = nullgen;
(yyval.gen).type = D_SHIFT;
@@ -2308,7 +2483,9 @@
break;
case 90:
-#line 552 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 553 "a.y"
{
(yyval.gen) = nullgen;
(yyval.gen).type = D_SHIFT;
@@ -2317,7 +2494,9 @@
break;
case 91:
-#line 558 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 559 "a.y"
{
(yyval.gen) = nullgen;
(yyval.gen).type = D_SHIFT;
@@ -2326,7 +2505,9 @@
break;
case 92:
-#line 564 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 565 "a.y"
{
(yyval.gen) = nullgen;
(yyval.gen).type = D_SHIFT;
@@ -2335,7 +2516,9 @@
break;
case 93:
-#line 572 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 573 "a.y"
{
if((yyval.lval) < 0 || (yyval.lval) >= 16)
print("register value out of range\n");
@@ -2344,7 +2527,9 @@
break;
case 94:
-#line 578 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 579 "a.y"
{
if((yyval.lval) < 0 || (yyval.lval) >= 32)
print("shift value out of range\n");
@@ -2353,14 +2538,18 @@
break;
case 96:
-#line 587 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 588 "a.y"
{
(yyval.lval) = REGPC;
}
break;
case 97:
-#line 591 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 592 "a.y"
{
if((yyvsp[(3) - (4)].lval) < 0 || (yyvsp[(3) - (4)].lval) >= NREG)
print("register value out of range\n");
@@ -2369,14 +2558,18 @@
break;
case 99:
-#line 600 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 601 "a.y"
{
(yyval.lval) = REGSP;
}
break;
case 101:
-#line 607 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 608 "a.y"
{
if((yyvsp[(3) - (4)].lval) < 0 || (yyvsp[(3) - (4)].lval) >= NREG)
print("register value out of range\n");
@@ -2385,7 +2578,9 @@
break;
case 104:
-#line 619 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 620 "a.y"
{
(yyval.gen) = nullgen;
(yyval.gen).type = D_FREG;
@@ -2394,7 +2589,9 @@
break;
case 105:
-#line 625 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 626 "a.y"
{
(yyval.gen) = nullgen;
(yyval.gen).type = D_FREG;
@@ -2403,7 +2600,9 @@
break;
case 106:
-#line 633 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 634 "a.y"
{
(yyval.gen) = nullgen;
(yyval.gen).type = D_OREG;
@@ -2414,7 +2613,9 @@
break;
case 107:
-#line 641 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 642 "a.y"
{
(yyval.gen) = nullgen;
(yyval.gen).type = D_OREG;
@@ -2425,7 +2626,9 @@
break;
case 108:
-#line 649 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 650 "a.y"
{
(yyval.gen) = nullgen;
(yyval.gen).type = D_OREG;
@@ -2436,150 +2639,202 @@
break;
case 109:
-#line 658 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 659 "a.y"
{
(yyval.lval) = 0;
}
break;
case 110:
-#line 662 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 663 "a.y"
{
(yyval.lval) = (yyvsp[(2) - (2)].lval);
}
break;
case 111:
-#line 666 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 667 "a.y"
{
(yyval.lval) = -(yyvsp[(2) - (2)].lval);
}
break;
case 116:
-#line 678 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 679 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (1)].sym)->value;
}
break;
case 117:
-#line 682 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 683 "a.y"
{
(yyval.lval) = -(yyvsp[(2) - (2)].lval);
}
break;
case 118:
-#line 686 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 687 "a.y"
{
(yyval.lval) = (yyvsp[(2) - (2)].lval);
}
break;
case 119:
-#line 690 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 691 "a.y"
{
(yyval.lval) = ~(yyvsp[(2) - (2)].lval);
}
break;
case 120:
-#line 694 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 695 "a.y"
{
(yyval.lval) = (yyvsp[(2) - (3)].lval);
}
break;
case 121:
-#line 699 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 700 "a.y"
{
(yyval.lval) = 0;
}
break;
case 122:
-#line 703 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 704 "a.y"
{
(yyval.lval) = (yyvsp[(2) - (2)].lval);
}
break;
case 124:
-#line 710 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 711 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) + (yyvsp[(3) - (3)].lval);
}
break;
case 125:
-#line 714 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 715 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) - (yyvsp[(3) - (3)].lval);
}
break;
case 126:
-#line 718 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 719 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) * (yyvsp[(3) - (3)].lval);
}
break;
case 127:
-#line 722 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 723 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) / (yyvsp[(3) - (3)].lval);
}
break;
case 128:
-#line 726 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 727 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) % (yyvsp[(3) - (3)].lval);
}
break;
case 129:
-#line 730 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 731 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (4)].lval) << (yyvsp[(4) - (4)].lval);
}
break;
case 130:
-#line 734 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 735 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (4)].lval) >> (yyvsp[(4) - (4)].lval);
}
break;
case 131:
-#line 738 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 739 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) & (yyvsp[(3) - (3)].lval);
}
break;
case 132:
-#line 742 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 743 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) ^ (yyvsp[(3) - (3)].lval);
}
break;
case 133:
-#line 746 "a.y"
+
+/* Line 1806 of yacc.c */
+#line 747 "a.y"
{
(yyval.lval) = (yyvsp[(1) - (3)].lval) | (yyvsp[(3) - (3)].lval);
}
break;
-/* Line 1267 of yacc.c. */
-#line 2581 "y.tab.c"
+
+/* Line 1806 of yacc.c */
+#line 2825 "y.tab.c"
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);
YYPOPSTACK (yylen);
@@ -2588,7 +2843,6 @@
*++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. */
@@ -2608,6 +2862,10 @@
| yyerrlab -- here on detecting error |
`------------------------------------*/
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 (!yyerrstatus)
{
@@ -2615,37 +2873,36 @@
#if ! YYERROR_VERBOSE
yyerror (YY_("syntax error"));
#else
+# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
+ yyssp, yytoken)
{
- YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
- if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
- {
- YYSIZE_T yyalloc = 2 * yysize;
- if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
- yyalloc = YYSTACK_ALLOC_MAXIMUM;
- if (yymsg != yymsgbuf)
- YYSTACK_FREE (yymsg);
- yymsg = (char *) YYSTACK_ALLOC (yyalloc);
- if (yymsg)
- yymsg_alloc = yyalloc;
- else
- {
- yymsg = yymsgbuf;
- yymsg_alloc = sizeof yymsgbuf;
- }
- }
-
- if (0 < yysize && yysize <= yymsg_alloc)
- {
- (void) yysyntax_error (yymsg, yystate, yychar);
- yyerror (yymsg);
- }
- else
- {
- yyerror (YY_("syntax error"));
- if (yysize != 0)
- goto yyexhaustedlab;
- }
+ char const *yymsgp = YY_("syntax error");
+ int yysyntax_error_status;
+ yysyntax_error_status = YYSYNTAX_ERROR;
+ if (yysyntax_error_status == 0)
+ yymsgp = yymsg;
+ else if (yysyntax_error_status == 1)
+ {
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+ yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
+ if (!yymsg)
+ {
+ yymsg = yymsgbuf;
+ yymsg_alloc = sizeof yymsgbuf;
+ yysyntax_error_status = 2;
+ }
+ else
+ {
+ yysyntax_error_status = YYSYNTAX_ERROR;
+ yymsgp = yymsg;
+ }
+ }
+ yyerror (yymsgp);
+ if (yysyntax_error_status == 2)
+ goto yyexhaustedlab;
}
+# undef YYSYNTAX_ERROR
#endif
}
@@ -2653,7 +2910,7 @@
if (yyerrstatus == 3)
{
- /* If just tried and failed to reuse look-ahead token after an
+ /* If just tried and failed to reuse lookahead token after an
error, discard it. */
if (yychar <= YYEOF)
@@ -2670,7 +2927,7 @@
}
}
- /* Else will try to reuse look-ahead token after shifting the error
+ /* Else will try to reuse lookahead token after shifting the error
token. */
goto yyerrlab1;
@@ -2704,7 +2961,7 @@
for (;;)
{
yyn = yypact[yystate];
- if (yyn != YYPACT_NINF)
+ if (!yypact_value_is_default (yyn))
{
yyn += YYTERROR;
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
@@ -2727,9 +2984,6 @@
YY_STACK_PRINT (yyss, yyssp);
}
- if (yyn == YYFINAL)
- YYACCEPT;
-
*++yyvsp = yylval;
@@ -2754,7 +3008,7 @@
yyresult = 1;
goto yyreturn;
-#ifndef yyoverflow
+#if !defined(yyoverflow) || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
@@ -2765,9 +3019,14 @@
#endif
yyreturn:
- if (yychar != YYEOF && yychar != YYEMPTY)
- yydestruct ("Cleanup: discarding lookahead",
- yytoken, &yylval);
+ 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",
+ yytoken, &yylval);
+ }
/* Do not reclaim the symbols of the rule which action triggered
this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen);
« no previous file with comments | « src/cmd/5a/y.tab.h ('k') | src/cmd/5c/sgen.c » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b