- Process C.l with flex 2.5.37.
- Process C.y with bison 2.7.
- Move dynC.tab.h out of public headers.
---
dynC_API/h/dynC.tab.h | 192 ---------
dynC_API/src/dynC.tab.C | 1073 ++++++++++++++++++++++++-----------------------
dynC_API/src/dynC.tab.h | 209 +++++++++
dynC_API/src/lex.dynC.C | 69 ++-
4 files changed, 791 insertions(+), 752 deletions(-)
delete mode 100644 dynC_API/h/dynC.tab.h
create mode 100644 dynC_API/src/dynC.tab.h
diff --git a/dynC_API/h/dynC.tab.h b/dynC_API/h/dynC.tab.h
deleted file mode 100644
index 822b96a1d4cd..000000000000
--- a/dynC_API/h/dynC.tab.h
+++ /dev/null
@@ -1,192 +0,0 @@
-
-/* A Bison parser, made by GNU Bison 2.4.1. */
-
-/* Skeleton interface 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
- 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.
-
- 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/>. */
-
-/* As a special exception, you may create a larger work that contains
- part or all of the Bison parser skeleton and distribute that work
- under terms of your choice, so long as that work isn't itself a
- parser generator using the skeleton or a modified version thereof
- as a parser skeleton. Alternatively, if you modify or redistribute
- the parser skeleton itself, you may (at your option) remove this
- 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. */
-
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- KNOWN_ERROR_TOK = 258,
- IDENTIFIER = 259,
- CONSTANT = 260,
- STRING = 261,
- TYPE = 262,
- NUMBER = 263,
- ERROR = 264,
- EOL = 265,
- SIZEOF = 266,
- D_TRUE = 267,
- D_FALSE = 268,
- PTR_OP = 269,
- INC_OP = 270,
- DEC_OP = 271,
- LEFT_OP = 272,
- RIGHT_OP = 273,
- LEFT_ASSIGN = 274,
- RIGHT_ASSIGN = 275,
- AND_ASSIGN = 276,
- XOR_ASSIGN = 277,
- OR_ASSIGN = 278,
- TYPE_NAME = 279,
- TYPEDEF = 280,
- EXTERN = 281,
- STATIC = 282,
- CHAR = 283,
- SHORT = 284,
- INT = 285,
- LONG = 286,
- SIGNED = 287,
- UNSIGNED = 288,
- FLOAT = 289,
- DOUBLE = 290,
- CONST = 291,
- VOID = 292,
- STRUCT = 293,
- UNION = 294,
- ENUM = 295,
- ELLIPSIS = 296,
- IF = 297,
- LOCAL = 298,
- PARAM = 299,
- GLOBAL = 300,
- FUNC = 301,
- DYNINST = 302,
- INST = 303,
- REGISTER = 304,
- NEWLINE = 305,
- CASE = 306,
- DEFAULT = 307,
- SWITCH = 308,
- RETURN = 309,
- NILL = 310,
- EOF_TOK = 311,
- COMMA = 312,
- AMPERSAND = 313,
- ASTERISK = 314,
- DOT = 315,
- NOT = 316,
- OR = 317,
- AND = 318,
- NOT_EQ = 319,
- EQ = 320,
- GREATER_EQ = 321,
- LESS_EQ = 322,
- COLON = 323,
- SEMI = 324,
- END_BLOCK = 325,
- START_BLOCK = 326,
- DOLLAR = 327,
- BACKTICK = 328,
- ASSIGN = 329,
- SUB_ASSIGN = 330,
- ADD_ASSIGN = 331,
- MOD_ASSIGN = 332,
- DIV_ASSIGN = 333,
- MUL_ASSIGN = 334,
- OR_OP = 335,
- AND_OP = 336,
- NCLOSE = 337,
- NOPEN = 338,
- LOWER_THAN_ELSE = 339,
- ELSE = 340,
- LOWER_THAN_DEREF = 341
- };
-#endif
-
-
-
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
-{
-
-/* Line 1676 of yacc.c */
-#line 66 "../src/C.y"
-
- int ival;
- long lval;
- double dval;
- char *sval;
-
- const char *context;
-
- struct VariableSpec {
- bool isConstant;
- bool isStatic;
- bool isGlobal;
- bool isLocal;
- bool isParam;
- bool isThread;
- bool isMachineState;
- bool isMutateeScope;
-
- const char * type;
- } varSpec;
-
- BPatch_snippet *snippet;
- BPatch_boolExpr *boolExpr;
- BPatch_funcCallExpr *funcCall;
- BPatch_variableExpr *varExpr;
- std::vector<BPatch_snippet *> *snippetList;
- std::vector<std::pair<BPatch_snippet *, const char *> > *snippetStringListPair;
- std::pair<BPatch_snippet *, const char *> *snippetStringPair;
-
-
-
-/* Line 1676 of yacc.c */
-#line 170 "dynC.tab.h"
-} YYSTYPE;
-# define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-#endif
-
-extern YYSTYPE dynClval;
-
-#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
-typedef struct YYLTYPE
-{
- int first_line;
- int first_column;
- int last_line;
- int last_column;
-} YYLTYPE;
-# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
-# define YYLTYPE_IS_DECLARED 1
-# define YYLTYPE_IS_TRIVIAL 1
-#endif
-
-extern YYLTYPE dynClloc;
-
diff --git a/dynC_API/src/dynC.tab.C b/dynC_API/src/dynC.tab.C
index d835c5d4d4d3..9bde446c3747 100644
--- a/dynC_API/src/dynC.tab.C
+++ b/dynC_API/src/dynC.tab.C
@@ -1,10 +1,8 @@
+/* A Bison parser, made by GNU Bison 2.7. */
-/* A Bison parser, made by GNU Bison 2.4.1. */
-
-/* Skeleton implementation for Bison's Yacc-like parsers in C
+/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2012 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
@@ -46,7 +44,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.4.1"
+#define YYBISON_VERSION "2.7"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -60,8 +58,6 @@
/* Pull parsers. */
#define YYPULL 1
-/* Using locations. */
-#define YYLSP_NEEDED 1
/* Substitute the variable and function names. */
#define yyparse dynCparse
@@ -74,8 +70,7 @@
#define yylloc dynClloc
/* Copy the first part of user declarations. */
-
-/* Line 189 of yacc.c */
+/* Line 371 of yacc.c */
#line 1 "../src/C.y"
/*
@@ -140,14 +135,16 @@ extern int line_num;
std::vector<BPatch_snippet *> endSnippets;
+/* Line 371 of yacc.c */
+#line 140 "dynC.tab.c"
-/* Line 189 of yacc.c */
-#line 146 "dynC.tab.c"
-
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
+# ifndef YY_NULL
+# if defined __cplusplus && 201103L <= __cplusplus
+# define YY_NULL nullptr
+# else
+# define YY_NULL 0
+# endif
+# endif
/* Enabling verbose error messages. */
#ifdef YYERROR_VERBOSE
@@ -157,21 +154,20 @@ std::vector<BPatch_snippet *> endSnippets;
# define YYERROR_VERBOSE 0
#endif
-/* Enabling the token table. */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
+/* In a future release of Bison, this section will be replaced
+ by #include "dynC.tab.h". */
+#ifndef YY_DYNC_DYNC_TAB_H_INCLUDED
+# define YY_DYNC_DYNC_TAB_H_INCLUDED
+/* Enabling traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+#if YYDEBUG
+extern int dynCdebug;
#endif
-
/* Tokens. */
#ifndef YYTOKENTYPE
-#undef ERROR
-#undef CHAR
-#undef SHORT
-#undef INT
-#undef LONG
-#undef FLOAT
-
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
@@ -264,12 +260,10 @@ std::vector<BPatch_snippet *> endSnippets;
#endif
-
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
{
-
-/* Line 214 of yacc.c */
+/* Line 387 of yacc.c */
#line 66 "../src/C.y"
int ival;
@@ -301,8 +295,7 @@ typedef union YYSTYPE
std::pair<BPatch_snippet *, const char *> *snippetStringPair;
-
-/* Line 214 of yacc.c */
+/* Line 387 of yacc.c */
#line 300 "dynC.tab.c"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
@@ -323,12 +316,28 @@ typedef struct YYLTYPE
# define YYLTYPE_IS_TRIVIAL 1
#endif
+extern YYSTYPE dynClval;
+extern YYLTYPE dynClloc;
+#ifdef YYPARSE_PARAM
+#if defined __STDC__ || defined __cplusplus
+int dynCparse (void *YYPARSE_PARAM);
+#else
+int dynCparse ();
+#endif
+#else /* ! YYPARSE_PARAM */
+#if defined __STDC__ || defined __cplusplus
+int dynCparse (void);
+#else
+int dynCparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
-/* Copy the second part of user declarations. */
+#endif /* !YY_DYNC_DYNC_TAB_H_INCLUDED */
+/* Copy the second part of user declarations. */
-/* Line 264 of yacc.c */
-#line 325 "dynC.tab.c"
+/* Line 390 of yacc.c */
+#line 341 "dynC.tab.c"
#ifdef short
# undef short
@@ -378,27 +387,27 @@ typedef short int yytype_int16;
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#ifndef YY_
-# if YYENABLE_NLS
+# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
-# define YY_(msgid) dgettext ("bison-runtime", msgid)
+# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
# endif
# endif
# ifndef YY_
-# define YY_(msgid) msgid
+# define YY_(Msgid) Msgid
# endif
#endif
/* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__
-# define YYUSE(e) ((void) (e))
+# define YYUSE(E) ((void) (E))
#else
-# define YYUSE(e) /* empty */
+# define YYUSE(E) /* empty */
#endif
/* Identity function, used to suppress warnings about constant conditions. */
#ifndef lint
-# define YYID(n) (n)
+# define YYID(N) (N)
#else
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
@@ -431,11 +440,12 @@ YYID (yyi)
# 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
+ /* Use EXIT_SUCCESS as a witness for stdlib.h. */
+# ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
# endif
# endif
# endif
@@ -458,24 +468,24 @@ YYID (yyi)
# 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
@@ -506,23 +516,7 @@ union yyalloc
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
+ 2 * YYSTACK_GAP_MAXIMUM)
-/* Copy COUNT objects from FROM to TO. The source and destination do
- 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
+# 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
@@ -542,6 +536,26 @@ union yyalloc
#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. */
#define YYFINAL 45
/* YYLAST -- Last index in YYTABLE. */
@@ -664,7 +678,7 @@ static const yytype_uint16 yyrline[] =
};
#endif
-#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+#if YYDEBUG || YYERROR_VERBOSE || 0
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
@@ -687,7 +701,7 @@ static const char *const yytname[] =
"$accept", "start", "var_declaration", "var_decl_modifiers",
"statement_list", "statement", "block", "func_call", "param_list",
"bool_constant", "bool_expression", "var_modifiers", "variable_expr",
- "constant", "const_list", "arith_expression", "inc_decr_expr", 0
+ "constant", "const_list", "arith_expression", "inc_decr_expr", YY_NULL
};
#endif
@@ -736,8 +750,8 @@ static const yytype_uint8 yyr2[] =
3, 1, 2, 2, 2, 2
};
-/* 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[] =
{
@@ -796,8 +810,7 @@ static const yytype_int8 yypgoto[] =
/* 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 -3
static const yytype_int16 yytable[] =
{
@@ -855,6 +868,12 @@ static const yytype_int16 yytable[] =
0, 0, 0, 0, 0, 0, 21
};
+#define yypact_value_is_default(Yystate) \
+ (!!((Yystate) == (-126)))
+
+#define yytable_value_is_error(Yytable_value) \
+ YYID (0)
+
static const yytype_int16 yycheck[] =
{
21, 25, 20, 57, 57, 8, 7, 6, 57, 8,
@@ -944,30 +963,39 @@ static const yytype_uint8 yystos[] =
/* 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)
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY && yylen == 1) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- yytoken = YYTRANSLATE (yychar); \
- YYPOPSTACK (1); \
- goto yybackup; \
- } \
- else \
- { \
+#define YYBACKUP(Token, Value) \
+do \
+ if (yychar == YYEMPTY) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ YYPOPSTACK (yylen); \
+ yystate = *yyssp; \
+ goto yybackup; \
+ } \
+ else \
+ { \
yyerror (YY_("syntax error: cannot back up")); \
YYERROR; \
} \
while (YYID (0))
-
+/* Error token number */
#define YYTERROR 1
#define YYERRCODE 256
@@ -976,38 +1004,75 @@ while (YYID (0))
If N is 0, then set CURRENT to the empty location which ends
the previous symbol: RHS[0] (always defined). */
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- do \
- if (YYID (N)) \
- { \
- (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
- (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
- (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
- (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
- } \
- else \
- { \
- (Current).first_line = (Current).last_line = \
- YYRHSLOC (Rhs, 0).last_line; \
- (Current).first_column = (Current).last_column = \
- YYRHSLOC (Rhs, 0).last_column; \
- } \
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+ do \
+ if (YYID (N)) \
+ { \
+ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
+ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
+ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
+ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
+ } \
+ else \
+ { \
+ (Current).first_line = (Current).last_line = \
+ YYRHSLOC (Rhs, 0).last_line; \
+ (Current).first_column = (Current).last_column = \
+ YYRHSLOC (Rhs, 0).last_column; \
+ } \
while (YYID (0))
#endif
+#define YYRHSLOC(Rhs, K) ((Rhs)[K])
+
/* 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. */
#ifndef YY_LOCATION_PRINT
-# if 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)
+# 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) \
+ yy_location_print_ (File, &(Loc))
+
# else
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
# endif
@@ -1015,7 +1080,6 @@ while (YYID (0))
/* YYLEX -- calling `yylex' with the right arguments. */
-
#ifdef YYLEX_PARAM
# define YYLEX yylex (YYLEX_PARAM)
#else
@@ -1066,6 +1130,8 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp)
YYLTYPE const * const yylocationp;
#endif
{
+ FILE *yyo = yyoutput;
+ YYUSE (yyo);
if (!yyvaluep)
return;
YYUSE (yylocationp);
@@ -1078,7 +1144,7 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp)
switch (yytype)
{
default:
- break;
+ break;
}
}
@@ -1208,7 +1274,6 @@ int yydebug;
# define YYMAXDEPTH 10000
#endif
-
#if YYERROR_VERBOSE
@@ -1311,115 +1376,145 @@ yytnamerr (char *yyres, const char *yystr)
}
# 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)
-{
- int yyn = yypact[yystate];
+/* 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.
- if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
- return 0;
- else
- {
- 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;
- }
+ 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)
+{
+ YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
+ YYSIZE_T yysize = yysize0;
+ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+ /* Internationalized format string. */
+ const char *yyformat = YY_NULL;
+ /* 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 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];
+ {
+ YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
+ if (! (yysize <= yysize1
+ && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
+ }
+ }
+ }
+ }
- yyf = YY_(yyformat);
- yysize1 = yysize + yystrlen (yyf);
- yysize_overflow |= (yysize1 < yysize);
- 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_
+ }
- 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)
- {
- /* 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;
+ 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. |
@@ -1450,43 +1545,43 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp)
{
default:
- break;
+ break;
}
}
-/* 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 (void);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
+
/* The lookahead symbol. */
int yychar;
+
+#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. */
-YYSTYPE yylval;
+YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
/* Location data for the lookahead symbol. */
-YYLTYPE yylloc;
+YYLTYPE yylloc
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
+ = { 1, 1, 1, 1 }
+# endif
+;
+
/* Number of syntax errors so far. */
int yynerrs;
-
-/*-------------------------.
-| yyparse or yypush_parse. |
-`-------------------------*/
+/*----------.
+| yyparse. |
+`----------*/
#ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \
@@ -1510,8 +1605,6 @@ yyparse ()
#endif
#endif
{
-
-
int yystate;
/* Number of tokens to shift before error messages enabled. */
int yyerrstatus;
@@ -1521,7 +1614,7 @@ yyparse ()
`yyvs': related to semantic values.
`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. */
/* The state stack. */
@@ -1540,14 +1633,14 @@ yyparse ()
YYLTYPE *yylsp;
/* The locations where the error started and ended. */
- YYLTYPE yyerror_range[2];
+ YYLTYPE yyerror_range[3];
YYSIZE_T yystacksize;
int yyn;
int yyresult;
/* Lookahead token as an internal (translated) token number. */
- int yytoken;
+ int yytoken = 0;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
@@ -1566,10 +1659,9 @@ yyparse ()
Keep to zero when no symbol should be popped. */
int yylen = 0;
- yytoken = 0;
- yyss = yyssa;
- yyvs = yyvsa;
- yyls = yylsa;
+ yyssp = yyss = yyssa;
+ yyvsp = yyvs = yyvsa;
+ yylsp = yyls = yylsa;
yystacksize = YYINITDEPTH;
YYDPRINTF ((stderr, "Starting parse\n"));
@@ -1579,23 +1671,8 @@ yyparse ()
yynerrs = 0;
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;
- yylsp = yyls;
-
-#if 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
-
/* User initialization code. */
-
-/* Line 1242 of yacc.c */
+/* Line 1575 of yacc.c */
#line 96 "../src/C.y"
{
#ifdef YYDEBUG
@@ -1604,10 +1681,9 @@ yyparse ()
#endif
#endif
}
-
-/* Line 1242 of yacc.c */
-#line 1603 "dynC.tab.c"
-
+/* Line 1575 of yacc.c */
+#line 1686 "dynC.tab.c"
+ yylsp[0] = yylloc;
goto yysetstate;
/*------------------------------------------------------------.
@@ -1704,7 +1780,7 @@ yybackup:
/* 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 lookahead token if don't already have one. */
@@ -1735,8 +1811,8 @@ yybackup:
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;
}
@@ -1753,7 +1829,9 @@ yybackup:
yychar = YYEMPTY;
yystate = yyn;
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
*++yylsp = yylloc;
goto yynewstate;
@@ -1791,8 +1869,7 @@ yyreduce:
switch (yyn)
{
case 2:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 165 "../src/C.y"
{
oneTimeCount = 0;
@@ -1813,12 +1890,11 @@ yyreduce:
fflush(stdout);
}
YYACCEPT;
- ;}
+ }
break;
case 3:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 188 "../src/C.y"
{
std::string mangledName;
@@ -1838,12 +1914,11 @@ yyreduce:
}
endSnippets.push_back(new BPatch_arithExpr(BPatch_assign, *(yyval.snippet), setSn));
}
- ;}
+ }
break;
case 4:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 208 "../src/C.y"
{
@@ -1861,12 +1936,11 @@ yyreduce:
if((yyvsp[(1) - (4)].varSpec).isStatic || (yyvsp[(1) - (4)].varSpec).isGlobal){
makeOneTimeStatementGbl(*(yyval.snippet));
}
- ;}
+ }
break;
case 5:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 226 "../src/C.y"
{
//IDENTIFIER leaks, but how to fix b/c use of $0?
@@ -1897,12 +1971,11 @@ yyreduce:
}
}
- ;}
+ }
break;
case 6:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 257 "../src/C.y"
{
std::stringstream type;
@@ -1935,12 +2008,11 @@ yyreduce:
assignVect->push_back(assign);
}
(yyval.snippet) = new BPatch_sequence(*assignVect);
- ;}
+ }
break;
case 7:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 290 "../src/C.y"
{
std::vector<BPatch_snippet *> argVect;
@@ -1986,22 +2058,20 @@ yyreduce:
}
(yyval.snippet) = new BPatch_sequence(*assignVect);
- ;}
+ }
break;
case 8:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 338 "../src/C.y"
{
YYSTYPE::VariableSpec rSpec = {false,false,false,false,false,false,false,false,(yyvsp[(1) - (1)].sval)};
(yyval.varSpec) = rSpec;
- ;}
+ }
break;
case 9:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 343 "../src/C.y"
{
if ((yyvsp[(2) - (2)].varSpec).isStatic){
@@ -2011,33 +2081,30 @@ yyreduce:
(yyvsp[(2) - (2)].varSpec).isStatic = true;
}
(yyval.varSpec) = (yyvsp[(2) - (2)].varSpec);
- ;}
+ }
break;
case 10:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 356 "../src/C.y"
{
if(verbose) printf("\n");
(yyval.snippetList) = new BPatch_Vector<BPatch_snippet *>;
(yyval.snippetList)->push_back((yyvsp[(1) - (1)].snippet));
- ;}
+ }
break;
case 11:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 362 "../src/C.y"
{
(yyvsp[(1) - (2)].snippetList)->push_back((yyvsp[(2) - (2)].snippet));
(yyval.snippetList) = (yyvsp[(1) - (2)].snippetList);
- ;}
+ }
break;
case 12:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 367 "../src/C.y"
{
BPatch_sequence *seq = new BPatch_sequence(*(yyvsp[(2) - (3)].snippetList));
@@ -2045,54 +2112,49 @@ yyreduce:
std::vector<BPatch_snippet *> *retVect = new std::vector<BPatch_snippet *>;
retVect->push_back(seq);
(yyval.snippetList) = retVect;
- ;}
+ }
break;
case 13:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 375 "../src/C.y"
{
BPatch_sequence seq = BPatch_sequence(*(yyvsp[(3) - (4)].snippetList));
makeOneTimeStatementGbl(seq);
(yyvsp[(1) - (4)].snippetList)->push_back(&seq);
(yyval.snippetList) = (yyvsp[(1) - (4)].snippetList);
- ;}
+ }
break;
case 14:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 385 "../src/C.y"
{
(yyval.snippet) = new BPatch_nullExpr();
actionTaken = false;
- ;}
+ }
break;
case 15:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 390 "../src/C.y"
{
yyerrorNoTok((yyvsp[(1) - (1)].context));
(yyval.snippet) = new BPatch_nullExpr();
actionTaken = false;
- ;}
+ }
break;
case 16:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 396 "../src/C.y"
{
(yyval.snippet) = (yyvsp[(1) - (2)].snippet);
- ;}
+ }
break;
case 17:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 401 "../src/C.y"
{
if(!actionTaken){
@@ -2102,24 +2164,22 @@ yyreduce:
(yyval.snippet) = (yyvsp[(1) - (2)].snippet);
}
actionTaken = false;
- ;}
+ }
break;
case 18:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 412 "../src/C.y"
{
if(verbose) printf(" if () ");
(yyval.snippet) = new BPatch_ifExpr(*(yyvsp[(3) - (5)].boolExpr), *(yyvsp[(5) - (5)].snippet));
delete (yyvsp[(3) - (5)].boolExpr);
delete (yyvsp[(5) - (5)].snippet);
- ;}
+ }
break;
case 19:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 420 "../src/C.y"
{
if(verbose) printf(" if () else ");
@@ -2127,22 +2187,20 @@ yyreduce:
delete (yyvsp[(3) - (7)].boolExpr);
delete (yyvsp[(5) - (7)].snippet);
delete (yyvsp[(7) - (7)].snippet);
- ;}
+ }
break;
case 21:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 433 "../src/C.y"
{
(yyval.snippet) = new BPatch_sequence(*(yyvsp[(2) - (3)].snippetList));
delete (yyvsp[(2) - (3)].snippetList);
- ;}
+ }
break;
case 22:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 440 "../src/C.y"
{
if(strcmp((yyvsp[(3) - (6)].sval), "break") == 0){
@@ -2156,12 +2214,11 @@ yyreduce:
free(errString);
}
delete (yyvsp[(3) - (6)].sval);
- ;}
+ }
break;
case 23:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 456 "../src/C.y"
{
BPatch_function *func = snippetGen->findFunction((yyvsp[(3) - (6)].sval), *(yyvsp[(5) - (6)].snippetList));
@@ -2171,173 +2228,156 @@ yyreduce:
break;
}
(yyval.snippet) = new BPatch_funcCallExpr(*func, *(yyvsp[(5) - (6)].snippetList));
- ;}
+ }
break;
case 24:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 469 "../src/C.y"
{
//No parameters, return an empty vector
(yyval.snippetList) = new BPatch_Vector<BPatch_snippet *>;
- ;}
+ }
break;
case 25:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 475 "../src/C.y"
{
(yyval.snippetList) = new BPatch_Vector<BPatch_snippet *>;
(yyval.snippetList)->push_back((yyvsp[(1) - (1)].snippet));
- ;}
+ }
break;
case 26:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 481 "../src/C.y"
{
if(verbose) printf(" , ");
(yyvsp[(1) - (3)].snippetList)->push_back((yyvsp[(3) - (3)].snippet));
(yyval.snippetList) = (yyvsp[(1) - (3)].snippetList);
- ;}
+ }
break;
case 27:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 490 "../src/C.y"
{
(yyval.boolExpr) = new BPatch_boolExpr(BPatch_eq, BPatch_constExpr(0), BPatch_constExpr(0));
- ;}
+ }
break;
case 28:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 494 "../src/C.y"
{
(yyval.boolExpr) = new BPatch_boolExpr(BPatch_ne, BPatch_constExpr(0), BPatch_constExpr(0));
- ;}
+ }
break;
case 30:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 502 "../src/C.y"
{
if(verbose) printf(" < ");
(yyval.boolExpr) = new BPatch_boolExpr(BPatch_lt, *(yyvsp[(1) - (3)].snippet), *(yyvsp[(3) - (3)].snippet));
- ;}
+ }
break;
case 31:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 507 "../src/C.y"
{
if(verbose) printf(" > ");
(yyval.boolExpr) = new BPatch_boolExpr(BPatch_gt, *(yyvsp[(1) - (3)].snippet), *(yyvsp[(3) - (3)].snippet));
- ;}
+ }
break;
case 32:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 512 "../src/C.y"
{
if(verbose) printf(" == ");
(yyval.boolExpr) = new BPatch_boolExpr(BPatch_eq, *(yyvsp[(1) - (3)].snippet), *(yyvsp[(3) - (3)].snippet));
- ;}
+ }
break;
case 33:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 517 "../src/C.y"
{
if(verbose) printf(" <= ");
(yyval.boolExpr) = new BPatch_boolExpr(BPatch_le, *(yyvsp[(1) - (3)].snippet), *(yyvsp[(3) - (3)].snippet));
- ;}
+ }
break;
case 34:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 522 "../src/C.y"
{
if(verbose) printf(" >= ");
(yyval.boolExpr) = new BPatch_boolExpr(BPatch_ge, *(yyvsp[(1) - (3)].snippet), *(yyvsp[(3) - (3)].snippet));
- ;}
+ }
break;
case 35:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 527 "../src/C.y"
{
if(verbose) printf(" != ");
(yyval.boolExpr) = new BPatch_boolExpr(BPatch_ne, *(yyvsp[(1) - (3)].snippet), *(yyvsp[(3) - (3)].snippet));
- ;}
+ }
break;
case 36:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 532 "../src/C.y"
{
if(verbose) printf(" AND ");
(yyval.boolExpr) = new BPatch_boolExpr(BPatch_and, *(yyvsp[(1) - (3)].boolExpr), *(yyvsp[(3) - (3)].boolExpr));
- ;}
+ }
break;
case 37:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 537 "../src/C.y"
{ if(verbose) printf(" OR ");
(yyval.boolExpr) = new BPatch_boolExpr(BPatch_or, *(yyvsp[(1) - (3)].boolExpr), *(yyvsp[(3) - (3)].boolExpr));
- ;}
+ }
break;
case 38:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 545 "../src/C.y"
{
YYSTYPE::VariableSpec vSpec = {false,false,false,false,false,false,false,false,""};
vSpec.isGlobal = true;
(yyval.varSpec) = vSpec;
- ;}
+ }
break;
case 39:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 551 "../src/C.y"
{
YYSTYPE::VariableSpec vSpec = {false,false,false,false,false,false,false,false,""};
vSpec.isLocal = true;
(yyval.varSpec) = vSpec;
- ;}
+ }
break;
case 40:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 557 "../src/C.y"
{
YYSTYPE::VariableSpec vSpec = {false,false,false,false,false,false,false,false,""};
vSpec.isParam = true;
(yyval.varSpec) = vSpec;
- ;}
+ }
break;
case 41:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 566 "../src/C.y"
{
(yyval.snippet) = snippetGen->findInstVariable(dynC_API::getMangledStub((yyvsp[(1) - (1)].sval), dynCSnippetName).c_str(), (yyvsp[(1) - (1)].sval));
@@ -2346,12 +2386,11 @@ yyreduce:
yyerror(snippetGen->getError().c_str());
break;
}
- ;}
+ }
break;
case 42:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 575 "../src/C.y"
{
(yyval.snippet) = snippetGen->findAppVariable((yyvsp[(3) - (3)].sval));
@@ -2360,12 +2399,11 @@ yyreduce:
yyerrorNoTokNonUni(snippetGen->getError().c_str());
break;
}
- ;}
+ }
break;
case 43:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 585 "../src/C.y"
{
//disallowed if there is no point specifier
@@ -2390,12 +2428,11 @@ yyreduce:
}
break;
}
- ;}
+ }
break;
case 44:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 611 "../src/C.y"
{
//special case for indexed parameters
@@ -2414,12 +2451,11 @@ yyreduce:
yyerrorNoTokNonUni(snippetGen->getError().c_str());
break;
}
- ;}
+ }
break;
case 45:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 631 "../src/C.y"
{
//array referance
@@ -2430,87 +2466,78 @@ yyreduce:
yyerror(snippetGen->getError().c_str());
break;
}
- ;}
+ }
break;
case 46:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 642 "../src/C.y"
{
(yyval.snippet) = (BPatch_snippet *)(new BPatch_arithExpr(BPatch_deref, *(yyvsp[(2) - (2)].snippet)));
- ;}
+ }
break;
case 47:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 646 "../src/C.y"
{
(yyval.snippet) = (BPatch_snippet *)(new BPatch_arithExpr(BPatch_addr, *(yyvsp[(2) - (2)].snippet)));
- ;}
+ }
break;
case 48:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 653 "../src/C.y"
{
if(verbose) printf(" %d ", (yyvsp[(1) - (1)].ival));
BPatch_snippet * c = new BPatch_constExpr((yyvsp[(1) - (1)].ival));
(yyval.snippetStringPair) = new std::pair<BPatch_snippet *, const char *>(c, "int");
- ;}
+ }
break;
case 49:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 659 "../src/C.y"
{
if(verbose) printf(" %s ", (yyvsp[(1) - (1)].sval));
BPatch_snippet * c = new BPatch_constExpr((yyvsp[(1) - (1)].sval));
(yyval.snippetStringPair) = new std::pair<BPatch_snippet *, const char *>(c, "char *");
- ;}
+ }
break;
case 50:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 668 "../src/C.y"
{
std::vector<std::pair<BPatch_snippet *, const char *> > *cnlist = new std::vector<std::pair<BPatch_snippet *, const char *> >();
cnlist->push_back(*(yyvsp[(1) - (1)].snippetStringPair));
(yyval.snippetStringListPair) = cnlist;
- ;}
+ }
break;
case 51:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 674 "../src/C.y"
{
(yyvsp[(1) - (3)].snippetStringListPair)->push_back(*(yyvsp[(3) - (3)].snippetStringPair));
(yyval.snippetStringListPair) = (yyvsp[(1) - (3)].snippetStringListPair);
- ;}
+ }
break;
case 53:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 680 "../src/C.y"
- {(yyval.snippet) = (yyvsp[(1) - (1)].snippetStringPair)->first;;}
+ {(yyval.snippet) = (yyvsp[(1) - (1)].snippetStringPair)->first;}
break;
case 54:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 681 "../src/C.y"
- {(yyval.snippet) = new BPatch_nullExpr();;}
+ {(yyval.snippet) = new BPatch_nullExpr();}
break;
case 55:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 683 "../src/C.y"
{
(yyval.snippet) = snippetGen->findRegister((yyvsp[(3) - (3)].sval));
@@ -2518,12 +2545,11 @@ yyreduce:
(yyval.snippet) = new BPatch_nullExpr();
yyerror(snippetGen->getError().c_str());
}
-;}
+}
break;
case 56:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 692 "../src/C.y"
{
if(verbose) printf("dyninst`%s ", (yyvsp[(3) - (3)].sval));
@@ -2591,143 +2617,130 @@ yyreduce:
yyerror("Syntax error: unrecognized dyninst call");
(yyval.snippet) = new BPatch_nullExpr();
- ;}
+ }
break;
case 57:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 760 "../src/C.y"
{
if(verbose) printf(" * ");
(yyval.snippet) = new BPatch_arithExpr(BPatch_times, *(yyvsp[(1) - (3)].snippet), *(yyvsp[(3) - (3)].snippet));
actionTaken = true;
- ;}
+ }
break;
case 58:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 766 "../src/C.y"
{
(yyval.snippet) = (yyvsp[(1) - (1)].snippet);
actionTaken = true;
- ;}
+ }
break;
case 59:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 771 "../src/C.y"
{
if(verbose) printf(" = ");
(yyval.snippet) = new BPatch_arithExpr(BPatch_assign, *(yyvsp[(1) - (3)].snippet), *(yyvsp[(3) - (3)].snippet));
actionTaken = true;
- ;}
+ }
break;
case 60:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 777 "../src/C.y"
{
if(verbose) printf(" += ");
(yyval.snippet) = new BPatch_arithExpr(BPatch_assign, *(yyvsp[(1) - (3)].snippet), BPatch_arithExpr(BPatch_plus, *(yyvsp[(1) - (3)].snippet), *(yyvsp[(3) - (3)].snippet)));
actionTaken = true;
- ;}
+ }
break;
case 61:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 783 "../src/C.y"
{
if(verbose) printf(" -= ");
(yyval.snippet) = new BPatch_arithExpr(BPatch_assign, *(yyvsp[(1) - (3)].snippet), BPatch_arithExpr(BPatch_minus, *(yyvsp[(1) - (3)].snippet), *(yyvsp[(3) - (3)].snippet)));
actionTaken = true;
- ;}
+ }
break;
case 62:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 789 "../src/C.y"
{
if(verbose) printf(" *= ");
(yyval.snippet) = new BPatch_arithExpr(BPatch_assign, *(yyvsp[(1) - (3)].snippet), BPatch_arithExpr(BPatch_times, *(yyvsp[(1) - (3)].snippet), *(yyvsp[(3) - (3)].snippet)));
actionTaken = true;
- ;}
+ }
break;
case 63:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 795 "../src/C.y"
{
if(verbose) printf(" /= ");
(yyval.snippet) = new BPatch_arithExpr(BPatch_assign, *(yyvsp[(1) - (3)].snippet), BPatch_arithExpr(BPatch_divide, *(yyvsp[(1) - (3)].snippet), *(yyvsp[(3) - (3)].snippet)));
actionTaken = true;
- ;}
+ }
break;
case 64:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 801 "../src/C.y"
{
if(verbose) printf(" %%= ");
(yyval.snippet) = new BPatch_arithExpr(BPatch_assign, *(yyvsp[(1) - (3)].snippet), BPatch_arithExpr(BPatch_minus, *(yyvsp[(1) - (3)].snippet), BPatch_arithExpr(BPatch_times, BPatch_arithExpr(BPatch_divide, *(yyvsp[(1) - (3)].snippet), *(yyvsp[(3) - (3)].snippet)), *(yyvsp[(3) - (3)].snippet))));
actionTaken = true;
- ;}
+ }
break;
case 65:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 807 "../src/C.y"
{
if(verbose) printf(" / ");
(yyval.snippet) = new BPatch_arithExpr(BPatch_divide, *(yyvsp[(1) - (3)].snippet), *(yyvsp[(3) - (3)].snippet));
actionTaken = true;
- ;}
+ }
break;
case 66:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 813 "../src/C.y"
{
if(verbose) printf(" %% ");
(yyval.snippet) = new BPatch_arithExpr(BPatch_minus, *(yyvsp[(1) - (3)].snippet), BPatch_arithExpr(BPatch_times, BPatch_arithExpr(BPatch_divide, *(yyvsp[(1) - (3)].snippet), *(yyvsp[(3) - (3)].snippet)), *(yyvsp[(3) - (3)].snippet)));
actionTaken = true;
- ;}
+ }
break;
case 67:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 819 "../src/C.y"
{
if(verbose) printf(" + ");
(yyval.snippet) = new BPatch_arithExpr(BPatch_plus, *(yyvsp[(1) - (3)].snippet), *(yyvsp[(3) - (3)].snippet));
actionTaken = true;
- ;}
+ }
break;
case 68:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 825 "../src/C.y"
{
if(verbose) printf(" - ");
(yyval.snippet) = new BPatch_arithExpr(BPatch_minus, *(yyvsp[(1) - (3)].snippet), *(yyvsp[(3) - (3)].snippet));
actionTaken = true;
- ;}
+ }
break;
case 69:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 831 "../src/C.y"
{
if(dynamic_cast<BPatch_nullExpr *>((yyvsp[(1) - (3)].snippet))){
@@ -2736,76 +2749,80 @@ yyreduce:
}else{
(yyval.snippet) = (yyvsp[(1) - (3)].snippet);
}
- ;}
+ }
break;
case 70:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 839 "../src/C.y"
- {(yyval.snippet) = (yyvsp[(2) - (3)].snippet);;}
+ {(yyval.snippet) = (yyvsp[(2) - (3)].snippet);}
break;
case 71:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 841 "../src/C.y"
{
(yyval.snippet) = (yyvsp[(1) - (1)].snippet);
actionTaken = true;
- ;}
+ }
break;
case 72:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 850 "../src/C.y"
{
if(verbose) printf(" ++ ");
BPatch_arithExpr addOne = BPatch_arithExpr(BPatch_assign, *(yyvsp[(1) - (2)].snippet), BPatch_arithExpr(BPatch_plus, *(yyvsp[(1) - (2)].snippet), BPatch_constExpr(1)));
(yyval.snippet) = new BPatch_arithExpr(BPatch_seq, (BPatch_snippet &)addOne, BPatch_arithExpr(BPatch_minus, *(yyvsp[(1) - (2)].snippet), BPatch_constExpr(1)));
- ;}
+ }
break;
case 73:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 856 "../src/C.y"
{
if(verbose) printf(" ++ ");
BPatch_arithExpr addOne = BPatch_arithExpr(BPatch_assign, *(yyvsp[(2) - (2)].snippet), BPatch_arithExpr(BPatch_plus, *(yyvsp[(2) - (2)].snippet), BPatch_constExpr(1)));
(yyval.snippet) = new BPatch_arithExpr(BPatch_seq, (BPatch_snippet &)addOne, *(yyvsp[(2) - (2)].snippet));
- ;}
+ }
break;
case 74:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 862 "../src/C.y"
{
if(verbose) printf(" -- ");
BPatch_arithExpr subOne = BPatch_arithExpr(BPatch_assign, *(yyvsp[(1) - (2)].snippet), BPatch_arithExpr(BPatch_minus, *(yyvsp[(1) - (2)].snippet), BPatch_constExpr(1)));
(yyval.snippet) = new BPatch_arithExpr(BPatch_seq, (BPatch_snippet &)subOne, BPatch_arithExpr(BPatch_plus, *(yyvsp[(1) - (2)].snippet), BPatch_constExpr(1)));
- ;}
+ }
break;
case 75:
-
-/* Line 1455 of yacc.c */
+/* Line 1792 of yacc.c */
#line 868 "../src/C.y"
{
if(verbose) printf(" -- ");
BPatch_arithExpr subOne = BPatch_arithExpr(BPatch_assign, *(yyvsp[(2) - (2)].snippet), BPatch_arithExpr(BPatch_minus, *(yyvsp[(2) - (2)].snippet), BPatch_constExpr(1)));
(yyval.snippet) = new BPatch_arithExpr(BPatch_seq, (BPatch_snippet &)subOne, *(yyvsp[(2) - (2)].snippet));
- ;}
+ }
break;
-
-/* Line 1455 of yacc.c */
-#line 2800 "dynC.tab.c"
+/* Line 1792 of yacc.c */
+#line 2813 "dynC.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);
@@ -2834,6 +2851,10 @@ yyreduce:
| 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)
{
@@ -2841,41 +2862,40 @@ yyerrlab:
#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
}
- yyerror_range[0] = yylloc;
+ yyerror_range[1] = yylloc;
if (yyerrstatus == 3)
{
@@ -2912,7 +2932,7 @@ yyerrorlab:
if (/*CONSTCOND*/ 0)
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
this YYERROR. */
YYPOPSTACK (yylen);
@@ -2931,7 +2951,7 @@ yyerrlab1:
for (;;)
{
yyn = yypact[yystate];
- if (yyn != YYPACT_NINF)
+ if (!yypact_value_is_default (yyn))
{
yyn += YYTERROR;
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
@@ -2946,7 +2966,7 @@ yyerrlab1:
if (yyssp == yyss)
YYABORT;
- yyerror_range[0] = *yylsp;
+ yyerror_range[1] = *yylsp;
yydestruct ("Error: popping",
yystos[yystate], yyvsp, yylsp);
YYPOPSTACK (1);
@@ -2954,12 +2974,14 @@ yyerrlab1:
YY_STACK_PRINT (yyss, yyssp);
}
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++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
the lookahead. YYLOC is available though. */
- YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
+ YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
*++yylsp = yyloc;
/* Shift the error token. */
@@ -2983,7 +3005,7 @@ yyabortlab:
yyresult = 1;
goto yyreturn;
-#if !defined(yyoverflow) || YYERROR_VERBOSE
+#if !defined yyoverflow || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
@@ -2995,8 +3017,13 @@ yyexhaustedlab:
yyreturn:
if (yychar != YYEMPTY)
- yydestruct ("Cleanup: discarding lookahead",
- yytoken, &yylval, &yylloc);
+ {
+ /* 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, &yylloc);
+ }
/* Do not reclaim the symbols of the rule which action triggered
this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen);
@@ -3020,8 +3047,7 @@ yyreturn:
}
-
-/* Line 1675 of yacc.c */
+/* Line 2055 of yacc.c */
#line 875 "../src/C.y"
@@ -3118,4 +3144,3 @@ void makeOneTimeStatementGbl(BPatch_snippet &statement){
BPatch_ifExpr *testFirst = new BPatch_ifExpr(BPatch_boolExpr(BPatch_eq, *var, BPatch_constExpr(0)), *pair);
statement = *testFirst;
}
-
diff --git a/dynC_API/src/dynC.tab.h b/dynC_API/src/dynC.tab.h
new file mode 100644
index 000000000000..78ae563a9560
--- /dev/null
+++ b/dynC_API/src/dynC.tab.h
@@ -0,0 +1,209 @@
+/* A Bison parser, made by GNU Bison 2.7. */
+
+/* Bison interface for Yacc-like parsers in C
+
+ Copyright (C) 1984, 1989-1990, 2000-2012 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.
+
+ 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/>. */
+
+/* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ 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. */
+
+#ifndef YY_DYNC_DYNC_TAB_H_INCLUDED
+# define YY_DYNC_DYNC_TAB_H_INCLUDED
+/* Enabling traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+#if YYDEBUG
+extern int dynCdebug;
+#endif
+
+/* Tokens. */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+ /* Put the tokens into the symbol table, so that GDB and other debuggers
+ know about them. */
+ enum yytokentype {
+ KNOWN_ERROR_TOK = 258,
+ IDENTIFIER = 259,
+ CONSTANT = 260,
+ STRING = 261,
+ TYPE = 262,
+ NUMBER = 263,
+ ERROR = 264,
+ EOL = 265,
+ SIZEOF = 266,
+ D_TRUE = 267,
+ D_FALSE = 268,
+ PTR_OP = 269,
+ INC_OP = 270,
+ DEC_OP = 271,
+ LEFT_OP = 272,
+ RIGHT_OP = 273,
+ LEFT_ASSIGN = 274,
+ RIGHT_ASSIGN = 275,
+ AND_ASSIGN = 276,
+ XOR_ASSIGN = 277,
+ OR_ASSIGN = 278,
+ TYPE_NAME = 279,
+ TYPEDEF = 280,
+ EXTERN = 281,
+ STATIC = 282,
+ CHAR = 283,
+ SHORT = 284,
+ INT = 285,
+ LONG = 286,
+ SIGNED = 287,
+ UNSIGNED = 288,
+ FLOAT = 289,
+ DOUBLE = 290,
+ CONST = 291,
+ VOID = 292,
+ STRUCT = 293,
+ UNION = 294,
+ ENUM = 295,
+ ELLIPSIS = 296,
+ IF = 297,
+ LOCAL = 298,
+ PARAM = 299,
+ GLOBAL = 300,
+ FUNC = 301,
+ DYNINST = 302,
+ INST = 303,
+ REGISTER = 304,
+ NEWLINE = 305,
+ CASE = 306,
+ DEFAULT = 307,
+ SWITCH = 308,
+ RETURN = 309,
+ NILL = 310,
+ EOF_TOK = 311,
+ COMMA = 312,
+ AMPERSAND = 313,
+ ASTERISK = 314,
+ DOT = 315,
+ NOT = 316,
+ OR = 317,
+ AND = 318,
+ NOT_EQ = 319,
+ EQ = 320,
+ GREATER_EQ = 321,
+ LESS_EQ = 322,
+ COLON = 323,
+ SEMI = 324,
+ END_BLOCK = 325,
+ START_BLOCK = 326,
+ DOLLAR = 327,
+ BACKTICK = 328,
+ ASSIGN = 329,
+ SUB_ASSIGN = 330,
+ ADD_ASSIGN = 331,
+ MOD_ASSIGN = 332,
+ DIV_ASSIGN = 333,
+ MUL_ASSIGN = 334,
+ OR_OP = 335,
+ AND_OP = 336,
+ NCLOSE = 337,
+ NOPEN = 338,
+ LOWER_THAN_ELSE = 339,
+ ELSE = 340,
+ LOWER_THAN_DEREF = 341
+ };
+#endif
+
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+{
+/* Line 2058 of yacc.c */
+#line 66 "../src/C.y"
+
+ int ival;
+ long lval;
+ double dval;
+ char *sval;
+
+ const char *context;
+
+ struct VariableSpec {
+ bool isConstant;
+ bool isStatic;
+ bool isGlobal;
+ bool isLocal;
+ bool isParam;
+ bool isThread;
+ bool isMachineState;
+ bool isMutateeScope;
+
+ const char * type;
+ } varSpec;
+
+ BPatch_snippet *snippet;
+ BPatch_boolExpr *boolExpr;
+ BPatch_funcCallExpr *funcCall;
+ BPatch_variableExpr *varExpr;
+ std::vector<BPatch_snippet *> *snippetList;
+ std::vector<std::pair<BPatch_snippet *, const char *> > *snippetStringListPair;
+ std::pair<BPatch_snippet *, const char *> *snippetStringPair;
+
+
+/* Line 2058 of yacc.c */
+#line 174 "dynC.tab.h"
+} YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+#endif
+
+#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
+typedef struct YYLTYPE
+{
+ int first_line;
+ int first_column;
+ int last_line;
+ int last_column;
+} YYLTYPE;
+# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
+# define YYLTYPE_IS_DECLARED 1
+# define YYLTYPE_IS_TRIVIAL 1
+#endif
+
+extern YYSTYPE dynClval;
+extern YYLTYPE dynClloc;
+#ifdef YYPARSE_PARAM
+#if defined __STDC__ || defined __cplusplus
+int dynCparse (void *YYPARSE_PARAM);
+#else
+int dynCparse ();
+#endif
+#else /* ! YYPARSE_PARAM */
+#if defined __STDC__ || defined __cplusplus
+int dynCparse (void);
+#else
+int dynCparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
+
+#endif /* !YY_DYNC_DYNC_TAB_H_INCLUDED */
diff --git a/dynC_API/src/lex.dynC.C b/dynC_API/src/lex.dynC.C
index c976f5175695..09bbd0c2a717 100644
--- a/dynC_API/src/lex.dynC.C
+++ b/dynC_API/src/lex.dynC.C
@@ -27,7 +27,7 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_SUBMINOR_VERSION 37
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
@@ -72,7 +72,6 @@ typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
/* Limits of integral types. */
#ifndef INT8_MIN
@@ -103,6 +102,8 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
+#endif /* ! C99 */
+
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
@@ -171,7 +172,12 @@ typedef unsigned int flex_uint32_t;
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif
-extern int dynCleng;
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
+extern yy_size_t dynCleng;
extern FILE *dynCin, *dynCout;
@@ -188,7 +194,7 @@ extern FILE *dynCin, *dynCout;
*/
#define YY_LESS_LINENO(n) \
do { \
- int yyl;\
+ yy_size_t yyl;\
for ( yyl = n; yyl < dynCleng; ++yyl )\
if ( dynCtext[yyl] == '\n' )\
--dynClineno;\
@@ -210,11 +216,6 @@ extern FILE *dynCin, *dynCout;
#define unput(c) yyunput( c, (yytext_ptr) )
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
@@ -232,7 +233,7 @@ struct yy_buffer_state
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
- int yy_n_chars;
+ yy_size_t yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
@@ -302,8 +303,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
/* yy_hold_char holds the character lost when dynCtext is formed. */
static char yy_hold_char;
-static int yy_n_chars; /* number of characters read into yy_ch_buf */
-int dynCleng;
+static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
+yy_size_t dynCleng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
@@ -331,7 +332,7 @@ static void dynC_init_buffer (YY_BUFFER_STATE b,FILE *file );
YY_BUFFER_STATE dynC_scan_buffer (char *base,yy_size_t size );
YY_BUFFER_STATE dynC_scan_string (yyconst char *yy_str );
-YY_BUFFER_STATE dynC_scan_bytes (yyconst char *bytes,int len );
+YY_BUFFER_STATE dynC_scan_bytes (yyconst char *bytes,yy_size_t len );
void *dynCalloc (yy_size_t );
void *dynCrealloc (void *,yy_size_t );
@@ -363,7 +364,7 @@ void dynCfree (void * );
/* Begin user sect3 */
-#define dynCwrap(n) 1
+#define dynCwrap() 1
#define YY_SKIP_YYWRAP
typedef unsigned char YY_CHAR;
@@ -939,7 +940,7 @@ const bool lexVerbose = false; // set to true for debug mode
//"$"{L}({L}|{D})* { yylval.sval = &dynCtext[1]; return(DYNINST_CALL); }
-#line 943 "lex.dynC.c"
+#line 944 "lex.dynC.c"
#define INITIAL 0
#define comment 1
@@ -980,7 +981,7 @@ FILE *dynCget_out (void );
void dynCset_out (FILE * out_str );
-int dynCget_leng (void );
+yy_size_t dynCget_leng (void );
char *dynCget_text (void );
@@ -1039,7 +1040,7 @@ static int input (void );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
- unsigned n; \
+ size_t n; \
for ( n = 0; n < max_size && \
(c = getc( dynCin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -1127,7 +1128,7 @@ YY_DECL
#line 56 "../src/C.l"
-#line 1131 "lex.dynC.c"
+#line 1132 "lex.dynC.c"
if ( !(yy_init) )
{
@@ -1202,7 +1203,7 @@ yy_find_action:
if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
{
- int yyl;
+ yy_size_t yyl;
for ( yyl = 0; yyl < dynCleng; ++yyl )
if ( dynCtext[yyl] == '\n' )
@@ -1798,7 +1799,7 @@ YY_RULE_SETUP
#line 225 "../src/C.l"
ECHO;
YY_BREAK
-#line 1802 "lex.dynC.c"
+#line 1803 "lex.dynC.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(stringmode):
yyterminate();
@@ -1985,21 +1986,21 @@ static int yy_get_next_buffer (void)
else
{
- int num_to_read =
+ yy_size_t num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */
/* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
int yy_c_buf_p_offset =
(int) ((yy_c_buf_p) - b->yy_ch_buf);
if ( b->yy_is_our_buffer )
{
- int new_size = b->yy_buf_size * 2;
+ yy_size_t new_size = b->yy_buf_size * 2;
if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8;
@@ -2030,7 +2031,7 @@ static int yy_get_next_buffer (void)
/* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
- (yy_n_chars), (size_t) num_to_read );
+ (yy_n_chars), num_to_read );
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
@@ -2126,7 +2127,7 @@ static int yy_get_next_buffer (void)
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 480);
- return yy_is_jam ? 0 : yy_current_state;
+ return yy_is_jam ? 0 : yy_current_state;
}
#ifndef YY_NO_INPUT
@@ -2153,7 +2154,7 @@ static int yy_get_next_buffer (void)
else
{ /* need more input */
- int offset = (yy_c_buf_p) - (yytext_ptr);
+ yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
++(yy_c_buf_p);
switch ( yy_get_next_buffer( ) )
@@ -2319,10 +2320,6 @@ static void dynC_load_buffer_state (void)
dynCfree((void *) b );
}
-#ifndef __cplusplus
-extern int isatty (int );
-#endif /* __cplusplus */
-
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
* such as during a dynCrestart() or at EOF.
@@ -2435,7 +2432,7 @@ void dynCpop_buffer_state (void)
*/
static void dynCensure_buffer_stack (void)
{
- int num_to_alloc;
+ yy_size_t num_to_alloc;
if (!(yy_buffer_stack)) {
@@ -2527,17 +2524,17 @@ YY_BUFFER_STATE dynC_scan_string (yyconst char * yystr )
/** Setup the input buffer state to scan the given bytes. The next call to dynClex() will
* scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
*
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE dynC_scan_bytes (yyconst char * yybytes, int _yybytes_len )
+YY_BUFFER_STATE dynC_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
- int i;
+ yy_size_t i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
@@ -2619,7 +2616,7 @@ FILE *dynCget_out (void)
/** Get the length of the current token.
*
*/
-int dynCget_leng (void)
+yy_size_t dynCget_leng (void)
{
return dynCleng;
}
--
1.9.3
|