1 /* A Bison parser, made from nic.y, by GNU bison 1.75. */
\r
3 /* Skeleton parser for Yacc-like parsing with Bison,
\r
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
\r
6 This program is free software; you can redistribute it and/or modify
\r
7 it under the terms of the GNU General Public License as published by
\r
8 the Free Software Foundation; either version 2, or (at your option)
\r
11 This program is distributed in the hope that it will be useful,
\r
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 GNU General Public License for more details.
\r
16 You should have received a copy of the GNU General Public License
\r
17 along with this program; if not, write to the Free Software
\r
18 Foundation, Inc., 59 Temple Place - Suite 330,
\r
19 Boston, MA 02111-1307, USA. */
\r
21 /* As a special exception, when this file is copied by Bison into a
\r
22 Bison output file, you may use that output file without restriction.
\r
23 This special exception was added by the Free Software Foundation
\r
24 in version 1.24 of Bison. */
\r
26 /* Written by Richard Stallman by simplifying the original so called
\r
27 ``semantic'' parser. */
\r
29 /* All symbols defined below should begin with yy or YY, to avoid
\r
30 infringing on user name space. This should be done even for local
\r
31 variables, as they might otherwise be expanded by user macros.
\r
32 There are some unavoidable exceptions within include files to
\r
33 define necessary library symbols; they are noted "INFRINGES ON
\r
34 USER NAME SPACE" below. */
\r
36 /* Identify Bison output. */
\r
42 /* Using locations. */
\r
43 #define YYLSP_NEEDED 0
\r
45 /* If NAME_PREFIX is specified substitute the variables and functions
\r
47 #define yyparse NicParserparse
\r
48 #define yylex NicParserlex
\r
49 #define yyerror NicParsererror
\r
50 #define yylval NicParserlval
\r
51 #define yychar NicParserchar
\r
52 #define yydebug NicParserdebug
\r
53 #define yynerrs NicParsernerrs
\r
58 # define YYTOKENTYPE
\r
59 /* Put the tokens into the symbol table, so that GDB and other debuggers
\r
73 #define STRING_TOKEN 259
\r
76 #define UNARY_OPS 262
\r
77 #define BINARY_OPS 263
\r
84 /* Copy the first part of user declarations. */
\r
91 /* Some addn'l includes, necessary but not included by the
\r
92 bison generated code.
\r
97 /* prototypes for the parser callbacks.
\r
100 #include "nic_def.h"
\r
102 extern int NicParserlex();
\r
103 void NicParsererror(char *s);
\r
106 extern nic_property *nicp;
\r
107 extern std::vector<std::string> nic_attr_vec;
\r
108 extern std::vector<std::string> nic_val_vec;
\r
109 extern std::string nic_a, nic_v;
\r
117 /* Enabling traces. */
\r
122 /* Enabling verbose error messages. */
\r
123 #ifdef YYERROR_VERBOSE
\r
124 # undef YYERROR_VERBOSE
\r
125 # define YYERROR_VERBOSE 1
\r
127 # define YYERROR_VERBOSE 0
\r
138 /* for FTA definition. */
\r
141 /* Line 193 of /usr/local/share/bison/yacc.c. */
\r
142 #line 143 "nic.tab.cc"
\r
143 # define YYSTYPE yystype
\r
144 # define YYSTYPE_IS_TRIVIAL 1
\r
148 typedef struct yyltype
\r
155 # define YYLTYPE yyltype
\r
156 # define YYLTYPE_IS_TRIVIAL 1
\r
159 /* Copy the second part of user declarations. */
\r
162 /* Line 213 of /usr/local/share/bison/yacc.c. */
\r
163 #line 164 "nic.tab.cc"
\r
165 #if ! defined (yyoverflow) || YYERROR_VERBOSE
\r
167 /* The parser invokes alloca or malloc; define the necessary symbols. */
\r
169 # if YYSTACK_USE_ALLOCA
\r
170 # define YYSTACK_ALLOC alloca
\r
172 # ifndef YYSTACK_USE_ALLOCA
\r
173 # if defined (alloca) || defined (_ALLOCA_H)
\r
174 # define YYSTACK_ALLOC alloca
\r
177 # define YYSTACK_ALLOC __builtin_alloca
\r
183 # ifdef YYSTACK_ALLOC
\r
184 /* Pacify GCC's `empty if-body' warning. */
\r
185 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
\r
187 # if defined (__STDC__) || defined (__cplusplus)
\r
188 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
\r
189 # define YYSIZE_T size_t
\r
191 # define YYSTACK_ALLOC malloc
\r
192 # define YYSTACK_FREE free
\r
194 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
\r
197 #if (! defined (yyoverflow) \
\r
198 && (! defined (__cplusplus) \
\r
199 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
\r
201 /* A type that is properly aligned for any stack member. */
\r
208 /* The size of the maximum gap between one aligned stack and the next. */
\r
209 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
\r
211 /* The size of an array large to enough to hold all stacks, each with
\r
213 # define YYSTACK_BYTES(N) \
\r
214 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
\r
217 /* Copy COUNT objects from FROM to TO. The source and destination do
\r
221 # define YYCOPY(To, From, Count) \
\r
222 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
\r
224 # define YYCOPY(To, From, Count) \
\r
227 register YYSIZE_T yyi; \
\r
228 for (yyi = 0; yyi < (Count); yyi++) \
\r
229 (To)[yyi] = (From)[yyi]; \
\r
235 /* Relocate STACK from its old location to the new one. The
\r
236 local variables YYSIZE and YYSTACKSIZE give the old and new number of
\r
237 elements in the stack, and YYPTR gives the new location of the
\r
238 stack. Advance YYPTR to a properly aligned location for the next
\r
240 # define YYSTACK_RELOCATE(Stack) \
\r
243 YYSIZE_T yynewbytes; \
\r
244 YYCOPY (&yyptr->Stack, Stack, yysize); \
\r
245 Stack = &yyptr->Stack; \
\r
246 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
\r
247 yyptr += yynewbytes / sizeof (*yyptr); \
\r
253 #if defined (__STDC__) || defined (__cplusplus)
\r
254 typedef signed char yysigned_char;
\r
256 typedef short yysigned_char;
\r
259 /* YYFINAL -- State number of the termination state. */
\r
263 /* YYNTOKENS -- Number of terminals. */
\r
264 #define YYNTOKENS 14
\r
265 /* YYNNTS -- Number of nonterminals. */
\r
267 /* YYNRULES -- Number of rules. */
\r
268 #define YYNRULES 20
\r
269 /* YYNRULES -- Number of states. */
\r
270 #define YYNSTATES 41
\r
272 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
\r
273 #define YYUNDEFTOK 2
\r
274 #define YYMAXUTOK 265
\r
276 #define YYTRANSLATE(X) \
\r
277 ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK)
\r
279 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
\r
280 static const unsigned char yytranslate[] =
\r
282 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
283 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
284 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
285 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
286 2, 2, 2, 2, 12, 2, 2, 2, 2, 2,
\r
287 2, 2, 2, 2, 2, 2, 2, 2, 2, 11,
\r
288 2, 13, 2, 2, 2, 2, 2, 2, 2, 2,
\r
289 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
290 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
291 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
292 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
293 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
294 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
295 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
296 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
297 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
298 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
299 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
300 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
301 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
302 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
303 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
304 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
305 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
306 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
307 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
\r
312 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
\r
314 static const unsigned char yyprhs[] =
\r
316 0, 0, 3, 10, 14, 18, 22, 26, 30, 34,
\r
317 36, 37, 39, 41, 45, 49, 51, 52, 54, 58,
\r
321 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
\r
322 static const yysigned_char yyrhs[] =
\r
324 15, 0, -1, 16, 17, 18, 19, 20, 21, -1,
\r
325 10, 24, 11, -1, 6, 22, 11, -1, 7, 22,
\r
326 11, -1, 8, 22, 11, -1, 9, 22, 11, -1,
\r
327 5, 22, 11, -1, 23, -1, -1, 3, -1, 4,
\r
328 -1, 23, 12, 3, -1, 23, 12, 4, -1, 25,
\r
329 -1, -1, 26, -1, 25, 12, 26, -1, 3, 13,
\r
330 4, -1, 3, 13, 3, -1
\r
333 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
\r
334 static const unsigned char yyrline[] =
\r
336 0, 61, 61, 65, 69, 73, 77, 81, 85, 89,
\r
337 91, 94, 96, 97, 98, 101, 103, 106, 109, 113,
\r
342 #if YYDEBUG || YYERROR_VERBOSE
\r
343 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
\r
344 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
\r
345 static const char *const yytname[] =
\r
347 "$end", "error", "$undefined", "NAME", "STRING_TOKEN", "FUNC", "TYPES",
\r
348 "UNARY_OPS", "BINARY_OPS", "FIELDS", "OPTIONS", "';'", "','", "'='",
\r
349 "$accept", "parse_result", "opts", "types", "unary_ops", "binary_ops",
\r
350 "fields", "fcns", "opt_attr_list", "attr_list", "opt_val_list",
\r
351 "val_list", "val", 0
\r
356 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
\r
357 token YYLEX-NUM. */
\r
358 static const unsigned short yytoknum[] =
\r
360 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
\r
365 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
\r
366 static const unsigned char yyr1[] =
\r
368 0, 14, 15, 16, 17, 18, 19, 20, 21, 22,
\r
369 22, 23, 23, 23, 23, 24, 24, 25, 25, 26,
\r
373 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
\r
374 static const unsigned char yyr2[] =
\r
376 0, 2, 6, 3, 3, 3, 3, 3, 3, 1,
\r
377 0, 1, 1, 3, 3, 1, 0, 1, 3, 3,
\r
381 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
\r
382 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
\r
383 means the default is an error. */
\r
384 static const unsigned char yydefact[] =
\r
386 0, 16, 0, 0, 0, 0, 15, 17, 1, 10,
\r
387 0, 0, 3, 0, 11, 12, 0, 9, 10, 0,
\r
388 20, 19, 18, 4, 0, 0, 10, 0, 13, 14,
\r
389 5, 0, 10, 0, 6, 0, 10, 2, 7, 0,
\r
393 /* YYDEFGOTO[NTERM-NUM]. */
\r
394 static const yysigned_char yydefgoto[] =
\r
396 -1, 2, 3, 10, 19, 27, 33, 37, 16, 17,
\r
400 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
\r
402 #define YYPACT_NINF -19
\r
403 static const yysigned_char yypact[] =
\r
405 -3, 6, 10, 5, -1, 4, 1, -19, -19, -2,
\r
406 9, 0, -19, 6, -19, -19, 8, 11, -2, 12,
\r
407 -19, -19, -19, -19, 2, 13, -2, 16, -19, -19,
\r
408 -19, 15, -2, 17, -19, 18, -2, -19, -19, 19,
\r
412 /* YYPGOTO[NTERM-NUM]. */
\r
413 static const yysigned_char yypgoto[] =
\r
415 -19, -19, -19, -19, -19, -19, -19, -19, -18, -19,
\r
419 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
\r
420 positive, shift that token. If negative, reduce the rule which
\r
421 number is the opposite. If zero, do what YYDEFACT says.
\r
422 If YYTABLE_NINF, parse error. */
\r
423 #define YYTABLE_NINF -1
\r
424 static const unsigned char yytable[] =
\r
426 25, 14, 15, 20, 21, 28, 29, 1, 31, 4,
\r
427 8, 9, 11, 13, 35, 12, 18, 0, 39, 23,
\r
428 26, 0, 36, 24, 30, 32, 34, 22, 0, 38,
\r
432 static const yysigned_char yycheck[] =
\r
434 18, 3, 4, 3, 4, 3, 4, 10, 26, 3,
\r
435 0, 6, 13, 12, 32, 11, 7, -1, 36, 11,
\r
436 8, -1, 5, 12, 11, 9, 11, 13, -1, 11,
\r
440 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
\r
441 symbol of state STATE-NUM. */
\r
442 static const unsigned char yystos[] =
\r
444 0, 10, 15, 16, 3, 24, 25, 26, 0, 6,
\r
445 17, 13, 11, 12, 3, 4, 22, 23, 7, 18,
\r
446 3, 4, 26, 11, 12, 22, 8, 19, 3, 4,
\r
447 11, 22, 9, 20, 11, 22, 5, 21, 11, 22,
\r
451 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
\r
452 # define YYSIZE_T __SIZE_TYPE__
\r
454 #if ! defined (YYSIZE_T) && defined (size_t)
\r
455 # define YYSIZE_T size_t
\r
457 #if ! defined (YYSIZE_T)
\r
458 # if defined (__STDC__) || defined (__cplusplus)
\r
459 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
\r
460 # define YYSIZE_T size_t
\r
463 #if ! defined (YYSIZE_T)
\r
464 # define YYSIZE_T unsigned int
\r
467 #define yyerrok (yyerrstatus = 0)
\r
468 #define yyclearin (yychar = YYEMPTY)
\r
472 #define YYACCEPT goto yyacceptlab
\r
473 #define YYABORT goto yyabortlab
\r
474 #define YYERROR goto yyerrlab1
\r
476 /* Like YYERROR except do call yyerror. This remains here temporarily
\r
477 to ease the transition to the new meaning of YYERROR, for GCC.
\r
478 Once GCC version 2 has supplanted version 1, this can go. */
\r
480 #define YYFAIL goto yyerrlab
\r
482 #define YYRECOVERING() (!!yyerrstatus)
\r
484 #define YYBACKUP(Token, Value) \
\r
486 if (yychar == YYEMPTY && yylen == 1) \
\r
488 yychar = (Token); \
\r
489 yylval = (Value); \
\r
490 yychar1 = YYTRANSLATE (yychar); \
\r
496 yyerror ("syntax error: cannot back up"); \
\r
502 #define YYERRCODE 256
\r
504 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
\r
507 #ifndef YYLLOC_DEFAULT
\r
508 # define YYLLOC_DEFAULT(Current, Rhs, N) \
\r
509 Current.first_line = Rhs[1].first_line; \
\r
510 Current.first_column = Rhs[1].first_column; \
\r
511 Current.last_line = Rhs[N].last_line; \
\r
512 Current.last_column = Rhs[N].last_column;
\r
515 /* YYLEX -- calling `yylex' with the right arguments. */
\r
517 #define YYLEX yylex ()
\r
519 /* Enable debugging if requested. */
\r
523 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
\r
524 # define YYFPRINTF fprintf
\r
527 # define YYDPRINTF(Args) \
\r
532 # define YYDSYMPRINT(Args) \
\r
537 /* Nonzero means print parse trace. It is left uninitialized so that
\r
538 multiple parsers can coexist. */
\r
540 #else /* !YYDEBUG */
\r
541 # define YYDPRINTF(Args)
\r
542 # define YYDSYMPRINT(Args)
\r
543 #endif /* !YYDEBUG */
\r
545 /* YYINITDEPTH -- initial size of the parser's stacks. */
\r
546 #ifndef YYINITDEPTH
\r
547 # define YYINITDEPTH 200
\r
550 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
\r
551 if the built-in stack extension method is used).
\r
553 Do not make this value too large; the results are undefined if
\r
554 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
\r
555 evaluated with infinite-precision integer arithmetic. */
\r
557 #if YYMAXDEPTH == 0
\r
562 # define YYMAXDEPTH 10000
\r
567 #if YYERROR_VERBOSE
\r
570 # if defined (__GLIBC__) && defined (_STRING_H)
\r
571 # define yystrlen strlen
\r
573 /* Return the length of YYSTR. */
\r
575 # if defined (__STDC__) || defined (__cplusplus)
\r
576 yystrlen (const char *yystr)
\r
582 register const char *yys = yystr;
\r
584 while (*yys++ != '\0')
\r
587 return yys - yystr - 1;
\r
593 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
\r
594 # define yystpcpy stpcpy
\r
596 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
\r
599 # if defined (__STDC__) || defined (__cplusplus)
\r
600 yystpcpy (char *yydest, const char *yysrc)
\r
602 yystpcpy (yydest, yysrc)
\r
607 register char *yyd = yydest;
\r
608 register const char *yys = yysrc;
\r
610 while ((*yyd++ = *yys++) != '\0')
\r
618 #endif /* !YYERROR_VERBOSE */
\r
623 /*-----------------------------.
\r
624 | Print this symbol on YYOUT. |
\r
625 `-----------------------------*/
\r
628 #if defined (__STDC__) || defined (__cplusplus)
\r
629 yysymprint (FILE* yyout, int yytype, YYSTYPE yyvalue)
\r
631 yysymprint (yyout, yytype, yyvalue)
\r
637 /* Pacify ``unused variable'' warnings. */
\r
640 if (yytype < YYNTOKENS)
\r
642 YYFPRINTF (yyout, "token %s (", yytname[yytype]);
\r
644 YYPRINT (yyout, yytoknum[yytype], yyvalue);
\r
648 YYFPRINTF (yyout, "nterm %s (", yytname[yytype]);
\r
655 YYFPRINTF (yyout, ")");
\r
657 #endif /* YYDEBUG. */
\r
660 /*-----------------------------------------------.
\r
661 | Release the memory associated to this symbol. |
\r
662 `-----------------------------------------------*/
\r
665 #if defined (__STDC__) || defined (__cplusplus)
\r
666 yydestruct (int yytype, YYSTYPE yyvalue)
\r
668 yydestruct (yytype, yyvalue)
\r
673 /* Pacify ``unused variable'' warnings. */
\r
685 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
\r
686 into yyparse. The argument should have type void *.
\r
687 It should actually point to an object.
\r
688 Grammar actions can access the variable by casting it
\r
689 to the proper pointer type. */
\r
691 #ifdef YYPARSE_PARAM
\r
692 # if defined (__STDC__) || defined (__cplusplus)
\r
693 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
\r
694 # define YYPARSE_PARAM_DECL
\r
696 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
\r
697 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
\r
699 #else /* !YYPARSE_PARAM */
\r
700 # define YYPARSE_PARAM_ARG
\r
701 # define YYPARSE_PARAM_DECL
\r
702 #endif /* !YYPARSE_PARAM */
\r
704 /* Prevent warning if -Wstrict-prototypes. */
\r
706 # ifdef YYPARSE_PARAM
\r
707 int yyparse (void *);
\r
709 int yyparse (void);
\r
714 /* The lookahead symbol. */
\r
717 /* The semantic value of the lookahead symbol. */
\r
720 /* Number of parse errors so far. */
\r
725 yyparse (YYPARSE_PARAM_ARG)
\r
729 register int yystate;
\r
732 /* Number of tokens to shift before error messages enabled. */
\r
734 /* Lookahead token as an internal (translated) token number. */
\r
737 /* Three stacks and their tools:
\r
738 `yyss': related to states,
\r
739 `yyvs': related to semantic values,
\r
740 `yyls': related to locations.
\r
742 Refer to the stacks thru separate pointers, to allow yyoverflow
\r
743 to reallocate them elsewhere. */
\r
745 /* The state stack. */
\r
746 short yyssa[YYINITDEPTH];
\r
747 short *yyss = yyssa;
\r
748 register short *yyssp;
\r
750 /* The semantic value stack. */
\r
751 YYSTYPE yyvsa[YYINITDEPTH];
\r
752 YYSTYPE *yyvs = yyvsa;
\r
753 register YYSTYPE *yyvsp;
\r
757 #define YYPOPSTACK (yyvsp--, yyssp--)
\r
759 YYSIZE_T yystacksize = YYINITDEPTH;
\r
761 /* The variables used to return semantic value and location from the
\r
762 action routines. */
\r
766 /* When reducing, the number of symbols on the RHS of the reduced
\r
770 YYDPRINTF ((stderr, "Starting parse\n"));
\r
775 yychar = YYEMPTY; /* Cause a token to be read. */
\r
777 /* Initialize stack pointers.
\r
778 Waste one element of value and location stack
\r
779 so that they stay on the same level as the state stack.
\r
780 The wasted elements are never initialized. */
\r
787 /*------------------------------------------------------------.
\r
788 | yynewstate -- Push a new state, which is found in yystate. |
\r
789 `------------------------------------------------------------*/
\r
791 /* In all cases, when you get here, the value and location stacks
\r
792 have just been pushed. so pushing a state here evens the stacks.
\r
799 if (yyssp >= yyss + yystacksize - 1)
\r
801 /* Get the current used size of the three stacks, in elements. */
\r
802 YYSIZE_T yysize = yyssp - yyss + 1;
\r
806 /* Give user a chance to reallocate the stack. Use copies of
\r
807 these so that the &'s don't force the real ones into
\r
809 YYSTYPE *yyvs1 = yyvs;
\r
810 short *yyss1 = yyss;
\r
813 /* Each stack pointer address is followed by the size of the
\r
814 data in use in that stack, in bytes. This used to be a
\r
815 conditional around just the two extra args, but that might
\r
816 be undefined if yyoverflow is a macro. */
\r
817 yyoverflow ("parser stack overflow",
\r
818 &yyss1, yysize * sizeof (*yyssp),
\r
819 &yyvs1, yysize * sizeof (*yyvsp),
\r
826 #else /* no yyoverflow */
\r
827 # ifndef YYSTACK_RELOCATE
\r
828 goto yyoverflowlab;
\r
830 /* Extend the stack our own way. */
\r
831 if (yystacksize >= YYMAXDEPTH)
\r
832 goto yyoverflowlab;
\r
834 if (yystacksize > YYMAXDEPTH)
\r
835 yystacksize = YYMAXDEPTH;
\r
838 short *yyss1 = yyss;
\r
839 union yyalloc *yyptr =
\r
840 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
\r
842 goto yyoverflowlab;
\r
843 YYSTACK_RELOCATE (yyss);
\r
844 YYSTACK_RELOCATE (yyvs);
\r
846 # undef YYSTACK_RELOCATE
\r
847 if (yyss1 != yyssa)
\r
848 YYSTACK_FREE (yyss1);
\r
851 #endif /* no yyoverflow */
\r
853 yyssp = yyss + yysize - 1;
\r
854 yyvsp = yyvs + yysize - 1;
\r
857 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
\r
858 (unsigned long int) yystacksize));
\r
860 if (yyssp >= yyss + yystacksize - 1)
\r
864 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
\r
873 /* Do appropriate processing given the current state. */
\r
874 /* Read a lookahead token if we need one and don't already have one. */
\r
877 /* First try to decide what to do without reference to lookahead token. */
\r
879 yyn = yypact[yystate];
\r
880 if (yyn == YYPACT_NINF)
\r
883 /* Not known => get a lookahead token if don't already have one. */
\r
885 /* yychar is either YYEMPTY or YYEOF
\r
886 or a valid token in external form. */
\r
888 if (yychar == YYEMPTY)
\r
890 YYDPRINTF ((stderr, "Reading a token: "));
\r
894 /* Convert token to internal form (in yychar1) for indexing tables with. */
\r
896 if (yychar <= 0) /* This means end of input. */
\r
899 yychar = YYEOF; /* Don't call YYLEX any more. */
\r
901 YYDPRINTF ((stderr, "Now at end of input.\n"));
\r
905 yychar1 = YYTRANSLATE (yychar);
\r
907 /* We have to keep this `#if YYDEBUG', since we use variables
\r
908 which are defined only if `YYDEBUG' is set. */
\r
909 YYDPRINTF ((stderr, "Next token is "));
\r
910 YYDSYMPRINT ((stderr, yychar1, yylval));
\r
911 YYDPRINTF ((stderr, "\n"));
\r
914 /* If the proper action on seeing token YYCHAR1 is to reduce or to
\r
915 detect an error, take that action. */
\r
917 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1)
\r
919 yyn = yytable[yyn];
\r
922 if (yyn == 0 || yyn == YYTABLE_NINF)
\r
928 if (yyn == YYFINAL)
\r
931 /* Shift the lookahead token. */
\r
932 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
\r
933 yychar, yytname[yychar1]));
\r
935 /* Discard the token being shifted unless it is eof. */
\r
936 if (yychar != YYEOF)
\r
942 /* Count tokens shifted since error; after three, turn off error
\r
951 /*-----------------------------------------------------------.
\r
952 | yydefault -- do the default action for the current state. |
\r
953 `-----------------------------------------------------------*/
\r
955 yyn = yydefact[yystate];
\r
961 /*-----------------------------.
\r
962 | yyreduce -- Do a reduction. |
\r
963 `-----------------------------*/
\r
965 /* yyn is the number of a rule to reduce with. */
\r
968 /* If YYLEN is nonzero, implement the default value of the action:
\r
971 Otherwise, the following line sets YYVAL to garbage.
\r
972 This behavior is undocumented and Bison
\r
973 users should not rely upon it. Assigning to YYVAL
\r
974 unconditionally makes the parser a bit smaller, and it avoids a
\r
975 GCC warning that YYVAL may be used uninitialized. */
\r
976 yyval = yyvsp[1-yylen];
\r
981 /* We have to keep this `#if YYDEBUG', since we use variables which
\r
982 are defined only if `YYDEBUG' is set. */
\r
987 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
\r
988 yyn - 1, yyrline[yyn]);
\r
990 /* Print the symbols being reduced, and their result. */
\r
991 for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)
\r
992 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
\r
993 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
\r
1000 {nicp->opta=nic_attr_vec; nicp->optv=nic_val_vec;}
\r
1005 {nicp->typea=nic_attr_vec;}
\r
1010 {nicp->opua=nic_attr_vec;}
\r
1015 {nicp->opba=nic_attr_vec;}
\r
1020 {nicp->fieldsa=nic_attr_vec;}
\r
1025 {nicp->funca=nic_attr_vec;}
\r
1030 {nic_attr_vec.clear(); }
\r
1035 {nic_attr_vec.clear(); nic_attr_vec.push_back(yyvsp[0].strval); }
\r
1040 {nic_attr_vec.clear(); nic_attr_vec.push_back(yyvsp[0].strval); }
\r
1045 {nic_attr_vec.push_back(yyvsp[0].strval);}
\r
1050 {nic_attr_vec.push_back(yyvsp[0].strval);}
\r
1055 {nic_attr_vec.clear(); nic_val_vec.clear();}
\r
1060 {nic_attr_vec.clear(); nic_attr_vec.push_back(nic_a);
\r
1061 nic_val_vec.clear(); nic_val_vec.push_back(nic_v); }
\r
1066 {nic_attr_vec.push_back(nic_a);
\r
1067 nic_val_vec.push_back(nic_v); }
\r
1072 {nic_a = yyvsp[-2].strval; nic_v = yyvsp[0].strval;}
\r
1077 {nic_a = yyvsp[-2].strval; nic_v = yyvsp[0].strval;}
\r
1083 /* Line 1016 of /usr/local/share/bison/yacc.c. */
\r
1084 #line 1085 "nic.tab.cc"
\r
1093 short *yyssp1 = yyss - 1;
\r
1094 YYFPRINTF (stderr, "state stack now");
\r
1095 while (yyssp1 != yyssp)
\r
1096 YYFPRINTF (stderr, " %d", *++yyssp1);
\r
1097 YYFPRINTF (stderr, "\n");
\r
1104 /* Now `shift' the result of the reduction. Determine what state
\r
1105 that goes to, based on the state we popped back to and the rule
\r
1106 number reduced by. */
\r
1110 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
\r
1111 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
\r
1112 yystate = yytable[yystate];
\r
1114 yystate = yydefgoto[yyn - YYNTOKENS];
\r
1119 /*------------------------------------.
\r
1120 | yyerrlab -- here on detecting error |
\r
1121 `------------------------------------*/
\r
1123 /* If not already recovering from an error, report this error. */
\r
1127 #if YYERROR_VERBOSE
\r
1128 yyn = yypact[yystate];
\r
1130 if (YYPACT_NINF < yyn && yyn < YYLAST)
\r
1132 YYSIZE_T yysize = 0;
\r
1133 int yytype = YYTRANSLATE (yychar);
\r
1138 /* Start YYX at -YYN if negative to avoid negative indexes in
\r
1140 for (yyx = yyn < 0 ? -yyn : 0;
\r
1141 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
\r
1142 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
\r
1143 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
\r
1144 yysize += yystrlen ("parse error, unexpected ") + 1;
\r
1145 yysize += yystrlen (yytname[yytype]);
\r
1146 yymsg = (char *) YYSTACK_ALLOC (yysize);
\r
1149 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
\r
1150 yyp = yystpcpy (yyp, yytname[yytype]);
\r
1155 for (yyx = yyn < 0 ? -yyn : 0;
\r
1156 yyx < (int) (sizeof (yytname) / sizeof (char *));
\r
1158 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
\r
1160 const char *yyq = ! yycount ? ", expecting " : " or ";
\r
1161 yyp = yystpcpy (yyp, yyq);
\r
1162 yyp = yystpcpy (yyp, yytname[yyx]);
\r
1167 YYSTACK_FREE (yymsg);
\r
1170 yyerror ("parse error; also virtual memory exhausted");
\r
1173 #endif /* YYERROR_VERBOSE */
\r
1174 yyerror ("parse error");
\r
1179 /*----------------------------------------------------.
\r
1180 | yyerrlab1 -- error raised explicitly by an action. |
\r
1181 `----------------------------------------------------*/
\r
1183 if (yyerrstatus == 3)
\r
1185 /* If just tried and failed to reuse lookahead token after an
\r
1186 error, discard it. */
\r
1188 /* Return failure if at end of input. */
\r
1189 if (yychar == YYEOF)
\r
1191 /* Pop the error token. */
\r
1193 /* Pop the rest of the stack. */
\r
1194 while (yyssp > yyss)
\r
1196 YYDPRINTF ((stderr, "Error: popping "));
\r
1197 YYDSYMPRINT ((stderr,
\r
1200 YYDPRINTF ((stderr, "\n"));
\r
1201 yydestruct (yystos[*yyssp], *yyvsp);
\r
1207 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
\r
1208 yychar, yytname[yychar1]));
\r
1209 yydestruct (yychar1, yylval);
\r
1213 /* Else will try to reuse lookahead token after shifting the error
\r
1216 yyerrstatus = 3; /* Each real token shifted decrements this. */
\r
1220 yyn = yypact[yystate];
\r
1221 if (yyn != YYPACT_NINF)
\r
1224 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
\r
1226 yyn = yytable[yyn];
\r
1232 /* Pop the current state because it cannot handle the error token. */
\r
1233 if (yyssp == yyss)
\r
1236 YYDPRINTF ((stderr, "Error: popping "));
\r
1237 YYDSYMPRINT ((stderr,
\r
1238 yystos[*yyssp], *yyvsp));
\r
1239 YYDPRINTF ((stderr, "\n"));
\r
1241 yydestruct (yystos[yystate], *yyvsp);
\r
1243 yystate = *--yyssp;
\r
1249 short *yyssp1 = yyss - 1;
\r
1250 YYFPRINTF (stderr, "Error: state stack now");
\r
1251 while (yyssp1 != yyssp)
\r
1252 YYFPRINTF (stderr, " %d", *++yyssp1);
\r
1253 YYFPRINTF (stderr, "\n");
\r
1258 if (yyn == YYFINAL)
\r
1261 YYDPRINTF ((stderr, "Shifting error token, "));
\r
1263 *++yyvsp = yylval;
\r
1270 /*-------------------------------------.
\r
1271 | yyacceptlab -- YYACCEPT comes here. |
\r
1272 `-------------------------------------*/
\r
1277 /*-----------------------------------.
\r
1278 | yyabortlab -- YYABORT comes here. |
\r
1279 `-----------------------------------*/
\r
1284 #ifndef yyoverflow
\r
1285 /*----------------------------------------------.
\r
1286 | yyoverflowlab -- parser overflow comes here. |
\r
1287 `----------------------------------------------*/
\r
1289 yyerror ("parser stack overflow");
\r
1291 /* Fall through. */
\r
1295 #ifndef yyoverflow
\r
1296 if (yyss != yyssa)
\r
1297 YYSTACK_FREE (yyss);
\r