1 /* A Bison parser, made by GNU Bison 1.875. */
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 /* Skeleton name. */
40 #define YYSKELETON_NAME "yacc.c"
41
42 /* Pure parsers. */
43 #define YYPURE 0
44
45 /* Using locations. */
46 #define YYLSP_NEEDED 0
47
48
49
50 /* Tokens. */
51 #ifndef YYTOKENTYPE
52 # define YYTOKENTYPE
53 /* Put the tokens into the symbol table, so that GDB and other debuggers
54 know about them. */
55 enum yytokentype {
56 T_KEYWORD_LEFT = 258,
57 T_ARRAY_LEFT = 259,
58 T_TABLE_LEFT = 260,
59 T_KEYWORD_RIGHT = 261,
60 T_ARRAY_RIGHT = 262,
61 T_TABLE_RIGHT = 263,
62 T_CONCAT = 264,
63 T_STRING = 265,
64 T_QUOTED_STRING = 266
65 };
66 #endif
67 #define T_KEYWORD_LEFT 258
68 #define T_ARRAY_LEFT 259
69 #define T_TABLE_LEFT 260
70 #define T_KEYWORD_RIGHT 261
71 #define T_ARRAY_RIGHT 262
72 #define T_TABLE_RIGHT 263
73 #define T_CONCAT 264
74 #define T_STRING 265
75 #define T_QUOTED_STRING 266
76
77
78
79
80 /* Copy the first part of user declarations. */
81 #line 27 "ipv2_parse.yy"
82
83 #ifdef DEC
84 #include <math.h>
85 #else
86 #include <stdlib.h>
87 #endif
88 #include <string.h>
89 #ifdef BISON
90 #define YYDEBUG 0
91 #if YYDEBUG != 0
92 int yydebug =1;
93 #endif /* YYDEBUG != 0 */
94 #endif /* BISON */
95 #if defined(SABER)
96 #define xmalloc malloc
97 #endif
98 #if defined(SGI)
99 #include <alloca.h>
100 #endif
101 #include <util/keyval/ipv2.h>
102 #define yyerror sc::IPV2::yerror
103 #define yyparse sc::IPV2::yparse
104 #define yylex sc::IPV2::ylex
105 #define yywrap sc::IPV2::ywrap
106
107
108 /* Enabling traces. */
109 #ifndef YYDEBUG
110 # define YYDEBUG 0
111 #endif
112
113 /* Enabling verbose error messages. */
114 #ifdef YYERROR_VERBOSE
115 # undef YYERROR_VERBOSE
116 # define YYERROR_VERBOSE 1
117 #else
118 # define YYERROR_VERBOSE 0
119 #endif
120
121 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
122 #line 53 "ipv2_parse.yy"
123 typedef union YYSTYPE {
124 char *str;
125 sc::ip_string_list_t *sl;
126 double dbl;
127 } YYSTYPE;
128 /* Line 191 of yacc.c. */
129 #line 129 "ipv2_parse.tmp.cc"
130 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
131 # define YYSTYPE_IS_DECLARED 1
132 # define YYSTYPE_IS_TRIVIAL 1
133 #endif
134
135
136
137 /* Copy the second part of user declarations. */
138
139
140 /* Line 214 of yacc.c. */
141 #line 141 "ipv2_parse.tmp.cc"
142
143 #if ! defined (yyoverflow) || YYERROR_VERBOSE
144
145 /* The parser invokes alloca or malloc; define the necessary symbols. */
146
147 # if YYSTACK_USE_ALLOCA
148 # define YYSTACK_ALLOC alloca
149 # else
150 # ifndef YYSTACK_USE_ALLOCA
151 # if defined (alloca) || defined (_ALLOCA_H)
152 # define YYSTACK_ALLOC alloca
153 # else
154 # ifdef __GNUC__
155 # define YYSTACK_ALLOC __builtin_alloca
156 # endif
157 # endif
158 # endif
159 # endif
160
161 # ifdef YYSTACK_ALLOC
162 /* Pacify GCC's `empty if-body' warning. */
163 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
164 # else
165 # if defined (__STDC__) || defined (__cplusplus)
166 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
167 # define YYSIZE_T size_t
168 # endif
169 # define YYSTACK_ALLOC malloc
170 # define YYSTACK_FREE free
171 # endif
172 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
173
174
175 #if (! defined (yyoverflow) \
176 && (! defined (__cplusplus) \
177 || (YYSTYPE_IS_TRIVIAL)))
178
179 /* A type that is properly aligned for any stack member. */
180 union yyalloc
181 {
182 short yyss;
183 YYSTYPE yyvs;
184 };
185
186 /* The size of the maximum gap between one aligned stack and the next. */
187 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
188
189 /* The size of an array large to enough to hold all stacks, each with
190 N elements. */
191 # define YYSTACK_BYTES(N) \
192 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
193 + YYSTACK_GAP_MAXIMUM)
194
195 /* Copy COUNT objects from FROM to TO. The source and destination do
196 not overlap. */
197 # ifndef YYCOPY
198 # if 1 < __GNUC__
199 # define YYCOPY(To, From, Count) \
200 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
201 # else
202 # define YYCOPY(To, From, Count) \
203 do \
204 { \
205 register YYSIZE_T yyi; \
206 for (yyi = 0; yyi < (Count); yyi++) \
207 (To)[yyi] = (From)[yyi]; \
208 } \
209 while (0)
210 # endif
211 # endif
212
213 /* Relocate STACK from its old location to the new one. The
214 local variables YYSIZE and YYSTACKSIZE give the old and new number of
215 elements in the stack, and YYPTR gives the new location of the
216 stack. Advance YYPTR to a properly aligned location for the next
217 stack. */
218 # define YYSTACK_RELOCATE(Stack) \
219 do \
220 { \
221 YYSIZE_T yynewbytes; \
222 YYCOPY (&yyptr->Stack, Stack, yysize); \
223 Stack = &yyptr->Stack; \
224 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
225 yyptr += yynewbytes / sizeof (*yyptr); \
226 } \
227 while (0)
228
229 #endif
230
231 #if defined (__STDC__) || defined (__cplusplus)
232 typedef signed char yysigned_char;
233 #else
234 typedef short yysigned_char;
235 #endif
236
237 /* YYFINAL -- State number of the termination state. */
238 #define YYFINAL 3
239 /* YYLAST -- Last index in YYTABLE. */
240 #define YYLAST 136
241
242 /* YYNTOKENS -- Number of terminals. */
243 #define YYNTOKENS 22
244 /* YYNNTS -- Number of nonterminals. */
245 #define YYNNTS 30
246 /* YYNRULES -- Number of rules. */
247 #define YYNRULES 62
248 /* YYNRULES -- Number of states. */
249 #define YYNSTATES 102
250
251 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
252 #define YYUNDEFTOK 2
253 #define YYMAXUTOK 266
254
255 #define YYTRANSLATE(YYX) \
256 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
257
258 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
259 static const unsigned char yytranslate[] =
260 {
261 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
262 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
263 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
264 2, 2, 2, 2, 2, 2, 21, 2, 2, 2,
265 2, 2, 17, 19, 16, 18, 2, 20, 2, 2,
266 2, 2, 2, 2, 2, 2, 2, 2, 12, 2,
267 14, 13, 15, 2, 2, 2, 2, 2, 2, 2,
268 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
269 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
270 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
271 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
272 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
273 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
274 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
275 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
276 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
277 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
278 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
279 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
280 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
281 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
282 2, 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, 2, 2, 1, 2, 3, 4,
287 5, 6, 7, 8, 9, 10, 11
288 };
289
290 #if YYDEBUG
291 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
292 YYRHS. */
293 static const unsigned char yyprhs[] =
294 {
295 0, 0, 3, 5, 8, 9, 15, 19, 23, 27,
296 28, 37, 43, 47, 51, 55, 58, 60, 64, 66,
297 69, 70, 74, 75, 79, 80, 82, 86, 88, 90,
298 92, 94, 97, 100, 104, 108, 110, 114, 120, 124,
299 126, 128, 130, 132, 134, 138, 142, 146, 150, 154,
300 156, 158, 161, 165, 168, 170, 174, 175, 179, 180,
301 184, 186, 188
302 };
303
304 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
305 static const yysigned_char yyrhs[] =
306 {
307 23, 0, -1, 24, -1, 24, 25, -1, -1, 36,
308 12, 3, 24, 6, -1, 36, 12, 30, -1, 36,
309 12, 25, -1, 36, 13, 41, -1, -1, 5, 27,
310 8, 26, 13, 5, 29, 8, -1, 37, 12, 3,
311 24, 6, -1, 37, 12, 30, -1, 37, 12, 25,
312 -1, 37, 13, 41, -1, 27, 28, -1, 28, -1,
313 28, 12, 51, -1, 51, -1, 29, 41, -1, -1,
314 34, 31, 35, -1, -1, 31, 32, 33, -1, -1,
315 30, -1, 3, 24, 6, -1, 25, -1, 4, -1,
316 7, -1, 51, -1, 51, 38, -1, 51, 39, -1,
317 51, 39, 38, -1, 51, 38, 39, -1, 38, -1,
318 14, 51, 15, -1, 14, 14, 40, 15, 15, -1,
319 40, 16, 51, -1, 51, -1, 47, -1, 51, -1,
320 45, -1, 42, -1, 3, 43, 6, -1, 44, 17,
321 44, -1, 44, 18, 44, -1, 44, 19, 44, -1,
322 44, 20, 44, -1, 45, -1, 51, -1, 21, 46,
323 -1, 46, 12, 51, -1, 12, 51, -1, 51, -1,
324 34, 48, 35, -1, -1, 48, 49, 41, -1, -1,
325 50, 9, 11, -1, 11, -1, 10, -1, 50, -1
326 };
327
328 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
329 static const unsigned char yyrline[] =
330 {
331 0, 71, 71, 74, 75, 78, 80, 82, 84, 87,
332 86, 91, 92, 93, 94, 108, 110, 115, 116, 119,
333 120, 123, 126, 126, 127, 130, 131, 132, 135, 138,
334 148, 149, 150, 151, 152, 155, 158, 161, 164, 165,
335 168, 169, 171, 172, 175, 179, 180, 181, 182, 186,
336 187, 190, 194, 195, 196, 199, 202, 202, 204, 207,
337 214, 218, 219
338 };
339 #endif
340
341 #if YYDEBUG || YYERROR_VERBOSE
342 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
343 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
344 static const char *const yytname[] =
345 {
346 "$end", "error", "$undefined", "T_KEYWORD_LEFT", "T_ARRAY_LEFT",
347 "T_TABLE_LEFT", "T_KEYWORD_RIGHT", "T_ARRAY_RIGHT", "T_TABLE_RIGHT",
348 "T_CONCAT", "T_STRING", "T_QUOTED_STRING", "':'", "'='", "'<'", "'>'",
349 "','", "'*'", "'-'", "'+'", "'/'", "'$'", "$accept", "input",
350 "group_defs", "group_def", "@1", "stringlist", "table_key",
351 "tablevalues", "karray_defs", "karray_elems", "@2", "karray_elem",
352 "array_left", "array_right", "keyword", "implicit_keyword", "polymorph",
353 "parentlist", "commalist", "value", "expression", "subexpression",
354 "expvalue", "var_sub", "var_key", "array", "values", "@3",
355 "quoted_string", "string", 0
356 };
357 #endif
358
359 # ifdef YYPRINT
360 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
361 token YYLEX-NUM. */
362 static const unsigned short yytoknum[] =
363 {
364 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
365 265, 266, 58, 61, 60, 62, 44, 42, 45, 43,
366 47, 36
367 };
368 # endif
369
370 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
371 static const unsigned char yyr1[] =
372 {
373 0, 22, 23, 24, 24, 25, 25, 25, 25, 26,
374 25, 25, 25, 25, 25, 27, 27, 28, 28, 29,
375 29, 30, 32, 31, 31, 33, 33, 33, 34, 35,
376 36, 36, 36, 36, 36, 37, 38, 39, 40, 40,
377 41, 41, 41, 41, 42, 43, 43, 43, 43, 44,
378 44, 45, 46, 46, 46, 47, 49, 48, 48, 50,
379 50, 51, 51
380 };
381
382 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
383 static const unsigned char yyr2[] =
384 {
385 0, 2, 1, 2, 0, 5, 3, 3, 3, 0,
386 8, 5, 3, 3, 3, 2, 1, 3, 1, 2,
387 0, 3, 0, 3, 0, 1, 3, 1, 1, 1,
388 1, 2, 2, 3, 3, 1, 3, 5, 3, 1,
389 1, 1, 1, 1, 3, 3, 3, 3, 3, 1,
390 1, 2, 3, 2, 1, 3, 0, 3, 0, 3,
391 1, 1, 1
392 };
393
394 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
395 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
396 means the default is an error. */
397 static const unsigned char yydefact[] =
398 {
399 4, 0, 2, 1, 0, 61, 60, 0, 3, 0,
400 0, 35, 62, 30, 0, 16, 18, 0, 0, 0,
401 0, 0, 0, 0, 31, 32, 9, 15, 0, 36,
402 4, 28, 7, 6, 24, 0, 0, 58, 8, 43,
403 42, 40, 41, 4, 13, 12, 14, 59, 0, 0,
404 34, 33, 0, 17, 0, 22, 0, 0, 49, 50,
405 0, 51, 54, 56, 0, 0, 39, 0, 5, 29,
406 0, 21, 44, 0, 0, 0, 0, 53, 0, 55,
407 0, 11, 0, 0, 20, 4, 27, 25, 23, 45,
408 46, 47, 48, 52, 57, 37, 38, 0, 0, 10,
409 19, 26
410 };
411
412 /* YYDEFGOTO[NTERM-NUM]. */
413 static const yysigned_char yydefgoto[] =
414 {
415 -1, 1, 2, 8, 52, 14, 15, 97, 33, 55,
416 70, 88, 37, 71, 9, 10, 11, 25, 65, 38,
417 39, 56, 57, 58, 61, 41, 63, 80, 12, 13
418 };
419
420 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
421 STATE-NUM. */
422 #define YYPACT_NINF -24
423 static const yysigned_char yypact[] =
424 {
425 -24, 12, 113, -24, 80, -24, -24, 80, -24, 119,
426 121, -24, 5, 2, 118, 6, -24, 8, 32, 30,
427 78, 30, 16, 43, 24, 31, -24, 6, 80, -24,
428 -24, -24, -24, -24, -24, 38, 110, -24, -24, -24,
429 -24, -24, -24, -24, -24, -24, -24, -24, 80, 33,
430 -24, -24, 17, -24, 93, 45, 44, 47, -24, -24,
431 80, 56, -24, 45, 103, 120, -24, 68, -24, -24,
432 91, -24, -24, 38, 38, 38, 38, -24, 80, -24,
433 30, -24, 60, 80, -24, -24, -24, -24, -24, -24,
434 -24, -24, -24, -24, -24, -24, -24, 18, 105, -24,
435 -24, -24
436 };
437
438 /* YYPGOTO[NTERM-NUM]. */
439 static const yysigned_char yypgoto[] =
440 {
441 -24, -24, -23, -12, -24, -24, 64, -24, -15, -24,
442 -24, -24, -9, 34, -24, -24, 0, 76, -24, -20,
443 -24, -24, 11, -17, -24, -24, -24, -24, -24, -4
444 };
445
446 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
447 positive, shift that token. If negative, reduce the rule which
448 number is the opposite. If zero, do what YYDEFACT says.
449 If YYTABLE_NINF, syntax error. */
450 #define YYTABLE_NINF -1
451 static const unsigned char yytable[] =
452 {
453 16, 46, 40, 17, 40, 45, 32, 54, 44, 34,
454 16, 34, 3, 24, 22, 42, 23, 42, 28, 17,
455 64, 35, 31, 29, 53, 51, 99, 47, 5, 6,
456 67, 59, 62, 35, 31, 30, 31, 4, 49, 36,
457 5, 6, 5, 6, 66, 7, 7, 48, 5, 6,
458 72, 36, 69, 5, 6, 87, 77, 48, 86, 36,
459 94, 34, 98, 40, 73, 74, 75, 76, 78, 59,
460 59, 59, 59, 84, 93, 95, 42, 100, 27, 96,
461 40, 43, 31, 4, 89, 90, 91, 92, 5, 6,
462 5, 6, 7, 42, 85, 31, 4, 79, 4, 68,
463 50, 5, 6, 5, 6, 7, 0, 7, 4, 81,
464 4, 101, 0, 5, 6, 5, 6, 7, 4, 7,
465 5, 6, 60, 5, 6, 0, 26, 7, 5, 6,
466 0, 18, 19, 20, 21, 82, 83
467 };
468
469 static const yysigned_char yycheck[] =
470 {
471 4, 21, 19, 7, 21, 20, 18, 30, 20, 18,
472 14, 20, 0, 13, 9, 19, 14, 21, 12, 23,
473 43, 3, 4, 15, 28, 25, 8, 11, 10, 11,
474 13, 35, 36, 3, 4, 3, 4, 5, 14, 21,
475 10, 11, 10, 11, 48, 14, 14, 14, 10, 11,
476 6, 21, 7, 10, 11, 70, 60, 14, 70, 21,
477 80, 70, 85, 80, 17, 18, 19, 20, 12, 73,
478 74, 75, 76, 5, 78, 15, 80, 97, 14, 83,
479 97, 3, 4, 5, 73, 74, 75, 76, 10, 11,
480 10, 11, 14, 97, 3, 4, 5, 63, 5, 6,
481 24, 10, 11, 10, 11, 14, -1, 14, 5, 6,
482 5, 6, -1, 10, 11, 10, 11, 14, 5, 14,
483 10, 11, 12, 10, 11, -1, 8, 14, 10, 11,
484 -1, 12, 13, 12, 13, 15, 16
485 };
486
487 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
488 symbol of state STATE-NUM. */
489 static const unsigned char yystos[] =
490 {
491 0, 23, 24, 0, 5, 10, 11, 14, 25, 36,
492 37, 38, 50, 51, 27, 28, 51, 51, 12, 13,
493 12, 13, 9, 14, 38, 39, 8, 28, 12, 15,
494 3, 4, 25, 30, 34, 3, 21, 34, 41, 42,
495 45, 47, 51, 3, 25, 30, 41, 11, 14, 14,
496 39, 38, 26, 51, 24, 31, 43, 44, 45, 51,
497 12, 46, 51, 48, 24, 40, 51, 13, 6, 7,
498 32, 35, 6, 17, 18, 19, 20, 51, 12, 35,
499 49, 6, 15, 16, 5, 3, 25, 30, 33, 44,
500 44, 44, 44, 51, 41, 15, 51, 29, 24, 8,
501 41, 6
502 };
503
504 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
505 # define YYSIZE_T __SIZE_TYPE__
506 #endif
507 #if ! defined (YYSIZE_T) && defined (size_t)
508 # define YYSIZE_T size_t
509 #endif
510 #if ! defined (YYSIZE_T)
511 # if defined (__STDC__) || defined (__cplusplus)
512 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
513 # define YYSIZE_T size_t
514 # endif
515 #endif
516 #if ! defined (YYSIZE_T)
517 # define YYSIZE_T unsigned int
518 #endif
519
520 #define yyerrok (yyerrstatus = 0)
521 #define yyclearin (yychar = YYEMPTY)
522 #define YYEMPTY (-2)
523 #define YYEOF 0
524
525 #define YYACCEPT goto yyacceptlab
526 #define YYABORT goto yyabortlab
527 #define YYERROR goto yyerrlab1
528
529
530 /* Like YYERROR except do call yyerror. This remains here temporarily
531 to ease the transition to the new meaning of YYERROR, for GCC.
532 Once GCC version 2 has supplanted version 1, this can go. */
533
534 #define YYFAIL goto yyerrlab
535
536 #define YYRECOVERING() (!!yyerrstatus)
537
538 #define YYBACKUP(Token, Value) \
539 do \
540 if (yychar == YYEMPTY && yylen == 1) \
541 { \
542 yychar = (Token); \
543 yylval = (Value); \
544 yytoken = YYTRANSLATE (yychar); \
545 YYPOPSTACK; \
546 goto yybackup; \
547 } \
548 else \
549 { \
550 yyerror ("syntax error: cannot back up");\
551 YYERROR; \
552 } \
553 while (0)
554
555 #define YYTERROR 1
556 #define YYERRCODE 256
557
558 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
559 are run). */
560
561 #ifndef YYLLOC_DEFAULT
562 # define YYLLOC_DEFAULT(Current, Rhs, N) \
563 Current.first_line = Rhs[1].first_line; \
564 Current.first_column = Rhs[1].first_column; \
565 Current.last_line = Rhs[N].last_line; \
566 Current.last_column = Rhs[N].last_column;
567 #endif
568
569 /* YYLEX -- calling `yylex' with the right arguments. */
570
571 #ifdef YYLEX_PARAM
572 # define YYLEX yylex (YYLEX_PARAM)
573 #else
574 # define YYLEX yylex ()
575 #endif
576
577 /* Enable debugging if requested. */
578 #if YYDEBUG
579
580 # ifndef YYFPRINTF
581 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
582 # define YYFPRINTF fprintf
583 # endif
584
585 # define YYDPRINTF(Args) \
586 do { \
587 if (yydebug) \
588 YYFPRINTF Args; \
589 } while (0)
590
591 # define YYDSYMPRINT(Args) \
592 do { \
593 if (yydebug) \
594 yysymprint Args; \
595 } while (0)
596
597 # define YYDSYMPRINTF(Title, Token, Value, Location) \
598 do { \
599 if (yydebug) \
600 { \
601 YYFPRINTF (stderr, "%s ", Title); \
602 yysymprint (stderr, \
603 Token, Value); \
604 YYFPRINTF (stderr, "\n"); \
605 } \
606 } while (0)
607
608 /*------------------------------------------------------------------.
609 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
610 | TOP (cinluded). |
611 `------------------------------------------------------------------*/
612
613 #if defined (__STDC__) || defined (__cplusplus)
614 static void
yy_stack_print(short * bottom,short * top)615 yy_stack_print (short *bottom, short *top)
616 #else
617 static void
618 yy_stack_print (bottom, top)
619 short *bottom;
620 short *top;
621 #endif
622 {
623 YYFPRINTF (stderr, "Stack now");
624 for (/* Nothing. */; bottom <= top; ++bottom)
625 YYFPRINTF (stderr, " %d", *bottom);
626 YYFPRINTF (stderr, "\n");
627 }
628
629 # define YY_STACK_PRINT(Bottom, Top) \
630 do { \
631 if (yydebug) \
632 yy_stack_print ((Bottom), (Top)); \
633 } while (0)
634
635
636 /*------------------------------------------------.
637 | Report that the YYRULE is going to be reduced. |
638 `------------------------------------------------*/
639
640 #if defined (__STDC__) || defined (__cplusplus)
641 static void
yy_reduce_print(int yyrule)642 yy_reduce_print (int yyrule)
643 #else
644 static void
645 yy_reduce_print (yyrule)
646 int yyrule;
647 #endif
648 {
649 int yyi;
650 unsigned int yylineno = yyrline[yyrule];
651 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
652 yyrule - 1, yylineno);
653 /* Print the symbols being reduced, and their result. */
654 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
655 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
656 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
657 }
658
659 # define YY_REDUCE_PRINT(Rule) \
660 do { \
661 if (yydebug) \
662 yy_reduce_print (Rule); \
663 } while (0)
664
665 /* Nonzero means print parse trace. It is left uninitialized so that
666 multiple parsers can coexist. */
667 int yydebug;
668 #else /* !YYDEBUG */
669 # define YYDPRINTF(Args)
670 # define YYDSYMPRINT(Args)
671 # define YYDSYMPRINTF(Title, Token, Value, Location)
672 # define YY_STACK_PRINT(Bottom, Top)
673 # define YY_REDUCE_PRINT(Rule)
674 #endif /* !YYDEBUG */
675
676
677 /* YYINITDEPTH -- initial size of the parser's stacks. */
678 #ifndef YYINITDEPTH
679 # define YYINITDEPTH 200
680 #endif
681
682 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
683 if the built-in stack extension method is used).
684
685 Do not make this value too large; the results are undefined if
686 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
687 evaluated with infinite-precision integer arithmetic. */
688
689 #if YYMAXDEPTH == 0
690 # undef YYMAXDEPTH
691 #endif
692
693 #ifndef YYMAXDEPTH
694 # define YYMAXDEPTH 10000
695 #endif
696
697
698
699 #if YYERROR_VERBOSE
700
701 # ifndef yystrlen
702 # if defined (__GLIBC__) && defined (_STRING_H)
703 # define yystrlen strlen
704 # else
705 /* Return the length of YYSTR. */
706 static YYSIZE_T
707 # if defined (__STDC__) || defined (__cplusplus)
yystrlen(const char * yystr)708 yystrlen (const char *yystr)
709 # else
710 yystrlen (yystr)
711 const char *yystr;
712 # endif
713 {
714 register const char *yys = yystr;
715
716 while (*yys++ != '\0')
717 continue;
718
719 return yys - yystr - 1;
720 }
721 # endif
722 # endif
723
724 # ifndef yystpcpy
725 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
726 # define yystpcpy stpcpy
727 # else
728 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
729 YYDEST. */
730 static char *
731 # if defined (__STDC__) || defined (__cplusplus)
yystpcpy(char * yydest,const char * yysrc)732 yystpcpy (char *yydest, const char *yysrc)
733 # else
734 yystpcpy (yydest, yysrc)
735 char *yydest;
736 const char *yysrc;
737 # endif
738 {
739 register char *yyd = yydest;
740 register const char *yys = yysrc;
741
742 while ((*yyd++ = *yys++) != '\0')
743 continue;
744
745 return yyd - 1;
746 }
747 # endif
748 # endif
749
750 #endif /* !YYERROR_VERBOSE */
751
752
753
754 #if YYDEBUG
755 /*--------------------------------.
756 | Print this symbol on YYOUTPUT. |
757 `--------------------------------*/
758
759 #if defined (__STDC__) || defined (__cplusplus)
760 static void
yysymprint(FILE * yyoutput,int yytype,YYSTYPE * yyvaluep)761 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
762 #else
763 static void
764 yysymprint (yyoutput, yytype, yyvaluep)
765 FILE *yyoutput;
766 int yytype;
767 YYSTYPE *yyvaluep;
768 #endif
769 {
770 /* Pacify ``unused variable'' warnings. */
771 (void) yyvaluep;
772
773 if (yytype < YYNTOKENS)
774 {
775 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
776 # ifdef YYPRINT
777 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
778 # endif
779 }
780 else
781 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
782
783 switch (yytype)
784 {
785 default:
786 break;
787 }
788 YYFPRINTF (yyoutput, ")");
789 }
790
791 #endif /* ! YYDEBUG */
792 /*-----------------------------------------------.
793 | Release the memory associated to this symbol. |
794 `-----------------------------------------------*/
795
796 #if defined (__STDC__) || defined (__cplusplus)
797 static void
yydestruct(int yytype,YYSTYPE * yyvaluep)798 yydestruct (int yytype, YYSTYPE *yyvaluep)
799 #else
800 static void
801 yydestruct (yytype, yyvaluep)
802 int yytype;
803 YYSTYPE *yyvaluep;
804 #endif
805 {
806 /* Pacify ``unused variable'' warnings. */
807 (void) yyvaluep;
808
809 switch (yytype)
810 {
811
812 default:
813 break;
814 }
815 }
816
817
818 /* Prevent warnings from -Wmissing-prototypes. */
819
820 #ifdef YYPARSE_PARAM
821 # if defined (__STDC__) || defined (__cplusplus)
822
823 # else
824
825 # endif
826 #else /* ! YYPARSE_PARAM */
827 #if defined (__STDC__) || defined (__cplusplus)
828
829 #else
830
831 #endif
832 #endif /* ! YYPARSE_PARAM */
833
834
835
836 /* The lookahead symbol. */
837 int yychar;
838
839 /* The semantic value of the lookahead symbol. */
840 YYSTYPE yylval;
841
842 /* Number of syntax errors so far. */
843 int yynerrs;
844
845
846
847 /*----------.
848 | yyparse. |
849 `----------*/
850
851 #ifdef YYPARSE_PARAM
852 # if defined (__STDC__) || defined (__cplusplus)
yyparse(void * YYPARSE_PARAM)853 int yyparse (void *YYPARSE_PARAM)
854 # else
855 int yyparse (YYPARSE_PARAM)
856 void *YYPARSE_PARAM;
857 # endif
858 #else /* ! YYPARSE_PARAM */
859 #if defined (__STDC__) || defined (__cplusplus)
860 int
861 yyparse (void)
862 #else
863 int
864 yyparse ()
865
866 #endif
867 #endif
868 {
869
870 register int yystate;
871 register int yyn;
872 int yyresult;
873 /* Number of tokens to shift before error messages enabled. */
874 int yyerrstatus;
875 /* Lookahead token as an internal (translated) token number. */
876 int yytoken = 0;
877
878 /* Three stacks and their tools:
879 `yyss': related to states,
880 `yyvs': related to semantic values,
881 `yyls': related to locations.
882
883 Refer to the stacks thru separate pointers, to allow yyoverflow
884 to reallocate them elsewhere. */
885
886 /* The state stack. */
887 short yyssa[YYINITDEPTH];
888 short *yyss = yyssa;
889 register short *yyssp;
890
891 /* The semantic value stack. */
892 YYSTYPE yyvsa[YYINITDEPTH];
893 YYSTYPE *yyvs = yyvsa;
894 register YYSTYPE *yyvsp;
895
896
897
898 #define YYPOPSTACK (yyvsp--, yyssp--)
899
900 YYSIZE_T yystacksize = YYINITDEPTH;
901
902 /* The variables used to return semantic value and location from the
903 action routines. */
904 YYSTYPE yyval;
905
906
907 /* When reducing, the number of symbols on the RHS of the reduced
908 rule. */
909 int yylen;
910
911 YYDPRINTF ((stderr, "Starting parse\n"));
912
913 yystate = 0;
914 yyerrstatus = 0;
915 yynerrs = 0;
916 yychar = YYEMPTY; /* Cause a token to be read. */
917
918 /* Initialize stack pointers.
919 Waste one element of value and location stack
920 so that they stay on the same level as the state stack.
921 The wasted elements are never initialized. */
922
923 yyssp = yyss;
924 yyvsp = yyvs;
925
926 goto yysetstate;
927
928 /*------------------------------------------------------------.
929 | yynewstate -- Push a new state, which is found in yystate. |
930 `------------------------------------------------------------*/
931 yynewstate:
932 /* In all cases, when you get here, the value and location stacks
933 have just been pushed. so pushing a state here evens the stacks.
934 */
935 yyssp++;
936
937 yysetstate:
938 *yyssp = yystate;
939
940 if (yyss + yystacksize - 1 <= yyssp)
941 {
942 /* Get the current used size of the three stacks, in elements. */
943 YYSIZE_T yysize = yyssp - yyss + 1;
944
945 #ifdef yyoverflow
946 {
947 /* Give user a chance to reallocate the stack. Use copies of
948 these so that the &'s don't force the real ones into
949 memory. */
950 YYSTYPE *yyvs1 = yyvs;
951 short *yyss1 = yyss;
952
953
954 /* Each stack pointer address is followed by the size of the
955 data in use in that stack, in bytes. This used to be a
956 conditional around just the two extra args, but that might
957 be undefined if yyoverflow is a macro. */
958 yyoverflow ("parser stack overflow",
959 &yyss1, yysize * sizeof (*yyssp),
960 &yyvs1, yysize * sizeof (*yyvsp),
961
962 &yystacksize);
963
964 yyss = yyss1;
965 yyvs = yyvs1;
966 }
967 #else /* no yyoverflow */
968 # ifndef YYSTACK_RELOCATE
969 goto yyoverflowlab;
970 # else
971 /* Extend the stack our own way. */
972 if (YYMAXDEPTH <= yystacksize)
973 goto yyoverflowlab;
974 yystacksize *= 2;
975 if (YYMAXDEPTH < yystacksize)
976 yystacksize = YYMAXDEPTH;
977
978 {
979 short *yyss1 = yyss;
980 union yyalloc *yyptr =
981 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
982 if (! yyptr)
983 goto yyoverflowlab;
984 YYSTACK_RELOCATE (yyss);
985 YYSTACK_RELOCATE (yyvs);
986
987 # undef YYSTACK_RELOCATE
988 if (yyss1 != yyssa)
989 YYSTACK_FREE (yyss1);
990 }
991 # endif
992 #endif /* no yyoverflow */
993
994 yyssp = yyss + yysize - 1;
995 yyvsp = yyvs + yysize - 1;
996
997
998 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
999 (unsigned long int) yystacksize));
1000
1001 if (yyss + yystacksize - 1 <= yyssp)
1002 YYABORT;
1003 }
1004
1005 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1006
1007 goto yybackup;
1008
1009 /*-----------.
1010 | yybackup. |
1011 `-----------*/
1012 yybackup:
1013
1014 /* Do appropriate processing given the current state. */
1015 /* Read a lookahead token if we need one and don't already have one. */
1016 /* yyresume: */
1017
1018 /* First try to decide what to do without reference to lookahead token. */
1019
1020 yyn = yypact[yystate];
1021 if (yyn == YYPACT_NINF)
1022 goto yydefault;
1023
1024 /* Not known => get a lookahead token if don't already have one. */
1025
1026 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1027 if (yychar == YYEMPTY)
1028 {
1029 YYDPRINTF ((stderr, "Reading a token: "));
1030 yychar = YYLEX;
1031 }
1032
1033 if (yychar <= YYEOF)
1034 {
1035 yychar = yytoken = YYEOF;
1036 YYDPRINTF ((stderr, "Now at end of input.\n"));
1037 }
1038 else
1039 {
1040 yytoken = YYTRANSLATE (yychar);
1041 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1042 }
1043
1044 /* If the proper action on seeing token YYTOKEN is to reduce or to
1045 detect an error, take that action. */
1046 yyn += yytoken;
1047 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1048 goto yydefault;
1049 yyn = yytable[yyn];
1050 if (yyn <= 0)
1051 {
1052 if (yyn == 0 || yyn == YYTABLE_NINF)
1053 goto yyerrlab;
1054 yyn = -yyn;
1055 goto yyreduce;
1056 }
1057
1058 if (yyn == YYFINAL)
1059 YYACCEPT;
1060
1061 /* Shift the lookahead token. */
1062 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1063
1064 /* Discard the token being shifted unless it is eof. */
1065 if (yychar != YYEOF)
1066 yychar = YYEMPTY;
1067
1068 *++yyvsp = yylval;
1069
1070
1071 /* Count tokens shifted since error; after three, turn off error
1072 status. */
1073 if (yyerrstatus)
1074 yyerrstatus--;
1075
1076 yystate = yyn;
1077 goto yynewstate;
1078
1079
1080 /*-----------------------------------------------------------.
1081 | yydefault -- do the default action for the current state. |
1082 `-----------------------------------------------------------*/
1083 yydefault:
1084 yyn = yydefact[yystate];
1085 if (yyn == 0)
1086 goto yyerrlab;
1087 goto yyreduce;
1088
1089
1090 /*-----------------------------.
1091 | yyreduce -- Do a reduction. |
1092 `-----------------------------*/
1093 yyreduce:
1094 /* yyn is the number of a rule to reduce with. */
1095 yylen = yyr2[yyn];
1096
1097 /* If YYLEN is nonzero, implement the default value of the action:
1098 `$$ = $1'.
1099
1100 Otherwise, the following line sets YYVAL to garbage.
1101 This behavior is undocumented and Bison
1102 users should not rely upon it. Assigning to YYVAL
1103 unconditionally makes the parser a bit smaller, and it avoids a
1104 GCC warning that YYVAL may be used uninitialized. */
1105 yyval = yyvsp[1-yylen];
1106
1107
1108 YY_REDUCE_PRINT (yyn);
1109 switch (yyn)
1110 {
1111 case 5:
1112 #line 79 "ipv2_parse.yy"
1113 { ip_pop_keyword(); ;}
1114 break;
1115
1116 case 6:
1117 #line 81 "ipv2_parse.yy"
1118 { ip_pop_keyword(); ;}
1119 break;
1120
1121 case 7:
1122 #line 83 "ipv2_parse.yy"
1123 { ip_pop_keyword(); ;}
1124 break;
1125
1126 case 8:
1127 #line 85 "ipv2_parse.yy"
1128 { ip_pop_keyword(); ;}
1129 break;
1130
1131 case 9:
1132 #line 87 "ipv2_parse.yy"
1133 { ip_begin_table(yyvsp[-1].sl); ;}
1134 break;
1135
1136 case 10:
1137 #line 90 "ipv2_parse.yy"
1138 { ip_done_table(); ;}
1139 break;
1140
1141 case 15:
1142 #line 109 "ipv2_parse.yy"
1143 { yyval.sl = ip_add_string_list(yyvsp[-1].sl,yyvsp[0].str); ;}
1144 break;
1145
1146 case 16:
1147 #line 111 "ipv2_parse.yy"
1148 { yyval.sl = ip_string_to_string_list(yyvsp[0].str); ;}
1149 break;
1150
1151 case 17:
1152 #line 115 "ipv2_parse.yy"
1153 { yyval.str = ip_append_keystrings(yyvsp[-2].str,yyvsp[0].str); ;}
1154 break;
1155
1156 case 18:
1157 #line 116 "ipv2_parse.yy"
1158 { yyval.str = yyvsp[0].str; ;}
1159 break;
1160
1161 case 22:
1162 #line 126 "ipv2_parse.yy"
1163 { ip_incr_karray(); ;}
1164 break;
1165
1166 case 24:
1167 #line 127 "ipv2_parse.yy"
1168 { ip_init_karray(); ;}
1169 break;
1170
1171 case 28:
1172 #line 135 "ipv2_parse.yy"
1173 { ip_start_karray(); ;}
1174 break;
1175
1176 case 29:
1177 #line 138 "ipv2_parse.yy"
1178 { ip_pop_karray(); ;}
1179 break;
1180
1181 case 30:
1182 #line 148 "ipv2_parse.yy"
1183 { ip_push_keyword(yyvsp[0].str); ;}
1184 break;
1185
1186 case 31:
1187 #line 149 "ipv2_parse.yy"
1188 { ip_push_keyclass(yyvsp[-1].str,yyvsp[0].str,0); ;}
1189 break;
1190
1191 case 32:
1192 #line 150 "ipv2_parse.yy"
1193 { ip_push_keyclass(yyvsp[-1].str,0,yyvsp[0].sl); ;}
1194 break;
1195
1196 case 33:
1197 #line 151 "ipv2_parse.yy"
1198 { ip_push_keyclass(yyvsp[-2].str,yyvsp[0].str,yyvsp[-1].sl); ;}
1199 break;
1200
1201 case 34:
1202 #line 152 "ipv2_parse.yy"
1203 { ip_push_keyclass(yyvsp[-2].str,yyvsp[-1].str,yyvsp[0].sl); ;}
1204 break;
1205
1206 case 35:
1207 #line 155 "ipv2_parse.yy"
1208 { ip_push_keyclass(0,yyvsp[0].str,0); ;}
1209 break;
1210
1211 case 36:
1212 #line 158 "ipv2_parse.yy"
1213 { yyval.str = yyvsp[-1].str; ;}
1214 break;
1215
1216 case 37:
1217 #line 161 "ipv2_parse.yy"
1218 { yyval.sl = yyvsp[-2].sl; ;}
1219 break;
1220
1221 case 38:
1222 #line 164 "ipv2_parse.yy"
1223 { yyval.sl = ip_add_string_list(yyvsp[-2].sl,yyvsp[0].str); ;}
1224 break;
1225
1226 case 39:
1227 #line 165 "ipv2_parse.yy"
1228 { yyval.sl = ip_string_to_string_list(yyvsp[0].str); ;}
1229 break;
1230
1231 case 41:
1232 #line 170 "ipv2_parse.yy"
1233 { ip_assign_value(yyvsp[0].str); ;}
1234 break;
1235
1236 case 42:
1237 #line 171 "ipv2_parse.yy"
1238 { ip_assign_variable(yyvsp[0].str); ;}
1239 break;
1240
1241 case 43:
1242 #line 172 "ipv2_parse.yy"
1243 { ip_assign_value(yyvsp[0].str); ;}
1244 break;
1245
1246 case 44:
1247 #line 176 "ipv2_parse.yy"
1248 { yyval.str = ip_double_to_string(yyvsp[-1].dbl); ;}
1249 break;
1250
1251 case 45:
1252 #line 179 "ipv2_parse.yy"
1253 { yyval.dbl = yyvsp[-2].dbl * yyvsp[0].dbl; ;}
1254 break;
1255
1256 case 46:
1257 #line 180 "ipv2_parse.yy"
1258 { yyval.dbl = yyvsp[-2].dbl - yyvsp[0].dbl; ;}
1259 break;
1260
1261 case 47:
1262 #line 181 "ipv2_parse.yy"
1263 { yyval.dbl = yyvsp[-2].dbl + yyvsp[0].dbl; ;}
1264 break;
1265
1266 case 48:
1267 #line 182 "ipv2_parse.yy"
1268 { yyval.dbl = yyvsp[-2].dbl / yyvsp[0].dbl; ;}
1269 break;
1270
1271 case 49:
1272 #line 186 "ipv2_parse.yy"
1273 { yyval.dbl = ip_get_variable_double(yyvsp[0].str); ;}
1274 break;
1275
1276 case 50:
1277 #line 187 "ipv2_parse.yy"
1278 { yyval.dbl = atof(yyvsp[0].str); free(yyvsp[0].str); ;}
1279 break;
1280
1281 case 51:
1282 #line 190 "ipv2_parse.yy"
1283 { yyval.str = yyvsp[0].str; ;}
1284 break;
1285
1286 case 52:
1287 #line 194 "ipv2_parse.yy"
1288 { yyval.str = ip_append_keystrings(yyvsp[-2].str,yyvsp[0].str); ;}
1289 break;
1290
1291 case 53:
1292 #line 195 "ipv2_parse.yy"
1293 { yyval.str = ip_append_keystrings(NULL,yyvsp[0].str); ;}
1294 break;
1295
1296 case 54:
1297 #line 196 "ipv2_parse.yy"
1298 { yyval.str = yyvsp[0].str; ;}
1299 break;
1300
1301 case 56:
1302 #line 202 "ipv2_parse.yy"
1303 { ip_incr_karray(); ;}
1304 break;
1305
1306 case 58:
1307 #line 204 "ipv2_parse.yy"
1308 { ip_init_karray(); ;}
1309 break;
1310
1311 case 59:
1312 #line 208 "ipv2_parse.yy"
1313 { yyval.str = (char*) malloc(strlen(yyvsp[-2].str)+strlen(yyvsp[0].str)+1);
1314 strcpy(yyval.str, yyvsp[-2].str);
1315 strcat(yyval.str, yyvsp[0].str);
1316 free(yyvsp[-2].str);
1317 free(yyvsp[0].str);
1318 ;}
1319 break;
1320
1321 case 60:
1322 #line 215 "ipv2_parse.yy"
1323 { yyval.str = yyvsp[0].str; ;}
1324 break;
1325
1326 case 61:
1327 #line 218 "ipv2_parse.yy"
1328 { yyval.str = yyvsp[0].str; ;}
1329 break;
1330
1331 case 62:
1332 #line 219 "ipv2_parse.yy"
1333 { yyval.str = yyvsp[0].str; ;}
1334 break;
1335
1336
1337 }
1338
1339 /* Line 999 of yacc.c. */
1340 #line 1340 "ipv2_parse.tmp.cc"
1341
1342 yyvsp -= yylen;
1343 yyssp -= yylen;
1344
1345
1346 YY_STACK_PRINT (yyss, yyssp);
1347
1348 *++yyvsp = yyval;
1349
1350
1351 /* Now `shift' the result of the reduction. Determine what state
1352 that goes to, based on the state we popped back to and the rule
1353 number reduced by. */
1354
1355 yyn = yyr1[yyn];
1356
1357 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1358 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1359 yystate = yytable[yystate];
1360 else
1361 yystate = yydefgoto[yyn - YYNTOKENS];
1362
1363 goto yynewstate;
1364
1365
1366 /*------------------------------------.
1367 | yyerrlab -- here on detecting error |
1368 `------------------------------------*/
1369 yyerrlab:
1370 /* If not already recovering from an error, report this error. */
1371 if (!yyerrstatus)
1372 {
1373 ++yynerrs;
1374 #if YYERROR_VERBOSE
1375 yyn = yypact[yystate];
1376
1377 if (YYPACT_NINF < yyn && yyn < YYLAST)
1378 {
1379 YYSIZE_T yysize = 0;
1380 int yytype = YYTRANSLATE (yychar);
1381 char *yymsg;
1382 int yyx, yycount;
1383
1384 yycount = 0;
1385 /* Start YYX at -YYN if negative to avoid negative indexes in
1386 YYCHECK. */
1387 for (yyx = yyn < 0 ? -yyn : 0;
1388 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1389 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1390 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1391 yysize += yystrlen ("syntax error, unexpected ") + 1;
1392 yysize += yystrlen (yytname[yytype]);
1393 yymsg = (char *) YYSTACK_ALLOC (yysize);
1394 if (yymsg != 0)
1395 {
1396 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
1397 yyp = yystpcpy (yyp, yytname[yytype]);
1398
1399 if (yycount < 5)
1400 {
1401 yycount = 0;
1402 for (yyx = yyn < 0 ? -yyn : 0;
1403 yyx < (int) (sizeof (yytname) / sizeof (char *));
1404 yyx++)
1405 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1406 {
1407 const char *yyq = ! yycount ? ", expecting " : " or ";
1408 yyp = yystpcpy (yyp, yyq);
1409 yyp = yystpcpy (yyp, yytname[yyx]);
1410 yycount++;
1411 }
1412 }
1413 yyerror (yymsg);
1414 YYSTACK_FREE (yymsg);
1415 }
1416 else
1417 yyerror ("syntax error; also virtual memory exhausted");
1418 }
1419 else
1420 #endif /* YYERROR_VERBOSE */
1421 yyerror ("syntax error");
1422 }
1423
1424
1425
1426 if (yyerrstatus == 3)
1427 {
1428 /* If just tried and failed to reuse lookahead token after an
1429 error, discard it. */
1430
1431 /* Return failure if at end of input. */
1432 if (yychar == YYEOF)
1433 {
1434 /* Pop the error token. */
1435 YYPOPSTACK;
1436 /* Pop the rest of the stack. */
1437 while (yyss < yyssp)
1438 {
1439 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1440 yydestruct (yystos[*yyssp], yyvsp);
1441 YYPOPSTACK;
1442 }
1443 YYABORT;
1444 }
1445
1446 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
1447 yydestruct (yytoken, &yylval);
1448 yychar = YYEMPTY;
1449
1450 }
1451
1452 /* Else will try to reuse lookahead token after shifting the error
1453 token. */
1454 goto yyerrlab1;
1455
1456
1457 /*----------------------------------------------------.
1458 | yyerrlab1 -- error raised explicitly by an action. |
1459 `----------------------------------------------------*/
1460 yyerrlab1:
1461 yyerrstatus = 3; /* Each real token shifted decrements this. */
1462
1463 for (;;)
1464 {
1465 yyn = yypact[yystate];
1466 if (yyn != YYPACT_NINF)
1467 {
1468 yyn += YYTERROR;
1469 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1470 {
1471 yyn = yytable[yyn];
1472 if (0 < yyn)
1473 break;
1474 }
1475 }
1476
1477 /* Pop the current state because it cannot handle the error token. */
1478 if (yyssp == yyss)
1479 YYABORT;
1480
1481 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1482 yydestruct (yystos[yystate], yyvsp);
1483 yyvsp--;
1484 yystate = *--yyssp;
1485
1486 YY_STACK_PRINT (yyss, yyssp);
1487 }
1488
1489 if (yyn == YYFINAL)
1490 YYACCEPT;
1491
1492 YYDPRINTF ((stderr, "Shifting error token, "));
1493
1494 *++yyvsp = yylval;
1495
1496
1497 yystate = yyn;
1498 goto yynewstate;
1499
1500
1501 /*-------------------------------------.
1502 | yyacceptlab -- YYACCEPT comes here. |
1503 `-------------------------------------*/
1504 yyacceptlab:
1505 yyresult = 0;
1506 goto yyreturn;
1507
1508 /*-----------------------------------.
1509 | yyabortlab -- YYABORT comes here. |
1510 `-----------------------------------*/
1511 yyabortlab:
1512 yyresult = 1;
1513 goto yyreturn;
1514
1515 #ifndef yyoverflow
1516 /*----------------------------------------------.
1517 | yyoverflowlab -- parser overflow comes here. |
1518 `----------------------------------------------*/
1519 yyoverflowlab:
1520 yyerror ("parser stack overflow");
1521 yyresult = 2;
1522 /* Fall through. */
1523 #endif
1524
1525 yyreturn:
1526 #ifndef yyoverflow
1527 if (yyss != yyssa)
1528 YYSTACK_FREE (yyss);
1529 #endif
1530 return yyresult;
1531 }
1532
1533
1534 #line 222 "ipv2_parse.yy"
1535
1536
1537