1
/* A Bison parser, made by GNU Bison 3.0.4. */
3
/* Bison implementation for Yacc-like parsers in C
5
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
7
This program is free software: you can redistribute it and/or modify
8
it under the terms of the GNU General Public License as published by
9
the Free Software Foundation, either version 3 of the License, or
10
(at your option) any later version.
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
17
You should have received a copy of the GNU General Public License
18
along with this program. If not, see <http://www.gnu.org/licenses/>. */
20
/* As a special exception, you may create a larger work that contains
21
part or all of the Bison parser skeleton and distribute that work
22
under terms of your choice, so long as that work isn't itself a
23
parser generator using the skeleton or a modified version thereof
24
as a parser skeleton. Alternatively, if you modify or redistribute
25
the parser skeleton itself, you may (at your option) remove this
26
special exception, which will cause the skeleton and the resulting
27
Bison output files to be licensed under the GNU General Public
28
License without this special exception.
30
This special exception was added by the Free Software Foundation in
31
version 2.2 of Bison. */
33
/* C LALR(1) parser skeleton written by Richard Stallman, by
34
simplifying the original so-called "semantic" parser. */
36
/* All symbols defined below should begin with yy or YY, to avoid
37
infringing on user name space. This should be done even for local
38
variables, as they might otherwise be expanded by user macros.
39
There are some unavoidable exceptions within include files to
40
define necessary library symbols; they are noted "INFRINGES ON
41
USER NAME SPACE" below. */
43
/* Identify Bison output. */
47
#define YYBISON_VERSION "3.0.4"
50
#define YYSKELETON_NAME "yacc.c"
62
/* Substitute the variable and function names. */
63
#define yyparse pqlqparse
65
#define yyerror pqlqerror
66
#define yydebug pqlqdebug
67
#define yynerrs pqlqnerrs
69
#define yylval pqlqlval
70
#define yychar pqlqchar
72
/* Copy the first part of user declarations. */
73
#line 1 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:339 */
79
#include "Expressions.h"
81
using namespace PetriEngine::PQL;
83
std::shared_ptr<PetriEngine::PQL::Condition> query;
85
void pqlqerror(const char *s) {printf("ERROR: %s\n", s);}
87
#line 88 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:339 */
90
# if defined __cplusplus && 201103L <= __cplusplus
91
# define YY_NULLPTR nullptr
97
/* Enabling verbose error messages. */
98
#ifdef YYERROR_VERBOSE
99
# undef YYERROR_VERBOSE
100
# define YYERROR_VERBOSE 1
102
# define YYERROR_VERBOSE 0
105
/* In a future release of Bison, this section will be replaced
106
by #include "PQLQueryParser.parser.hpp". */
107
#ifndef YY_PQLQ_PETRIENGINE_PQL_PQLQUERYPARSER_PARSER_HPP_INCLUDED
108
# define YY_PQLQ_PETRIENGINE_PQL_PQLQUERYPARSER_PARSER_HPP_INCLUDED
114
extern int pqlqdebug;
145
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
149
#line 19 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:355 */
151
PetriEngine::PQL::Expr* expr;
152
PetriEngine::PQL::Condition* cond;
156
#line 157 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:355 */
159
typedef union YYSTYPE YYSTYPE;
160
# define YYSTYPE_IS_TRIVIAL 1
161
# define YYSTYPE_IS_DECLARED 1
165
extern YYSTYPE pqlqlval;
167
int pqlqparse (void);
169
#endif /* !YY_PQLQ_PETRIENGINE_PQL_PQLQUERYPARSER_PARSER_HPP_INCLUDED */
171
/* Copy the second part of user declarations. */
173
#line 174 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:358 */
180
typedef YYTYPE_UINT8 yytype_uint8;
182
typedef unsigned char yytype_uint8;
186
typedef YYTYPE_INT8 yytype_int8;
188
typedef signed char yytype_int8;
192
typedef YYTYPE_UINT16 yytype_uint16;
194
typedef unsigned short int yytype_uint16;
198
typedef YYTYPE_INT16 yytype_int16;
200
typedef short int yytype_int16;
204
# ifdef __SIZE_TYPE__
205
# define YYSIZE_T __SIZE_TYPE__
206
# elif defined size_t
207
# define YYSIZE_T size_t
208
# elif ! defined YYSIZE_T
209
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
210
# define YYSIZE_T size_t
212
# define YYSIZE_T unsigned int
216
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
219
# if defined YYENABLE_NLS && YYENABLE_NLS
221
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
222
# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
226
# define YY_(Msgid) Msgid
231
# if (defined __GNUC__ \
232
&& (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
233
|| defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
234
# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
236
# define YY_ATTRIBUTE(Spec) /* empty */
240
#ifndef YY_ATTRIBUTE_PURE
241
# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
244
#ifndef YY_ATTRIBUTE_UNUSED
245
# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
248
#if !defined _Noreturn \
249
&& (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
250
# if defined _MSC_VER && 1200 <= _MSC_VER
251
# define _Noreturn __declspec (noreturn)
253
# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
257
/* Suppress unused-variable warnings by "using" E. */
258
#if ! defined lint || defined __GNUC__
259
# define YYUSE(E) ((void) (E))
261
# define YYUSE(E) /* empty */
264
#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
265
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
266
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
267
_Pragma ("GCC diagnostic push") \
268
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
269
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
270
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
271
_Pragma ("GCC diagnostic pop")
273
# define YY_INITIAL_VALUE(Value) Value
275
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
276
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
277
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
279
#ifndef YY_INITIAL_VALUE
280
# define YY_INITIAL_VALUE(Value) /* Nothing. */
284
#if ! defined yyoverflow || YYERROR_VERBOSE
286
/* The parser invokes alloca or malloc; define the necessary symbols. */
288
# ifdef YYSTACK_USE_ALLOCA
289
# if YYSTACK_USE_ALLOCA
291
# define YYSTACK_ALLOC __builtin_alloca
292
# elif defined __BUILTIN_VA_ARG_INCR
293
# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
295
# define YYSTACK_ALLOC __alloca
296
# elif defined _MSC_VER
297
# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
298
# define alloca _alloca
300
# define YYSTACK_ALLOC alloca
301
# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
302
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
303
/* Use EXIT_SUCCESS as a witness for stdlib.h. */
304
# ifndef EXIT_SUCCESS
305
# define EXIT_SUCCESS 0
312
# ifdef YYSTACK_ALLOC
313
/* Pacify GCC's 'empty if-body' warning. */
314
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
315
# ifndef YYSTACK_ALLOC_MAXIMUM
316
/* The OS might guarantee only one guard page at the bottom of the stack,
317
and a page size can be as small as 4096 bytes. So we cannot safely
318
invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
319
to allow for a few compiler-allocated temporary stack slots. */
320
# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
323
# define YYSTACK_ALLOC YYMALLOC
324
# define YYSTACK_FREE YYFREE
325
# ifndef YYSTACK_ALLOC_MAXIMUM
326
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
328
# if (defined __cplusplus && ! defined EXIT_SUCCESS \
329
&& ! ((defined YYMALLOC || defined malloc) \
330
&& (defined YYFREE || defined free)))
331
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
332
# ifndef EXIT_SUCCESS
333
# define EXIT_SUCCESS 0
337
# define YYMALLOC malloc
338
# if ! defined malloc && ! defined EXIT_SUCCESS
339
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
344
# if ! defined free && ! defined EXIT_SUCCESS
345
void free (void *); /* INFRINGES ON USER NAME SPACE */
349
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
352
#if (! defined yyoverflow \
353
&& (! defined __cplusplus \
354
|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
356
/* A type that is properly aligned for any stack member. */
359
yytype_int16 yyss_alloc;
363
/* The size of the maximum gap between one aligned stack and the next. */
364
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
366
/* The size of an array large to enough to hold all stacks, each with
368
# define YYSTACK_BYTES(N) \
369
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
370
+ YYSTACK_GAP_MAXIMUM)
372
# define YYCOPY_NEEDED 1
374
/* Relocate STACK from its old location to the new one. The
375
local variables YYSIZE and YYSTACKSIZE give the old and new number of
376
elements in the stack, and YYPTR gives the new location of the
377
stack. Advance YYPTR to a properly aligned location for the next
379
# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
382
YYSIZE_T yynewbytes; \
383
YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
384
Stack = &yyptr->Stack_alloc; \
385
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
386
yyptr += yynewbytes / sizeof (*yyptr); \
392
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
393
/* Copy COUNT objects from SRC to DST. The source and destination do
396
# if defined __GNUC__ && 1 < __GNUC__
397
# define YYCOPY(Dst, Src, Count) \
398
__builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
400
# define YYCOPY(Dst, Src, Count) \
404
for (yyi = 0; yyi < (Count); yyi++) \
405
(Dst)[yyi] = (Src)[yyi]; \
410
#endif /* !YYCOPY_NEEDED */
412
/* YYFINAL -- State number of the termination state. */
414
/* YYLAST -- Last index in YYTABLE. */
417
/* YYNTOKENS -- Number of terminals. */
419
/* YYNNTS -- Number of nonterminals. */
421
/* YYNRULES -- Number of rules. */
423
/* YYNSTATES -- Number of states. */
426
/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
427
by yylex, with out-of-bounds checking. */
429
#define YYMAXUTOK 276
431
#define YYTRANSLATE(YYX) \
432
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
434
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
435
as returned by yylex, without out-of-bounds checking. */
436
static const yytype_uint8 yytranslate[] =
438
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
439
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
440
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
441
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
442
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
443
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
444
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
445
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
446
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
447
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
448
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
449
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
450
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
451
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
452
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
453
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
454
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
457
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
459
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
460
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
461
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
462
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463
2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
464
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
465
15, 16, 17, 18, 19, 20, 21
469
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
470
static const yytype_uint8 yyrline[] =
472
0, 48, 48, 49, 52, 53, 54, 55, 56, 57,
473
58, 59, 62, 63, 64, 65, 66, 67, 70, 71,
474
72, 73, 76, 77, 80, 81, 82
478
#if YYDEBUG || YYERROR_VERBOSE || 0
479
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
480
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
481
static const char *const yytname[] =
483
"$end", "error", "$undefined", "ID", "INT", "DEADLOCK", "TRUE", "FALSE",
484
"LPAREN", "RPAREN", "AND", "OR", "NOT", "EQUAL", "NEQUAL", "LESS",
485
"LESSEQUAL", "GREATER", "GREATEREQUAL", "PLUS", "MINUS", "MULTIPLY",
486
"$accept", "query", "logic", "compare", "expr", "term", "factor", YY_NULLPTR
491
/* YYTOKNUM[NUM] -- (External) token number corresponding to the
492
(internal) symbol number NUM (which must be that of a token). */
493
static const yytype_uint16 yytoknum[] =
495
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
496
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
501
#define YYPACT_NINF -17
503
#define yypact_value_is_default(Yystate) \
504
(!!((Yystate) == (-17)))
506
#define YYTABLE_NINF -1
508
#define yytable_value_is_error(Yytable_value) \
511
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
513
static const yytype_int8 yypact[] =
515
3, -17, -17, -17, -17, -17, -17, 21, 21, 27,
516
1, 34, -17, 48, -16, -17, 60, 40, -17, 27,
517
53, -17, 21, 21, 27, 27, 27, 27, 27, 27,
518
35, 35, 35, -17, -17, -6, -17, -17, 53, 53,
519
53, 53, 53, 53, -16, -16, -17
522
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
523
Performed when YYTABLE does not specify something else to do. Zero
524
means the default is an error. */
525
static const yytype_uint8 yydefact[] =
527
0, 3, 26, 25, 11, 9, 10, 0, 0, 0,
528
0, 2, 8, 0, 21, 23, 0, 0, 6, 0,
529
20, 1, 0, 0, 0, 0, 0, 0, 0, 0,
530
0, 0, 0, 7, 24, 0, 4, 5, 12, 13,
531
14, 15, 16, 17, 18, 19, 22
534
/* YYPGOTO[NTERM-NUM]. */
535
static const yytype_int8 yypgoto[] =
537
-17, -17, 29, -17, -7, 44, 0
540
/* YYDEFGOTO[NTERM-NUM]. */
541
static const yytype_int8 yydefgoto[] =
543
-1, 10, 11, 12, 13, 14, 15
546
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
547
positive, shift that token. If negative, reduce the rule whose
548
number is the opposite. If YYTABLE_NINF, syntax error. */
549
static const yytype_uint8 yytable[] =
551
17, 21, 20, 34, 1, 32, 2, 3, 4, 5,
552
6, 7, 35, 30, 31, 8, 0, 38, 39, 40,
553
41, 42, 43, 9, 2, 3, 4, 5, 6, 7,
554
2, 3, 46, 8, 0, 19, 16, 18, 2, 3,
555
0, 9, 0, 19, 22, 23, 0, 9, 0, 34,
556
0, 36, 37, 24, 25, 26, 27, 28, 29, 30,
557
31, 24, 25, 26, 27, 28, 29, 30, 31, 33,
558
22, 23, 30, 31, 44, 45
561
static const yytype_int8 yycheck[] =
563
7, 0, 9, 9, 1, 21, 3, 4, 5, 6,
564
7, 8, 19, 19, 20, 12, -1, 24, 25, 26,
565
27, 28, 29, 20, 3, 4, 5, 6, 7, 8,
566
3, 4, 32, 12, -1, 8, 7, 8, 3, 4,
567
-1, 20, -1, 8, 10, 11, -1, 20, -1, 9,
568
-1, 22, 23, 13, 14, 15, 16, 17, 18, 19,
569
20, 13, 14, 15, 16, 17, 18, 19, 20, 9,
570
10, 11, 19, 20, 30, 31
573
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
574
symbol of state STATE-NUM. */
575
static const yytype_uint8 yystos[] =
577
0, 1, 3, 4, 5, 6, 7, 8, 12, 20,
578
23, 24, 25, 26, 27, 28, 24, 26, 24, 8,
579
26, 0, 10, 11, 13, 14, 15, 16, 17, 18,
580
19, 20, 21, 9, 9, 26, 24, 24, 26, 26,
581
26, 26, 26, 26, 27, 27, 28
584
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
585
static const yytype_uint8 yyr1[] =
587
0, 22, 23, 23, 24, 24, 24, 24, 24, 24,
588
24, 24, 25, 25, 25, 25, 25, 25, 26, 26,
589
26, 26, 27, 27, 28, 28, 28
592
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
593
static const yytype_uint8 yyr2[] =
595
0, 2, 1, 1, 3, 3, 2, 3, 1, 1,
596
1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
601
#define yyerrok (yyerrstatus = 0)
602
#define yyclearin (yychar = YYEMPTY)
606
#define YYACCEPT goto yyacceptlab
607
#define YYABORT goto yyabortlab
608
#define YYERROR goto yyerrorlab
611
#define YYRECOVERING() (!!yyerrstatus)
613
#define YYBACKUP(Token, Value) \
615
if (yychar == YYEMPTY) \
619
YYPOPSTACK (yylen); \
625
yyerror (YY_("syntax error: cannot back up")); \
630
/* Error token number */
632
#define YYERRCODE 256
636
/* Enable debugging if requested. */
640
# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
641
# define YYFPRINTF fprintf
644
# define YYDPRINTF(Args) \
650
/* This macro is provided for backward compatibility. */
651
#ifndef YY_LOCATION_PRINT
652
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
656
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
660
YYFPRINTF (stderr, "%s ", Title); \
661
yy_symbol_print (stderr, \
663
YYFPRINTF (stderr, "\n"); \
668
/*----------------------------------------.
669
| Print this symbol's value on YYOUTPUT. |
670
`----------------------------------------*/
673
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
675
FILE *yyo = yyoutput;
680
if (yytype < YYNTOKENS)
681
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
687
/*--------------------------------.
688
| Print this symbol on YYOUTPUT. |
689
`--------------------------------*/
692
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
694
YYFPRINTF (yyoutput, "%s %s (",
695
yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
697
yy_symbol_value_print (yyoutput, yytype, yyvaluep);
698
YYFPRINTF (yyoutput, ")");
701
/*------------------------------------------------------------------.
702
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
704
`------------------------------------------------------------------*/
707
yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
709
YYFPRINTF (stderr, "Stack now");
710
for (; yybottom <= yytop; yybottom++)
712
int yybot = *yybottom;
713
YYFPRINTF (stderr, " %d", yybot);
715
YYFPRINTF (stderr, "\n");
718
# define YY_STACK_PRINT(Bottom, Top) \
721
yy_stack_print ((Bottom), (Top)); \
725
/*------------------------------------------------.
726
| Report that the YYRULE is going to be reduced. |
727
`------------------------------------------------*/
730
yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
732
unsigned long int yylno = yyrline[yyrule];
733
int yynrhs = yyr2[yyrule];
735
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
737
/* The symbols being reduced. */
738
for (yyi = 0; yyi < yynrhs; yyi++)
740
YYFPRINTF (stderr, " $%d = ", yyi + 1);
741
yy_symbol_print (stderr,
742
yystos[yyssp[yyi + 1 - yynrhs]],
743
&(yyvsp[(yyi + 1) - (yynrhs)])
745
YYFPRINTF (stderr, "\n");
749
# define YY_REDUCE_PRINT(Rule) \
752
yy_reduce_print (yyssp, yyvsp, Rule); \
755
/* Nonzero means print parse trace. It is left uninitialized so that
756
multiple parsers can coexist. */
759
# define YYDPRINTF(Args)
760
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
761
# define YY_STACK_PRINT(Bottom, Top)
762
# define YY_REDUCE_PRINT(Rule)
763
#endif /* !YYDEBUG */
766
/* YYINITDEPTH -- initial size of the parser's stacks. */
768
# define YYINITDEPTH 200
771
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
772
if the built-in stack extension method is used).
774
Do not make this value too large; the results are undefined if
775
YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
776
evaluated with infinite-precision integer arithmetic. */
779
# define YYMAXDEPTH 10000
786
# if defined __GLIBC__ && defined _STRING_H
787
# define yystrlen strlen
789
/* Return the length of YYSTR. */
791
yystrlen (const char *yystr)
794
for (yylen = 0; yystr[yylen]; yylen++)
802
# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
803
# define yystpcpy stpcpy
805
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
808
yystpcpy (char *yydest, const char *yysrc)
811
const char *yys = yysrc;
813
while ((*yyd++ = *yys++) != '\0')
822
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
823
quotes and backslashes, so that it's suitable for yyerror. The
824
heuristic is that double-quoting is unnecessary unless the string
825
contains an apostrophe, a comma, or backslash (other than
826
backslash-backslash). YYSTR is taken from yytname. If YYRES is
827
null, do not copy; instead, return the length of what the result
830
yytnamerr (char *yyres, const char *yystr)
835
char const *yyp = yystr;
842
goto do_not_strip_quotes;
846
goto do_not_strip_quotes;
859
do_not_strip_quotes: ;
863
return yystrlen (yystr);
865
return yystpcpy (yyres, yystr) - yyres;
869
/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
870
about the unexpected token YYTOKEN for the state stack whose top is
873
Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
874
not large enough to hold the message. In that case, also set
875
*YYMSG_ALLOC to the required number of bytes. Return 2 if the
876
required number of bytes is too large to store. */
878
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
879
yytype_int16 *yyssp, int yytoken)
881
YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
882
YYSIZE_T yysize = yysize0;
883
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
884
/* Internationalized format string. */
885
const char *yyformat = YY_NULLPTR;
886
/* Arguments of yyformat. */
887
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
888
/* Number of reported tokens (one for the "unexpected", one per
892
/* There are many possibilities here to consider:
893
- If this state is a consistent state with a default action, then
894
the only way this function was invoked is if the default action
895
is an error action. In that case, don't check for expected
896
tokens because there are none.
897
- The only way there can be no lookahead present (in yychar) is if
898
this state is a consistent state with a default action. Thus,
899
detecting the absence of a lookahead is sufficient to determine
900
that there is no unexpected or expected token to report. In that
901
case, just report a simple "syntax error".
902
- Don't assume there isn't a lookahead just because this state is a
903
consistent state with a default action. There might have been a
904
previous inconsistent state, consistent state with a non-default
905
action, or user semantic action that manipulated yychar.
906
- Of course, the expected token list depends on states to have
907
correct lookahead information, and it depends on the parser not
908
to perform extra reductions after fetching a lookahead from the
909
scanner and before detecting a syntax error. Thus, state merging
910
(from LALR or IELR) and default reductions corrupt the expected
911
token list. However, the list is correct for canonical LR with
912
one exception: it will still contain any token that will not be
913
accepted due to an error action in a later state.
915
if (yytoken != YYEMPTY)
917
int yyn = yypact[*yyssp];
918
yyarg[yycount++] = yytname[yytoken];
919
if (!yypact_value_is_default (yyn))
921
/* Start YYX at -YYN if negative to avoid negative indexes in
922
YYCHECK. In other words, skip the first -YYN actions for
923
this state because they are default actions. */
924
int yyxbegin = yyn < 0 ? -yyn : 0;
925
/* Stay within bounds of both yycheck and yytname. */
926
int yychecklim = YYLAST - yyn + 1;
927
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
930
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
931
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
932
&& !yytable_value_is_error (yytable[yyx + yyn]))
934
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
940
yyarg[yycount++] = yytname[yyx];
942
YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
943
if (! (yysize <= yysize1
944
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
954
# define YYCASE_(N, S) \
958
YYCASE_(0, YY_("syntax error"));
959
YYCASE_(1, YY_("syntax error, unexpected %s"));
960
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
961
YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
962
YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
963
YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
968
YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
969
if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
974
if (*yymsg_alloc < yysize)
976
*yymsg_alloc = 2 * yysize;
977
if (! (yysize <= *yymsg_alloc
978
&& *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
979
*yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
983
/* Avoid sprintf, as that infringes on the user's name space.
984
Don't have undefined behavior even if the translation
985
produced a string with the wrong number of "%s"s. */
989
while ((*yyp = *yyformat) != '\0')
990
if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
992
yyp += yytnamerr (yyp, yyarg[yyi++]);
1003
#endif /* YYERROR_VERBOSE */
1005
/*-----------------------------------------------.
1006
| Release the memory associated to this symbol. |
1007
`-----------------------------------------------*/
1010
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1015
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1017
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1019
YY_IGNORE_MAYBE_UNINITIALIZED_END
1025
/* The lookahead symbol. */
1028
/* The semantic value of the lookahead symbol. */
1030
/* Number of syntax errors so far. */
1042
/* Number of tokens to shift before error messages enabled. */
1045
/* The stacks and their tools:
1046
'yyss': related to states.
1047
'yyvs': related to semantic values.
1049
Refer to the stacks through separate pointers, to allow yyoverflow
1050
to reallocate them elsewhere. */
1052
/* The state stack. */
1053
yytype_int16 yyssa[YYINITDEPTH];
1055
yytype_int16 *yyssp;
1057
/* The semantic value stack. */
1058
YYSTYPE yyvsa[YYINITDEPTH];
1062
YYSIZE_T yystacksize;
1066
/* Lookahead token as an internal (translated) token number. */
1068
/* The variables used to return semantic value and location from the
1073
/* Buffer for error messages, and its allocated size. */
1075
char *yymsg = yymsgbuf;
1076
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1079
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1081
/* The number of symbols on the RHS of the reduced rule.
1082
Keep to zero when no symbol should be popped. */
1085
yyssp = yyss = yyssa;
1086
yyvsp = yyvs = yyvsa;
1087
yystacksize = YYINITDEPTH;
1089
YYDPRINTF ((stderr, "Starting parse\n"));
1094
yychar = YYEMPTY; /* Cause a token to be read. */
1097
/*------------------------------------------------------------.
1098
| yynewstate -- Push a new state, which is found in yystate. |
1099
`------------------------------------------------------------*/
1101
/* In all cases, when you get here, the value and location stacks
1102
have just been pushed. So pushing a state here evens the stacks. */
1108
if (yyss + yystacksize - 1 <= yyssp)
1110
/* Get the current used size of the three stacks, in elements. */
1111
YYSIZE_T yysize = yyssp - yyss + 1;
1115
/* Give user a chance to reallocate the stack. Use copies of
1116
these so that the &'s don't force the real ones into
1118
YYSTYPE *yyvs1 = yyvs;
1119
yytype_int16 *yyss1 = yyss;
1121
/* Each stack pointer address is followed by the size of the
1122
data in use in that stack, in bytes. This used to be a
1123
conditional around just the two extra args, but that might
1124
be undefined if yyoverflow is a macro. */
1125
yyoverflow (YY_("memory exhausted"),
1126
&yyss1, yysize * sizeof (*yyssp),
1127
&yyvs1, yysize * sizeof (*yyvsp),
1133
#else /* no yyoverflow */
1134
# ifndef YYSTACK_RELOCATE
1135
goto yyexhaustedlab;
1137
/* Extend the stack our own way. */
1138
if (YYMAXDEPTH <= yystacksize)
1139
goto yyexhaustedlab;
1141
if (YYMAXDEPTH < yystacksize)
1142
yystacksize = YYMAXDEPTH;
1145
yytype_int16 *yyss1 = yyss;
1146
union yyalloc *yyptr =
1147
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1149
goto yyexhaustedlab;
1150
YYSTACK_RELOCATE (yyss_alloc, yyss);
1151
YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1152
# undef YYSTACK_RELOCATE
1154
YYSTACK_FREE (yyss1);
1157
#endif /* no yyoverflow */
1159
yyssp = yyss + yysize - 1;
1160
yyvsp = yyvs + yysize - 1;
1162
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1163
(unsigned long int) yystacksize));
1165
if (yyss + yystacksize - 1 <= yyssp)
1169
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1171
if (yystate == YYFINAL)
1181
/* Do appropriate processing given the current state. Read a
1182
lookahead token if we need one and don't already have one. */
1184
/* First try to decide what to do without reference to lookahead token. */
1185
yyn = yypact[yystate];
1186
if (yypact_value_is_default (yyn))
1189
/* Not known => get a lookahead token if don't already have one. */
1191
/* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1192
if (yychar == YYEMPTY)
1194
YYDPRINTF ((stderr, "Reading a token: "));
1198
if (yychar <= YYEOF)
1200
yychar = yytoken = YYEOF;
1201
YYDPRINTF ((stderr, "Now at end of input.\n"));
1205
yytoken = YYTRANSLATE (yychar);
1206
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1209
/* If the proper action on seeing token YYTOKEN is to reduce or to
1210
detect an error, take that action. */
1212
if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1217
if (yytable_value_is_error (yyn))
1223
/* Count tokens shifted since error; after three, turn off error
1228
/* Shift the lookahead token. */
1229
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1231
/* Discard the shifted token. */
1235
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1237
YY_IGNORE_MAYBE_UNINITIALIZED_END
1242
/*-----------------------------------------------------------.
1243
| yydefault -- do the default action for the current state. |
1244
`-----------------------------------------------------------*/
1246
yyn = yydefact[yystate];
1252
/*-----------------------------.
1253
| yyreduce -- Do a reduction. |
1254
`-----------------------------*/
1256
/* yyn is the number of a rule to reduce with. */
1259
/* If YYLEN is nonzero, implement the default value of the action:
1262
Otherwise, the following line sets YYVAL to garbage.
1263
This behavior is undocumented and Bison
1264
users should not rely upon it. Assigning to YYVAL
1265
unconditionally makes the parser a bit smaller, and it avoids a
1266
GCC warning that YYVAL may be used uninitialized. */
1267
yyval = yyvsp[1-yylen];
1270
YY_REDUCE_PRINT (yyn);
1274
#line 48 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:1646 */
1275
{ query = Condition_ptr((yyvsp[0].cond)); }
1276
#line 1277 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1280
#line 49 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:1646 */
1282
#line 1283 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1286
#line 52 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:1646 */
1287
{ (yyval.cond) = new AndCondition(Condition_ptr((yyvsp[-2].cond)), Condition_ptr((yyvsp[0].cond))); }
1288
#line 1289 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1292
#line 53 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:1646 */
1293
{ (yyval.cond) = new OrCondition(Condition_ptr((yyvsp[-2].cond)), Condition_ptr((yyvsp[0].cond))); }
1294
#line 1295 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1298
#line 54 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:1646 */
1299
{ (yyval.cond) = new NotCondition(Condition_ptr((yyvsp[0].cond))); }
1300
#line 1301 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1304
#line 55 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:1646 */
1305
{ (yyval.cond) = (yyvsp[-1].cond); }
1306
#line 1307 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1310
#line 56 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:1646 */
1311
{ (yyval.cond) = (yyvsp[0].cond); }
1312
#line 1313 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1316
#line 57 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:1646 */
1317
{ (yyval.cond) = new BooleanCondition(true);}
1318
#line 1319 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1322
#line 58 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:1646 */
1323
{ (yyval.cond) = new BooleanCondition(false);}
1324
#line 1325 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1328
#line 59 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:1646 */
1329
{ (yyval.cond) = new DeadlockCondition();}
1330
#line 1331 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1334
#line 62 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:1646 */
1335
{ (yyval.cond) = new EqualCondition(Expr_ptr((yyvsp[-2].expr)), Expr_ptr((yyvsp[0].expr))); }
1336
#line 1337 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1340
#line 63 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:1646 */
1341
{ (yyval.cond) = new NotEqualCondition(Expr_ptr((yyvsp[-2].expr)), Expr_ptr((yyvsp[0].expr))); }
1342
#line 1343 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1346
#line 64 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:1646 */
1347
{ (yyval.cond) = new LessThanCondition(Expr_ptr((yyvsp[-2].expr)), Expr_ptr((yyvsp[0].expr))); }
1348
#line 1349 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1352
#line 65 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:1646 */
1353
{ (yyval.cond) = new LessThanOrEqualCondition(Expr_ptr((yyvsp[-2].expr)), Expr_ptr((yyvsp[0].expr))); }
1354
#line 1355 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1358
#line 66 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:1646 */
1359
{ (yyval.cond) = new GreaterThanCondition(Expr_ptr((yyvsp[-2].expr)), Expr_ptr((yyvsp[0].expr))); }
1360
#line 1361 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1364
#line 67 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:1646 */
1365
{ (yyval.cond) = new GreaterThanOrEqualCondition(Expr_ptr((yyvsp[-2].expr)), Expr_ptr((yyvsp[0].expr))); }
1366
#line 1367 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1370
#line 70 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:1646 */
1371
{ (yyval.expr) = new PlusExpr(std::vector<Expr_ptr>({Expr_ptr((yyvsp[-2].expr)), Expr_ptr((yyvsp[0].expr))})); }
1372
#line 1373 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1376
#line 71 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:1646 */
1377
{ (yyval.expr) = new SubtractExpr(std::vector<Expr_ptr>({Expr_ptr((yyvsp[-2].expr)), Expr_ptr((yyvsp[0].expr))})); }
1378
#line 1379 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1382
#line 72 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:1646 */
1383
{ (yyval.expr) = new MinusExpr(Expr_ptr((yyvsp[0].expr))); }
1384
#line 1385 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1388
#line 73 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:1646 */
1389
{ (yyval.expr) = (yyvsp[0].expr); }
1390
#line 1391 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1394
#line 76 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:1646 */
1395
{ (yyval.expr) = new MultiplyExpr(std::vector<Expr_ptr>({Expr_ptr((yyvsp[-2].expr)), Expr_ptr((yyvsp[0].expr))})); }
1396
#line 1397 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1400
#line 77 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:1646 */
1401
{ (yyval.expr) = (yyvsp[0].expr); }
1402
#line 1403 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1406
#line 80 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:1646 */
1407
{ (yyval.expr) = (yyvsp[-1].expr); }
1408
#line 1409 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1412
#line 81 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:1646 */
1413
{ (yyval.expr) = new LiteralExpr(atol((yyvsp[0].string)->c_str())); delete (yyvsp[0].string); }
1414
#line 1415 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1418
#line 82 "PetriEngine/PQL/PQLQueryParser.y" /* yacc.c:1646 */
1419
{ (yyval.expr) = new IdentifierExpr(*(yyvsp[0].string)); delete (yyvsp[0].string); }
1420
#line 1421 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1424
#line 1425 "PetriEngine/PQL/PQLQueryParser.parser.cpp" /* yacc.c:1646 */
1427
/* User semantic actions sometimes alter yychar, and that requires
1428
that yytoken be updated with the new translation. We take the
1429
approach of translating immediately before every use of yytoken.
1430
One alternative is translating here after every semantic action,
1431
but that translation would be missed if the semantic action invokes
1432
YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1433
if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1434
incorrect destructor might then be invoked immediately. In the
1435
case of YYERROR or YYBACKUP, subsequent parser actions might lead
1436
to an incorrect destructor call or verbose syntax error message
1437
before the lookahead is translated. */
1438
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1442
YY_STACK_PRINT (yyss, yyssp);
1446
/* Now 'shift' the result of the reduction. Determine what state
1447
that goes to, based on the state we popped back to and the rule
1448
number reduced by. */
1452
yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1453
if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1454
yystate = yytable[yystate];
1456
yystate = yydefgoto[yyn - YYNTOKENS];
1461
/*--------------------------------------.
1462
| yyerrlab -- here on detecting error. |
1463
`--------------------------------------*/
1465
/* Make sure we have latest lookahead translation. See comments at
1466
user semantic actions for why this is necessary. */
1467
yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1469
/* If not already recovering from an error, report this error. */
1473
#if ! YYERROR_VERBOSE
1474
yyerror (YY_("syntax error"));
1476
# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1479
char const *yymsgp = YY_("syntax error");
1480
int yysyntax_error_status;
1481
yysyntax_error_status = YYSYNTAX_ERROR;
1482
if (yysyntax_error_status == 0)
1484
else if (yysyntax_error_status == 1)
1486
if (yymsg != yymsgbuf)
1487
YYSTACK_FREE (yymsg);
1488
yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1492
yymsg_alloc = sizeof yymsgbuf;
1493
yysyntax_error_status = 2;
1497
yysyntax_error_status = YYSYNTAX_ERROR;
1502
if (yysyntax_error_status == 2)
1503
goto yyexhaustedlab;
1505
# undef YYSYNTAX_ERROR
1511
if (yyerrstatus == 3)
1513
/* If just tried and failed to reuse lookahead token after an
1514
error, discard it. */
1516
if (yychar <= YYEOF)
1518
/* Return failure if at end of input. */
1519
if (yychar == YYEOF)
1524
yydestruct ("Error: discarding",
1530
/* Else will try to reuse lookahead token after shifting the error
1535
/*---------------------------------------------------.
1536
| yyerrorlab -- error raised explicitly by YYERROR. |
1537
`---------------------------------------------------*/
1540
/* Pacify compilers like GCC when the user code never invokes
1541
YYERROR and the label yyerrorlab therefore never appears in user
1543
if (/*CONSTCOND*/ 0)
1546
/* Do not reclaim the symbols of the rule whose action triggered
1550
YY_STACK_PRINT (yyss, yyssp);
1555
/*-------------------------------------------------------------.
1556
| yyerrlab1 -- common code for both syntax error and YYERROR. |
1557
`-------------------------------------------------------------*/
1559
yyerrstatus = 3; /* Each real token shifted decrements this. */
1563
yyn = yypact[yystate];
1564
if (!yypact_value_is_default (yyn))
1567
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1575
/* Pop the current state because it cannot handle the error token. */
1580
yydestruct ("Error: popping",
1581
yystos[yystate], yyvsp);
1584
YY_STACK_PRINT (yyss, yyssp);
1587
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1589
YY_IGNORE_MAYBE_UNINITIALIZED_END
1592
/* Shift the error token. */
1593
YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1599
/*-------------------------------------.
1600
| yyacceptlab -- YYACCEPT comes here. |
1601
`-------------------------------------*/
1606
/*-----------------------------------.
1607
| yyabortlab -- YYABORT comes here. |
1608
`-----------------------------------*/
1613
#if !defined yyoverflow || YYERROR_VERBOSE
1614
/*-------------------------------------------------.
1615
| yyexhaustedlab -- memory exhaustion comes here. |
1616
`-------------------------------------------------*/
1618
yyerror (YY_("memory exhausted"));
1624
if (yychar != YYEMPTY)
1626
/* Make sure we have latest lookahead translation. See comments at
1627
user semantic actions for why this is necessary. */
1628
yytoken = YYTRANSLATE (yychar);
1629
yydestruct ("Cleanup: discarding lookahead",
1632
/* Do not reclaim the symbols of the rule whose action triggered
1633
this YYABORT or YYACCEPT. */
1635
YY_STACK_PRINT (yyss, yyssp);
1636
while (yyssp != yyss)
1638
yydestruct ("Cleanup: popping",
1639
yystos[*yyssp], yyvsp);
1644
YYSTACK_FREE (yyss);
1647
if (yymsg != yymsgbuf)
1648
YYSTACK_FREE (yymsg);