1 /* A Bison parser, made from partn.y, by GNU bison 1.75. */
\r
3 /* Skeleton parser for Yacc-like parsing with Bison,
\r
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
\r
6 This program is free software; you can redistribute it and/or modify
\r
7 it under the terms of the GNU General Public License as published by
\r
8 the Free Software Foundation; either version 2, or (at your option)
\r
11 This program is distributed in the hope that it will be useful,
\r
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 GNU General Public License for more details.
\r
16 You should have received a copy of the GNU General Public License
\r
17 along with this program; if not, write to the Free Software
\r
18 Foundation, Inc., 59 Temple Place - Suite 330,
\r
19 Boston, MA 02111-1307, USA. */
\r
21 /* As a special exception, when this file is copied by Bison into a
\r
22 Bison output file, you may use that output file without restriction.
\r
23 This special exception was added by the Free Software Foundation
\r
24 in version 1.24 of Bison. */
\r
26 /* Written by Richard Stallman by simplifying the original so called
\r
27 ``semantic'' parser. */
\r
29 /* All symbols defined below should begin with yy or YY, to avoid
\r
30 infringing on user name space. This should be done even for local
\r
31 variables, as they might otherwise be expanded by user macros.
\r
32 There are some unavoidable exceptions within include files to
\r
33 define necessary library symbols; they are noted "INFRINGES ON
\r
34 USER NAME SPACE" below. */
\r
36 /* Identify Bison output. */
\r
42 /* Using locations. */
\r
43 #define YYLSP_NEEDED 0
\r
45 /* If NAME_PREFIX is specified substitute the variables and functions
\r
47 #define yyparse PartnParserparse
\r
48 #define yylex PartnParserlex
\r
49 #define yyerror PartnParsererror
\r
50 #define yylval PartnParserlval
\r
51 #define yychar PartnParserchar
\r
52 #define yydebug PartnParserdebug
\r
53 #define yynerrs PartnParsernerrs
\r
58 # define YYTOKENTYPE
\r
59 /* Put the tokens into the symbol table, so that GDB and other debuggers
\r
73 #define STRING_TOKEN 259
\r
75 #define LONGINTNUM 261
\r
84 /* Copy the first part of user declarations. */
\r
91 /* Some addn'l includes, necessary but not included by the
\r
92 bison generated code.
\r
97 /* prototypes for the parser callbacks.
\r
100 #include "parse_partn.h"
\r
102 extern partn_def_list_t *partn_parse_result;
\r
109 /* Enabling traces. */
\r
114 /* Enabling verbose error messages. */
\r
115 #ifdef YYERROR_VERBOSE
\r
116 # undef YYERROR_VERBOSE
\r
117 # define YYERROR_VERBOSE 1
\r
119 # define YYERROR_VERBOSE 0
\r
130 /* for FTA definition. */
\r
132 scalarexp_t *scalarval;
\r
133 se_list_t *se_listval;
\r
135 partn_def_list_t *pdl;
\r
138 /* Line 193 of /usr/local/share/bison/yacc.c. */
\r
139 #line 140 "partn.tab.cc"
\r
140 # define YYSTYPE yystype
\r
141 # define YYSTYPE_IS_TRIVIAL 1
\r
145 typedef struct yyltype
\r
152 # define YYLTYPE yyltype
\r
153 # define YYLTYPE_IS_TRIVIAL 1
\r
156 /* Copy the second part of user declarations. */
\r
159 /* Line 213 of /usr/local/share/bison/yacc.c. */
\r
160 #line 161 "partn.tab.cc"
\r
162 #if ! defined (yyoverflow) || YYERROR_VERBOSE
\r
164 /* The parser invokes alloca or malloc; define the necessary symbols. */
\r
166 # if YYSTACK_USE_ALLOCA
\r
167 # define YYSTACK_ALLOC alloca
\r
169 # ifndef YYSTACK_USE_ALLOCA
\r
170 # if defined (alloca) || defined (_ALLOCA_H)
\r
171 # define YYSTACK_ALLOC alloca
\r
174 # define YYSTACK_ALLOC __builtin_alloca
\r
180 # ifdef YYSTACK_ALLOC
\r
181 /* Pacify GCC's `empty if-body' warning. */
\r
182 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
\r
184 # if defined (__STDC__) || defined (__cplusplus)
\r
185 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
\r
186 # define YYSIZE_T size_t
\r
188 # define YYSTACK_ALLOC malloc
\r
189 # define YYSTACK_FREE free
\r
191 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
\r
194 #if (! defined (yyoverflow) \
\r
195 && (! defined (__cplusplus) \
\r
196 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
\r
198 /* A type that is properly aligned for any stack member. */
\r
205 /* The size of the maximum gap between one aligned stack and the next. */
\r
206 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
\r
208 /* The size of an array large to enough to hold all stacks, each with
\r
210 # define YYSTACK_BYTES(N) \
\r
211 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
\r
214 /* Copy COUNT objects from FROM to TO. The source and destination do
\r
218 # define YYCOPY(To, From, Count) \
\r
219 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
\r
221 # define YYCOPY(To, From, Count) \
\r
224 register YYSIZE_T yyi; \
\r
225 for (yyi = 0; yyi < (Count); yyi++) \
\r
226 (To)[yyi] = (From)[yyi]; \
\r
232 /* Relocate STACK from its old location to the new one. The
\r
233 local variables YYSIZE and YYSTACKSIZE give the old and new number of
\r
234 elements in the stack, and YYPTR gives the new location of the
\r
235 stack. Advance YYPTR to a properly aligned location for the next
\r
237 # define YYSTACK_RELOCATE(Stack) \
\r
240 YYSIZE_T yynewbytes; \
\r
241 YYCOPY (&yyptr->Stack, Stack, yysize); \
\r
242 Stack = &yyptr->Stack; \
\r
243 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
\r
244 yyptr += yynewbytes / sizeof (*yyptr); \
\r
250 #if defined (__STDC__) || defined (__cplusplus)
\r
251 typedef signed char yysigned_char;
\r
253 typedef short yysigned_char;
\r
256 /* YYFINAL -- State number of the termination state. */
\r
260 /* YYNTOKENS -- Number of terminals. */
\r
261 #define YYNTOKENS 23
\r
262 /* YYNNTS -- Number of nonterminals. */
\r
264 /* YYNRULES -- Number of rules. */
\r
265 #define YYNRULES 24
\r
266 /* YYNRULES -- Number of states. */
\r
267 #define YYNSTATES 47
\r
269 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
\r
270 #define YYUNDEFTOK 2
\r
271 #define YYMAXUTOK 265
\r
273 #define YYTRANSLATE(X) \
\r
274 ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK)
\r
276 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
\r
277 static const unsigned char yytranslate[] =
\r
279 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
280 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
281 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
282 2, 2, 2, 2, 2, 2, 2, 2, 8, 2,
\r
283 20, 21, 11, 9, 22, 10, 2, 12, 2, 2,
\r
284 2, 2, 2, 2, 2, 2, 2, 2, 19, 2,
\r
285 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
286 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
287 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
288 2, 17, 2, 18, 2, 2, 2, 2, 2, 2,
\r
289 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
290 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
291 2, 2, 2, 2, 7, 2, 2, 2, 2, 2,
\r
292 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
293 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
294 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
295 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
296 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
297 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
298 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
299 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
300 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
301 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
302 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
303 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
\r
304 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
\r
305 5, 6, 13, 14, 15, 16
\r
309 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
\r
311 static const unsigned char yyprhs[] =
\r
313 0, 0, 3, 5, 7, 10, 19, 23, 27, 31,
\r
314 35, 39, 43, 46, 49, 51, 53, 57, 59, 63,
\r
318 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
\r
319 static const yysigned_char yyrhs[] =
\r
321 24, 0, -1, 25, -1, 26, -1, 25, 26, -1,
\r
322 3, 17, 3, 18, 19, 20, 28, 21, -1, 27,
\r
323 9, 27, -1, 27, 10, 27, -1, 27, 7, 27,
\r
324 -1, 27, 11, 27, -1, 27, 12, 27, -1, 27,
\r
325 8, 27, -1, 9, 27, -1, 10, 27, -1, 29,
\r
326 -1, 30, -1, 20, 27, 21, -1, 27, -1, 28,
\r
327 22, 27, -1, 5, -1, 6, -1, 14, 4, -1,
\r
328 15, 4, -1, 16, 4, -1, 3, -1
\r
331 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
\r
332 static const unsigned char yyrline[] =
\r
334 0, 75, 75, 81, 83, 86, 91, 93, 94, 95,
\r
335 96, 97, 98, 99, 100, 101, 102, 105, 107, 110,
\r
336 112, 113, 114, 115, 119
\r
340 #if YYDEBUG || YYERROR_VERBOSE
\r
341 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
\r
342 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
\r
343 static const char *const yytname[] =
\r
345 "$end", "error", "$undefined", "NAME", "STRING_TOKEN", "INTNUM",
\r
346 "LONGINTNUM", "'|'", "'&'", "'+'", "'-'", "'*'", "'/'", "UMINUS",
\r
347 "HEX_L", "LHEX_L", "IP_L", "'['", "']'", "':'", "'('", "')'", "','",
\r
348 "$accept", "parse_result", "partn_def_list", "partn_def", "scalar_exp",
\r
349 "scalar_exp_commalist", "literal", "column_ref", 0
\r
354 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
\r
355 token YYLEX-NUM. */
\r
356 static const unsigned short yytoknum[] =
\r
358 0, 256, 257, 258, 259, 260, 261, 124, 38, 43,
\r
359 45, 42, 47, 262, 263, 264, 265, 91, 93, 58,
\r
364 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
\r
365 static const unsigned char yyr1[] =
\r
367 0, 23, 24, 25, 25, 26, 27, 27, 27, 27,
\r
368 27, 27, 27, 27, 27, 27, 27, 28, 28, 29,
\r
372 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
\r
373 static const unsigned char yyr2[] =
\r
375 0, 2, 1, 1, 2, 8, 3, 3, 3, 3,
\r
376 3, 3, 2, 2, 1, 1, 3, 1, 3, 1,
\r
380 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
\r
381 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
\r
382 means the default is an error. */
\r
383 static const unsigned char yydefact[] =
\r
385 0, 0, 0, 2, 3, 0, 1, 4, 0, 0,
\r
386 0, 0, 24, 19, 20, 0, 0, 0, 0, 0,
\r
387 0, 17, 0, 14, 15, 12, 13, 21, 22, 23,
\r
388 0, 0, 0, 0, 0, 0, 0, 5, 0, 16,
\r
389 8, 11, 6, 7, 9, 10, 18
\r
392 /* YYDEFGOTO[NTERM-NUM]. */
\r
393 static const yysigned_char yydefgoto[] =
\r
395 -1, 2, 3, 4, 21, 22, 23, 24
\r
398 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
\r
400 #define YYPACT_NINF -20
\r
401 static const yysigned_char yypact[] =
\r
403 1, 13, 31, 1, -20, 29, -20, -20, 18, 32,
\r
404 17, 19, -20, -20, -20, 19, 19, 34, 48, 49,
\r
405 19, -1, -19, -20, -20, -20, -20, -20, -20, -20,
\r
406 33, 19, 19, 19, 19, 19, 19, -20, 19, -20,
\r
407 38, 3, 15, 15, -20, -20, -1
\r
410 /* YYPGOTO[NTERM-NUM]. */
\r
411 static const yysigned_char yypgoto[] =
\r
413 -20, -20, -20, 52, -15, -20, -20, -20
\r
416 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
\r
417 positive, shift that token. If negative, reduce the rule which
\r
418 number is the opposite. If zero, do what YYDEFACT says.
\r
419 If YYTABLE_NINF, parse error. */
\r
420 #define YYTABLE_NINF -1
\r
421 static const unsigned char yytable[] =
\r
423 25, 26, 37, 38, 1, 30, 31, 32, 33, 34,
\r
424 35, 36, 33, 34, 35, 36, 40, 41, 42, 43,
\r
425 44, 45, 12, 46, 13, 14, 35, 36, 15, 16,
\r
426 5, 6, 8, 17, 18, 19, 9, 11, 27, 20,
\r
427 31, 32, 33, 34, 35, 36, 32, 33, 34, 35,
\r
428 36, 10, 28, 29, 39, 7
\r
431 static const unsigned char yycheck[] =
\r
433 15, 16, 21, 22, 3, 20, 7, 8, 9, 10,
\r
434 11, 12, 9, 10, 11, 12, 31, 32, 33, 34,
\r
435 35, 36, 3, 38, 5, 6, 11, 12, 9, 10,
\r
436 17, 0, 3, 14, 15, 16, 18, 20, 4, 20,
\r
437 7, 8, 9, 10, 11, 12, 8, 9, 10, 11,
\r
438 12, 19, 4, 4, 21, 3
\r
441 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
\r
442 symbol of state STATE-NUM. */
\r
443 static const unsigned char yystos[] =
\r
445 0, 3, 24, 25, 26, 17, 0, 26, 3, 18,
\r
446 19, 20, 3, 5, 6, 9, 10, 14, 15, 16,
\r
447 20, 27, 28, 29, 30, 27, 27, 4, 4, 4,
\r
448 27, 7, 8, 9, 10, 11, 12, 21, 22, 21,
\r
449 27, 27, 27, 27, 27, 27, 27
\r
452 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
\r
453 # define YYSIZE_T __SIZE_TYPE__
\r
455 #if ! defined (YYSIZE_T) && defined (size_t)
\r
456 # define YYSIZE_T size_t
\r
458 #if ! defined (YYSIZE_T)
\r
459 # if defined (__STDC__) || defined (__cplusplus)
\r
460 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
\r
461 # define YYSIZE_T size_t
\r
464 #if ! defined (YYSIZE_T)
\r
465 # define YYSIZE_T unsigned int
\r
468 #define yyerrok (yyerrstatus = 0)
\r
469 #define yyclearin (yychar = YYEMPTY)
\r
473 #define YYACCEPT goto yyacceptlab
\r
474 #define YYABORT goto yyabortlab
\r
475 #define YYERROR goto yyerrlab1
\r
477 /* Like YYERROR except do call yyerror. This remains here temporarily
\r
478 to ease the transition to the new meaning of YYERROR, for GCC.
\r
479 Once GCC version 2 has supplanted version 1, this can go. */
\r
481 #define YYFAIL goto yyerrlab
\r
483 #define YYRECOVERING() (!!yyerrstatus)
\r
485 #define YYBACKUP(Token, Value) \
\r
487 if (yychar == YYEMPTY && yylen == 1) \
\r
489 yychar = (Token); \
\r
490 yylval = (Value); \
\r
491 yychar1 = YYTRANSLATE (yychar); \
\r
497 yyerror ("syntax error: cannot back up"); \
\r
503 #define YYERRCODE 256
\r
505 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
\r
508 #ifndef YYLLOC_DEFAULT
\r
509 # define YYLLOC_DEFAULT(Current, Rhs, N) \
\r
510 Current.first_line = Rhs[1].first_line; \
\r
511 Current.first_column = Rhs[1].first_column; \
\r
512 Current.last_line = Rhs[N].last_line; \
\r
513 Current.last_column = Rhs[N].last_column;
\r
516 /* YYLEX -- calling `yylex' with the right arguments. */
\r
518 #define YYLEX yylex ()
\r
520 /* Enable debugging if requested. */
\r
524 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
\r
525 # define YYFPRINTF fprintf
\r
528 # define YYDPRINTF(Args) \
\r
533 # define YYDSYMPRINT(Args) \
\r
538 /* Nonzero means print parse trace. It is left uninitialized so that
\r
539 multiple parsers can coexist. */
\r
541 #else /* !YYDEBUG */
\r
542 # define YYDPRINTF(Args)
\r
543 # define YYDSYMPRINT(Args)
\r
544 #endif /* !YYDEBUG */
\r
546 /* YYINITDEPTH -- initial size of the parser's stacks. */
\r
547 #ifndef YYINITDEPTH
\r
548 # define YYINITDEPTH 200
\r
551 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
\r
552 if the built-in stack extension method is used).
\r
554 Do not make this value too large; the results are undefined if
\r
555 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
\r
556 evaluated with infinite-precision integer arithmetic. */
\r
558 #if YYMAXDEPTH == 0
\r
563 # define YYMAXDEPTH 10000
\r
568 #if YYERROR_VERBOSE
\r
571 # if defined (__GLIBC__) && defined (_STRING_H)
\r
572 # define yystrlen strlen
\r
574 /* Return the length of YYSTR. */
\r
576 # if defined (__STDC__) || defined (__cplusplus)
\r
577 yystrlen (const char *yystr)
\r
583 register const char *yys = yystr;
\r
585 while (*yys++ != '\0')
\r
588 return yys - yystr - 1;
\r
594 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
\r
595 # define yystpcpy stpcpy
\r
597 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
\r
600 # if defined (__STDC__) || defined (__cplusplus)
\r
601 yystpcpy (char *yydest, const char *yysrc)
\r
603 yystpcpy (yydest, yysrc)
\r
608 register char *yyd = yydest;
\r
609 register const char *yys = yysrc;
\r
611 while ((*yyd++ = *yys++) != '\0')
\r
619 #endif /* !YYERROR_VERBOSE */
\r
624 /*-----------------------------.
\r
625 | Print this symbol on YYOUT. |
\r
626 `-----------------------------*/
\r
629 #if defined (__STDC__) || defined (__cplusplus)
\r
630 yysymprint (FILE* yyout, int yytype, YYSTYPE yyvalue)
\r
632 yysymprint (yyout, yytype, yyvalue)
\r
638 /* Pacify ``unused variable'' warnings. */
\r
641 if (yytype < YYNTOKENS)
\r
643 YYFPRINTF (yyout, "token %s (", yytname[yytype]);
\r
645 YYPRINT (yyout, yytoknum[yytype], yyvalue);
\r
649 YYFPRINTF (yyout, "nterm %s (", yytname[yytype]);
\r
656 YYFPRINTF (yyout, ")");
\r
658 #endif /* YYDEBUG. */
\r
661 /*-----------------------------------------------.
\r
662 | Release the memory associated to this symbol. |
\r
663 `-----------------------------------------------*/
\r
666 #if defined (__STDC__) || defined (__cplusplus)
\r
667 yydestruct (int yytype, YYSTYPE yyvalue)
\r
669 yydestruct (yytype, yyvalue)
\r
674 /* Pacify ``unused variable'' warnings. */
\r
686 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
\r
687 into yyparse. The argument should have type void *.
\r
688 It should actually point to an object.
\r
689 Grammar actions can access the variable by casting it
\r
690 to the proper pointer type. */
\r
692 #ifdef YYPARSE_PARAM
\r
693 # if defined (__STDC__) || defined (__cplusplus)
\r
694 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
\r
695 # define YYPARSE_PARAM_DECL
\r
697 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
\r
698 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
\r
700 #else /* !YYPARSE_PARAM */
\r
701 # define YYPARSE_PARAM_ARG
\r
702 # define YYPARSE_PARAM_DECL
\r
703 #endif /* !YYPARSE_PARAM */
\r
705 /* Prevent warning if -Wstrict-prototypes. */
\r
707 # ifdef YYPARSE_PARAM
\r
708 int yyparse (void *);
\r
710 int yyparse (void);
\r
715 /* The lookahead symbol. */
\r
718 /* The semantic value of the lookahead symbol. */
\r
721 /* Number of parse errors so far. */
\r
726 yyparse (YYPARSE_PARAM_ARG)
\r
730 register int yystate;
\r
733 /* Number of tokens to shift before error messages enabled. */
\r
735 /* Lookahead token as an internal (translated) token number. */
\r
738 /* Three stacks and their tools:
\r
739 `yyss': related to states,
\r
740 `yyvs': related to semantic values,
\r
741 `yyls': related to locations.
\r
743 Refer to the stacks thru separate pointers, to allow yyoverflow
\r
744 to reallocate them elsewhere. */
\r
746 /* The state stack. */
\r
747 short yyssa[YYINITDEPTH];
\r
748 short *yyss = yyssa;
\r
749 register short *yyssp;
\r
751 /* The semantic value stack. */
\r
752 YYSTYPE yyvsa[YYINITDEPTH];
\r
753 YYSTYPE *yyvs = yyvsa;
\r
754 register YYSTYPE *yyvsp;
\r
758 #define YYPOPSTACK (yyvsp--, yyssp--)
\r
760 YYSIZE_T yystacksize = YYINITDEPTH;
\r
762 /* The variables used to return semantic value and location from the
\r
763 action routines. */
\r
767 /* When reducing, the number of symbols on the RHS of the reduced
\r
771 YYDPRINTF ((stderr, "Starting parse\n"));
\r
776 yychar = YYEMPTY; /* Cause a token to be read. */
\r
778 /* Initialize stack pointers.
\r
779 Waste one element of value and location stack
\r
780 so that they stay on the same level as the state stack.
\r
781 The wasted elements are never initialized. */
\r
788 /*------------------------------------------------------------.
\r
789 | yynewstate -- Push a new state, which is found in yystate. |
\r
790 `------------------------------------------------------------*/
\r
792 /* In all cases, when you get here, the value and location stacks
\r
793 have just been pushed. so pushing a state here evens the stacks.
\r
800 if (yyssp >= yyss + yystacksize - 1)
\r
802 /* Get the current used size of the three stacks, in elements. */
\r
803 YYSIZE_T yysize = yyssp - yyss + 1;
\r
807 /* Give user a chance to reallocate the stack. Use copies of
\r
808 these so that the &'s don't force the real ones into
\r
810 YYSTYPE *yyvs1 = yyvs;
\r
811 short *yyss1 = yyss;
\r
814 /* Each stack pointer address is followed by the size of the
\r
815 data in use in that stack, in bytes. This used to be a
\r
816 conditional around just the two extra args, but that might
\r
817 be undefined if yyoverflow is a macro. */
\r
818 yyoverflow ("parser stack overflow",
\r
819 &yyss1, yysize * sizeof (*yyssp),
\r
820 &yyvs1, yysize * sizeof (*yyvsp),
\r
827 #else /* no yyoverflow */
\r
828 # ifndef YYSTACK_RELOCATE
\r
829 goto yyoverflowlab;
\r
831 /* Extend the stack our own way. */
\r
832 if (yystacksize >= YYMAXDEPTH)
\r
833 goto yyoverflowlab;
\r
835 if (yystacksize > YYMAXDEPTH)
\r
836 yystacksize = YYMAXDEPTH;
\r
839 short *yyss1 = yyss;
\r
840 union yyalloc *yyptr =
\r
841 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
\r
843 goto yyoverflowlab;
\r
844 YYSTACK_RELOCATE (yyss);
\r
845 YYSTACK_RELOCATE (yyvs);
\r
847 # undef YYSTACK_RELOCATE
\r
848 if (yyss1 != yyssa)
\r
849 YYSTACK_FREE (yyss1);
\r
852 #endif /* no yyoverflow */
\r
854 yyssp = yyss + yysize - 1;
\r
855 yyvsp = yyvs + yysize - 1;
\r
858 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
\r
859 (unsigned long int) yystacksize));
\r
861 if (yyssp >= yyss + yystacksize - 1)
\r
865 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
\r
874 /* Do appropriate processing given the current state. */
\r
875 /* Read a lookahead token if we need one and don't already have one. */
\r
878 /* First try to decide what to do without reference to lookahead token. */
\r
880 yyn = yypact[yystate];
\r
881 if (yyn == YYPACT_NINF)
\r
884 /* Not known => get a lookahead token if don't already have one. */
\r
886 /* yychar is either YYEMPTY or YYEOF
\r
887 or a valid token in external form. */
\r
889 if (yychar == YYEMPTY)
\r
891 YYDPRINTF ((stderr, "Reading a token: "));
\r
895 /* Convert token to internal form (in yychar1) for indexing tables with. */
\r
897 if (yychar <= 0) /* This means end of input. */
\r
900 yychar = YYEOF; /* Don't call YYLEX any more. */
\r
902 YYDPRINTF ((stderr, "Now at end of input.\n"));
\r
906 yychar1 = YYTRANSLATE (yychar);
\r
908 /* We have to keep this `#if YYDEBUG', since we use variables
\r
909 which are defined only if `YYDEBUG' is set. */
\r
910 YYDPRINTF ((stderr, "Next token is "));
\r
911 YYDSYMPRINT ((stderr, yychar1, yylval));
\r
912 YYDPRINTF ((stderr, "\n"));
\r
915 /* If the proper action on seeing token YYCHAR1 is to reduce or to
\r
916 detect an error, take that action. */
\r
918 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1)
\r
920 yyn = yytable[yyn];
\r
923 if (yyn == 0 || yyn == YYTABLE_NINF)
\r
929 if (yyn == YYFINAL)
\r
932 /* Shift the lookahead token. */
\r
933 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
\r
934 yychar, yytname[yychar1]));
\r
936 /* Discard the token being shifted unless it is eof. */
\r
937 if (yychar != YYEOF)
\r
943 /* Count tokens shifted since error; after three, turn off error
\r
952 /*-----------------------------------------------------------.
\r
953 | yydefault -- do the default action for the current state. |
\r
954 `-----------------------------------------------------------*/
\r
956 yyn = yydefact[yystate];
\r
962 /*-----------------------------.
\r
963 | yyreduce -- Do a reduction. |
\r
964 `-----------------------------*/
\r
966 /* yyn is the number of a rule to reduce with. */
\r
969 /* If YYLEN is nonzero, implement the default value of the action:
\r
972 Otherwise, the following line sets YYVAL to garbage.
\r
973 This behavior is undocumented and Bison
\r
974 users should not rely upon it. Assigning to YYVAL
\r
975 unconditionally makes the parser a bit smaller, and it avoids a
\r
976 GCC warning that YYVAL may be used uninitialized. */
\r
977 yyval = yyvsp[1-yylen];
\r
982 /* We have to keep this `#if YYDEBUG', since we use variables which
\r
983 are defined only if `YYDEBUG' is set. */
\r
988 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
\r
989 yyn - 1, yyrline[yyn]);
\r
991 /* Print the symbols being reduced, and their result. */
\r
992 for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)
\r
993 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
\r
994 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
\r
1000 #line 75 "partn.y"
\r
1002 partn_parse_result = yyvsp[0].pdl;
\r
1007 #line 82 "partn.y"
\r
1008 {yyval.pdl = new partn_def_list_t(yyvsp[0].pd);}
\r
1012 #line 83 "partn.y"
\r
1013 {yyval.pdl=yyvsp[-1].pdl->append(yyvsp[0].pd);}
\r
1017 #line 88 "partn.y"
\r
1018 {yyval.pd = new partn_def_t(yyvsp[-7].strval,yyvsp[-5].strval,yyvsp[-1].se_listval);}
\r
1022 #line 92 "partn.y"
\r
1023 { yyval.scalarval=new scalarexp_t("+",yyvsp[-2].scalarval,yyvsp[0].scalarval);}
\r
1027 #line 93 "partn.y"
\r
1028 { yyval.scalarval=new scalarexp_t("-",yyvsp[-2].scalarval,yyvsp[0].scalarval);}
\r
1032 #line 94 "partn.y"
\r
1033 { yyval.scalarval=new scalarexp_t("|",yyvsp[-2].scalarval,yyvsp[0].scalarval);}
\r
1037 #line 95 "partn.y"
\r
1038 { yyval.scalarval=new scalarexp_t("*",yyvsp[-2].scalarval,yyvsp[0].scalarval);}
\r
1042 #line 96 "partn.y"
\r
1043 { yyval.scalarval=new scalarexp_t("/",yyvsp[-2].scalarval,yyvsp[0].scalarval);}
\r
1047 #line 97 "partn.y"
\r
1048 { yyval.scalarval=new scalarexp_t("&",yyvsp[-2].scalarval,yyvsp[0].scalarval);}
\r
1052 #line 98 "partn.y"
\r
1053 { yyval.scalarval = new scalarexp_t("+",yyvsp[0].scalarval);}
\r
1057 #line 99 "partn.y"
\r
1058 { yyval.scalarval = new scalarexp_t("-",yyvsp[0].scalarval);}
\r
1062 #line 100 "partn.y"
\r
1063 { yyval.scalarval= new scalarexp_t(yyvsp[0].litval);}
\r
1067 #line 101 "partn.y"
\r
1068 { yyval.scalarval = new scalarexp_t(yyvsp[0].colref);}
\r
1072 #line 102 "partn.y"
\r
1073 {yyval.scalarval = yyvsp[-1].scalarval;}
\r
1077 #line 106 "partn.y"
\r
1078 { yyval.se_listval= new se_list_t(yyvsp[0].scalarval); }
\r
1082 #line 107 "partn.y"
\r
1083 { yyval.se_listval=yyvsp[-2].se_listval->append(yyvsp[0].scalarval); }
\r
1087 #line 111 "partn.y"
\r
1088 {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_INT);}
\r
1092 #line 112 "partn.y"
\r
1093 {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_LONGINT);}
\r
1097 #line 113 "partn.y"
\r
1098 {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_HEX);}
\r
1102 #line 114 "partn.y"
\r
1103 {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_LONGHEX);}
\r
1107 #line 115 "partn.y"
\r
1108 {yyval.litval = new literal_t(yyvsp[0].strval,LITERAL_IP);}
\r
1112 #line 120 "partn.y"
\r
1113 {yyval.colref = new colref_t(yyvsp[0].strval); }
\r
1119 /* Line 1016 of /usr/local/share/bison/yacc.c. */
\r
1120 #line 1121 "partn.tab.cc"
\r
1129 short *yyssp1 = yyss - 1;
\r
1130 YYFPRINTF (stderr, "state stack now");
\r
1131 while (yyssp1 != yyssp)
\r
1132 YYFPRINTF (stderr, " %d", *++yyssp1);
\r
1133 YYFPRINTF (stderr, "\n");
\r
1140 /* Now `shift' the result of the reduction. Determine what state
\r
1141 that goes to, based on the state we popped back to and the rule
\r
1142 number reduced by. */
\r
1146 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
\r
1147 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
\r
1148 yystate = yytable[yystate];
\r
1150 yystate = yydefgoto[yyn - YYNTOKENS];
\r
1155 /*------------------------------------.
\r
1156 | yyerrlab -- here on detecting error |
\r
1157 `------------------------------------*/
\r
1159 /* If not already recovering from an error, report this error. */
\r
1163 #if YYERROR_VERBOSE
\r
1164 yyn = yypact[yystate];
\r
1166 if (YYPACT_NINF < yyn && yyn < YYLAST)
\r
1168 YYSIZE_T yysize = 0;
\r
1169 int yytype = YYTRANSLATE (yychar);
\r
1174 /* Start YYX at -YYN if negative to avoid negative indexes in
\r
1176 for (yyx = yyn < 0 ? -yyn : 0;
\r
1177 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
\r
1178 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
\r
1179 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
\r
1180 yysize += yystrlen ("parse error, unexpected ") + 1;
\r
1181 yysize += yystrlen (yytname[yytype]);
\r
1182 yymsg = (char *) YYSTACK_ALLOC (yysize);
\r
1185 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
\r
1186 yyp = yystpcpy (yyp, yytname[yytype]);
\r
1191 for (yyx = yyn < 0 ? -yyn : 0;
\r
1192 yyx < (int) (sizeof (yytname) / sizeof (char *));
\r
1194 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
\r
1196 const char *yyq = ! yycount ? ", expecting " : " or ";
\r
1197 yyp = yystpcpy (yyp, yyq);
\r
1198 yyp = yystpcpy (yyp, yytname[yyx]);
\r
1203 YYSTACK_FREE (yymsg);
\r
1206 yyerror ("parse error; also virtual memory exhausted");
\r
1209 #endif /* YYERROR_VERBOSE */
\r
1210 yyerror ("parse error");
\r
1215 /*----------------------------------------------------.
\r
1216 | yyerrlab1 -- error raised explicitly by an action. |
\r
1217 `----------------------------------------------------*/
\r
1219 if (yyerrstatus == 3)
\r
1221 /* If just tried and failed to reuse lookahead token after an
\r
1222 error, discard it. */
\r
1224 /* Return failure if at end of input. */
\r
1225 if (yychar == YYEOF)
\r
1227 /* Pop the error token. */
\r
1229 /* Pop the rest of the stack. */
\r
1230 while (yyssp > yyss)
\r
1232 YYDPRINTF ((stderr, "Error: popping "));
\r
1233 YYDSYMPRINT ((stderr,
\r
1236 YYDPRINTF ((stderr, "\n"));
\r
1237 yydestruct (yystos[*yyssp], *yyvsp);
\r
1243 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
\r
1244 yychar, yytname[yychar1]));
\r
1245 yydestruct (yychar1, yylval);
\r
1249 /* Else will try to reuse lookahead token after shifting the error
\r
1252 yyerrstatus = 3; /* Each real token shifted decrements this. */
\r
1256 yyn = yypact[yystate];
\r
1257 if (yyn != YYPACT_NINF)
\r
1260 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
\r
1262 yyn = yytable[yyn];
\r
1268 /* Pop the current state because it cannot handle the error token. */
\r
1269 if (yyssp == yyss)
\r
1272 YYDPRINTF ((stderr, "Error: popping "));
\r
1273 YYDSYMPRINT ((stderr,
\r
1274 yystos[*yyssp], *yyvsp));
\r
1275 YYDPRINTF ((stderr, "\n"));
\r
1277 yydestruct (yystos[yystate], *yyvsp);
\r
1279 yystate = *--yyssp;
\r
1285 short *yyssp1 = yyss - 1;
\r
1286 YYFPRINTF (stderr, "Error: state stack now");
\r
1287 while (yyssp1 != yyssp)
\r
1288 YYFPRINTF (stderr, " %d", *++yyssp1);
\r
1289 YYFPRINTF (stderr, "\n");
\r
1294 if (yyn == YYFINAL)
\r
1297 YYDPRINTF ((stderr, "Shifting error token, "));
\r
1299 *++yyvsp = yylval;
\r
1306 /*-------------------------------------.
\r
1307 | yyacceptlab -- YYACCEPT comes here. |
\r
1308 `-------------------------------------*/
\r
1313 /*-----------------------------------.
\r
1314 | yyabortlab -- YYABORT comes here. |
\r
1315 `-----------------------------------*/
\r
1320 #ifndef yyoverflow
\r
1321 /*----------------------------------------------.
\r
1322 | yyoverflowlab -- parser overflow comes here. |
\r
1323 `----------------------------------------------*/
\r
1325 yyerror ("parser stack overflow");
\r
1327 /* Fall through. */
\r
1331 #ifndef yyoverflow
\r
1332 if (yyss != yyssa)
\r
1333 YYSTACK_FREE (yyss);
\r
1339 #line 124 "partn.y"
\r