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