|
|
|
@ -1,23 +1,24 @@ |
|
|
|
|
|
|
|
/* A Bison parser, made by GNU Bison 2.4.1. */ |
|
|
|
/* 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 |
|
|
|
|
|
|
|
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 |
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
|
|
|
it under the terms of the GNU General Public License as published by |
|
|
|
the Free Software Foundation, either version 3 of the License, or |
|
|
|
(at your option) any later version. |
|
|
|
|
|
|
|
the Free Software Foundation; either version 2, or (at your option) |
|
|
|
any later version. |
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, |
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
|
GNU General Public License for more details. |
|
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License |
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
|
|
|
along with this program; if not, write to the Free Software |
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, |
|
|
|
Boston, MA 02110-1301, USA. */ |
|
|
|
|
|
|
|
/* As a special exception, you may create a larger work that contains |
|
|
|
part or all of the Bison parser skeleton and distribute that work |
|
|
|
@ -28,7 +29,7 @@ |
|
|
|
special exception, which will cause the skeleton and the resulting |
|
|
|
Bison output files to be licensed under the GNU General Public |
|
|
|
License without this special exception. |
|
|
|
|
|
|
|
|
|
|
|
This special exception was added by the Free Software Foundation in |
|
|
|
version 2.2 of Bison. */ |
|
|
|
|
|
|
|
@ -46,7 +47,7 @@ |
|
|
|
#define YYBISON 1 |
|
|
|
|
|
|
|
/* Bison version. */ |
|
|
|
#define YYBISON_VERSION "2.4.1" |
|
|
|
#define YYBISON_VERSION "2.3" |
|
|
|
|
|
|
|
/* Skeleton name. */ |
|
|
|
#define YYSKELETON_NAME "yacc.c" |
|
|
|
@ -54,28 +55,55 @@ |
|
|
|
/* Pure parsers. */ |
|
|
|
#define YYPURE 1 |
|
|
|
|
|
|
|
/* Push parsers. */ |
|
|
|
#define YYPUSH 0 |
|
|
|
|
|
|
|
/* Pull parsers. */ |
|
|
|
#define YYPULL 1 |
|
|
|
|
|
|
|
/* Using locations. */ |
|
|
|
#define YYLSP_NEEDED 0 |
|
|
|
|
|
|
|
/* Substitute the variable and function names. */ |
|
|
|
#define yyparse PTparse |
|
|
|
#define yylex PTlex |
|
|
|
#define yyerror PTerror |
|
|
|
#define yylval PTlval |
|
|
|
#define yychar PTchar |
|
|
|
#define yydebug PTdebug |
|
|
|
#define yynerrs PTnerrs |
|
|
|
#define yyparse PTparse |
|
|
|
#define yylex PTlex |
|
|
|
#define yyerror PTerror |
|
|
|
#define yylval PTlval |
|
|
|
#define yychar PTchar |
|
|
|
#define yydebug PTdebug |
|
|
|
#define yynerrs PTnerrs |
|
|
|
|
|
|
|
|
|
|
|
/* Copy the first part of user declarations. */ |
|
|
|
/* Tokens. */ |
|
|
|
#ifndef YYTOKENTYPE |
|
|
|
# define YYTOKENTYPE |
|
|
|
/* Put the tokens into the symbol table, so that GDB and other debuggers |
|
|
|
know about them. */ |
|
|
|
enum yytokentype { |
|
|
|
TOK_NUM = 258, |
|
|
|
TOK_STR = 259, |
|
|
|
TOK_LE = 260, |
|
|
|
TOK_LT = 261, |
|
|
|
TOK_GE = 262, |
|
|
|
TOK_GT = 263, |
|
|
|
TOK_EQ = 264, |
|
|
|
TOK_NE = 265, |
|
|
|
TOK_OR = 266, |
|
|
|
TOK_AND = 267, |
|
|
|
NEG = 268 |
|
|
|
}; |
|
|
|
#endif |
|
|
|
/* Tokens. */ |
|
|
|
#define TOK_NUM 258 |
|
|
|
#define TOK_STR 259 |
|
|
|
#define TOK_LE 260 |
|
|
|
#define TOK_LT 261 |
|
|
|
#define TOK_GE 262 |
|
|
|
#define TOK_GT 263 |
|
|
|
#define TOK_EQ 264 |
|
|
|
#define TOK_NE 265 |
|
|
|
#define TOK_OR 266 |
|
|
|
#define TOK_AND 267 |
|
|
|
#define NEG 268 |
|
|
|
|
|
|
|
|
|
|
|
/* Line 189 of yacc.c */ |
|
|
|
|
|
|
|
|
|
|
|
/* Copy the first part of user declarations. */ |
|
|
|
#line 1 "inpptree-parser.y" |
|
|
|
|
|
|
|
|
|
|
|
@ -84,7 +112,6 @@ |
|
|
|
#include "inpptree-parser.h" |
|
|
|
|
|
|
|
extern int PTlex (YYSTYPE *lvalp, char **line); |
|
|
|
extern int PTparse (char **line, struct INPparseNode **retval, void *ckt); |
|
|
|
|
|
|
|
static void PTerror (char **line, struct INPparseNode **retval, void *ckt, char const *); |
|
|
|
|
|
|
|
@ -95,9 +122,6 @@ |
|
|
|
#define U(x) (void)x |
|
|
|
|
|
|
|
|
|
|
|
/* Line 189 of yacc.c */ |
|
|
|
#line 100 "inpptree-parser.c" |
|
|
|
|
|
|
|
/* Enabling traces. */ |
|
|
|
#ifndef YYDEBUG |
|
|
|
# define YYDEBUG 0 |
|
|
|
@ -116,56 +140,29 @@ |
|
|
|
# define YYTOKEN_TABLE 0 |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/* Tokens. */ |
|
|
|
#ifndef YYTOKENTYPE |
|
|
|
# define YYTOKENTYPE |
|
|
|
/* Put the tokens into the symbol table, so that GDB and other debuggers |
|
|
|
know about them. */ |
|
|
|
enum yytokentype { |
|
|
|
TOK_NUM = 258, |
|
|
|
TOK_STR = 259, |
|
|
|
TOK_LE = 260, |
|
|
|
TOK_LT = 261, |
|
|
|
TOK_GE = 262, |
|
|
|
TOK_GT = 263, |
|
|
|
TOK_EQ = 264, |
|
|
|
TOK_NE = 265, |
|
|
|
TOK_OR = 266, |
|
|
|
TOK_AND = 267, |
|
|
|
NEG = 268 |
|
|
|
}; |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED |
|
|
|
typedef union YYSTYPE |
|
|
|
#line 31 "inpptree-parser.y" |
|
|
|
{ |
|
|
|
|
|
|
|
/* Line 222 of yacc.c */ |
|
|
|
#line 32 "inpptree-parser.y" |
|
|
|
|
|
|
|
double num; |
|
|
|
const char *str; |
|
|
|
struct INPparseNode *pnode; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Line 222 of yacc.c */ |
|
|
|
#line 157 "inpptree-parser.c" |
|
|
|
} YYSTYPE; |
|
|
|
# define YYSTYPE_IS_TRIVIAL 1 |
|
|
|
} |
|
|
|
/* Line 187 of yacc.c. */ |
|
|
|
#line 153 "inpptree-parser.c" |
|
|
|
YYSTYPE; |
|
|
|
# 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 264 of yacc.c */ |
|
|
|
#line 169 "inpptree-parser.c" |
|
|
|
/* Line 216 of yacc.c. */ |
|
|
|
#line 166 "inpptree-parser.c" |
|
|
|
|
|
|
|
#ifdef short |
|
|
|
# undef short |
|
|
|
@ -240,14 +237,14 @@ typedef short int yytype_int16; |
|
|
|
#if (defined __STDC__ || defined __C99__FUNC__ \ |
|
|
|
|| defined __cplusplus || defined _MSC_VER) |
|
|
|
static int |
|
|
|
YYID (int yyi) |
|
|
|
YYID (int i) |
|
|
|
#else |
|
|
|
static int |
|
|
|
YYID (yyi) |
|
|
|
int yyi; |
|
|
|
YYID (i) |
|
|
|
int i; |
|
|
|
#endif |
|
|
|
{ |
|
|
|
return yyi; |
|
|
|
return i; |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
@ -328,9 +325,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ |
|
|
|
/* A type that is properly aligned for any stack member. */ |
|
|
|
union yyalloc |
|
|
|
{ |
|
|
|
yytype_int16 yyss_alloc; |
|
|
|
YYSTYPE yyvs_alloc; |
|
|
|
}; |
|
|
|
yytype_int16 yyss; |
|
|
|
YYSTYPE yyvs; |
|
|
|
}; |
|
|
|
|
|
|
|
/* The size of the maximum gap between one aligned stack and the next. */ |
|
|
|
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
|
|
|
@ -364,12 +361,12 @@ union yyalloc |
|
|
|
elements in the stack, and YYPTR gives the new location of the |
|
|
|
stack. Advance YYPTR to a properly aligned location for the next |
|
|
|
stack. */ |
|
|
|
# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ |
|
|
|
# define YYSTACK_RELOCATE(Stack) \ |
|
|
|
do \ |
|
|
|
{ \ |
|
|
|
YYSIZE_T yynewbytes; \ |
|
|
|
YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ |
|
|
|
Stack = &yyptr->Stack_alloc; \ |
|
|
|
YYCOPY (&yyptr->Stack, Stack, yysize); \ |
|
|
|
Stack = &yyptr->Stack; \ |
|
|
|
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ |
|
|
|
yyptr += yynewbytes / sizeof (*yyptr); \ |
|
|
|
} \ |
|
|
|
@ -457,9 +454,9 @@ static const yytype_int8 yyrhs[] = |
|
|
|
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ |
|
|
|
static const yytype_uint8 yyrline[] = |
|
|
|
{ |
|
|
|
0, 60, 60, 64, 65, 67, 68, 69, 70, 71, |
|
|
|
73, 75, 77, 79, 84, 85, 86, 87, 88, 89, |
|
|
|
91, 95, 99, 104, 105 |
|
|
|
0, 59, 59, 63, 64, 66, 67, 68, 69, 70, |
|
|
|
72, 74, 76, 78, 83, 84, 85, 86, 87, 88, |
|
|
|
90, 94, 98, 103, 104 |
|
|
|
}; |
|
|
|
#endif |
|
|
|
|
|
|
|
@ -781,20 +778,17 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, line, retval, ckt) |
|
|
|
#if (defined __STDC__ || defined __C99__FUNC__ \ |
|
|
|
|| defined __cplusplus || defined _MSC_VER) |
|
|
|
static void |
|
|
|
yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) |
|
|
|
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) |
|
|
|
#else |
|
|
|
static void |
|
|
|
yy_stack_print (yybottom, yytop) |
|
|
|
yytype_int16 *yybottom; |
|
|
|
yytype_int16 *yytop; |
|
|
|
yy_stack_print (bottom, top) |
|
|
|
yytype_int16 *bottom; |
|
|
|
yytype_int16 *top; |
|
|
|
#endif |
|
|
|
{ |
|
|
|
YYFPRINTF (stderr, "Stack now"); |
|
|
|
for (; yybottom <= yytop; yybottom++) |
|
|
|
{ |
|
|
|
int yybot = *yybottom; |
|
|
|
YYFPRINTF (stderr, " %d", yybot); |
|
|
|
} |
|
|
|
for (; bottom <= top; ++bottom) |
|
|
|
YYFPRINTF (stderr, " %d", *bottom); |
|
|
|
YYFPRINTF (stderr, "\n"); |
|
|
|
} |
|
|
|
|
|
|
|
@ -831,11 +825,11 @@ yy_reduce_print (yyvsp, yyrule, line, retval, ckt) |
|
|
|
/* The symbols being reduced. */ |
|
|
|
for (yyi = 0; yyi < yynrhs; yyi++) |
|
|
|
{ |
|
|
|
YYFPRINTF (stderr, " $%d = ", yyi + 1); |
|
|
|
fprintf (stderr, " $%d = ", yyi + 1); |
|
|
|
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], |
|
|
|
&(yyvsp[(yyi + 1) - (yynrhs)]) |
|
|
|
, line, retval, ckt); |
|
|
|
YYFPRINTF (stderr, "\n"); |
|
|
|
fprintf (stderr, "\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -1121,8 +1115,10 @@ yydestruct (yymsg, yytype, yyvaluep, line, retval, ckt) |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* Prevent warnings from -Wmissing-prototypes. */ |
|
|
|
|
|
|
|
#ifdef YYPARSE_PARAM |
|
|
|
#if defined __STDC__ || defined __cplusplus |
|
|
|
int yyparse (void *YYPARSE_PARAM); |
|
|
|
@ -1141,9 +1137,10 @@ int yyparse (); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------. |
|
|
|
| yyparse or yypush_parse. | |
|
|
|
`-------------------------*/ |
|
|
|
|
|
|
|
/*----------. |
|
|
|
| yyparse. | |
|
|
|
`----------*/ |
|
|
|
|
|
|
|
#ifdef YYPARSE_PARAM |
|
|
|
#if (defined __STDC__ || defined __C99__FUNC__ \ |
|
|
|
@ -1169,46 +1166,22 @@ yyparse (line, retval, ckt) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
{ |
|
|
|
/* The lookahead symbol. */ |
|
|
|
/* The look-ahead symbol. */ |
|
|
|
int yychar; |
|
|
|
|
|
|
|
/* The semantic value of the lookahead symbol. */ |
|
|
|
/* The semantic value of the look-ahead symbol. */ |
|
|
|
YYSTYPE yylval; |
|
|
|
|
|
|
|
/* Number of syntax errors so far. */ |
|
|
|
int yynerrs; |
|
|
|
|
|
|
|
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; |
|
|
|
/* Number of syntax errors so far. */ |
|
|
|
int yynerrs; |
|
|
|
|
|
|
|
int yystate; |
|
|
|
int yyn; |
|
|
|
int yyresult; |
|
|
|
/* 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; |
|
|
|
|
|
|
|
/* Number of tokens to shift before error messages enabled. */ |
|
|
|
int yyerrstatus; |
|
|
|
/* Look-ahead token as an internal (translated) token number. */ |
|
|
|
int yytoken = 0; |
|
|
|
#if YYERROR_VERBOSE |
|
|
|
/* Buffer for error messages, and its allocated size. */ |
|
|
|
char yymsgbuf[128]; |
|
|
|
@ -1216,28 +1189,51 @@ YYSTYPE yylval; |
|
|
|
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; |
|
|
|
|
|
|
|
@ -1267,6 +1263,7 @@ YYSTYPE yylval; |
|
|
|
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 |
|
|
|
@ -1274,6 +1271,7 @@ YYSTYPE yylval; |
|
|
|
yyoverflow (YY_("memory exhausted"), |
|
|
|
&yyss1, yysize * sizeof (*yyssp), |
|
|
|
&yyvs1, yysize * sizeof (*yyvsp), |
|
|
|
|
|
|
|
&yystacksize); |
|
|
|
|
|
|
|
yyss = yyss1; |
|
|
|
@ -1296,8 +1294,9 @@ YYSTYPE yylval; |
|
|
|
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); |
|
|
|
if (! yyptr) |
|
|
|
goto yyexhaustedlab; |
|
|
|
YYSTACK_RELOCATE (yyss_alloc, yyss); |
|
|
|
YYSTACK_RELOCATE (yyvs_alloc, yyvs); |
|
|
|
YYSTACK_RELOCATE (yyss); |
|
|
|
YYSTACK_RELOCATE (yyvs); |
|
|
|
|
|
|
|
# undef YYSTACK_RELOCATE |
|
|
|
if (yyss1 != yyssa) |
|
|
|
YYSTACK_FREE (yyss1); |
|
|
|
@ -1308,6 +1307,7 @@ YYSTYPE yylval; |
|
|
|
yyssp = yyss + yysize - 1; |
|
|
|
yyvsp = yyvs + yysize - 1; |
|
|
|
|
|
|
|
|
|
|
|
YYDPRINTF ((stderr, "Stack size increased to %lu\n", |
|
|
|
(unsigned long int) yystacksize)); |
|
|
|
|
|
|
|
@ -1317,9 +1317,6 @@ YYSTYPE yylval; |
|
|
|
|
|
|
|
YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
|
|
|
|
|
|
|
if (yystate == YYFINAL) |
|
|
|
YYACCEPT; |
|
|
|
|
|
|
|
goto yybackup; |
|
|
|
|
|
|
|
/*-----------. |
|
|
|
@ -1328,16 +1325,16 @@ YYSTYPE yylval; |
|
|
|
yybackup: |
|
|
|
|
|
|
|
/* Do appropriate processing given the current state. Read a |
|
|
|
lookahead token if we need one and don't already have one. */ |
|
|
|
look-ahead token if we need one and don't already have one. */ |
|
|
|
|
|
|
|
/* First try to decide what to do without reference to lookahead token. */ |
|
|
|
/* First try to decide what to do without reference to look-ahead token. */ |
|
|
|
yyn = yypact[yystate]; |
|
|
|
if (yyn == YYPACT_NINF) |
|
|
|
goto yydefault; |
|
|
|
|
|
|
|
/* Not known => get a lookahead token if don't already have one. */ |
|
|
|
/* Not known => get a look-ahead token if don't already have one. */ |
|
|
|
|
|
|
|
/* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ |
|
|
|
/* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ |
|
|
|
if (yychar == YYEMPTY) |
|
|
|
{ |
|
|
|
YYDPRINTF ((stderr, "Reading a token: ")); |
|
|
|
@ -1369,16 +1366,20 @@ yybackup: |
|
|
|
goto yyreduce; |
|
|
|
} |
|
|
|
|
|
|
|
if (yyn == YYFINAL) |
|
|
|
YYACCEPT; |
|
|
|
|
|
|
|
/* Count tokens shifted since error; after three, turn off error |
|
|
|
status. */ |
|
|
|
if (yyerrstatus) |
|
|
|
yyerrstatus--; |
|
|
|
|
|
|
|
/* Shift the lookahead token. */ |
|
|
|
/* Shift the look-ahead token. */ |
|
|
|
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); |
|
|
|
|
|
|
|
/* Discard the shifted token. */ |
|
|
|
yychar = YYEMPTY; |
|
|
|
/* Discard the shifted token unless it is eof. */ |
|
|
|
if (yychar != YYEOF) |
|
|
|
yychar = YYEMPTY; |
|
|
|
|
|
|
|
yystate = yyn; |
|
|
|
*++yyvsp = yylval; |
|
|
|
@ -1418,86 +1419,62 @@ yyreduce: |
|
|
|
switch (yyn) |
|
|
|
{ |
|
|
|
case 2: |
|
|
|
|
|
|
|
/* Line 1455 of yacc.c */ |
|
|
|
#line 60 "inpptree-parser.y" |
|
|
|
#line 59 "inpptree-parser.y" |
|
|
|
{ *retval = (yyvsp[(1) - (1)].pnode); ;} |
|
|
|
break; |
|
|
|
|
|
|
|
case 3: |
|
|
|
|
|
|
|
/* Line 1455 of yacc.c */ |
|
|
|
#line 64 "inpptree-parser.y" |
|
|
|
#line 63 "inpptree-parser.y" |
|
|
|
{ (yyval.pnode) = mknnode((yyvsp[(1) - (1)].num)); ;} |
|
|
|
break; |
|
|
|
|
|
|
|
case 4: |
|
|
|
|
|
|
|
/* Line 1455 of yacc.c */ |
|
|
|
#line 65 "inpptree-parser.y" |
|
|
|
#line 64 "inpptree-parser.y" |
|
|
|
{ (yyval.pnode) = mksnode((yyvsp[(1) - (1)].str), ckt); ;} |
|
|
|
break; |
|
|
|
|
|
|
|
case 5: |
|
|
|
|
|
|
|
/* Line 1455 of yacc.c */ |
|
|
|
#line 67 "inpptree-parser.y" |
|
|
|
#line 66 "inpptree-parser.y" |
|
|
|
{ (yyval.pnode) = mkbnode("+", (yyvsp[(1) - (3)].pnode), (yyvsp[(3) - (3)].pnode)); ;} |
|
|
|
break; |
|
|
|
|
|
|
|
case 6: |
|
|
|
|
|
|
|
/* Line 1455 of yacc.c */ |
|
|
|
#line 68 "inpptree-parser.y" |
|
|
|
#line 67 "inpptree-parser.y" |
|
|
|
{ (yyval.pnode) = mkbnode("-", (yyvsp[(1) - (3)].pnode), (yyvsp[(3) - (3)].pnode)); ;} |
|
|
|
break; |
|
|
|
|
|
|
|
case 7: |
|
|
|
|
|
|
|
/* Line 1455 of yacc.c */ |
|
|
|
#line 69 "inpptree-parser.y" |
|
|
|
#line 68 "inpptree-parser.y" |
|
|
|
{ (yyval.pnode) = mkbnode("*", (yyvsp[(1) - (3)].pnode), (yyvsp[(3) - (3)].pnode)); ;} |
|
|
|
break; |
|
|
|
|
|
|
|
case 8: |
|
|
|
|
|
|
|
/* Line 1455 of yacc.c */ |
|
|
|
#line 70 "inpptree-parser.y" |
|
|
|
#line 69 "inpptree-parser.y" |
|
|
|
{ (yyval.pnode) = mkbnode("/", (yyvsp[(1) - (3)].pnode), (yyvsp[(3) - (3)].pnode)); ;} |
|
|
|
break; |
|
|
|
|
|
|
|
case 9: |
|
|
|
|
|
|
|
/* Line 1455 of yacc.c */ |
|
|
|
#line 71 "inpptree-parser.y" |
|
|
|
#line 70 "inpptree-parser.y" |
|
|
|
{ (yyval.pnode) = mkbnode("^", (yyvsp[(1) - (3)].pnode), (yyvsp[(3) - (3)].pnode)); ;} |
|
|
|
break; |
|
|
|
|
|
|
|
case 10: |
|
|
|
|
|
|
|
/* Line 1455 of yacc.c */ |
|
|
|
#line 73 "inpptree-parser.y" |
|
|
|
#line 72 "inpptree-parser.y" |
|
|
|
{ (yyval.pnode) = (yyvsp[(2) - (3)].pnode); ;} |
|
|
|
break; |
|
|
|
|
|
|
|
case 11: |
|
|
|
|
|
|
|
/* Line 1455 of yacc.c */ |
|
|
|
#line 75 "inpptree-parser.y" |
|
|
|
#line 74 "inpptree-parser.y" |
|
|
|
{ (yyval.pnode) = mkfnode("-",(yyvsp[(2) - (2)].pnode)); ;} |
|
|
|
break; |
|
|
|
|
|
|
|
case 12: |
|
|
|
|
|
|
|
/* Line 1455 of yacc.c */ |
|
|
|
#line 77 "inpptree-parser.y" |
|
|
|
#line 76 "inpptree-parser.y" |
|
|
|
{ (yyval.pnode) = mkfnode((yyvsp[(1) - (4)].str), (yyvsp[(3) - (4)].pnode)); ;} |
|
|
|
break; |
|
|
|
|
|
|
|
case 13: |
|
|
|
|
|
|
|
/* Line 1455 of yacc.c */ |
|
|
|
#line 79 "inpptree-parser.y" |
|
|
|
#line 78 "inpptree-parser.y" |
|
|
|
{ (yyval.pnode) = mkfnode("ternary_fcn", |
|
|
|
mkbnode(",", |
|
|
|
mkbnode(",", (yyvsp[(1) - (5)].pnode), (yyvsp[(3) - (5)].pnode)), |
|
|
|
@ -1505,51 +1482,37 @@ yyreduce: |
|
|
|
break; |
|
|
|
|
|
|
|
case 14: |
|
|
|
|
|
|
|
/* Line 1455 of yacc.c */ |
|
|
|
#line 84 "inpptree-parser.y" |
|
|
|
#line 83 "inpptree-parser.y" |
|
|
|
{ (yyval.pnode) = mkfnode("eq0", mkbnode("-",(yyvsp[(1) - (3)].pnode),(yyvsp[(3) - (3)].pnode))); ;} |
|
|
|
break; |
|
|
|
|
|
|
|
case 15: |
|
|
|
|
|
|
|
/* Line 1455 of yacc.c */ |
|
|
|
#line 85 "inpptree-parser.y" |
|
|
|
#line 84 "inpptree-parser.y" |
|
|
|
{ (yyval.pnode) = mkfnode("ne0", mkbnode("-",(yyvsp[(1) - (3)].pnode),(yyvsp[(3) - (3)].pnode))); ;} |
|
|
|
break; |
|
|
|
|
|
|
|
case 16: |
|
|
|
|
|
|
|
/* Line 1455 of yacc.c */ |
|
|
|
#line 86 "inpptree-parser.y" |
|
|
|
#line 85 "inpptree-parser.y" |
|
|
|
{ (yyval.pnode) = mkfnode("gt0", mkbnode("-",(yyvsp[(1) - (3)].pnode),(yyvsp[(3) - (3)].pnode))); ;} |
|
|
|
break; |
|
|
|
|
|
|
|
case 17: |
|
|
|
|
|
|
|
/* Line 1455 of yacc.c */ |
|
|
|
#line 87 "inpptree-parser.y" |
|
|
|
#line 86 "inpptree-parser.y" |
|
|
|
{ (yyval.pnode) = mkfnode("lt0", mkbnode("-",(yyvsp[(1) - (3)].pnode),(yyvsp[(3) - (3)].pnode))); ;} |
|
|
|
break; |
|
|
|
|
|
|
|
case 18: |
|
|
|
|
|
|
|
/* Line 1455 of yacc.c */ |
|
|
|
#line 88 "inpptree-parser.y" |
|
|
|
#line 87 "inpptree-parser.y" |
|
|
|
{ (yyval.pnode) = mkfnode("ge0", mkbnode("-",(yyvsp[(1) - (3)].pnode),(yyvsp[(3) - (3)].pnode))); ;} |
|
|
|
break; |
|
|
|
|
|
|
|
case 19: |
|
|
|
|
|
|
|
/* Line 1455 of yacc.c */ |
|
|
|
#line 89 "inpptree-parser.y" |
|
|
|
#line 88 "inpptree-parser.y" |
|
|
|
{ (yyval.pnode) = mkfnode("le0", mkbnode("-",(yyvsp[(1) - (3)].pnode),(yyvsp[(3) - (3)].pnode))); ;} |
|
|
|
break; |
|
|
|
|
|
|
|
case 20: |
|
|
|
|
|
|
|
/* Line 1455 of yacc.c */ |
|
|
|
#line 91 "inpptree-parser.y" |
|
|
|
#line 90 "inpptree-parser.y" |
|
|
|
{ (yyval.pnode) = mkfnode("ne0", |
|
|
|
mkbnode("+", |
|
|
|
mkfnode("ne0", (yyvsp[(1) - (3)].pnode)), |
|
|
|
@ -1557,9 +1520,7 @@ yyreduce: |
|
|
|
break; |
|
|
|
|
|
|
|
case 21: |
|
|
|
|
|
|
|
/* Line 1455 of yacc.c */ |
|
|
|
#line 95 "inpptree-parser.y" |
|
|
|
#line 94 "inpptree-parser.y" |
|
|
|
{ (yyval.pnode) = mkfnode("eq0", |
|
|
|
mkbnode("+", |
|
|
|
mkfnode("eq0", (yyvsp[(1) - (3)].pnode)), |
|
|
|
@ -1567,23 +1528,18 @@ yyreduce: |
|
|
|
break; |
|
|
|
|
|
|
|
case 22: |
|
|
|
|
|
|
|
/* Line 1455 of yacc.c */ |
|
|
|
#line 99 "inpptree-parser.y" |
|
|
|
#line 98 "inpptree-parser.y" |
|
|
|
{ (yyval.pnode) = mkfnode("eq0", (yyvsp[(2) - (2)].pnode)); ;} |
|
|
|
break; |
|
|
|
|
|
|
|
case 24: |
|
|
|
|
|
|
|
/* Line 1455 of yacc.c */ |
|
|
|
#line 105 "inpptree-parser.y" |
|
|
|
#line 104 "inpptree-parser.y" |
|
|
|
{ (yyval.pnode) = mkbnode(",", (yyvsp[(1) - (3)].pnode), (yyvsp[(3) - (3)].pnode)); ;} |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Line 1455 of yacc.c */ |
|
|
|
#line 1587 "inpptree-parser.c" |
|
|
|
/* Line 1267 of yacc.c. */ |
|
|
|
#line 1543 "inpptree-parser.c" |
|
|
|
default: break; |
|
|
|
} |
|
|
|
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); |
|
|
|
@ -1594,6 +1550,7 @@ yyreduce: |
|
|
|
|
|
|
|
*++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. */ |
|
|
|
@ -1658,7 +1615,7 @@ yyerrlab: |
|
|
|
|
|
|
|
if (yyerrstatus == 3) |
|
|
|
{ |
|
|
|
/* If just tried and failed to reuse lookahead token after an |
|
|
|
/* If just tried and failed to reuse look-ahead token after an |
|
|
|
error, discard it. */ |
|
|
|
|
|
|
|
if (yychar <= YYEOF) |
|
|
|
@ -1675,7 +1632,7 @@ yyerrlab: |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/* Else will try to reuse lookahead token after shifting the error |
|
|
|
/* Else will try to reuse look-ahead token after shifting the error |
|
|
|
token. */ |
|
|
|
goto yyerrlab1; |
|
|
|
|
|
|
|
@ -1732,6 +1689,9 @@ yyerrlab1: |
|
|
|
YY_STACK_PRINT (yyss, yyssp); |
|
|
|
} |
|
|
|
|
|
|
|
if (yyn == YYFINAL) |
|
|
|
YYACCEPT; |
|
|
|
|
|
|
|
*++yyvsp = yylval; |
|
|
|
|
|
|
|
|
|
|
|
@ -1756,7 +1716,7 @@ yyabortlab: |
|
|
|
yyresult = 1; |
|
|
|
goto yyreturn; |
|
|
|
|
|
|
|
#if !defined(yyoverflow) || YYERROR_VERBOSE |
|
|
|
#ifndef yyoverflow |
|
|
|
/*-------------------------------------------------. |
|
|
|
| yyexhaustedlab -- memory exhaustion comes here. | |
|
|
|
`-------------------------------------------------*/ |
|
|
|
@ -1767,7 +1727,7 @@ yyexhaustedlab: |
|
|
|
#endif |
|
|
|
|
|
|
|
yyreturn: |
|
|
|
if (yychar != YYEMPTY) |
|
|
|
if (yychar != YYEOF && yychar != YYEMPTY) |
|
|
|
yydestruct ("Cleanup: discarding lookahead", |
|
|
|
yytoken, &yylval, line, retval, ckt); |
|
|
|
/* Do not reclaim the symbols of the rule which action triggered |
|
|
|
@ -1793,9 +1753,7 @@ yyreturn: |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Line 1675 of yacc.c */ |
|
|
|
#line 107 "inpptree-parser.y" |
|
|
|
#line 106 "inpptree-parser.y" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|