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