Fixed newline characters throughout the code
[com/gs-lite.git] / src / ftacmp / nic.tab.cc
1 /* A Bison parser, made from nic.y, by GNU bison 1.75.  */
2
3 /* Skeleton parser for Yacc-like parsing with Bison,
4    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
5
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)
9    any later version.
10
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.
15
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.  */
20
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.  */
25
26 /* Written by Richard Stallman by simplifying the original so called
27    ``semantic'' parser.  */
28
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.  */
35
36 /* Identify Bison output.  */
37 #define YYBISON 1
38
39 /* Pure parsers.  */
40 #define YYPURE  0
41
42 /* Using locations.  */
43 #define YYLSP_NEEDED 0
44
45 /* If NAME_PREFIX is specified substitute the variables and functions
46    names.  */
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
54
55
56 /* Tokens.  */
57 #ifndef YYTOKENTYPE
58 # define YYTOKENTYPE
59    /* Put the tokens into the symbol table, so that GDB and other debuggers
60       know about them.  */
61    enum yytokentype {
62      NAME = 258,
63      STRING_TOKEN = 259,
64      FUNC = 260,
65      TYPES = 261,
66      UNARY_OPS = 262,
67      BINARY_OPS = 263,
68      FIELDS = 264,
69      OPTIONS = 265
70    };
71 #endif
72 #define NAME 258
73 #define STRING_TOKEN 259
74 #define FUNC 260
75 #define TYPES 261
76 #define UNARY_OPS 262
77 #define BINARY_OPS 263
78 #define FIELDS 264
79 #define OPTIONS 265
80
81
82
83
84 /* Copy the first part of user declarations.  */
85 #line 8 "nic.y"
86
87
88
89 #include <stdio.h>
90
91 /*              Some addn'l includes, necessary but not included by the
92                 bison generated code.
93 */
94
95 #include <stdlib.h>
96
97 /*              prototypes for the parser callbacks.
98 */
99
100 #include "nic_def.h"
101
102 extern int NicParserlex();
103 void NicParsererror(char *s);
104
105
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;
110
111
112
113 #define YYDEBUG 1
114
115
116
117 /* Enabling traces.  */
118 #ifndef YYDEBUG
119 # define YYDEBUG 0
120 #endif
121
122 /* Enabling verbose error messages.  */
123 #ifdef YYERROR_VERBOSE
124 # undef YYERROR_VERBOSE
125 # define YYERROR_VERBOSE 1
126 #else
127 # define YYERROR_VERBOSE 0
128 #endif
129
130 #ifndef YYSTYPE
131 #line 42 "nic.y"
132 typedef union {
133         int intval;
134         double floatval;
135         char *strval;
136         int subtok;
137
138         /*                      for FTA definition.     */
139
140 } yystype;
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
145 #endif
146
147 #ifndef YYLTYPE
148 typedef struct yyltype
149 {
150   int first_line;
151   int first_column;
152   int last_line;
153   int last_column;
154 } yyltype;
155 # define YYLTYPE yyltype
156 # define YYLTYPE_IS_TRIVIAL 1
157 #endif
158
159 /* Copy the second part of user declarations.  */
160
161
162 /* Line 213 of /usr/local/share/bison/yacc.c.  */
163 #line 164 "nic.tab.cc"
164
165 #if ! defined (yyoverflow) || YYERROR_VERBOSE
166
167 /* The parser invokes alloca or malloc; define the necessary symbols.  */
168
169 # if YYSTACK_USE_ALLOCA
170 #  define YYSTACK_ALLOC alloca
171 # else
172 #  ifndef YYSTACK_USE_ALLOCA
173 #   if defined (alloca) || defined (_ALLOCA_H)
174 #    define YYSTACK_ALLOC alloca
175 #   else
176 #    ifdef __GNUC__
177 #     define YYSTACK_ALLOC __builtin_alloca
178 #    endif
179 #   endif
180 #  endif
181 # endif
182
183 # ifdef YYSTACK_ALLOC
184    /* Pacify GCC's `empty if-body' warning. */
185 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
186 # else
187 #  if defined (__STDC__) || defined (__cplusplus)
188 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
189 #   define YYSIZE_T size_t
190 #  endif
191 #  define YYSTACK_ALLOC malloc
192 #  define YYSTACK_FREE free
193 # endif
194 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
195
196
197 #if (! defined (yyoverflow) \
198      && (! defined (__cplusplus) \
199          || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
200
201 /* A type that is properly aligned for any stack member.  */
202 union yyalloc
203 {
204   short yyss;
205   YYSTYPE yyvs;
206   };
207
208 /* The size of the maximum gap between one aligned stack and the next.  */
209 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
210
211 /* The size of an array large to enough to hold all stacks, each with
212    N elements.  */
213 # define YYSTACK_BYTES(N) \
214      ((N) * (sizeof (short) + sizeof (YYSTYPE))                         \
215       + YYSTACK_GAP_MAX)
216
217 /* Copy COUNT objects from FROM to TO.  The source and destination do
218    not overlap.  */
219 # ifndef YYCOPY
220 #  if 1 < __GNUC__
221 #   define YYCOPY(To, From, Count) \
222       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
223 #  else
224 #   define YYCOPY(To, From, Count)              \
225       do                                        \
226         {                                       \
227           register YYSIZE_T yyi;                \
228           for (yyi = 0; yyi < (Count); yyi++)   \
229             (To)[yyi] = (From)[yyi];    \
230         }                                       \
231       while (0)
232 #  endif
233 # endif
234
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
239    stack.  */
240 # define YYSTACK_RELOCATE(Stack)                                        \
241     do                                                                  \
242       {                                                                 \
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);                          \
248       }                                                                 \
249     while (0)
250
251 #endif
252
253 #if defined (__STDC__) || defined (__cplusplus)
254    typedef signed char yysigned_char;
255 #else
256    typedef short yysigned_char;
257 #endif
258
259 /* YYFINAL -- State number of the termination state. */
260 #define YYFINAL  8
261 #define YYLAST   30
262
263 /* YYNTOKENS -- Number of terminals. */
264 #define YYNTOKENS  14
265 /* YYNNTS -- Number of nonterminals. */
266 #define YYNNTS  13
267 /* YYNRULES -- Number of rules. */
268 #define YYNRULES  20
269 /* YYNRULES -- Number of states. */
270 #define YYNSTATES  41
271
272 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
273 #define YYUNDEFTOK  2
274 #define YYMAXUTOK   265
275
276 #define YYTRANSLATE(X) \
277   ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK)
278
279 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
280 static const unsigned char yytranslate[] =
281 {
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,
308        5,     6,     7,     8,     9,    10
309 };
310
311 #if YYDEBUG
312 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
313    YYRHS.  */
314 static const unsigned char yyprhs[] =
315 {
316        0,     0,     3,    10,    14,    18,    22,    26,    30,    34,
317       36,    37,    39,    41,    45,    49,    51,    52,    54,    58,
318       62
319 };
320
321 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
322 static const yysigned_char yyrhs[] =
323 {
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,
330        4,    -1,     3,    13,     3,    -1
331 };
332
333 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
334 static const unsigned char yyrline[] =
335 {
336        0,    61,    61,    65,    69,    73,    77,    81,    85,    89,
337       91,    94,    96,    97,    98,   101,   103,   106,   109,   113,
338      115
339 };
340 #endif
341
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[] =
346 {
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", 
351   "val_list", "val", 0
352 };
353 #endif
354
355 # ifdef YYPRINT
356 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
357    token YYLEX-NUM.  */
358 static const unsigned short yytoknum[] =
359 {
360        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
361      265,    59,    44,    61
362 };
363 # endif
364
365 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
366 static const unsigned char yyr1[] =
367 {
368        0,    14,    15,    16,    17,    18,    19,    20,    21,    22,
369       22,    23,    23,    23,    23,    24,    24,    25,    25,    26,
370       26
371 };
372
373 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
374 static const unsigned char yyr2[] =
375 {
376        0,     2,     6,     3,     3,     3,     3,     3,     3,     1,
377        0,     1,     1,     3,     3,     1,     0,     1,     3,     3,
378        3
379 };
380
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[] =
385 {
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,
390        8
391 };
392
393 /* YYDEFGOTO[NTERM-NUM]. */
394 static const yysigned_char yydefgoto[] =
395 {
396       -1,     2,     3,    10,    19,    27,    33,    37,    16,    17,
397        5,     6,     7
398 };
399
400 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
401    STATE-NUM.  */
402 #define YYPACT_NINF -19
403 static const yysigned_char yypact[] =
404 {
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,
409      -19
410 };
411
412 /* YYPGOTO[NTERM-NUM].  */
413 static const yysigned_char yypgoto[] =
414 {
415      -19,   -19,   -19,   -19,   -19,   -19,   -19,   -19,   -18,   -19,
416      -19,   -19,    14
417 };
418
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[] =
425 {
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,
429       40
430 };
431
432 static const yysigned_char yycheck[] =
433 {
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,
437       11
438 };
439
440 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
441    symbol of state STATE-NUM.  */
442 static const unsigned char yystos[] =
443 {
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,
448       11
449 };
450
451 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
452 # define YYSIZE_T __SIZE_TYPE__
453 #endif
454 #if ! defined (YYSIZE_T) && defined (size_t)
455 # define YYSIZE_T size_t
456 #endif
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
461 # endif
462 #endif
463 #if ! defined (YYSIZE_T)
464 # define YYSIZE_T unsigned int
465 #endif
466
467 #define yyerrok         (yyerrstatus = 0)
468 #define yyclearin       (yychar = YYEMPTY)
469 #define YYEMPTY         -2
470 #define YYEOF           0
471
472 #define YYACCEPT        goto yyacceptlab
473 #define YYABORT         goto yyabortlab
474 #define YYERROR         goto yyerrlab1
475
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.  */
479
480 #define YYFAIL          goto yyerrlab
481
482 #define YYRECOVERING()  (!!yyerrstatus)
483
484 #define YYBACKUP(Token, Value)                                  \
485 do                                                              \
486   if (yychar == YYEMPTY && yylen == 1)                          \
487     {                                                           \
488       yychar = (Token);                                         \
489       yylval = (Value);                                         \
490       yychar1 = YYTRANSLATE (yychar);                           \
491       YYPOPSTACK;                                               \
492       goto yybackup;                                            \
493     }                                                           \
494   else                                                          \
495     {                                                           \
496       yyerror ("syntax error: cannot back up");                 \
497       YYERROR;                                                  \
498     }                                                           \
499 while (0)
500
501 #define YYTERROR        1
502 #define YYERRCODE       256
503
504 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
505    are run).  */
506
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;
513 #endif
514
515 /* YYLEX -- calling `yylex' with the right arguments.  */
516
517 #define YYLEX   yylex ()
518
519 /* Enable debugging if requested.  */
520 #if YYDEBUG
521
522 # ifndef YYFPRINTF
523 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
524 #  define YYFPRINTF fprintf
525 # endif
526
527 # define YYDPRINTF(Args)                        \
528 do {                                            \
529   if (yydebug)                                  \
530     YYFPRINTF Args;                             \
531 } while (0)
532 # define YYDSYMPRINT(Args)                      \
533 do {                                            \
534   if (yydebug)                                  \
535     yysymprint Args;                            \
536 } while (0)
537 /* Nonzero means print parse trace.  It is left uninitialized so that
538    multiple parsers can coexist.  */
539 int yydebug;
540 #else /* !YYDEBUG */
541 # define YYDPRINTF(Args)
542 # define YYDSYMPRINT(Args)
543 #endif /* !YYDEBUG */
544
545 /* YYINITDEPTH -- initial size of the parser's stacks.  */
546 #ifndef YYINITDEPTH
547 # define YYINITDEPTH 200
548 #endif
549
550 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
551    if the built-in stack extension method is used).
552
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.  */
556
557 #if YYMAXDEPTH == 0
558 # undef YYMAXDEPTH
559 #endif
560
561 #ifndef YYMAXDEPTH
562 # define YYMAXDEPTH 10000
563 #endif
564
565 \f
566
567 #if YYERROR_VERBOSE
568
569 # ifndef yystrlen
570 #  if defined (__GLIBC__) && defined (_STRING_H)
571 #   define yystrlen strlen
572 #  else
573 /* Return the length of YYSTR.  */
574 static YYSIZE_T
575 #   if defined (__STDC__) || defined (__cplusplus)
576 yystrlen (const char *yystr)
577 #   else
578 yystrlen (yystr)
579      const char *yystr;
580 #   endif
581 {
582   register const char *yys = yystr;
583
584   while (*yys++ != '\0')
585     continue;
586
587   return yys - yystr - 1;
588 }
589 #  endif
590 # endif
591
592 # ifndef yystpcpy
593 #  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
594 #   define yystpcpy stpcpy
595 #  else
596 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
597    YYDEST.  */
598 static char *
599 #   if defined (__STDC__) || defined (__cplusplus)
600 yystpcpy (char *yydest, const char *yysrc)
601 #   else
602 yystpcpy (yydest, yysrc)
603      char *yydest;
604      const char *yysrc;
605 #   endif
606 {
607   register char *yyd = yydest;
608   register const char *yys = yysrc;
609
610   while ((*yyd++ = *yys++) != '\0')
611     continue;
612
613   return yyd - 1;
614 }
615 #  endif
616 # endif
617
618 #endif /* !YYERROR_VERBOSE */
619
620 \f
621
622 #if YYDEBUG
623 /*-----------------------------.
624 | Print this symbol on YYOUT.  |
625 `-----------------------------*/
626
627 static void
628 #if defined (__STDC__) || defined (__cplusplus)
629 yysymprint (FILE* yyout, int yytype, YYSTYPE yyvalue)
630 #else
631 yysymprint (yyout, yytype, yyvalue)
632     FILE* yyout;
633     int yytype;
634     YYSTYPE yyvalue;
635 #endif
636 {
637   /* Pacify ``unused variable'' warnings.  */
638   (void) yyvalue;
639
640   if (yytype < YYNTOKENS)
641     {
642       YYFPRINTF (yyout, "token %s (", yytname[yytype]);
643 # ifdef YYPRINT
644       YYPRINT (yyout, yytoknum[yytype], yyvalue);
645 # endif
646     }
647   else
648     YYFPRINTF (yyout, "nterm %s (", yytname[yytype]);
649
650   switch (yytype)
651     {
652       default:
653         break;
654     }
655   YYFPRINTF (yyout, ")");
656 }
657 #endif /* YYDEBUG. */
658
659
660 /*-----------------------------------------------.
661 | Release the memory associated to this symbol.  |
662 `-----------------------------------------------*/
663
664 static void
665 #if defined (__STDC__) || defined (__cplusplus)
666 yydestruct (int yytype, YYSTYPE yyvalue)
667 #else
668 yydestruct (yytype, yyvalue)
669     int yytype;
670     YYSTYPE yyvalue;
671 #endif
672 {
673   /* Pacify ``unused variable'' warnings.  */
674   (void) yyvalue;
675
676   switch (yytype)
677     {
678       default:
679         break;
680     }
681 }
682
683 \f
684
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.  */
690
691 #ifdef YYPARSE_PARAM
692 # if defined (__STDC__) || defined (__cplusplus)
693 #  define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
694 #  define YYPARSE_PARAM_DECL
695 # else
696 #  define YYPARSE_PARAM_ARG YYPARSE_PARAM
697 #  define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
698 # endif
699 #else /* !YYPARSE_PARAM */
700 # define YYPARSE_PARAM_ARG
701 # define YYPARSE_PARAM_DECL
702 #endif /* !YYPARSE_PARAM */
703
704 /* Prevent warning if -Wstrict-prototypes.  */
705 #ifdef __GNUC__
706 # ifdef YYPARSE_PARAM
707 int yyparse (void *);
708 # else
709 int yyparse (void);
710 # endif
711 #endif
712
713
714 /* The lookahead symbol.  */
715 int yychar;
716
717 /* The semantic value of the lookahead symbol.  */
718 YYSTYPE yylval;
719
720 /* Number of parse errors so far.  */
721 int yynerrs;
722
723
724 int
725 yyparse (YYPARSE_PARAM_ARG)
726      YYPARSE_PARAM_DECL
727 {
728   
729   register int yystate;
730   register int yyn;
731   int yyresult;
732   /* Number of tokens to shift before error messages enabled.  */
733   int yyerrstatus;
734   /* Lookahead token as an internal (translated) token number.  */
735   int yychar1 = 0;
736
737   /* Three stacks and their tools:
738      `yyss': related to states,
739      `yyvs': related to semantic values,
740      `yyls': related to locations.
741
742      Refer to the stacks thru separate pointers, to allow yyoverflow
743      to reallocate them elsewhere.  */
744
745   /* The state stack.  */
746   short yyssa[YYINITDEPTH];
747   short *yyss = yyssa;
748   register short *yyssp;
749
750   /* The semantic value stack.  */
751   YYSTYPE yyvsa[YYINITDEPTH];
752   YYSTYPE *yyvs = yyvsa;
753   register YYSTYPE *yyvsp;
754
755
756
757 #define YYPOPSTACK   (yyvsp--, yyssp--)
758
759   YYSIZE_T yystacksize = YYINITDEPTH;
760
761   /* The variables used to return semantic value and location from the
762      action routines.  */
763   YYSTYPE yyval;
764
765
766   /* When reducing, the number of symbols on the RHS of the reduced
767      rule.  */
768   int yylen;
769
770   YYDPRINTF ((stderr, "Starting parse\n"));
771
772   yystate = 0;
773   yyerrstatus = 0;
774   yynerrs = 0;
775   yychar = YYEMPTY;             /* Cause a token to be read.  */
776
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.  */
781
782   yyssp = yyss;
783   yyvsp = yyvs;
784
785   goto yysetstate;
786
787 /*------------------------------------------------------------.
788 | yynewstate -- Push a new state, which is found in yystate.  |
789 `------------------------------------------------------------*/
790  yynewstate:
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.
793      */
794   yyssp++;
795
796  yysetstate:
797   *yyssp = yystate;
798
799   if (yyssp >= yyss + yystacksize - 1)
800     {
801       /* Get the current used size of the three stacks, in elements.  */
802       YYSIZE_T yysize = yyssp - yyss + 1;
803
804 #ifdef yyoverflow
805       {
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
808            memory.  */
809         YYSTYPE *yyvs1 = yyvs;
810         short *yyss1 = yyss;
811
812
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),
820
821                     &yystacksize);
822
823         yyss = yyss1;
824         yyvs = yyvs1;
825       }
826 #else /* no yyoverflow */
827 # ifndef YYSTACK_RELOCATE
828       goto yyoverflowlab;
829 # else
830       /* Extend the stack our own way.  */
831       if (yystacksize >= YYMAXDEPTH)
832         goto yyoverflowlab;
833       yystacksize *= 2;
834       if (yystacksize > YYMAXDEPTH)
835         yystacksize = YYMAXDEPTH;
836
837       {
838         short *yyss1 = yyss;
839         union yyalloc *yyptr =
840           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
841         if (! yyptr)
842           goto yyoverflowlab;
843         YYSTACK_RELOCATE (yyss);
844         YYSTACK_RELOCATE (yyvs);
845
846 #  undef YYSTACK_RELOCATE
847         if (yyss1 != yyssa)
848           YYSTACK_FREE (yyss1);
849       }
850 # endif
851 #endif /* no yyoverflow */
852
853       yyssp = yyss + yysize - 1;
854       yyvsp = yyvs + yysize - 1;
855
856
857       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
858                   (unsigned long int) yystacksize));
859
860       if (yyssp >= yyss + yystacksize - 1)
861         YYABORT;
862     }
863
864   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
865
866   goto yybackup;
867
868 /*-----------.
869 | yybackup.  |
870 `-----------*/
871 yybackup:
872
873 /* Do appropriate processing given the current state.  */
874 /* Read a lookahead token if we need one and don't already have one.  */
875 /* yyresume: */
876
877   /* First try to decide what to do without reference to lookahead token.  */
878
879   yyn = yypact[yystate];
880   if (yyn == YYPACT_NINF)
881     goto yydefault;
882
883   /* Not known => get a lookahead token if don't already have one.  */
884
885   /* yychar is either YYEMPTY or YYEOF
886      or a valid token in external form.  */
887
888   if (yychar == YYEMPTY)
889     {
890       YYDPRINTF ((stderr, "Reading a token: "));
891       yychar = YYLEX;
892     }
893
894   /* Convert token to internal form (in yychar1) for indexing tables with.  */
895
896   if (yychar <= 0)              /* This means end of input.  */
897     {
898       yychar1 = 0;
899       yychar = YYEOF;           /* Don't call YYLEX any more.  */
900
901       YYDPRINTF ((stderr, "Now at end of input.\n"));
902     }
903   else
904     {
905       yychar1 = YYTRANSLATE (yychar);
906
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"));
912     }
913
914   /* If the proper action on seeing token YYCHAR1 is to reduce or to
915      detect an error, take that action.  */
916   yyn += yychar1;
917   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1)
918     goto yydefault;
919   yyn = yytable[yyn];
920   if (yyn <= 0)
921     {
922       if (yyn == 0 || yyn == YYTABLE_NINF)
923         goto yyerrlab;
924       yyn = -yyn;
925       goto yyreduce;
926     }
927
928   if (yyn == YYFINAL)
929     YYACCEPT;
930
931   /* Shift the lookahead token.  */
932   YYDPRINTF ((stderr, "Shifting token %d (%s), ",
933               yychar, yytname[yychar1]));
934
935   /* Discard the token being shifted unless it is eof.  */
936   if (yychar != YYEOF)
937     yychar = YYEMPTY;
938
939   *++yyvsp = yylval;
940
941
942   /* Count tokens shifted since error; after three, turn off error
943      status.  */
944   if (yyerrstatus)
945     yyerrstatus--;
946
947   yystate = yyn;
948   goto yynewstate;
949
950
951 /*-----------------------------------------------------------.
952 | yydefault -- do the default action for the current state.  |
953 `-----------------------------------------------------------*/
954 yydefault:
955   yyn = yydefact[yystate];
956   if (yyn == 0)
957     goto yyerrlab;
958   goto yyreduce;
959
960
961 /*-----------------------------.
962 | yyreduce -- Do a reduction.  |
963 `-----------------------------*/
964 yyreduce:
965   /* yyn is the number of a rule to reduce with.  */
966   yylen = yyr2[yyn];
967
968   /* If YYLEN is nonzero, implement the default value of the action:
969      `$$ = $1'.
970
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];
977
978
979
980 #if YYDEBUG
981   /* We have to keep this `#if YYDEBUG', since we use variables which
982      are defined only if `YYDEBUG' is set.  */
983   if (yydebug)
984     {
985       int yyi;
986
987       YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
988                  yyn - 1, yyrline[yyn]);
989
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]]);
994     }
995 #endif
996   switch (yyn)
997     {
998         case 3:
999 #line 66 "nic.y"
1000     {nicp->opta=nic_attr_vec; nicp->optv=nic_val_vec;}
1001     break;
1002
1003   case 4:
1004 #line 70 "nic.y"
1005     {nicp->typea=nic_attr_vec;}
1006     break;
1007
1008   case 5:
1009 #line 74 "nic.y"
1010     {nicp->opua=nic_attr_vec;}
1011     break;
1012
1013   case 6:
1014 #line 78 "nic.y"
1015     {nicp->opba=nic_attr_vec;}
1016     break;
1017
1018   case 7:
1019 #line 82 "nic.y"
1020     {nicp->fieldsa=nic_attr_vec;}
1021     break;
1022
1023   case 8:
1024 #line 86 "nic.y"
1025     {nicp->funca=nic_attr_vec;}
1026     break;
1027
1028   case 10:
1029 #line 91 "nic.y"
1030     {nic_attr_vec.clear(); }
1031     break;
1032
1033   case 11:
1034 #line 95 "nic.y"
1035     {nic_attr_vec.clear();  nic_attr_vec.push_back(yyvsp[0].strval); }
1036     break;
1037
1038   case 12:
1039 #line 96 "nic.y"
1040     {nic_attr_vec.clear();  nic_attr_vec.push_back(yyvsp[0].strval); }
1041     break;
1042
1043   case 13:
1044 #line 97 "nic.y"
1045     {nic_attr_vec.push_back(yyvsp[0].strval);}
1046     break;
1047
1048   case 14:
1049 #line 98 "nic.y"
1050     {nic_attr_vec.push_back(yyvsp[0].strval);}
1051     break;
1052
1053   case 16:
1054 #line 103 "nic.y"
1055     {nic_attr_vec.clear(); nic_val_vec.clear();}
1056     break;
1057
1058   case 17:
1059 #line 107 "nic.y"
1060     {nic_attr_vec.clear();  nic_attr_vec.push_back(nic_a);
1061                          nic_val_vec.clear(); nic_val_vec.push_back(nic_v); }
1062     break;
1063
1064   case 18:
1065 #line 109 "nic.y"
1066     {nic_attr_vec.push_back(nic_a);
1067                                         nic_val_vec.push_back(nic_v); }
1068     break;
1069
1070   case 19:
1071 #line 114 "nic.y"
1072     {nic_a = yyvsp[-2].strval; nic_v = yyvsp[0].strval;}
1073     break;
1074
1075   case 20:
1076 #line 115 "nic.y"
1077     {nic_a = yyvsp[-2].strval; nic_v = yyvsp[0].strval;}
1078     break;
1079
1080
1081     }
1082
1083 /* Line 1016 of /usr/local/share/bison/yacc.c.  */
1084 #line 1085 "nic.tab.cc"
1085 \f
1086   yyvsp -= yylen;
1087   yyssp -= yylen;
1088
1089
1090 #if YYDEBUG
1091   if (yydebug)
1092     {
1093       short *yyssp1 = yyss - 1;
1094       YYFPRINTF (stderr, "state stack now");
1095       while (yyssp1 != yyssp)
1096         YYFPRINTF (stderr, " %d", *++yyssp1);
1097       YYFPRINTF (stderr, "\n");
1098     }
1099 #endif
1100
1101   *++yyvsp = yyval;
1102
1103
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.  */
1107
1108   yyn = yyr1[yyn];
1109
1110   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1111   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1112     yystate = yytable[yystate];
1113   else
1114     yystate = yydefgoto[yyn - YYNTOKENS];
1115
1116   goto yynewstate;
1117
1118
1119 /*------------------------------------.
1120 | yyerrlab -- here on detecting error |
1121 `------------------------------------*/
1122 yyerrlab:
1123   /* If not already recovering from an error, report this error.  */
1124   if (!yyerrstatus)
1125     {
1126       ++yynerrs;
1127 #if YYERROR_VERBOSE
1128       yyn = yypact[yystate];
1129
1130       if (YYPACT_NINF < yyn && yyn < YYLAST)
1131         {
1132           YYSIZE_T yysize = 0;
1133           int yytype = YYTRANSLATE (yychar);
1134           char *yymsg;
1135           int yyx, yycount;
1136
1137           yycount = 0;
1138           /* Start YYX at -YYN if negative to avoid negative indexes in
1139              YYCHECK.  */
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);
1147           if (yymsg != 0)
1148             {
1149               char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1150               yyp = yystpcpy (yyp, yytname[yytype]);
1151
1152               if (yycount < 5)
1153                 {
1154                   yycount = 0;
1155                   for (yyx = yyn < 0 ? -yyn : 0;
1156                        yyx < (int) (sizeof (yytname) / sizeof (char *));
1157                        yyx++)
1158                     if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1159                       {
1160                         const char *yyq = ! yycount ? ", expecting " : " or ";
1161                         yyp = yystpcpy (yyp, yyq);
1162                         yyp = yystpcpy (yyp, yytname[yyx]);
1163                         yycount++;
1164                       }
1165                 }
1166               yyerror (yymsg);
1167               YYSTACK_FREE (yymsg);
1168             }
1169           else
1170             yyerror ("parse error; also virtual memory exhausted");
1171         }
1172       else
1173 #endif /* YYERROR_VERBOSE */
1174         yyerror ("parse error");
1175     }
1176   goto yyerrlab1;
1177
1178
1179 /*----------------------------------------------------.
1180 | yyerrlab1 -- error raised explicitly by an action.  |
1181 `----------------------------------------------------*/
1182 yyerrlab1:
1183   if (yyerrstatus == 3)
1184     {
1185       /* If just tried and failed to reuse lookahead token after an
1186          error, discard it.  */
1187
1188       /* Return failure if at end of input.  */
1189       if (yychar == YYEOF)
1190         {
1191           /* Pop the error token.  */
1192           YYPOPSTACK;
1193           /* Pop the rest of the stack.  */
1194           while (yyssp > yyss)
1195             {
1196               YYDPRINTF ((stderr, "Error: popping "));
1197               YYDSYMPRINT ((stderr,
1198                             yystos[*yyssp],
1199                             *yyvsp));
1200               YYDPRINTF ((stderr, "\n"));
1201               yydestruct (yystos[*yyssp], *yyvsp);
1202               YYPOPSTACK;
1203             }
1204           YYABORT;
1205         }
1206
1207       YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1208                   yychar, yytname[yychar1]));
1209       yydestruct (yychar1, yylval);
1210       yychar = YYEMPTY;
1211     }
1212
1213   /* Else will try to reuse lookahead token after shifting the error
1214      token.  */
1215
1216   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
1217
1218   for (;;)
1219     {
1220       yyn = yypact[yystate];
1221       if (yyn != YYPACT_NINF)
1222         {
1223           yyn += YYTERROR;
1224           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1225             {
1226               yyn = yytable[yyn];
1227               if (0 < yyn)
1228                 break;
1229             }
1230         }
1231
1232       /* Pop the current state because it cannot handle the error token.  */
1233       if (yyssp == yyss)
1234         YYABORT;
1235
1236       YYDPRINTF ((stderr, "Error: popping "));
1237       YYDSYMPRINT ((stderr,
1238                     yystos[*yyssp], *yyvsp));
1239       YYDPRINTF ((stderr, "\n"));
1240
1241       yydestruct (yystos[yystate], *yyvsp);
1242       yyvsp--;
1243       yystate = *--yyssp;
1244
1245
1246 #if YYDEBUG
1247       if (yydebug)
1248         {
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");
1254         }
1255 #endif
1256     }
1257
1258   if (yyn == YYFINAL)
1259     YYACCEPT;
1260
1261   YYDPRINTF ((stderr, "Shifting error token, "));
1262
1263   *++yyvsp = yylval;
1264
1265
1266   yystate = yyn;
1267   goto yynewstate;
1268
1269
1270 /*-------------------------------------.
1271 | yyacceptlab -- YYACCEPT comes here.  |
1272 `-------------------------------------*/
1273 yyacceptlab:
1274   yyresult = 0;
1275   goto yyreturn;
1276
1277 /*-----------------------------------.
1278 | yyabortlab -- YYABORT comes here.  |
1279 `-----------------------------------*/
1280 yyabortlab:
1281   yyresult = 1;
1282   goto yyreturn;
1283
1284 #ifndef yyoverflow
1285 /*----------------------------------------------.
1286 | yyoverflowlab -- parser overflow comes here.  |
1287 `----------------------------------------------*/
1288 yyoverflowlab:
1289   yyerror ("parser stack overflow");
1290   yyresult = 2;
1291   /* Fall through.  */
1292 #endif
1293
1294 yyreturn:
1295 #ifndef yyoverflow
1296   if (yyss != yyssa)
1297     YYSTACK_FREE (yyss);
1298 #endif
1299   return yyresult;
1300 }
1301
1302
1303 #line 122 "nic.y"
1304
1305
1306