Browse Source

update bison generated files

rlar 14 years ago
parent
commit
848b0c2158
  1. 5
      ChangeLog
  2. 227
      src/spicelib/parser/inpptree-parser.c
  3. 16
      src/spicelib/parser/inpptree-parser.h

5
ChangeLog

@ -1,3 +1,8 @@
2012-02-11 Robert Larice
* src/spicelib/parser/inpptree-parser.c ,
* src/spicelib/parser/inpptree-parser.h :
update bison generated files
2012-02-11 Robert Larice 2012-02-11 Robert Larice
* src/spicelib/parser/inpptree-parser.y , * src/spicelib/parser/inpptree-parser.y ,
* src/spicelib/parser/inpptree.c : * src/spicelib/parser/inpptree.c :

227
src/spicelib/parser/inpptree-parser.c

@ -61,7 +61,7 @@
#define YYPULL 1 #define YYPULL 1
/* Using locations. */ /* Using locations. */
#define YYLSP_NEEDED 0
#define YYLSP_NEEDED 1
/* Substitute the variable and function names. */ /* Substitute the variable and function names. */
#define yyparse PTparse #define yyparse PTparse
@ -71,21 +71,43 @@
#define yychar PTchar #define yychar PTchar
#define yydebug PTdebug #define yydebug PTdebug
#define yynerrs PTnerrs #define yynerrs PTnerrs
#define yylloc PTlloc
/* Copy the first part of user declarations. */ /* Copy the first part of user declarations. */
/* Line 189 of yacc.c */ /* Line 189 of yacc.c */
#line 1 "inpptree-parser.y"
#line 1 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
/*
* (compile (concat "bison " buffer-file-name))
*/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
struct PTltype {
char *start, *stop;
};
# define YYLTYPE struct PTltype
# define YYLLOC_DEFAULT(Current, Rhs, N) \
do \
if (N) { \
(Current).start = YYRHSLOC(Rhs, 1).start; \
(Current).stop = YYRHSLOC(Rhs, N).stop; \
} else { \
(Current).start = (Current).stop = YYRHSLOC(Rhs, 0).stop; \
} \
while (0)
#include "inpptree-parser.h" #include "inpptree-parser.h"
extern int PTlex (YYSTYPE *lvalp, char **line);
extern int PTlex (YYSTYPE *lvalp, struct PTltype *llocp, char **line);
extern int PTdebug;
static void PTerror (char **line, struct INPparseNode **retval, void *ckt, char const *);
static void PTerror (YYLTYPE *locp, char **line, struct INPparseNode **retval, void *ckt, char const *);
#if defined (_MSC_VER) #if defined (_MSC_VER)
# define __func__ __FUNCTION__ /* __func__ is C99, but MSC can't */ # define __func__ __FUNCTION__ /* __func__ is C99, but MSC can't */
@ -95,7 +117,7 @@
/* Line 189 of yacc.c */ /* Line 189 of yacc.c */
#line 99 "inpptree-parser.c"
#line 121 "inpptree-parser.c"
/* Enabling traces. */ /* Enabling traces. */
#ifndef YYDEBUG #ifndef YYDEBUG
@ -144,7 +166,7 @@ typedef union YYSTYPE
{ {
/* Line 214 of yacc.c */ /* Line 214 of yacc.c */
#line 31 "inpptree-parser.y"
#line 53 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
double num; double num;
const char *str; const char *str;
@ -153,19 +175,32 @@ typedef union YYSTYPE
/* Line 214 of yacc.c */ /* Line 214 of yacc.c */
#line 157 "inpptree-parser.c"
#line 179 "inpptree-parser.c"
} YYSTYPE; } YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
#endif #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
/* Copy the second part of user declarations. */ /* Copy the second part of user declarations. */
/* Line 264 of yacc.c */ /* Line 264 of yacc.c */
#line 169 "inpptree-parser.c"
#line 204 "inpptree-parser.c"
#ifdef short #ifdef short
# undef short # undef short
@ -323,13 +358,15 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
#if (! defined yyoverflow \ #if (! defined yyoverflow \
&& (! defined __cplusplus \ && (! defined __cplusplus \
|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
|| (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
&& defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */ /* A type that is properly aligned for any stack member. */
union yyalloc union yyalloc
{ {
yytype_int16 yyss_alloc; yytype_int16 yyss_alloc;
YYSTYPE yyvs_alloc; YYSTYPE yyvs_alloc;
YYLTYPE yyls_alloc;
}; };
/* The size of the maximum gap between one aligned stack and the next. */ /* The size of the maximum gap between one aligned stack and the next. */
@ -338,8 +375,8 @@ union yyalloc
/* The size of an array large to enough to hold all stacks, each with /* The size of an array large to enough to hold all stacks, each with
N elements. */ N elements. */
# define YYSTACK_BYTES(N) \ # define YYSTACK_BYTES(N) \
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
+ 2 * YYSTACK_GAP_MAXIMUM)
/* Copy COUNT objects from FROM to TO. The source and destination do /* Copy COUNT objects from FROM to TO. The source and destination do
not overlap. */ not overlap. */
@ -457,9 +494,9 @@ static const yytype_int8 yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint8 yyrline[] = static const yytype_uint8 yyrline[] =
{ {
0, 65, 65, 69, 70, 72, 73, 74, 75, 76,
78, 80, 82, 84, 86, 91, 92, 93, 94, 95,
96, 98, 102, 106, 111, 112
0, 87, 87, 96, 97, 99, 100, 101, 102, 103,
105, 107, 109, 111, 113, 118, 119, 120, 121, 122,
123, 125, 129, 133, 138, 139
}; };
#endif #endif
@ -620,7 +657,7 @@ do \
} \ } \
else \ else \
{ \ { \
yyerror (line, retval, ckt, YY_("syntax error: cannot back up")); \
yyerror (&yylloc, line, retval, ckt, YY_("syntax error: cannot back up")); \
YYERROR; \ YYERROR; \
} \ } \
while (YYID (0)) while (YYID (0))
@ -675,9 +712,9 @@ while (YYID (0))
/* YYLEX -- calling `yylex' with the right arguments. */ /* YYLEX -- calling `yylex' with the right arguments. */
#ifdef YYLEX_PARAM #ifdef YYLEX_PARAM
# define YYLEX yylex (&yylval, YYLEX_PARAM)
# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
#else #else
# define YYLEX yylex (&yylval, line)
# define YYLEX yylex (&yylval, &yylloc, line)
#endif #endif
/* Enable debugging if requested. */ /* Enable debugging if requested. */
@ -700,7 +737,7 @@ do { \
{ \ { \
YYFPRINTF (stderr, "%s ", Title); \ YYFPRINTF (stderr, "%s ", Title); \
yy_symbol_print (stderr, \ yy_symbol_print (stderr, \
Type, Value, line, retval, ckt); \
Type, Value, Location, line, retval, ckt); \
YYFPRINTF (stderr, "\n"); \ YYFPRINTF (stderr, "\n"); \
} \ } \
} while (YYID (0)) } while (YYID (0))
@ -714,13 +751,14 @@ do { \
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
static void static void
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, char **line, struct INPparseNode **retval, void *ckt)
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, char **line, struct INPparseNode **retval, void *ckt)
#else #else
static void static void
yy_symbol_value_print (yyoutput, yytype, yyvaluep, line, retval, ckt)
yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, line, retval, ckt)
FILE *yyoutput; FILE *yyoutput;
int yytype; int yytype;
YYSTYPE const * const yyvaluep; YYSTYPE const * const yyvaluep;
YYLTYPE const * const yylocationp;
char **line; char **line;
struct INPparseNode **retval; struct INPparseNode **retval;
void *ckt; void *ckt;
@ -728,6 +766,7 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, line, retval, ckt)
{ {
if (!yyvaluep) if (!yyvaluep)
return; return;
YYUSE (yylocationp);
YYUSE (line); YYUSE (line);
YYUSE (retval); YYUSE (retval);
YYUSE (ckt); YYUSE (ckt);
@ -752,13 +791,14 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, line, retval, ckt)
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
static void static void
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, char **line, struct INPparseNode **retval, void *ckt)
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, char **line, struct INPparseNode **retval, void *ckt)
#else #else
static void static void
yy_symbol_print (yyoutput, yytype, yyvaluep, line, retval, ckt)
yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, line, retval, ckt)
FILE *yyoutput; FILE *yyoutput;
int yytype; int yytype;
YYSTYPE const * const yyvaluep; YYSTYPE const * const yyvaluep;
YYLTYPE const * const yylocationp;
char **line; char **line;
struct INPparseNode **retval; struct INPparseNode **retval;
void *ckt; void *ckt;
@ -769,7 +809,9 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, line, retval, ckt)
else else
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
yy_symbol_value_print (yyoutput, yytype, yyvaluep, line, retval, ckt);
YY_LOCATION_PRINT (yyoutput, *yylocationp);
YYFPRINTF (yyoutput, ": ");
yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, line, retval, ckt);
YYFPRINTF (yyoutput, ")"); YYFPRINTF (yyoutput, ")");
} }
@ -812,11 +854,12 @@ do { \
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
static void static void
yy_reduce_print (YYSTYPE *yyvsp, int yyrule, char **line, struct INPparseNode **retval, void *ckt)
yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, char **line, struct INPparseNode **retval, void *ckt)
#else #else
static void static void
yy_reduce_print (yyvsp, yyrule, line, retval, ckt)
yy_reduce_print (yyvsp, yylsp, yyrule, line, retval, ckt)
YYSTYPE *yyvsp; YYSTYPE *yyvsp;
YYLTYPE *yylsp;
int yyrule; int yyrule;
char **line; char **line;
struct INPparseNode **retval; struct INPparseNode **retval;
@ -834,7 +877,7 @@ yy_reduce_print (yyvsp, yyrule, line, retval, ckt)
YYFPRINTF (stderr, " $%d = ", yyi + 1); YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
&(yyvsp[(yyi + 1) - (yynrhs)]) &(yyvsp[(yyi + 1) - (yynrhs)])
, line, retval, ckt);
, &(yylsp[(yyi + 1) - (yynrhs)]) , line, retval, ckt);
YYFPRINTF (stderr, "\n"); YYFPRINTF (stderr, "\n");
} }
} }
@ -842,7 +885,7 @@ yy_reduce_print (yyvsp, yyrule, line, retval, ckt)
# define YY_REDUCE_PRINT(Rule) \ # define YY_REDUCE_PRINT(Rule) \
do { \ do { \
if (yydebug) \ if (yydebug) \
yy_reduce_print (yyvsp, Rule, line, retval, ckt); \
yy_reduce_print (yyvsp, yylsp, Rule, line, retval, ckt); \
} while (YYID (0)) } while (YYID (0))
/* Nonzero means print parse trace. It is left uninitialized so that /* Nonzero means print parse trace. It is left uninitialized so that
@ -1093,19 +1136,21 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
static void static void
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, char **line, struct INPparseNode **retval, void *ckt)
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, char **line, struct INPparseNode **retval, void *ckt)
#else #else
static void static void
yydestruct (yymsg, yytype, yyvaluep, line, retval, ckt)
yydestruct (yymsg, yytype, yyvaluep, yylocationp, line, retval, ckt)
const char *yymsg; const char *yymsg;
int yytype; int yytype;
YYSTYPE *yyvaluep; YYSTYPE *yyvaluep;
YYLTYPE *yylocationp;
char **line; char **line;
struct INPparseNode **retval; struct INPparseNode **retval;
void *ckt; void *ckt;
#endif #endif
{ {
YYUSE (yyvaluep); YYUSE (yyvaluep);
YYUSE (yylocationp);
YYUSE (line); YYUSE (line);
YYUSE (retval); YYUSE (retval);
YYUSE (ckt); YYUSE (ckt);
@ -1175,6 +1220,9 @@ int yychar;
/* The semantic value of the lookahead symbol. */ /* The semantic value of the lookahead symbol. */
YYSTYPE yylval; YYSTYPE yylval;
/* Location data for the lookahead symbol. */
YYLTYPE yylloc;
/* Number of syntax errors so far. */ /* Number of syntax errors so far. */
int yynerrs; int yynerrs;
@ -1185,6 +1233,7 @@ YYSTYPE yylval;
/* The stacks and their tools: /* The stacks and their tools:
`yyss': related to states. `yyss': related to states.
`yyvs': related to semantic values. `yyvs': related to semantic values.
`yyls': related to locations.
Refer to the stacks thru separate pointers, to allow yyoverflow Refer to the stacks thru separate pointers, to allow yyoverflow
to reallocate them elsewhere. */ to reallocate them elsewhere. */
@ -1199,6 +1248,14 @@ YYSTYPE yylval;
YYSTYPE *yyvs; YYSTYPE *yyvs;
YYSTYPE *yyvsp; YYSTYPE *yyvsp;
/* The location stack. */
YYLTYPE yylsa[YYINITDEPTH];
YYLTYPE *yyls;
YYLTYPE *yylsp;
/* The locations where the error started and ended. */
YYLTYPE yyerror_range[2];
YYSIZE_T yystacksize; YYSIZE_T yystacksize;
int yyn; int yyn;
@ -1208,6 +1265,7 @@ YYSTYPE yylval;
/* The variables used to return semantic value and location from the /* The variables used to return semantic value and location from the
action routines. */ action routines. */
YYSTYPE yyval; YYSTYPE yyval;
YYLTYPE yyloc;
#if YYERROR_VERBOSE #if YYERROR_VERBOSE
/* Buffer for error messages, and its allocated size. */ /* Buffer for error messages, and its allocated size. */
@ -1216,7 +1274,7 @@ YYSTYPE yylval;
YYSIZE_T yymsg_alloc = sizeof yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif #endif
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
/* The number of symbols on the RHS of the reduced rule. /* The number of symbols on the RHS of the reduced rule.
Keep to zero when no symbol should be popped. */ Keep to zero when no symbol should be popped. */
@ -1225,6 +1283,7 @@ YYSTYPE yylval;
yytoken = 0; yytoken = 0;
yyss = yyssa; yyss = yyssa;
yyvs = yyvsa; yyvs = yyvsa;
yyls = yylsa;
yystacksize = YYINITDEPTH; yystacksize = YYINITDEPTH;
YYDPRINTF ((stderr, "Starting parse\n")); YYDPRINTF ((stderr, "Starting parse\n"));
@ -1240,17 +1299,25 @@ YYSTYPE yylval;
The wasted elements are never initialized. */ The wasted elements are never initialized. */
yyssp = yyss; yyssp = yyss;
yyvsp = yyvs; 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. */ /* User initialization code. */
/* Line 1242 of yacc.c */ /* Line 1242 of yacc.c */
#line 58 "inpptree-parser.y"
#line 80 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
{ {
yylval.num = 0.0; yylval.num = 0.0;
yylloc.start = yylloc.stop = NULL;
} }
/* Line 1242 of yacc.c */ /* Line 1242 of yacc.c */
#line 1254 "inpptree-parser.c"
#line 1321 "inpptree-parser.c"
yyvsp[0] = yylval; yyvsp[0] = yylval;
goto yysetstate; goto yysetstate;
@ -1278,6 +1345,7 @@ YYSTYPE yylval;
memory. */ memory. */
YYSTYPE *yyvs1 = yyvs; YYSTYPE *yyvs1 = yyvs;
yytype_int16 *yyss1 = yyss; yytype_int16 *yyss1 = yyss;
YYLTYPE *yyls1 = yyls;
/* Each stack pointer address is followed by the size of the /* Each stack pointer address is followed by the size of the
data in use in that stack, in bytes. This used to be a data in use in that stack, in bytes. This used to be a
@ -1286,8 +1354,10 @@ YYSTYPE yylval;
yyoverflow (YY_("memory exhausted"), yyoverflow (YY_("memory exhausted"),
&yyss1, yysize * sizeof (*yyssp), &yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp), &yyvs1, yysize * sizeof (*yyvsp),
&yyls1, yysize * sizeof (*yylsp),
&yystacksize); &yystacksize);
yyls = yyls1;
yyss = yyss1; yyss = yyss1;
yyvs = yyvs1; yyvs = yyvs1;
} }
@ -1310,6 +1380,7 @@ YYSTYPE yylval;
goto yyexhaustedlab; goto yyexhaustedlab;
YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyss_alloc, yyss);
YYSTACK_RELOCATE (yyvs_alloc, yyvs); YYSTACK_RELOCATE (yyvs_alloc, yyvs);
YYSTACK_RELOCATE (yyls_alloc, yyls);
# undef YYSTACK_RELOCATE # undef YYSTACK_RELOCATE
if (yyss1 != yyssa) if (yyss1 != yyssa)
YYSTACK_FREE (yyss1); YYSTACK_FREE (yyss1);
@ -1319,6 +1390,7 @@ YYSTYPE yylval;
yyssp = yyss + yysize - 1; yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1; yyvsp = yyvs + yysize - 1;
yylsp = yyls + yysize - 1;
YYDPRINTF ((stderr, "Stack size increased to %lu\n", YYDPRINTF ((stderr, "Stack size increased to %lu\n",
(unsigned long int) yystacksize)); (unsigned long int) yystacksize));
@ -1394,7 +1466,7 @@ yybackup:
yystate = yyn; yystate = yyn;
*++yyvsp = yylval; *++yyvsp = yylval;
*++yylsp = yylloc;
goto yynewstate; goto yynewstate;
@ -1425,91 +1497,96 @@ yyreduce:
GCC warning that YYVAL may be used uninitialized. */ GCC warning that YYVAL may be used uninitialized. */
yyval = yyvsp[1-yylen]; yyval = yyvsp[1-yylen];
/* Default location. */
YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
YY_REDUCE_PRINT (yyn); YY_REDUCE_PRINT (yyn);
switch (yyn) switch (yyn)
{ {
case 2: case 2:
/* Line 1455 of yacc.c */ /* Line 1455 of yacc.c */
#line 65 "inpptree-parser.y"
{ *retval = (yyvsp[(1) - (1)].pnode); ;}
#line 88 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
{
*retval = (yyvsp[(1) - (1)].pnode);
*line = (yylsp[(1) - (1)]).stop;
YYACCEPT;
;}
break; break;
case 3: case 3:
/* Line 1455 of yacc.c */ /* Line 1455 of yacc.c */
#line 69 "inpptree-parser.y"
#line 96 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
{ (yyval.pnode) = mknnode((yyvsp[(1) - (1)].num)); ;} { (yyval.pnode) = mknnode((yyvsp[(1) - (1)].num)); ;}
break; break;
case 4: case 4:
/* Line 1455 of yacc.c */ /* Line 1455 of yacc.c */
#line 70 "inpptree-parser.y"
#line 97 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
{ (yyval.pnode) = mksnode((yyvsp[(1) - (1)].str), ckt); ;} { (yyval.pnode) = mksnode((yyvsp[(1) - (1)].str), ckt); ;}
break; break;
case 5: case 5:
/* Line 1455 of yacc.c */ /* Line 1455 of yacc.c */
#line 72 "inpptree-parser.y"
#line 99 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
{ (yyval.pnode) = mkbnode("+", (yyvsp[(1) - (3)].pnode), (yyvsp[(3) - (3)].pnode)); ;} { (yyval.pnode) = mkbnode("+", (yyvsp[(1) - (3)].pnode), (yyvsp[(3) - (3)].pnode)); ;}
break; break;
case 6: case 6:
/* Line 1455 of yacc.c */ /* Line 1455 of yacc.c */
#line 73 "inpptree-parser.y"
#line 100 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
{ (yyval.pnode) = mkbnode("-", (yyvsp[(1) - (3)].pnode), (yyvsp[(3) - (3)].pnode)); ;} { (yyval.pnode) = mkbnode("-", (yyvsp[(1) - (3)].pnode), (yyvsp[(3) - (3)].pnode)); ;}
break; break;
case 7: case 7:
/* Line 1455 of yacc.c */ /* Line 1455 of yacc.c */
#line 74 "inpptree-parser.y"
#line 101 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
{ (yyval.pnode) = mkbnode("*", (yyvsp[(1) - (3)].pnode), (yyvsp[(3) - (3)].pnode)); ;} { (yyval.pnode) = mkbnode("*", (yyvsp[(1) - (3)].pnode), (yyvsp[(3) - (3)].pnode)); ;}
break; break;
case 8: case 8:
/* Line 1455 of yacc.c */ /* Line 1455 of yacc.c */
#line 75 "inpptree-parser.y"
#line 102 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
{ (yyval.pnode) = mkbnode("/", (yyvsp[(1) - (3)].pnode), (yyvsp[(3) - (3)].pnode)); ;} { (yyval.pnode) = mkbnode("/", (yyvsp[(1) - (3)].pnode), (yyvsp[(3) - (3)].pnode)); ;}
break; break;
case 9: case 9:
/* Line 1455 of yacc.c */ /* Line 1455 of yacc.c */
#line 76 "inpptree-parser.y"
#line 103 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
{ (yyval.pnode) = mkbnode("^", (yyvsp[(1) - (3)].pnode), (yyvsp[(3) - (3)].pnode)); ;} { (yyval.pnode) = mkbnode("^", (yyvsp[(1) - (3)].pnode), (yyvsp[(3) - (3)].pnode)); ;}
break; break;
case 10: case 10:
/* Line 1455 of yacc.c */ /* Line 1455 of yacc.c */
#line 78 "inpptree-parser.y"
#line 105 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
{ (yyval.pnode) = (yyvsp[(2) - (3)].pnode); ;} { (yyval.pnode) = (yyvsp[(2) - (3)].pnode); ;}
break; break;
case 11: case 11:
/* Line 1455 of yacc.c */ /* Line 1455 of yacc.c */
#line 80 "inpptree-parser.y"
#line 107 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
{ (yyval.pnode) = mkfnode("-",(yyvsp[(2) - (2)].pnode)); ;} { (yyval.pnode) = mkfnode("-",(yyvsp[(2) - (2)].pnode)); ;}
break; break;
case 12: case 12:
/* Line 1455 of yacc.c */ /* Line 1455 of yacc.c */
#line 82 "inpptree-parser.y"
#line 109 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
{ (yyval.pnode) = mkfnode((yyvsp[(1) - (4)].str), (yyvsp[(3) - (4)].pnode)); ;} { (yyval.pnode) = mkfnode((yyvsp[(1) - (4)].str), (yyvsp[(3) - (4)].pnode)); ;}
break; break;
case 14: case 14:
/* Line 1455 of yacc.c */ /* Line 1455 of yacc.c */
#line 86 "inpptree-parser.y"
#line 113 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
{ (yyval.pnode) = mkfnode("ternary_fcn", { (yyval.pnode) = mkfnode("ternary_fcn",
mkbnode(",", mkbnode(",",
mkbnode(",", (yyvsp[(1) - (5)].pnode), (yyvsp[(3) - (5)].pnode)), mkbnode(",", (yyvsp[(1) - (5)].pnode), (yyvsp[(3) - (5)].pnode)),
@ -1519,49 +1596,49 @@ yyreduce:
case 15: case 15:
/* Line 1455 of yacc.c */ /* Line 1455 of yacc.c */
#line 91 "inpptree-parser.y"
#line 118 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
{ (yyval.pnode) = mkfnode("eq0", mkbnode("-",(yyvsp[(1) - (3)].pnode),(yyvsp[(3) - (3)].pnode))); ;} { (yyval.pnode) = mkfnode("eq0", mkbnode("-",(yyvsp[(1) - (3)].pnode),(yyvsp[(3) - (3)].pnode))); ;}
break; break;
case 16: case 16:
/* Line 1455 of yacc.c */ /* Line 1455 of yacc.c */
#line 92 "inpptree-parser.y"
#line 119 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
{ (yyval.pnode) = mkfnode("ne0", mkbnode("-",(yyvsp[(1) - (3)].pnode),(yyvsp[(3) - (3)].pnode))); ;} { (yyval.pnode) = mkfnode("ne0", mkbnode("-",(yyvsp[(1) - (3)].pnode),(yyvsp[(3) - (3)].pnode))); ;}
break; break;
case 17: case 17:
/* Line 1455 of yacc.c */ /* Line 1455 of yacc.c */
#line 93 "inpptree-parser.y"
#line 120 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
{ (yyval.pnode) = mkfnode("gt0", mkbnode("-",(yyvsp[(1) - (3)].pnode),(yyvsp[(3) - (3)].pnode))); ;} { (yyval.pnode) = mkfnode("gt0", mkbnode("-",(yyvsp[(1) - (3)].pnode),(yyvsp[(3) - (3)].pnode))); ;}
break; break;
case 18: case 18:
/* Line 1455 of yacc.c */ /* Line 1455 of yacc.c */
#line 94 "inpptree-parser.y"
#line 121 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
{ (yyval.pnode) = mkfnode("lt0", mkbnode("-",(yyvsp[(1) - (3)].pnode),(yyvsp[(3) - (3)].pnode))); ;} { (yyval.pnode) = mkfnode("lt0", mkbnode("-",(yyvsp[(1) - (3)].pnode),(yyvsp[(3) - (3)].pnode))); ;}
break; break;
case 19: case 19:
/* Line 1455 of yacc.c */ /* Line 1455 of yacc.c */
#line 95 "inpptree-parser.y"
#line 122 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
{ (yyval.pnode) = mkfnode("ge0", mkbnode("-",(yyvsp[(1) - (3)].pnode),(yyvsp[(3) - (3)].pnode))); ;} { (yyval.pnode) = mkfnode("ge0", mkbnode("-",(yyvsp[(1) - (3)].pnode),(yyvsp[(3) - (3)].pnode))); ;}
break; break;
case 20: case 20:
/* Line 1455 of yacc.c */ /* Line 1455 of yacc.c */
#line 96 "inpptree-parser.y"
#line 123 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
{ (yyval.pnode) = mkfnode("le0", mkbnode("-",(yyvsp[(1) - (3)].pnode),(yyvsp[(3) - (3)].pnode))); ;} { (yyval.pnode) = mkfnode("le0", mkbnode("-",(yyvsp[(1) - (3)].pnode),(yyvsp[(3) - (3)].pnode))); ;}
break; break;
case 21: case 21:
/* Line 1455 of yacc.c */ /* Line 1455 of yacc.c */
#line 98 "inpptree-parser.y"
#line 125 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
{ (yyval.pnode) = mkfnode("ne0", { (yyval.pnode) = mkfnode("ne0",
mkbnode("+", mkbnode("+",
mkfnode("ne0", (yyvsp[(1) - (3)].pnode)), mkfnode("ne0", (yyvsp[(1) - (3)].pnode)),
@ -1571,7 +1648,7 @@ yyreduce:
case 22: case 22:
/* Line 1455 of yacc.c */ /* Line 1455 of yacc.c */
#line 102 "inpptree-parser.y"
#line 129 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
{ (yyval.pnode) = mkfnode("eq0", { (yyval.pnode) = mkfnode("eq0",
mkbnode("+", mkbnode("+",
mkfnode("eq0", (yyvsp[(1) - (3)].pnode)), mkfnode("eq0", (yyvsp[(1) - (3)].pnode)),
@ -1581,21 +1658,21 @@ yyreduce:
case 23: case 23:
/* Line 1455 of yacc.c */ /* Line 1455 of yacc.c */
#line 106 "inpptree-parser.y"
#line 133 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
{ (yyval.pnode) = mkfnode("eq0", (yyvsp[(2) - (2)].pnode)); ;} { (yyval.pnode) = mkfnode("eq0", (yyvsp[(2) - (2)].pnode)); ;}
break; break;
case 25: case 25:
/* Line 1455 of yacc.c */ /* Line 1455 of yacc.c */
#line 112 "inpptree-parser.y"
#line 139 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
{ (yyval.pnode) = mkbnode(",", (yyvsp[(1) - (3)].pnode), (yyvsp[(3) - (3)].pnode)); ;} { (yyval.pnode) = mkbnode(",", (yyvsp[(1) - (3)].pnode), (yyvsp[(3) - (3)].pnode)); ;}
break; break;
/* Line 1455 of yacc.c */ /* Line 1455 of yacc.c */
#line 1599 "inpptree-parser.c"
#line 1676 "inpptree-parser.c"
default: break; default: break;
} }
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@ -1605,6 +1682,7 @@ yyreduce:
YY_STACK_PRINT (yyss, yyssp); YY_STACK_PRINT (yyss, yyssp);
*++yyvsp = yyval; *++yyvsp = yyval;
*++yylsp = yyloc;
/* Now `shift' the result of the reduction. Determine what state /* Now `shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule that goes to, based on the state we popped back to and the rule
@ -1630,7 +1708,7 @@ yyerrlab:
{ {
++yynerrs; ++yynerrs;
#if ! YYERROR_VERBOSE #if ! YYERROR_VERBOSE
yyerror (line, retval, ckt, YY_("syntax error"));
yyerror (&yylloc, line, retval, ckt, YY_("syntax error"));
#else #else
{ {
YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
@ -1654,11 +1732,11 @@ yyerrlab:
if (0 < yysize && yysize <= yymsg_alloc) if (0 < yysize && yysize <= yymsg_alloc)
{ {
(void) yysyntax_error (yymsg, yystate, yychar); (void) yysyntax_error (yymsg, yystate, yychar);
yyerror (line, retval, ckt, yymsg);
yyerror (&yylloc, line, retval, ckt, yymsg);
} }
else else
{ {
yyerror (line, retval, ckt, YY_("syntax error"));
yyerror (&yylloc, line, retval, ckt, YY_("syntax error"));
if (yysize != 0) if (yysize != 0)
goto yyexhaustedlab; goto yyexhaustedlab;
} }
@ -1666,7 +1744,7 @@ yyerrlab:
#endif #endif
} }
yyerror_range[0] = yylloc;
if (yyerrstatus == 3) if (yyerrstatus == 3)
{ {
@ -1682,7 +1760,7 @@ yyerrlab:
else else
{ {
yydestruct ("Error: discarding", yydestruct ("Error: discarding",
yytoken, &yylval, line, retval, ckt);
yytoken, &yylval, &yylloc, line, retval, ckt);
yychar = YYEMPTY; yychar = YYEMPTY;
} }
} }
@ -1703,6 +1781,7 @@ yyerrorlab:
if (/*CONSTCOND*/ 0) if (/*CONSTCOND*/ 0)
goto yyerrorlab; goto yyerrorlab;
yyerror_range[0] = yylsp[1-yylen];
/* Do not reclaim the symbols of the rule which action triggered /* Do not reclaim the symbols of the rule which action triggered
this YYERROR. */ this YYERROR. */
YYPOPSTACK (yylen); YYPOPSTACK (yylen);
@ -1736,9 +1815,9 @@ yyerrlab1:
if (yyssp == yyss) if (yyssp == yyss)
YYABORT; YYABORT;
yyerror_range[0] = *yylsp;
yydestruct ("Error: popping", yydestruct ("Error: popping",
yystos[yystate], yyvsp, line, retval, ckt);
yystos[yystate], yyvsp, yylsp, line, retval, ckt);
YYPOPSTACK (1); YYPOPSTACK (1);
yystate = *yyssp; yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp); YY_STACK_PRINT (yyss, yyssp);
@ -1746,6 +1825,11 @@ yyerrlab1:
*++yyvsp = yylval; *++yyvsp = yylval;
yyerror_range[1] = yylloc;
/* Using YYLLOC is tempting, but would change the location of
the lookahead. YYLOC is available though. */
YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
*++yylsp = yyloc;
/* Shift the error token. */ /* Shift the error token. */
YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
@ -1773,7 +1857,7 @@ yyabortlab:
| yyexhaustedlab -- memory exhaustion comes here. | | yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/ `-------------------------------------------------*/
yyexhaustedlab: yyexhaustedlab:
yyerror (line, retval, ckt, YY_("memory exhausted"));
yyerror (&yylloc, line, retval, ckt, YY_("memory exhausted"));
yyresult = 2; yyresult = 2;
/* Fall through. */ /* Fall through. */
#endif #endif
@ -1781,7 +1865,7 @@ yyexhaustedlab:
yyreturn: yyreturn:
if (yychar != YYEMPTY) if (yychar != YYEMPTY)
yydestruct ("Cleanup: discarding lookahead", yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval, line, retval, ckt);
yytoken, &yylval, &yylloc, line, retval, ckt);
/* Do not reclaim the symbols of the rule which action triggered /* Do not reclaim the symbols of the rule which action triggered
this YYABORT or YYACCEPT. */ this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen); YYPOPSTACK (yylen);
@ -1789,7 +1873,7 @@ yyreturn:
while (yyssp != yyss) while (yyssp != yyss)
{ {
yydestruct ("Cleanup: popping", yydestruct ("Cleanup: popping",
yystos[*yyssp], yyvsp, line, retval, ckt);
yystos[*yyssp], yyvsp, yylsp, line, retval, ckt);
YYPOPSTACK (1); YYPOPSTACK (1);
} }
#ifndef yyoverflow #ifndef yyoverflow
@ -1807,14 +1891,15 @@ yyreturn:
/* Line 1675 of yacc.c */ /* Line 1675 of yacc.c */
#line 114 "inpptree-parser.y"
#line 141 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
/* Called by yyparse on error. */ /* Called by yyparse on error. */
static void static void
PTerror (char **line, struct INPparseNode **retval, void *ckt, char const *s)
PTerror (YYLTYPE *locp, char **line, struct INPparseNode **retval, void *ckt, char const *s)
{ {
NG_IGNORE(locp);
NG_IGNORE(line); NG_IGNORE(line);
NG_IGNORE(retval); NG_IGNORE(retval);
NG_IGNORE(ckt); NG_IGNORE(ckt);

16
src/spicelib/parser/inpptree-parser.h

@ -61,7 +61,7 @@ typedef union YYSTYPE
{ {
/* Line 1676 of yacc.c */ /* Line 1676 of yacc.c */
#line 31 "inpptree-parser.y"
#line 53 "/s/larice/ngspice.work/tmp-1/ng-spice-rework/src/spicelib/parser/inpptree-parser.y"
double num; double num;
const char *str; const char *str;
@ -79,4 +79,18 @@ typedef union YYSTYPE
#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
Loading…
Cancel
Save