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"
61 /* "%code top" blocks. */
62 #line 43 "parser.y" /* yacc.c:316 */
64 /*! \internal \file parser.cpp
65 * \brief Generated (from parser.y by Bison) parser for the selection language.
67 * \ingroup module_selection
69 /*! \internal \file parser.h
70 * \brief Generated (from parser.y by Bison) parser include file.
72 * \ingroup module_selection
76 #line 77 "parser.cpp" /* yacc.c:316 */
78 /* Substitute the variable and function names. */
79 #define yypush_parse _gmx_sel_yypush_parse
80 #define yypstate_new _gmx_sel_yypstate_new
81 #define yypstate_delete _gmx_sel_yypstate_delete
82 #define yypstate _gmx_sel_yypstate
83 #define yylex _gmx_sel_yylex
84 #define yyerror _gmx_sel_yyerror
85 #define yydebug _gmx_sel_yydebug
86 #define yynerrs _gmx_sel_yynerrs
89 /* Copy the first part of user declarations. */
90 #line 56 "parser.y" /* yacc.c:339 */
92 #include "gromacs/utility/unique_cptr.h"
94 #include "parser_internal.h"
96 using gmx::sfree_guard
;
97 using gmx::SelectionParserValue
;
98 using gmx::SelectionParserValueList
;
99 using gmx::SelectionParserValueListPointer
;
100 using gmx::SelectionParserParameter
;
101 using gmx::SelectionParserParameterList
;
102 using gmx::SelectionParserParameterListPointer
;
103 using gmx::SelectionTreeElement
;
104 using gmx::SelectionTreeElementPointer
;
107 #pragma warning(disable: 4065)
110 #line 111 "parser.cpp" /* yacc.c:339 */
113 # if defined __cplusplus && 201103L <= __cplusplus
114 # define YY_NULLPTR nullptr
116 # define YY_NULLPTR 0
120 /* Enabling verbose error messages. */
121 #ifdef YYERROR_VERBOSE
122 # undef YYERROR_VERBOSE
123 # define YYERROR_VERBOSE 1
125 # define YYERROR_VERBOSE 0
128 /* In a future release of Bison, this section will be replaced
129 by #include "parser.h". */
130 #ifndef YY__GMX_SEL_YY_PARSER_H_INCLUDED
131 # define YY__GMX_SEL_YY_PARSER_H_INCLUDED
137 extern int _gmx_sel_yydebug
;
139 /* "%code requires" blocks. */
140 #line 1 "parser.y" /* yacc.c:355 */
143 * This file is part of the GROMACS molecular simulation package.
145 * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
146 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
147 * and including many others, as listed in the AUTHORS file in the
148 * top-level source directory and at http://www.gromacs.org.
150 * GROMACS is free software; you can redistribute it and/or
151 * modify it under the terms of the GNU Lesser General Public License
152 * as published by the Free Software Foundation; either version 2.1
153 * of the License, or (at your option) any later version.
155 * GROMACS is distributed in the hope that it will be useful,
156 * but WITHOUT ANY WARRANTY; without even the implied warranty of
157 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
158 * Lesser General Public License for more details.
160 * You should have received a copy of the GNU Lesser General Public
161 * License along with GROMACS; if not, see
162 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
163 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
165 * If you want to redistribute modifications to GROMACS, please
166 * consider that scientific software is very special. Version
167 * control is crucial - bugs must be traceable. We will be happy to
168 * consider code for inclusion in the official distribution, but
169 * derived work must not be called official GROMACS. Details are found
170 * in the README & COPYING files - if they are missing, get the
171 * official version at http://www.gromacs.org.
173 * To help us fund GROMACS development, we humbly ask that you cite
174 * the research papers on the package. Check out http://www.gromacs.org.
176 #line 76 "parser.y" /* yacc.c:355 */
178 #include "parsetree.h"
181 #define YYLTYPE ::gmx::SelectionLocation
183 #line 184 "parser.cpp" /* yacc.c:355 */
198 VARIABLE_NUMERIC
= 266,
199 VARIABLE_GROUP
= 267,
201 KEYWORD_NUMERIC
= 269,
205 METHOD_NUMERIC
= 273,
225 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
229 #line 83 "parser.y" /* yacc.c:355 */
234 struct gmx_ana_selmethod_t
*meth
;
236 gmx::SelectionStringMatchType smt
;
238 gmx::SelectionTreeElementPointer
*sel
;
239 gmx::SelectionParserValue
*val
;
240 gmx::SelectionParserValueListPointer
*vlist
;
241 gmx::SelectionParserParameter
*param
;
242 gmx::SelectionParserParameterListPointer
*plist
;
244 #line 245 "parser.cpp" /* yacc.c:355 */
247 typedef union YYSTYPE YYSTYPE
;
248 # define YYSTYPE_IS_TRIVIAL 1
249 # define YYSTYPE_IS_DECLARED 1
253 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
254 typedef struct YYLTYPE YYLTYPE
;
262 # define YYLTYPE_IS_DECLARED 1
263 # define YYLTYPE_IS_TRIVIAL 1
268 #ifndef YYPUSH_MORE_DEFINED
269 # define YYPUSH_MORE_DEFINED
270 enum { YYPUSH_MORE
= 4 };
273 typedef struct _gmx_sel_yypstate _gmx_sel_yypstate
;
275 int _gmx_sel_yypush_parse (_gmx_sel_yypstate
*ps
, int pushed_char
, YYSTYPE
const *pushed_val
, YYLTYPE
*pushed_loc
, void *scanner
);
277 _gmx_sel_yypstate
* _gmx_sel_yypstate_new (void);
278 void _gmx_sel_yypstate_delete (_gmx_sel_yypstate
*ps
);
280 #endif /* !YY__GMX_SEL_YY_PARSER_H_INCLUDED */
282 /* Copy the second part of user declarations. */
284 #line 285 "parser.cpp" /* yacc.c:358 */
291 typedef YYTYPE_UINT8 yytype_uint8
;
293 typedef unsigned char yytype_uint8
;
297 typedef YYTYPE_INT8 yytype_int8
;
299 typedef signed char yytype_int8
;
303 typedef YYTYPE_UINT16 yytype_uint16
;
305 typedef unsigned short int yytype_uint16
;
309 typedef YYTYPE_INT16 yytype_int16
;
311 typedef short int yytype_int16
;
315 # ifdef __SIZE_TYPE__
316 # define YYSIZE_T __SIZE_TYPE__
317 # elif defined size_t
318 # define YYSIZE_T size_t
319 # elif ! defined YYSIZE_T
320 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
321 # define YYSIZE_T size_t
323 # define YYSIZE_T unsigned int
327 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
330 # if defined YYENABLE_NLS && YYENABLE_NLS
332 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
333 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
337 # define YY_(Msgid) Msgid
342 # if (defined __GNUC__ \
343 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
344 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
345 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
347 # define YY_ATTRIBUTE(Spec) /* empty */
351 #ifndef YY_ATTRIBUTE_PURE
352 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
355 #ifndef YY_ATTRIBUTE_UNUSED
356 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
359 #if !defined _Noreturn \
360 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
361 # if defined _MSC_VER && 1200 <= _MSC_VER
362 # define _Noreturn __declspec (noreturn)
364 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
368 /* Suppress unused-variable warnings by "using" E. */
369 #if ! defined lint || defined __GNUC__
370 # define YYUSE(E) ((void) (E))
372 # define YYUSE(E) /* empty */
375 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
376 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
377 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
378 _Pragma ("GCC diagnostic push") \
379 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
380 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
381 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
382 _Pragma ("GCC diagnostic pop")
384 # define YY_INITIAL_VALUE(Value) Value
386 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
387 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
388 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
390 #ifndef YY_INITIAL_VALUE
391 # define YY_INITIAL_VALUE(Value) /* Nothing. */
395 #if ! defined yyoverflow || YYERROR_VERBOSE
397 /* The parser invokes alloca or malloc; define the necessary symbols. */
399 # ifdef YYSTACK_ALLOC
400 /* Pacify GCC's 'empty if-body' warning. */
401 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
402 # ifndef YYSTACK_ALLOC_MAXIMUM
403 /* The OS might guarantee only one guard page at the bottom of the stack,
404 and a page size can be as small as 4096 bytes. So we cannot safely
405 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
406 to allow for a few compiler-allocated temporary stack slots. */
407 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
410 # define YYSTACK_ALLOC YYMALLOC
411 # define YYSTACK_FREE YYFREE
412 # ifndef YYSTACK_ALLOC_MAXIMUM
413 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
415 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
416 && ! ((defined YYMALLOC || defined malloc) \
417 && (defined YYFREE || defined free)))
418 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
419 # ifndef EXIT_SUCCESS
420 # define EXIT_SUCCESS 0
424 # define YYMALLOC malloc
425 # if ! defined malloc && ! defined EXIT_SUCCESS
426 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
431 # if ! defined free && ! defined EXIT_SUCCESS
432 void free (void *); /* INFRINGES ON USER NAME SPACE */
436 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
439 #if (! defined yyoverflow \
440 && (! defined __cplusplus || defined GMX_YYFORCE_C_STACK_EXTENSION \
441 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
442 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
444 /* A type that is properly aligned for any stack member. */
447 yytype_int16 yyss_alloc
;
452 /* The size of the maximum gap between one aligned stack and the next. */
453 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
455 /* The size of an array large to enough to hold all stacks, each with
457 # define YYSTACK_BYTES(N) \
458 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
459 + 2 * YYSTACK_GAP_MAXIMUM)
461 # define YYCOPY_NEEDED 1
463 /* Relocate STACK from its old location to the new one. The
464 local variables YYSIZE and YYSTACKSIZE give the old and new number of
465 elements in the stack, and YYPTR gives the new location of the
466 stack. Advance YYPTR to a properly aligned location for the next
468 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
471 YYSIZE_T yynewbytes; \
472 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
473 Stack = &yyptr->Stack_alloc; \
474 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
475 yyptr += yynewbytes / sizeof (*yyptr); \
481 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
482 /* Copy COUNT objects from SRC to DST. The source and destination do
485 # if defined __GNUC__ && 1 < __GNUC__
486 # define YYCOPY(Dst, Src, Count) \
487 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
489 # define YYCOPY(Dst, Src, Count) \
493 for (yyi = 0; yyi < (Count); yyi++) \
494 (Dst)[yyi] = (Src)[yyi]; \
499 #endif /* !YYCOPY_NEEDED */
501 /* YYFINAL -- State number of the termination state. */
503 /* YYLAST -- Last index in YYTABLE. */
506 /* YYNTOKENS -- Number of terminals. */
508 /* YYNNTS -- Number of nonterminals. */
510 /* YYNRULES -- Number of rules. */
512 /* YYNSTATES -- Number of states. */
513 #define YYNSTATES 154
515 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
516 by yylex, with out-of-bounds checking. */
518 #define YYMAXUTOK 288
520 #define YYTRANSLATE(YYX) \
521 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
523 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
524 as returned by yylex, without out-of-bounds checking. */
525 static const yytype_uint8 yytranslate
[] =
527 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
528 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
529 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
530 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
531 40, 41, 34, 32, 45, 33, 2, 35, 2, 2,
532 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
533 2, 39, 2, 43, 2, 2, 2, 2, 2, 2,
534 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
535 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
536 2, 44, 2, 46, 37, 2, 2, 2, 2, 2,
537 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
538 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
539 2, 2, 2, 47, 2, 48, 42, 2, 2, 2,
540 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
541 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
542 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
543 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
544 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
545 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
546 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
547 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
548 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
549 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
550 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
551 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
552 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
553 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
554 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
555 25, 26, 27, 28, 29, 30, 31, 36, 38
559 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
560 static const yytype_uint16 yyrline
[] =
562 0, 199, 199, 204, 217, 218, 238, 243, 254, 266,
563 272, 279, 286, 293, 303, 304, 311, 312, 326, 327,
564 331, 332, 335, 336, 339, 340, 348, 359, 370, 381,
565 385, 396, 403, 412, 413, 418, 419, 420, 424, 432,
566 440, 448, 459, 474, 485, 499, 507, 515, 526, 532,
567 538, 544, 550, 556, 562, 569, 580, 595, 604, 608,
568 618, 632, 640, 648, 661, 663, 669, 674, 685, 694,
569 695, 700, 705, 713, 724, 725, 729, 735, 743, 753,
570 759, 765, 771, 777, 781, 787, 793, 800, 804, 810,
575 #if YYDEBUG || YYERROR_VERBOSE || 0
576 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
577 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
578 static const char *const yytname
[] =
580 "$end", "error", "$undefined", "INVALID", "TOK_INT", "TOK_REAL", "STR",
581 "IDENTIFIER", "CMD_SEP", "GROUP", "TO", "VARIABLE_NUMERIC",
582 "VARIABLE_GROUP", "VARIABLE_POS", "KEYWORD_NUMERIC", "KEYWORD_STR",
583 "KEYWORD_POS", "KEYWORD_GROUP", "METHOD_NUMERIC", "METHOD_GROUP",
584 "METHOD_POS", "MODIFIER", "EMPTY_POSMOD", "PARAM", "END_OF_METHOD", "OF",
585 "CMP_OP", "PARAM_REDUCT", "OR", "XOR", "AND", "NOT", "'+'", "'-'", "'*'",
586 "'/'", "UNARY_NEG", "'^'", "NUM_REDUCT", "'='", "'('", "')'", "'~'",
587 "'?'", "'['", "','", "']'", "'{'", "'}'", "$accept", "commands",
588 "command", "cmd_plain", "selection", "integer_number", "real_number",
589 "number", "string", "sel_expr", "pos_mod", "str_match_type", "num_expr",
590 "str_expr", "pos_expr", "method_params", "method_param_list",
591 "method_param", "value_list", "value_list_contents", "basic_value_list",
592 "basic_value_list_contents", "value_item", "basic_value_item",
593 "value_item_range", YY_NULLPTR
598 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
599 (internal) symbol number NUM (which must be that of a token). */
600 static const yytype_uint16 yytoknum
[] =
602 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
603 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
604 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
605 285, 286, 43, 45, 42, 47, 287, 94, 288, 61,
606 40, 41, 126, 63, 91, 44, 93, 123, 125
610 #define YYPACT_NINF -85
612 #define yypact_value_is_default(Yystate) \
613 (!!((Yystate) == (-85)))
615 #define YYTABLE_NINF -22
617 #define yytable_value_is_error(Yytable_value) \
620 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
622 static const yytype_int16 yypact
[] =
624 -85, 10, -85, -2, 26, -85, 273, 0, 55, -85,
625 -85, -85, 40, -85, -85, 310, 204, 273, 69, -85,
626 62, 82, -85, -3, 139, 312, -85, -85, -85, 82,
627 296, -85, -85, -85, -85, 310, -85, 96, -85, 310,
628 -85, 204, -6, 73, 15, 71, 220, 67, -85, -85,
629 135, -85, -85, 83, -85, -85, 310, 310, 41, 185,
630 -85, -85, -85, 204, 204, 204, 204, 204, 204, 296,
631 -3, 312, -85, -3, 97, -85, -85, 71, 319, 91,
632 -85, -85, -85, -85, -85, -85, 69, -85, 113, -85,
633 24, 206, 137, 140, -85, -85, 90, -85, -85, -85,
634 -85, -85, 85, -85, -85, -85, 330, 167, 167, 73,
635 73, 73, 67, -85, -85, 229, 107, 40, 24, -85,
636 174, 69, 69, 206, -85, -85, 155, 153, 159, 326,
637 259, 137, 140, -85, -3, 179, 330, -85, -85, -85,
638 -85, 69, -85, -85, -85, -85, -85, -85, 160, 164,
642 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
643 Performed when YYTABLE does not specify something else to do. Zero
644 means the default is an error. */
645 static const yytype_uint8 yydefact
[] =
647 2, 0, 1, 0, 43, 44, 24, 25, 0, 62,
648 61, 63, 34, 66, 33, 0, 0, 0, 0, 3,
649 0, 9, 8, 15, 0, 0, 14, 5, 43, 10,
650 0, 32, 24, 25, 31, 0, 59, 64, 34, 0,
651 26, 0, 0, 52, 0, 15, 0, 14, 18, 20,
652 0, 22, 23, 0, 4, 66, 0, 0, 45, 0,
653 38, 66, 66, 0, 0, 0, 0, 0, 0, 0,
654 11, 12, 13, 60, 71, 65, 67, 0, 0, 45,
655 16, 29, 54, 58, 19, 21, 0, 17, 28, 27,
656 0, 0, 84, 85, 86, 41, 74, 76, 87, 37,
657 35, 36, 0, 39, 47, 42, 30, 48, 49, 50,
658 51, 53, 0, 71, 68, 69, 0, 0, 0, 46,
659 0, 0, 0, 0, 77, 40, 0, 43, 44, 0,
660 0, 0, 0, 55, 79, 0, 81, 82, 80, 72,
661 83, 0, 75, 88, 89, 90, 78, 70, 43, 44,
665 /* YYPGOTO[NTERM-NUM]. */
666 static const yytype_int8 yypgoto
[] =
668 -85, -85, -85, -85, 7, -17, -15, -84, -1, 116,
669 19, -85, 12, -85, 3, 75, -85, -85, -85, 63,
670 -53, 92, 52, -65, -63
673 /* YYDEFGOTO[NTERM-NUM]. */
674 static const yytype_int16 yydefgoto
[] =
676 -1, 1, 19, 20, 21, 92, 93, 53, 94, 134,
677 24, 102, 25, 137, 138, 36, 37, 76, 114, 115,
681 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
682 positive, shift that token. If negative, reduce the rule whose
683 number is the opposite. If YYTABLE_NINF, syntax error. */
684 static const yytype_int16 yytable
[] =
686 22, 51, 116, 52, 26, 95, 27, 34, 79, 26,
687 2, 3, 61, 29, 4, 5, 6, 7, -6, 8,
688 47, 9, 10, 11, 44, 56, 12, 57, 43, 46,
689 13, 124, 14, 72, -7, 42, 55, 11, 145, 30,
690 117, 15, 71, 16, 13, 48, 49, 32, 33, 125,
691 17, 46, 140, 78, 18, 124, 80, 152, 146, 31,
692 42, 32, 33, 140, 118, 35, 90, 140, 18, 51,
693 54, 52, 112, 48, 49, 106, 107, 108, 109, 110,
694 111, 46, 42, 42, 42, 42, 42, 42, 91, 48,
695 49, 32, 33, 119, 48, 49, 32, 33, 131, 56,
696 132, 57, 50, 55, 143, 51, 144, 52, 83, 131,
697 68, 132, 81, 131, 133, 132, 90, 23, 50, 74,
698 75, 112, 23, 50, 51, 133, 52, 136, 86, 133,
699 87, 40, 91, 45, 135, 123, 104, 105, 136, 84,
700 85, 43, 136, 57, 113, 135, 70, 121, 42, 135,
701 122, 73, 141, 58, 59, 77, 60, 61, 62, 127,
702 128, 32, 33, -18, 8, 153, 9, 10, 11, -20,
703 -19, 12, 88, 89, -21, 13, 126, 14, 48, 49,
704 32, 33, 150, 120, 0, 77, 15, 0, 129, 48,
705 49, 32, 33, 58, 151, 69, 60, 61, 62, 18,
706 130, 66, 67, 147, 68, 0, 0, 50, 28, 5,
707 48, 49, 32, 33, 0, 9, 0, 0, 50, 123,
708 38, 0, 142, 0, 99, 0, 14, 100, 101, 0,
709 0, 0, 91, 127, 128, 32, 33, 16, 8, 50,
710 9, 10, 11, 0, 41, 12, 63, 0, 0, 13,
711 0, 14, 64, 65, 66, 67, 0, 68, 0, 0,
712 15, 82, 129, 127, 128, 32, 33, 0, 8, 69,
713 9, 10, 11, 18, 130, 12, 0, 28, 5, 13,
714 0, 14, 8, 0, 9, 10, 11, 0, 0, 12,
715 15, 0, 129, 13, 0, 14, 0, 0, 0, 69,
716 28, 5, 0, 18, 15, 8, 16, 9, 10, 11,
717 0, 0, 12, 17, 28, 5, 13, 18, 14, 8,
718 0, 9, 10, 0, 0, 0, 38, 15, 0, 16,
719 148, 149, 14, 0, 0, 0, 69, 9, 63, 0,
720 18, 15, 38, 16, 64, 65, 66, 67, 14, 68,
721 39, 64, 65, 66, 67, 0, 68, 0, 0, 16,
722 82, 0, 64, 65, 66, 67, 41, 68
725 static const yytype_int16 yycheck
[] =
727 1, 18, 86, 18, 1, 58, 8, 8, 14, 6,
728 0, 1, 18, 6, 4, 5, 6, 7, 8, 9,
729 17, 11, 12, 13, 17, 28, 16, 30, 16, 17,
730 20, 96, 22, 30, 8, 16, 21, 13, 122, 39,
731 16, 31, 30, 33, 20, 4, 5, 6, 7, 102,
732 40, 39, 115, 41, 44, 120, 41, 141, 123, 4,
733 41, 6, 7, 126, 40, 25, 25, 130, 44, 86,
734 8, 86, 69, 4, 5, 63, 64, 65, 66, 67,
735 68, 69, 63, 64, 65, 66, 67, 68, 47, 4,
736 5, 6, 7, 90, 4, 5, 6, 7, 115, 28,
737 115, 30, 33, 21, 121, 122, 121, 122, 41, 126,
738 37, 126, 41, 130, 115, 130, 25, 1, 33, 23,
739 24, 118, 6, 33, 141, 126, 141, 115, 45, 130,
740 55, 15, 47, 17, 115, 45, 61, 62, 126, 4,
741 5, 129, 130, 30, 47, 126, 30, 10, 129, 130,
742 10, 35, 45, 14, 15, 39, 17, 18, 19, 4,
743 5, 6, 7, 10, 9, 46, 11, 12, 13, 10,
744 10, 16, 56, 57, 10, 20, 113, 22, 4, 5,
745 6, 7, 130, 91, -1, 69, 31, -1, 33, 4,
746 5, 6, 7, 14, 15, 40, 17, 18, 19, 44,
747 45, 34, 35, 48, 37, -1, -1, 33, 4, 5,
748 4, 5, 6, 7, -1, 11, -1, -1, 33, 45,
749 16, -1, 48, -1, 39, -1, 22, 42, 43, -1,
750 -1, -1, 47, 4, 5, 6, 7, 33, 9, 33,
751 11, 12, 13, -1, 40, 16, 26, -1, -1, 20,
752 -1, 22, 32, 33, 34, 35, -1, 37, -1, -1,
753 31, 41, 33, 4, 5, 6, 7, -1, 9, 40,
754 11, 12, 13, 44, 45, 16, -1, 4, 5, 20,
755 -1, 22, 9, -1, 11, 12, 13, -1, -1, 16,
756 31, -1, 33, 20, -1, 22, -1, -1, -1, 40,
757 4, 5, -1, 44, 31, 9, 33, 11, 12, 13,
758 -1, -1, 16, 40, 4, 5, 20, 44, 22, 9,
759 -1, 11, 12, -1, -1, -1, 16, 31, -1, 33,
760 4, 5, 22, -1, -1, -1, 40, 11, 26, -1,
761 44, 31, 16, 33, 32, 33, 34, 35, 22, 37,
762 40, 32, 33, 34, 35, -1, 37, -1, -1, 33,
763 41, -1, 32, 33, 34, 35, 40, 37
766 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
767 symbol of state STATE-NUM. */
768 static const yytype_uint8 yystos
[] =
770 0, 50, 0, 1, 4, 5, 6, 7, 9, 11,
771 12, 13, 16, 20, 22, 31, 33, 40, 44, 51,
772 52, 53, 57, 58, 59, 61, 63, 8, 4, 53,
773 39, 4, 6, 7, 57, 25, 64, 65, 16, 40,
774 58, 40, 59, 61, 53, 58, 61, 63, 4, 5,
775 33, 54, 55, 56, 8, 21, 28, 30, 14, 15,
776 17, 18, 19, 26, 32, 33, 34, 35, 37, 40,
777 58, 61, 63, 58, 23, 24, 66, 58, 61, 14,
778 41, 41, 41, 41, 4, 5, 45, 64, 58, 58,
779 25, 47, 54, 55, 57, 69, 70, 72, 73, 39,
780 42, 43, 60, 69, 64, 64, 61, 61, 61, 61,
781 61, 61, 63, 47, 67, 68, 56, 16, 40, 63,
782 70, 10, 10, 45, 72, 69, 68, 4, 5, 33,
783 45, 54, 55, 57, 58, 59, 61, 62, 63, 71,
784 73, 45, 48, 54, 55, 56, 72, 48, 4, 5,
788 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
789 static const yytype_uint8 yyr1
[] =
791 0, 49, 50, 50, 51, 51, 52, 52, 52, 52,
792 52, 52, 52, 52, 53, 53, 53, 53, 54, 54,
793 55, 55, 56, 56, 57, 57, 58, 58, 58, 58,
794 58, 58, 58, 59, 59, 60, 60, 60, 58, 58,
795 58, 58, 58, 61, 61, 61, 61, 61, 61, 61,
796 61, 61, 61, 61, 61, 62, 62, 63, 63, 63,
797 63, 58, 61, 63, 64, 64, 65, 65, 66, 67,
798 67, 68, 68, 68, 69, 69, 70, 70, 70, 71,
799 71, 71, 71, 71, 72, 72, 72, 72, 73, 73,
803 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
804 static const yytype_uint8 yyr2
[] =
806 0, 2, 0, 2, 2, 2, 0, 1, 1, 1,
807 2, 3, 3, 3, 1, 1, 3, 3, 1, 2,
808 1, 2, 1, 1, 1, 1, 2, 3, 3, 3,
809 3, 2, 2, 1, 1, 1, 1, 1, 2, 3,
810 4, 3, 3, 1, 1, 2, 4, 3, 3, 3,
811 3, 3, 2, 3, 3, 1, 2, 7, 3, 2,
812 3, 1, 1, 1, 1, 2, 0, 2, 2, 1,
813 3, 0, 2, 3, 1, 3, 1, 2, 3, 1,
814 1, 1, 1, 1, 1, 1, 1, 1, 3, 3,
819 #define yyerrok (yyerrstatus = 0)
820 #define yyclearin (yychar = YYEMPTY)
824 #define YYACCEPT goto yyacceptlab
825 #define YYABORT goto yyabortlab
826 #define YYERROR goto yyerrorlab
829 #define YYRECOVERING() (!!yyerrstatus)
831 #define YYBACKUP(Token, Value) \
833 if (yychar == YYEMPTY) \
837 YYPOPSTACK (yylen); \
843 yyerror (&yylloc, scanner, YY_("syntax error: cannot back up")); \
848 /* Error token number */
850 #define YYERRCODE 256
853 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
854 If N is 0, then set CURRENT to the empty location which ends
855 the previous symbol: RHS[0] (always defined). */
857 #ifndef YYLLOC_DEFAULT
858 # define YYLLOC_DEFAULT(Current, Rhs, N) \
862 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
863 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
864 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
865 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
869 (Current).first_line = (Current).last_line = \
870 YYRHSLOC (Rhs, 0).last_line; \
871 (Current).first_column = (Current).last_column = \
872 YYRHSLOC (Rhs, 0).last_column; \
877 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
880 /* Enable debugging if requested. */
884 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
885 # define YYFPRINTF fprintf
888 # define YYDPRINTF(Args) \
895 /* YY_LOCATION_PRINT -- Print the location on the stream.
896 This macro was not mandated originally: define only if we know
897 we won't break user code: when these are the locations we know. */
899 #ifndef YY_LOCATION_PRINT
900 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
902 /* Print *YYLOCP on YYO. Private, do not rely on its existence. */
906 yy_location_print_ (FILE *yyo
, YYLTYPE
const * const yylocp
)
909 int end_col
= 0 != yylocp
->last_column
? yylocp
->last_column
- 1 : 0;
910 if (0 <= yylocp
->first_line
)
912 res
+= YYFPRINTF (yyo
, "%d", yylocp
->first_line
);
913 if (0 <= yylocp
->first_column
)
914 res
+= YYFPRINTF (yyo
, ".%d", yylocp
->first_column
);
916 if (0 <= yylocp
->last_line
)
918 if (yylocp
->first_line
< yylocp
->last_line
)
920 res
+= YYFPRINTF (yyo
, "-%d", yylocp
->last_line
);
922 res
+= YYFPRINTF (yyo
, ".%d", end_col
);
924 else if (0 <= end_col
&& yylocp
->first_column
< end_col
)
925 res
+= YYFPRINTF (yyo
, "-%d", end_col
);
930 # define YY_LOCATION_PRINT(File, Loc) \
931 yy_location_print_ (File, &(Loc))
934 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
939 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
943 YYFPRINTF (stderr, "%s ", Title); \
944 yy_symbol_print (stderr, \
945 Type, Value, Location, scanner); \
946 YYFPRINTF (stderr, "\n"); \
951 /*----------------------------------------.
952 | Print this symbol's value on YYOUTPUT. |
953 `----------------------------------------*/
956 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
, void *scanner
)
958 FILE *yyo gmx_unused
= yyoutput
;
965 if (yytype
< YYNTOKENS
)
966 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
972 /*--------------------------------.
973 | Print this symbol on YYOUTPUT. |
974 `--------------------------------*/
977 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, YYLTYPE
const * const yylocationp
, void *scanner
)
979 YYFPRINTF (yyoutput
, "%s %s (",
980 yytype
< YYNTOKENS
? "token" : "nterm", yytname
[yytype
]);
982 YY_LOCATION_PRINT (yyoutput
, *yylocationp
);
983 YYFPRINTF (yyoutput
, ": ");
984 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, yylocationp
, scanner
);
985 YYFPRINTF (yyoutput
, ")");
988 /*------------------------------------------------------------------.
989 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
991 `------------------------------------------------------------------*/
994 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
996 YYFPRINTF (stderr
, "Stack now");
997 for (; yybottom
<= yytop
; yybottom
++)
999 int yybot
= *yybottom
;
1000 YYFPRINTF (stderr
, " %d", yybot
);
1002 YYFPRINTF (stderr
, "\n");
1005 # define YY_STACK_PRINT(Bottom, Top) \
1008 yy_stack_print ((Bottom), (Top)); \
1012 /*------------------------------------------------.
1013 | Report that the YYRULE is going to be reduced. |
1014 `------------------------------------------------*/
1017 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, YYLTYPE
*yylsp
, int yyrule
, void *scanner
)
1019 unsigned long int yylno
= yyrline
[yyrule
];
1020 int yynrhs
= yyr2
[yyrule
];
1022 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1024 /* The symbols being reduced. */
1025 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1027 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1028 yy_symbol_print (stderr
,
1029 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
1030 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1031 , &(yylsp
[(yyi
+ 1) - (yynrhs
)]) , scanner
);
1032 YYFPRINTF (stderr
, "\n");
1036 # define YY_REDUCE_PRINT(Rule) \
1039 yy_reduce_print (yyssp, yyvsp, yylsp, Rule, scanner); \
1042 /* Nonzero means print parse trace. It is left uninitialized so that
1043 multiple parsers can coexist. */
1045 #else /* !YYDEBUG */
1046 # define YYDPRINTF(Args)
1047 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1048 # define YY_STACK_PRINT(Bottom, Top)
1049 # define YY_REDUCE_PRINT(Rule)
1050 #endif /* !YYDEBUG */
1053 /* YYINITDEPTH -- initial size of the parser's stacks. */
1055 # define YYINITDEPTH 200
1058 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1059 if the built-in stack extension method is used).
1061 Do not make this value too large; the results are undefined if
1062 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1063 evaluated with infinite-precision integer arithmetic. */
1066 # define YYMAXDEPTH 10000
1073 # if defined __GLIBC__ && defined _STRING_H
1074 # define yystrlen strlen
1076 /* Return the length of YYSTR. */
1078 yystrlen (const char *yystr
)
1081 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1089 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1090 # define yystpcpy stpcpy
1092 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1095 yystpcpy (char *yydest
, const char *yysrc
)
1098 const char *yys
= yysrc
;
1100 while ((*yyd
++ = *yys
++) != '\0')
1109 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1110 quotes and backslashes, so that it's suitable for yyerror. The
1111 heuristic is that double-quoting is unnecessary unless the string
1112 contains an apostrophe, a comma, or backslash (other than
1113 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1114 null, do not copy; instead, return the length of what the result
1117 yytnamerr (char *yyres
, const char *yystr
)
1122 char const *yyp
= yystr
;
1129 goto do_not_strip_quotes
;
1133 goto do_not_strip_quotes
;
1146 do_not_strip_quotes
: ;
1150 return yystrlen (yystr
);
1152 return yystpcpy (yyres
, yystr
) - yyres
;
1156 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1157 about the unexpected token YYTOKEN for the state stack whose top is
1160 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1161 not large enough to hold the message. In that case, also set
1162 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1163 required number of bytes is too large to store. */
1165 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1166 yytype_int16
*yyssp
, int yytoken
)
1168 YYSIZE_T yysize0
= yytnamerr (YY_NULLPTR
, yytname
[yytoken
]);
1169 YYSIZE_T yysize
= yysize0
;
1170 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1171 /* Internationalized format string. */
1172 const char *yyformat
= YY_NULLPTR
;
1173 /* Arguments of yyformat. */
1174 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1175 /* Number of reported tokens (one for the "unexpected", one per
1179 /* There are many possibilities here to consider:
1180 - If this state is a consistent state with a default action, then
1181 the only way this function was invoked is if the default action
1182 is an error action. In that case, don't check for expected
1183 tokens because there are none.
1184 - The only way there can be no lookahead present (in yychar) is if
1185 this state is a consistent state with a default action. Thus,
1186 detecting the absence of a lookahead is sufficient to determine
1187 that there is no unexpected or expected token to report. In that
1188 case, just report a simple "syntax error".
1189 - Don't assume there isn't a lookahead just because this state is a
1190 consistent state with a default action. There might have been a
1191 previous inconsistent state, consistent state with a non-default
1192 action, or user semantic action that manipulated yychar.
1193 - Of course, the expected token list depends on states to have
1194 correct lookahead information, and it depends on the parser not
1195 to perform extra reductions after fetching a lookahead from the
1196 scanner and before detecting a syntax error. Thus, state merging
1197 (from LALR or IELR) and default reductions corrupt the expected
1198 token list. However, the list is correct for canonical LR with
1199 one exception: it will still contain any token that will not be
1200 accepted due to an error action in a later state.
1202 if (yytoken
!= YYEMPTY
)
1204 int yyn
= yypact
[*yyssp
];
1205 yyarg
[yycount
++] = yytname
[yytoken
];
1206 if (!yypact_value_is_default (yyn
))
1208 /* Start YYX at -YYN if negative to avoid negative indexes in
1209 YYCHECK. In other words, skip the first -YYN actions for
1210 this state because they are default actions. */
1211 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1212 /* Stay within bounds of both yycheck and yytname. */
1213 int yychecklim
= YYLAST
- yyn
+ 1;
1214 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1217 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1218 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
1219 && !yytable_value_is_error (yytable
[yyx
+ yyn
]))
1221 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1227 yyarg
[yycount
++] = yytname
[yyx
];
1229 YYSIZE_T yysize1
= yysize
+ yytnamerr (YY_NULLPTR
, yytname
[yyx
]);
1230 if (! (yysize
<= yysize1
1231 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1241 # define YYCASE_(N, S) \
1245 YYCASE_(0, YY_("syntax error"));
1246 YYCASE_(1, YY_("syntax error, unexpected %s"));
1247 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1248 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1249 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1250 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1255 YYSIZE_T yysize1
= yysize
+ yystrlen (yyformat
);
1256 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1261 if (*yymsg_alloc
< yysize
)
1263 *yymsg_alloc
= 2 * yysize
;
1264 if (! (yysize
<= *yymsg_alloc
1265 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1266 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1270 /* Avoid sprintf, as that infringes on the user's name space.
1271 Don't have undefined behavior even if the translation
1272 produced a string with the wrong number of "%s"s. */
1276 while ((*yyp
= *yyformat
) != '\0')
1277 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1279 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1290 #endif /* YYERROR_VERBOSE */
1292 /*-----------------------------------------------.
1293 | Release the memory associated to this symbol. |
1294 `-----------------------------------------------*/
1297 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, YYLTYPE
*yylocationp
, void *scanner
)
1300 YYUSE (yylocationp
);
1304 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1306 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1310 #line 178 "parser.y" /* yacc.c:1257 */
1311 { free(((*yyvaluep
).str
)); }
1312 #line 1313 "parser.cpp" /* yacc.c:1257 */
1315 case 7: /* IDENTIFIER */
1316 #line 178 "parser.y" /* yacc.c:1257 */
1317 { free(((*yyvaluep
).str
)); }
1318 #line 1319 "parser.cpp" /* yacc.c:1257 */
1321 case 16: /* KEYWORD_POS */
1322 #line 178 "parser.y" /* yacc.c:1257 */
1323 { free(((*yyvaluep
).str
)); }
1324 #line 1325 "parser.cpp" /* yacc.c:1257 */
1327 case 23: /* PARAM */
1328 #line 179 "parser.y" /* yacc.c:1257 */
1329 { if(((*yyvaluep
).str
)) free(((*yyvaluep
).str
)); }
1330 #line 1331 "parser.cpp" /* yacc.c:1257 */
1333 case 26: /* CMP_OP */
1334 #line 178 "parser.y" /* yacc.c:1257 */
1335 { free(((*yyvaluep
).str
)); }
1336 #line 1337 "parser.cpp" /* yacc.c:1257 */
1339 case 50: /* commands */
1340 #line 180 "parser.y" /* yacc.c:1257 */
1341 { delete ((*yyvaluep
).sel
); }
1342 #line 1343 "parser.cpp" /* yacc.c:1257 */
1345 case 51: /* command */
1346 #line 180 "parser.y" /* yacc.c:1257 */
1347 { delete ((*yyvaluep
).sel
); }
1348 #line 1349 "parser.cpp" /* yacc.c:1257 */
1351 case 52: /* cmd_plain */
1352 #line 180 "parser.y" /* yacc.c:1257 */
1353 { delete ((*yyvaluep
).sel
); }
1354 #line 1355 "parser.cpp" /* yacc.c:1257 */
1357 case 53: /* selection */
1358 #line 180 "parser.y" /* yacc.c:1257 */
1359 { delete ((*yyvaluep
).sel
); }
1360 #line 1361 "parser.cpp" /* yacc.c:1257 */
1363 case 57: /* string */
1364 #line 178 "parser.y" /* yacc.c:1257 */
1365 { free(((*yyvaluep
).str
)); }
1366 #line 1367 "parser.cpp" /* yacc.c:1257 */
1369 case 58: /* sel_expr */
1370 #line 181 "parser.y" /* yacc.c:1257 */
1371 { delete ((*yyvaluep
).sel
); }
1372 #line 1373 "parser.cpp" /* yacc.c:1257 */
1375 case 59: /* pos_mod */
1376 #line 179 "parser.y" /* yacc.c:1257 */
1377 { if(((*yyvaluep
).str
)) free(((*yyvaluep
).str
)); }
1378 #line 1379 "parser.cpp" /* yacc.c:1257 */
1381 case 61: /* num_expr */
1382 #line 181 "parser.y" /* yacc.c:1257 */
1383 { delete ((*yyvaluep
).sel
); }
1384 #line 1385 "parser.cpp" /* yacc.c:1257 */
1387 case 62: /* str_expr */
1388 #line 181 "parser.y" /* yacc.c:1257 */
1389 { delete ((*yyvaluep
).sel
); }
1390 #line 1391 "parser.cpp" /* yacc.c:1257 */
1393 case 63: /* pos_expr */
1394 #line 181 "parser.y" /* yacc.c:1257 */
1395 { delete ((*yyvaluep
).sel
); }
1396 #line 1397 "parser.cpp" /* yacc.c:1257 */
1399 case 64: /* method_params */
1400 #line 182 "parser.y" /* yacc.c:1257 */
1401 { delete ((*yyvaluep
).plist
); }
1402 #line 1403 "parser.cpp" /* yacc.c:1257 */
1405 case 65: /* method_param_list */
1406 #line 182 "parser.y" /* yacc.c:1257 */
1407 { delete ((*yyvaluep
).plist
); }
1408 #line 1409 "parser.cpp" /* yacc.c:1257 */
1411 case 66: /* method_param */
1412 #line 182 "parser.y" /* yacc.c:1257 */
1413 { delete ((*yyvaluep
).param
); }
1414 #line 1415 "parser.cpp" /* yacc.c:1257 */
1417 case 67: /* value_list */
1418 #line 183 "parser.y" /* yacc.c:1257 */
1419 { delete ((*yyvaluep
).vlist
); }
1420 #line 1421 "parser.cpp" /* yacc.c:1257 */
1423 case 68: /* value_list_contents */
1424 #line 183 "parser.y" /* yacc.c:1257 */
1425 { delete ((*yyvaluep
).vlist
); }
1426 #line 1427 "parser.cpp" /* yacc.c:1257 */
1429 case 69: /* basic_value_list */
1430 #line 183 "parser.y" /* yacc.c:1257 */
1431 { delete ((*yyvaluep
).vlist
); }
1432 #line 1433 "parser.cpp" /* yacc.c:1257 */
1435 case 70: /* basic_value_list_contents */
1436 #line 183 "parser.y" /* yacc.c:1257 */
1437 { delete ((*yyvaluep
).vlist
); }
1438 #line 1439 "parser.cpp" /* yacc.c:1257 */
1441 case 71: /* value_item */
1442 #line 184 "parser.y" /* yacc.c:1257 */
1443 { delete ((*yyvaluep
).val
); }
1444 #line 1445 "parser.cpp" /* yacc.c:1257 */
1447 case 72: /* basic_value_item */
1448 #line 184 "parser.y" /* yacc.c:1257 */
1449 { delete ((*yyvaluep
).val
); }
1450 #line 1451 "parser.cpp" /* yacc.c:1257 */
1453 case 73: /* value_item_range */
1454 #line 184 "parser.y" /* yacc.c:1257 */
1455 { delete ((*yyvaluep
).val
); }
1456 #line 1457 "parser.cpp" /* yacc.c:1257 */
1463 YY_IGNORE_MAYBE_UNINITIALIZED_END
1470 /* Number of syntax errors so far. */
1474 /* Number of tokens to shift before error messages enabled. */
1477 /* The stacks and their tools:
1478 'yyss': related to states.
1479 'yyvs': related to semantic values.
1480 'yyls': related to locations.
1482 Refer to the stacks through separate pointers, to allow yyoverflow
1483 to reallocate them elsewhere. */
1485 /* The state stack. */
1486 yytype_int16 yyssa
[YYINITDEPTH
];
1488 yytype_int16
*yyssp
;
1490 /* The semantic value stack. */
1491 YYSTYPE yyvsa
[YYINITDEPTH
];
1495 /* The location stack. */
1496 YYLTYPE yylsa
[YYINITDEPTH
];
1500 /* The locations where the error started and ended. */
1501 YYLTYPE yyerror_range
[3];
1503 YYSIZE_T yystacksize
;
1504 /* Used to determine if this is the first time this instance has
1509 /* Initialize the parser data structure. */
1514 yyps
= (yypstate
*) malloc (sizeof *yyps
);
1522 yypstate_delete (yypstate
*yyps
)
1525 /* If the stack was reallocated but the parse did not complete, then the
1526 stack still needs to be freed. */
1527 if (!yyps
->yynew
&& yyps
->yyss
!= yyps
->yyssa
)
1528 YYSTACK_FREE (yyps
->yyss
);
1533 #define _gmx_sel_yynerrs yyps->_gmx_sel_yynerrs
1534 #define yystate yyps->yystate
1535 #define yyerrstatus yyps->yyerrstatus
1536 #define yyssa yyps->yyssa
1537 #define yyss yyps->yyss
1538 #define yyssp yyps->yyssp
1539 #define yyvsa yyps->yyvsa
1540 #define yyvs yyps->yyvs
1541 #define yyvsp yyps->yyvsp
1542 #define yylsa yyps->yylsa
1543 #define yyls yyps->yyls
1544 #define yylsp yyps->yylsp
1545 #define yyerror_range yyps->yyerror_range
1546 #define yystacksize yyps->yystacksize
1554 yypush_parse (yypstate
*yyps
, int yypushed_char
, YYSTYPE
const *yypushed_val
, YYLTYPE
*yypushed_loc
, void *scanner
)
1556 /* The lookahead symbol. */
1560 /* The semantic value of the lookahead symbol. */
1561 /* Default value used for initialization, for pacifying older GCCs
1562 or non-GCC compilers. */
1563 YY_INITIAL_VALUE (static YYSTYPE yyval_default
;)
1564 YYSTYPE yylval
YY_INITIAL_VALUE (= yyval_default
);
1566 /* Location data for the lookahead symbol. */
1567 static YYLTYPE yyloc_default
1568 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1572 YYLTYPE yylloc
= yyloc_default
;
1576 /* Lookahead token as an internal (translated) token number. */
1578 /* The variables used to return semantic value and location from the
1584 /* Buffer for error messages, and its allocated size. */
1586 char *yymsg
= yymsgbuf
;
1587 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1590 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1592 /* The number of symbols on the RHS of the reduced rule.
1593 Keep to zero when no symbol should be popped. */
1598 yyn
= yypact
[yystate
];
1599 goto yyread_pushed_token
;
1602 yyssp
= yyss
= yyssa
;
1603 yyvsp
= yyvs
= yyvsa
;
1604 yylsp
= yyls
= yylsa
;
1605 yystacksize
= YYINITDEPTH
;
1607 YYDPRINTF ((stderr
, "Starting parse\n"));
1612 yychar
= YYEMPTY
; /* Cause a token to be read. */
1613 yylsp
[0] = *yypushed_loc
;
1616 /*------------------------------------------------------------.
1617 | yynewstate -- Push a new state, which is found in yystate. |
1618 `------------------------------------------------------------*/
1620 /* In all cases, when you get here, the value and location stacks
1621 have just been pushed. So pushing a state here evens the stacks. */
1627 if (yyss
+ yystacksize
- 1 <= yyssp
)
1629 /* Get the current used size of the three stacks, in elements. */
1630 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1634 /* Give user a chance to reallocate the stack. Use copies of
1635 these so that the &'s don't force the real ones into
1637 YYSTYPE
*yyvs1
= yyvs
;
1638 yytype_int16
*yyss1
= yyss
;
1639 YYLTYPE
*yyls1
= yyls
;
1641 /* Each stack pointer address is followed by the size of the
1642 data in use in that stack, in bytes. This used to be a
1643 conditional around just the two extra args, but that might
1644 be undefined if yyoverflow is a macro. */
1645 yyoverflow (YY_("memory exhausted"),
1646 &yyss1
, yysize
* sizeof (*yyssp
),
1647 &yyvs1
, yysize
* sizeof (*yyvsp
),
1648 &yyls1
, yysize
* sizeof (*yylsp
),
1655 #else /* no yyoverflow */
1656 # ifndef YYSTACK_RELOCATE
1657 goto yyexhaustedlab
;
1659 /* Extend the stack our own way. */
1660 if (YYMAXDEPTH
<= yystacksize
)
1661 goto yyexhaustedlab
;
1663 if (YYMAXDEPTH
< yystacksize
)
1664 yystacksize
= YYMAXDEPTH
;
1667 yytype_int16
*yyss1
= yyss
;
1668 union yyalloc
*yyptr
=
1669 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1671 goto yyexhaustedlab
;
1672 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1673 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1674 YYSTACK_RELOCATE (yyls_alloc
, yyls
);
1675 # undef YYSTACK_RELOCATE
1677 YYSTACK_FREE (yyss1
);
1680 #endif /* no yyoverflow */
1682 yyssp
= yyss
+ yysize
- 1;
1683 yyvsp
= yyvs
+ yysize
- 1;
1684 yylsp
= yyls
+ yysize
- 1;
1686 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1687 (unsigned long int) yystacksize
));
1689 if (yyss
+ yystacksize
- 1 <= yyssp
)
1693 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1695 if (yystate
== YYFINAL
)
1705 /* Do appropriate processing given the current state. Read a
1706 lookahead token if we need one and don't already have one. */
1708 /* First try to decide what to do without reference to lookahead token. */
1709 yyn
= yypact
[yystate
];
1710 if (yypact_value_is_default (yyn
))
1713 /* Not known => get a lookahead token if don't already have one. */
1715 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1716 if (yychar
== YYEMPTY
)
1720 YYDPRINTF ((stderr
, "Return for a new token:\n"));
1721 yyresult
= YYPUSH_MORE
;
1725 yyread_pushed_token
:
1726 YYDPRINTF ((stderr
, "Reading a token: "));
1727 yychar
= yypushed_char
;
1729 yylval
= *yypushed_val
;
1731 yylloc
= *yypushed_loc
;
1734 if (yychar
<= YYEOF
)
1736 yychar
= yytoken
= YYEOF
;
1737 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1741 yytoken
= YYTRANSLATE (yychar
);
1742 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1745 /* If the proper action on seeing token YYTOKEN is to reduce or to
1746 detect an error, take that action. */
1748 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1753 if (yytable_value_is_error (yyn
))
1759 /* Count tokens shifted since error; after three, turn off error
1764 /* Shift the lookahead token. */
1765 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1767 /* Discard the shifted token. */
1771 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1773 YY_IGNORE_MAYBE_UNINITIALIZED_END
1778 /*-----------------------------------------------------------.
1779 | yydefault -- do the default action for the current state. |
1780 `-----------------------------------------------------------*/
1782 yyn
= yydefact
[yystate
];
1788 /*-----------------------------.
1789 | yyreduce -- Do a reduction. |
1790 `-----------------------------*/
1792 /* yyn is the number of a rule to reduce with. */
1795 /* If YYLEN is nonzero, implement the default value of the action:
1798 Otherwise, the following line sets YYVAL to garbage.
1799 This behavior is undocumented and Bison
1800 users should not rely upon it. Assigning to YYVAL
1801 unconditionally makes the parser a bit smaller, and it avoids a
1802 GCC warning that YYVAL may be used uninitialized. */
1803 yyval
= yyvsp
[1-yylen
];
1805 /* Default location. */
1806 YYLLOC_DEFAULT (yyloc
, (yylsp
- yylen
), yylen
);
1807 YY_REDUCE_PRINT (yyn
);
1811 #line 199 "parser.y" /* yacc.c:1646 */
1814 set_empty((yyval
.sel
));
1815 END_ACTION_TOPLEVEL
;
1817 #line 1818 "parser.cpp" /* yacc.c:1646 */
1821 #line 205 "parser.y" /* yacc.c:1646 */
1824 set((yyval
.sel
), _gmx_sel_append_selection(get((yyvsp
[0].sel
)), get((yyvsp
[-1].sel
)), scanner
));
1825 if (_gmx_sel_parser_should_finish(scanner
)) {
1829 END_ACTION_TOPLEVEL
;
1831 #line 1832 "parser.cpp" /* yacc.c:1646 */
1835 #line 217 "parser.y" /* yacc.c:1646 */
1836 { (yyval
.sel
) = (yyvsp
[-1].sel
); }
1837 #line 1838 "parser.cpp" /* yacc.c:1646 */
1841 #line 219 "parser.y" /* yacc.c:1646 */
1844 _gmx_sel_lexer_clear_method_stack(scanner
);
1845 if (_gmx_selparser_handle_error(scanner
))
1853 _gmx_sel_lexer_clear_pselstr(scanner
);
1854 set_empty((yyval
.sel
));
1855 END_ACTION_TOPLEVEL
;
1857 #line 1858 "parser.cpp" /* yacc.c:1646 */
1861 #line 238 "parser.y" /* yacc.c:1646 */
1864 set_empty((yyval
.sel
));
1867 #line 1868 "parser.cpp" /* yacc.c:1646 */
1871 #line 244 "parser.y" /* yacc.c:1646 */
1874 SelectionTreeElementPointer s
1875 = _gmx_sel_init_group_by_id((yyvsp
[0].i
), scanner
);
1876 SelectionTreeElementPointer p
1877 = _gmx_sel_init_position(s
, NULL
, scanner
);
1879 set((yyval
.sel
), _gmx_sel_init_selection(NULL
, p
, scanner
));
1882 #line 1883 "parser.cpp" /* yacc.c:1646 */
1886 #line 255 "parser.y" /* yacc.c:1646 */
1889 const sfree_guard
nameGuard((yyvsp
[0].str
));
1890 SelectionTreeElementPointer s
1891 = _gmx_sel_init_group_by_name((yyvsp
[0].str
), scanner
);
1892 SelectionTreeElementPointer p
1893 = _gmx_sel_init_position(s
, NULL
, scanner
);
1895 set((yyval
.sel
), _gmx_sel_init_selection(NULL
, p
, scanner
));
1898 #line 1899 "parser.cpp" /* yacc.c:1646 */
1902 #line 267 "parser.y" /* yacc.c:1646 */
1905 set((yyval
.sel
), _gmx_sel_init_selection(NULL
, get((yyvsp
[0].sel
)), scanner
));
1908 #line 1909 "parser.cpp" /* yacc.c:1646 */
1912 #line 273 "parser.y" /* yacc.c:1646 */
1915 const sfree_guard
nameGuard((yyvsp
[-1].str
));
1916 set((yyval
.sel
), _gmx_sel_init_selection((yyvsp
[-1].str
), get((yyvsp
[0].sel
)), scanner
));
1919 #line 1920 "parser.cpp" /* yacc.c:1646 */
1923 #line 280 "parser.y" /* yacc.c:1646 */
1926 const sfree_guard
nameGuard((yyvsp
[-2].str
));
1927 set((yyval
.sel
), _gmx_sel_assign_variable((yyvsp
[-2].str
), get((yyvsp
[0].sel
)), scanner
));
1930 #line 1931 "parser.cpp" /* yacc.c:1646 */
1934 #line 287 "parser.y" /* yacc.c:1646 */
1937 const sfree_guard
nameGuard((yyvsp
[-2].str
));
1938 set((yyval
.sel
), _gmx_sel_assign_variable((yyvsp
[-2].str
), get((yyvsp
[0].sel
)), scanner
));
1941 #line 1942 "parser.cpp" /* yacc.c:1646 */
1945 #line 294 "parser.y" /* yacc.c:1646 */
1948 const sfree_guard
nameGuard((yyvsp
[-2].str
));
1949 set((yyval
.sel
), _gmx_sel_assign_variable((yyvsp
[-2].str
), get((yyvsp
[0].sel
)), scanner
));
1952 #line 1953 "parser.cpp" /* yacc.c:1646 */
1956 #line 303 "parser.y" /* yacc.c:1646 */
1957 { (yyval
.sel
) = (yyvsp
[0].sel
); }
1958 #line 1959 "parser.cpp" /* yacc.c:1646 */
1962 #line 305 "parser.y" /* yacc.c:1646 */
1965 set((yyval
.sel
), _gmx_sel_init_position(get((yyvsp
[0].sel
)), NULL
, scanner
));
1966 CHECK_SEL((yyval
.sel
));
1969 #line 1970 "parser.cpp" /* yacc.c:1646 */
1973 #line 311 "parser.y" /* yacc.c:1646 */
1974 { (yyval
.sel
) = (yyvsp
[-1].sel
); }
1975 #line 1976 "parser.cpp" /* yacc.c:1646 */
1979 #line 313 "parser.y" /* yacc.c:1646 */
1982 set((yyval
.sel
), _gmx_sel_init_modifier((yyvsp
[-1].meth
), get((yyvsp
[0].plist
)), get((yyvsp
[-2].sel
)), scanner
));
1983 CHECK_SEL((yyval
.sel
));
1986 #line 1987 "parser.cpp" /* yacc.c:1646 */
1990 #line 326 "parser.y" /* yacc.c:1646 */
1991 { (yyval
.i
) = (yyvsp
[0].i
); }
1992 #line 1993 "parser.cpp" /* yacc.c:1646 */
1996 #line 327 "parser.y" /* yacc.c:1646 */
1997 { (yyval
.i
) = -(yyvsp
[0].i
); }
1998 #line 1999 "parser.cpp" /* yacc.c:1646 */
2002 #line 331 "parser.y" /* yacc.c:1646 */
2003 { (yyval
.r
) = (yyvsp
[0].r
); }
2004 #line 2005 "parser.cpp" /* yacc.c:1646 */
2008 #line 332 "parser.y" /* yacc.c:1646 */
2009 { (yyval
.r
) = -(yyvsp
[0].r
); }
2010 #line 2011 "parser.cpp" /* yacc.c:1646 */
2014 #line 335 "parser.y" /* yacc.c:1646 */
2015 { (yyval
.r
) = (yyvsp
[0].i
); }
2016 #line 2017 "parser.cpp" /* yacc.c:1646 */
2020 #line 336 "parser.y" /* yacc.c:1646 */
2021 { (yyval
.r
) = (yyvsp
[0].r
); }
2022 #line 2023 "parser.cpp" /* yacc.c:1646 */
2026 #line 339 "parser.y" /* yacc.c:1646 */
2027 { (yyval
.str
) = (yyvsp
[0].str
); }
2028 #line 2029 "parser.cpp" /* yacc.c:1646 */
2032 #line 340 "parser.y" /* yacc.c:1646 */
2033 { (yyval
.str
) = (yyvsp
[0].str
); }
2034 #line 2035 "parser.cpp" /* yacc.c:1646 */
2038 #line 349 "parser.y" /* yacc.c:1646 */
2041 SelectionTreeElementPointer
arg(get((yyvsp
[0].sel
)));
2042 SelectionTreeElementPointer
sel(
2043 new SelectionTreeElement(SEL_BOOLEAN
, (yyloc
)));
2044 sel
->u
.boolt
= BOOL_NOT
;
2046 set((yyval
.sel
), sel
);
2049 #line 2050 "parser.cpp" /* yacc.c:1646 */
2053 #line 360 "parser.y" /* yacc.c:1646 */
2056 SelectionTreeElementPointer
arg1(get((yyvsp
[-2].sel
))), arg2(get((yyvsp
[0].sel
)));
2057 SelectionTreeElementPointer
sel(
2058 new SelectionTreeElement(SEL_BOOLEAN
, (yyloc
)));
2059 sel
->u
.boolt
= BOOL_AND
;
2060 sel
->child
= arg1
; sel
->child
->next
= arg2
;
2061 set((yyval
.sel
), sel
);
2064 #line 2065 "parser.cpp" /* yacc.c:1646 */
2068 #line 371 "parser.y" /* yacc.c:1646 */
2071 SelectionTreeElementPointer
arg1(get((yyvsp
[-2].sel
))), arg2(get((yyvsp
[0].sel
)));
2072 SelectionTreeElementPointer
sel(
2073 new SelectionTreeElement(SEL_BOOLEAN
, (yyloc
)));
2074 sel
->u
.boolt
= BOOL_OR
;
2075 sel
->child
= arg1
; sel
->child
->next
= arg2
;
2076 set((yyval
.sel
), sel
);
2079 #line 2080 "parser.cpp" /* yacc.c:1646 */
2083 #line 381 "parser.y" /* yacc.c:1646 */
2084 { (yyval
.sel
) = (yyvsp
[-1].sel
); }
2085 #line 2086 "parser.cpp" /* yacc.c:1646 */
2089 #line 386 "parser.y" /* yacc.c:1646 */
2092 const sfree_guard
opGuard((yyvsp
[-1].str
));
2093 set((yyval
.sel
), _gmx_sel_init_comparison(get((yyvsp
[-2].sel
)), get((yyvsp
[0].sel
)), (yyvsp
[-1].str
), scanner
));
2094 CHECK_SEL((yyval
.sel
));
2097 #line 2098 "parser.cpp" /* yacc.c:1646 */
2101 #line 397 "parser.y" /* yacc.c:1646 */
2104 const sfree_guard
nameGuard((yyvsp
[0].str
));
2105 set((yyval
.sel
), _gmx_sel_init_group_by_name((yyvsp
[0].str
), scanner
));
2108 #line 2109 "parser.cpp" /* yacc.c:1646 */
2112 #line 404 "parser.y" /* yacc.c:1646 */
2115 set((yyval
.sel
), _gmx_sel_init_group_by_id((yyvsp
[0].i
), scanner
));
2118 #line 2119 "parser.cpp" /* yacc.c:1646 */
2122 #line 412 "parser.y" /* yacc.c:1646 */
2123 { (yyval
.str
) = NULL
; }
2124 #line 2125 "parser.cpp" /* yacc.c:1646 */
2128 #line 413 "parser.y" /* yacc.c:1646 */
2129 { (yyval
.str
) = (yyvsp
[0].str
); }
2130 #line 2131 "parser.cpp" /* yacc.c:1646 */
2134 #line 418 "parser.y" /* yacc.c:1646 */
2135 { (yyval
.smt
) = gmx::eStringMatchType_RegularExpression
; }
2136 #line 2137 "parser.cpp" /* yacc.c:1646 */
2140 #line 419 "parser.y" /* yacc.c:1646 */
2141 { (yyval
.smt
) = gmx::eStringMatchType_Wildcard
; }
2142 #line 2143 "parser.cpp" /* yacc.c:1646 */
2146 #line 420 "parser.y" /* yacc.c:1646 */
2147 { (yyval
.smt
) = gmx::eStringMatchType_Exact
; }
2148 #line 2149 "parser.cpp" /* yacc.c:1646 */
2152 #line 425 "parser.y" /* yacc.c:1646 */
2155 const sfree_guard
posmodGuard((yyvsp
[-1].str
));
2156 set((yyval
.sel
), _gmx_sel_init_keyword((yyvsp
[0].meth
), SelectionParserValueListPointer(), (yyvsp
[-1].str
), scanner
));
2157 CHECK_SEL((yyval
.sel
));
2160 #line 2161 "parser.cpp" /* yacc.c:1646 */
2164 #line 433 "parser.y" /* yacc.c:1646 */
2167 const sfree_guard
posmodGuard((yyvsp
[-2].str
));
2168 set((yyval
.sel
), _gmx_sel_init_keyword_strmatch((yyvsp
[-1].meth
), gmx::eStringMatchType_Auto
, get((yyvsp
[0].vlist
)), (yyvsp
[-2].str
), scanner
));
2169 CHECK_SEL((yyval
.sel
));
2172 #line 2173 "parser.cpp" /* yacc.c:1646 */
2176 #line 441 "parser.y" /* yacc.c:1646 */
2179 const sfree_guard
posmodGuard((yyvsp
[-3].str
));
2180 set((yyval
.sel
), _gmx_sel_init_keyword_strmatch((yyvsp
[-2].meth
), (yyvsp
[-1].smt
), get((yyvsp
[0].vlist
)), (yyvsp
[-3].str
), scanner
));
2181 CHECK_SEL((yyval
.sel
));
2184 #line 2185 "parser.cpp" /* yacc.c:1646 */
2188 #line 449 "parser.y" /* yacc.c:1646 */
2191 const sfree_guard
posmodGuard((yyvsp
[-2].str
));
2192 set((yyval
.sel
), _gmx_sel_init_keyword((yyvsp
[-1].meth
), get((yyvsp
[0].vlist
)), (yyvsp
[-2].str
), scanner
));
2193 CHECK_SEL((yyval
.sel
));
2196 #line 2197 "parser.cpp" /* yacc.c:1646 */
2200 #line 460 "parser.y" /* yacc.c:1646 */
2203 const sfree_guard
posmodGuard((yyvsp
[-2].str
));
2204 set((yyval
.sel
), _gmx_sel_init_method((yyvsp
[-1].meth
), get((yyvsp
[0].plist
)), (yyvsp
[-2].str
), scanner
));
2205 CHECK_SEL((yyval
.sel
));
2208 #line 2209 "parser.cpp" /* yacc.c:1646 */
2212 #line 475 "parser.y" /* yacc.c:1646 */
2215 SelectionTreeElementPointer
sel(
2216 new SelectionTreeElement(SEL_CONST
, (yyloc
)));
2217 _gmx_selelem_set_vtype(sel
, INT_VALUE
);
2218 _gmx_selvalue_reserve(&sel
->v
, 1);
2219 sel
->v
.u
.i
[0] = (yyvsp
[0].i
);
2220 set((yyval
.sel
), sel
);
2223 #line 2224 "parser.cpp" /* yacc.c:1646 */
2227 #line 486 "parser.y" /* yacc.c:1646 */
2230 SelectionTreeElementPointer
sel(
2231 new SelectionTreeElement(SEL_CONST
, (yyloc
)));
2232 _gmx_selelem_set_vtype(sel
, REAL_VALUE
);
2233 _gmx_selvalue_reserve(&sel
->v
, 1);
2234 sel
->v
.u
.r
[0] = (yyvsp
[0].r
);
2235 set((yyval
.sel
), sel
);
2238 #line 2239 "parser.cpp" /* yacc.c:1646 */
2242 #line 500 "parser.y" /* yacc.c:1646 */
2245 const sfree_guard
posmodGuard((yyvsp
[-1].str
));
2246 set((yyval
.sel
), _gmx_sel_init_keyword((yyvsp
[0].meth
), SelectionParserValueListPointer(), (yyvsp
[-1].str
), scanner
));
2247 CHECK_SEL((yyval
.sel
));
2250 #line 2251 "parser.cpp" /* yacc.c:1646 */
2254 #line 508 "parser.y" /* yacc.c:1646 */
2257 const sfree_guard
posmodGuard((yyvsp
[-3].str
));
2258 set((yyval
.sel
), _gmx_sel_init_keyword_of((yyvsp
[-2].meth
), get((yyvsp
[0].sel
)), (yyvsp
[-3].str
), scanner
));
2259 CHECK_SEL((yyval
.sel
));
2262 #line 2263 "parser.cpp" /* yacc.c:1646 */
2266 #line 516 "parser.y" /* yacc.c:1646 */
2269 const sfree_guard
posmodGuard((yyvsp
[-2].str
));
2270 set((yyval
.sel
), _gmx_sel_init_method((yyvsp
[-1].meth
), get((yyvsp
[0].plist
)), (yyvsp
[-2].str
), scanner
));
2271 CHECK_SEL((yyval
.sel
));
2274 #line 2275 "parser.cpp" /* yacc.c:1646 */
2278 #line 527 "parser.y" /* yacc.c:1646 */
2281 set((yyval
.sel
), _gmx_sel_init_arithmetic(get((yyvsp
[-2].sel
)), get((yyvsp
[0].sel
)), '+', scanner
));
2284 #line 2285 "parser.cpp" /* yacc.c:1646 */
2288 #line 533 "parser.y" /* yacc.c:1646 */
2291 set((yyval
.sel
), _gmx_sel_init_arithmetic(get((yyvsp
[-2].sel
)), get((yyvsp
[0].sel
)), '-', scanner
));
2294 #line 2295 "parser.cpp" /* yacc.c:1646 */
2298 #line 539 "parser.y" /* yacc.c:1646 */
2301 set((yyval
.sel
), _gmx_sel_init_arithmetic(get((yyvsp
[-2].sel
)), get((yyvsp
[0].sel
)), '*', scanner
));
2304 #line 2305 "parser.cpp" /* yacc.c:1646 */
2308 #line 545 "parser.y" /* yacc.c:1646 */
2311 set((yyval
.sel
), _gmx_sel_init_arithmetic(get((yyvsp
[-2].sel
)), get((yyvsp
[0].sel
)), '/', scanner
));
2314 #line 2315 "parser.cpp" /* yacc.c:1646 */
2318 #line 551 "parser.y" /* yacc.c:1646 */
2321 set((yyval
.sel
), _gmx_sel_init_arithmetic(get((yyvsp
[0].sel
)), SelectionTreeElementPointer(), '-', scanner
));
2324 #line 2325 "parser.cpp" /* yacc.c:1646 */
2328 #line 557 "parser.y" /* yacc.c:1646 */
2331 set((yyval
.sel
), _gmx_sel_init_arithmetic(get((yyvsp
[-2].sel
)), get((yyvsp
[0].sel
)), '^', scanner
));
2334 #line 2335 "parser.cpp" /* yacc.c:1646 */
2338 #line 562 "parser.y" /* yacc.c:1646 */
2339 { (yyval
.sel
) = (yyvsp
[-1].sel
); }
2340 #line 2341 "parser.cpp" /* yacc.c:1646 */
2344 #line 570 "parser.y" /* yacc.c:1646 */
2347 SelectionTreeElementPointer
sel(
2348 new SelectionTreeElement(SEL_CONST
, (yyloc
)));
2349 _gmx_selelem_set_vtype(sel
, STR_VALUE
);
2350 _gmx_selvalue_reserve(&sel
->v
, 1);
2351 sel
->v
.u
.s
[0] = (yyvsp
[0].str
);
2352 set((yyval
.sel
), sel
);
2355 #line 2356 "parser.cpp" /* yacc.c:1646 */
2359 #line 581 "parser.y" /* yacc.c:1646 */
2362 const sfree_guard
posmodGuard((yyvsp
[-1].str
));
2363 set((yyval
.sel
), _gmx_sel_init_keyword((yyvsp
[0].meth
), SelectionParserValueListPointer(), (yyvsp
[-1].str
), scanner
));
2364 CHECK_SEL((yyval
.sel
));
2367 #line 2368 "parser.cpp" /* yacc.c:1646 */
2371 #line 596 "parser.y" /* yacc.c:1646 */
2374 set((yyval
.sel
), _gmx_sel_init_const_position((yyvsp
[-5].r
), (yyvsp
[-3].r
), (yyvsp
[-1].r
), scanner
));
2377 #line 2378 "parser.cpp" /* yacc.c:1646 */
2381 #line 604 "parser.y" /* yacc.c:1646 */
2382 { (yyval
.sel
) = (yyvsp
[-1].sel
); }
2383 #line 2384 "parser.cpp" /* yacc.c:1646 */
2387 #line 609 "parser.y" /* yacc.c:1646 */
2390 set((yyval
.sel
), _gmx_sel_init_method((yyvsp
[-1].meth
), get((yyvsp
[0].plist
)), NULL
, scanner
));
2391 CHECK_SEL((yyval
.sel
));
2394 #line 2395 "parser.cpp" /* yacc.c:1646 */
2398 #line 619 "parser.y" /* yacc.c:1646 */
2401 const sfree_guard
keywordGuard((yyvsp
[-2].str
));
2402 set((yyval
.sel
), _gmx_sel_init_position(get((yyvsp
[0].sel
)), (yyvsp
[-2].str
), scanner
));
2403 CHECK_SEL((yyval
.sel
));
2406 #line 2407 "parser.cpp" /* yacc.c:1646 */
2410 #line 633 "parser.y" /* yacc.c:1646 */
2413 set((yyval
.sel
), _gmx_sel_init_variable_ref(get((yyvsp
[0].sel
)), scanner
));
2416 #line 2417 "parser.cpp" /* yacc.c:1646 */
2420 #line 641 "parser.y" /* yacc.c:1646 */
2423 set((yyval
.sel
), _gmx_sel_init_variable_ref(get((yyvsp
[0].sel
)), scanner
));
2426 #line 2427 "parser.cpp" /* yacc.c:1646 */
2430 #line 649 "parser.y" /* yacc.c:1646 */
2433 set((yyval
.sel
), _gmx_sel_init_variable_ref(get((yyvsp
[0].sel
)), scanner
));
2436 #line 2437 "parser.cpp" /* yacc.c:1646 */
2440 #line 662 "parser.y" /* yacc.c:1646 */
2441 { (yyval
.plist
) = (yyvsp
[0].plist
); }
2442 #line 2443 "parser.cpp" /* yacc.c:1646 */
2446 #line 664 "parser.y" /* yacc.c:1646 */
2447 { (yyval
.plist
) = (yyvsp
[-1].plist
); }
2448 #line 2449 "parser.cpp" /* yacc.c:1646 */
2452 #line 669 "parser.y" /* yacc.c:1646 */
2455 set((yyval
.plist
), SelectionParserParameter::createList());
2458 #line 2459 "parser.cpp" /* yacc.c:1646 */
2462 #line 675 "parser.y" /* yacc.c:1646 */
2465 SelectionParserParameterListPointer
list(get((yyvsp
[-1].plist
)));
2466 list
->push_back(get((yyvsp
[0].param
)));
2467 set((yyval
.plist
), std::move(list
));
2470 #line 2471 "parser.cpp" /* yacc.c:1646 */
2474 #line 686 "parser.y" /* yacc.c:1646 */
2477 const sfree_guard
nameGuard((yyvsp
[-1].str
));
2478 set((yyval
.param
), SelectionParserParameter::create((yyvsp
[-1].str
), get((yyvsp
[0].vlist
)), (yyloc
)));
2481 #line 2482 "parser.cpp" /* yacc.c:1646 */
2485 #line 694 "parser.y" /* yacc.c:1646 */
2486 { (yyval
.vlist
) = (yyvsp
[0].vlist
); }
2487 #line 2488 "parser.cpp" /* yacc.c:1646 */
2491 #line 695 "parser.y" /* yacc.c:1646 */
2492 { (yyval
.vlist
) = (yyvsp
[-1].vlist
); }
2493 #line 2494 "parser.cpp" /* yacc.c:1646 */
2497 #line 700 "parser.y" /* yacc.c:1646 */
2500 set((yyval
.vlist
), SelectionParserValue::createList());
2503 #line 2504 "parser.cpp" /* yacc.c:1646 */
2507 #line 706 "parser.y" /* yacc.c:1646 */
2510 SelectionParserValueListPointer
list(get((yyvsp
[-1].vlist
)));
2511 list
->push_back(get((yyvsp
[0].val
)));
2512 set((yyval
.vlist
), std::move(list
));
2515 #line 2516 "parser.cpp" /* yacc.c:1646 */
2519 #line 714 "parser.y" /* yacc.c:1646 */
2522 SelectionParserValueListPointer
list(get((yyvsp
[-2].vlist
)));
2523 list
->push_back(get((yyvsp
[0].val
)));
2524 set((yyval
.vlist
), std::move(list
));
2527 #line 2528 "parser.cpp" /* yacc.c:1646 */
2531 #line 724 "parser.y" /* yacc.c:1646 */
2532 { (yyval
.vlist
) = (yyvsp
[0].vlist
); }
2533 #line 2534 "parser.cpp" /* yacc.c:1646 */
2537 #line 725 "parser.y" /* yacc.c:1646 */
2538 { (yyval
.vlist
) = (yyvsp
[-1].vlist
); }
2539 #line 2540 "parser.cpp" /* yacc.c:1646 */
2543 #line 730 "parser.y" /* yacc.c:1646 */
2546 set((yyval
.vlist
), SelectionParserValue::createList(get((yyvsp
[0].val
))));
2549 #line 2550 "parser.cpp" /* yacc.c:1646 */
2553 #line 736 "parser.y" /* yacc.c:1646 */
2556 SelectionParserValueListPointer
list(get((yyvsp
[-1].vlist
)));
2557 list
->push_back(get((yyvsp
[0].val
)));
2558 set((yyval
.vlist
), std::move(list
));
2561 #line 2562 "parser.cpp" /* yacc.c:1646 */
2565 #line 744 "parser.y" /* yacc.c:1646 */
2568 SelectionParserValueListPointer
list(get((yyvsp
[-2].vlist
)));
2569 list
->push_back(get((yyvsp
[0].val
)));
2570 set((yyval
.vlist
), std::move(list
));
2573 #line 2574 "parser.cpp" /* yacc.c:1646 */
2577 #line 754 "parser.y" /* yacc.c:1646 */
2580 set((yyval
.val
), SelectionParserValue::createExpr(get((yyvsp
[0].sel
))));
2583 #line 2584 "parser.cpp" /* yacc.c:1646 */
2587 #line 760 "parser.y" /* yacc.c:1646 */
2590 set((yyval
.val
), SelectionParserValue::createExpr(get((yyvsp
[0].sel
))));
2593 #line 2594 "parser.cpp" /* yacc.c:1646 */
2597 #line 766 "parser.y" /* yacc.c:1646 */
2600 set((yyval
.val
), SelectionParserValue::createExpr(get((yyvsp
[0].sel
))));
2603 #line 2604 "parser.cpp" /* yacc.c:1646 */
2607 #line 772 "parser.y" /* yacc.c:1646 */
2610 set((yyval
.val
), SelectionParserValue::createExpr(get((yyvsp
[0].sel
))));
2613 #line 2614 "parser.cpp" /* yacc.c:1646 */
2617 #line 777 "parser.y" /* yacc.c:1646 */
2618 { (yyval
.val
) = (yyvsp
[0].val
); }
2619 #line 2620 "parser.cpp" /* yacc.c:1646 */
2623 #line 782 "parser.y" /* yacc.c:1646 */
2626 set((yyval
.val
), SelectionParserValue::createInteger((yyvsp
[0].i
), (yyloc
)));
2629 #line 2630 "parser.cpp" /* yacc.c:1646 */
2633 #line 788 "parser.y" /* yacc.c:1646 */
2636 set((yyval
.val
), SelectionParserValue::createReal((yyvsp
[0].r
), (yyloc
)));
2639 #line 2640 "parser.cpp" /* yacc.c:1646 */
2643 #line 794 "parser.y" /* yacc.c:1646 */
2646 const sfree_guard
stringGuard((yyvsp
[0].str
));
2647 set((yyval
.val
), SelectionParserValue::createString((yyvsp
[0].str
), (yyloc
)));
2650 #line 2651 "parser.cpp" /* yacc.c:1646 */
2654 #line 800 "parser.y" /* yacc.c:1646 */
2655 { (yyval
.val
) = (yyvsp
[0].val
); }
2656 #line 2657 "parser.cpp" /* yacc.c:1646 */
2660 #line 805 "parser.y" /* yacc.c:1646 */
2663 set((yyval
.val
), SelectionParserValue::createIntegerRange((yyvsp
[-2].i
), (yyvsp
[0].i
), (yyloc
)));
2666 #line 2667 "parser.cpp" /* yacc.c:1646 */
2670 #line 811 "parser.y" /* yacc.c:1646 */
2673 set((yyval
.val
), SelectionParserValue::createRealRange((yyvsp
[-2].i
), (yyvsp
[0].r
), (yyloc
)));
2676 #line 2677 "parser.cpp" /* yacc.c:1646 */
2680 #line 817 "parser.y" /* yacc.c:1646 */
2683 set((yyval
.val
), SelectionParserValue::createRealRange((yyvsp
[-2].r
), (yyvsp
[0].r
), (yyloc
)));
2686 #line 2687 "parser.cpp" /* yacc.c:1646 */
2690 #line 2691 "parser.cpp" /* yacc.c:1646 */
2693 /* User semantic actions sometimes alter yychar, and that requires
2694 that yytoken be updated with the new translation. We take the
2695 approach of translating immediately before every use of yytoken.
2696 One alternative is translating here after every semantic action,
2697 but that translation would be missed if the semantic action invokes
2698 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2699 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2700 incorrect destructor might then be invoked immediately. In the
2701 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2702 to an incorrect destructor call or verbose syntax error message
2703 before the lookahead is translated. */
2704 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2708 YY_STACK_PRINT (yyss
, yyssp
);
2713 /* Now 'shift' the result of the reduction. Determine what state
2714 that goes to, based on the state we popped back to and the rule
2715 number reduced by. */
2719 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2720 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2721 yystate
= yytable
[yystate
];
2723 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2728 /*--------------------------------------.
2729 | yyerrlab -- here on detecting error. |
2730 `--------------------------------------*/
2732 /* Make sure we have latest lookahead translation. See comments at
2733 user semantic actions for why this is necessary. */
2734 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
2736 /* If not already recovering from an error, report this error. */
2740 #if ! YYERROR_VERBOSE
2741 yyerror (&yylloc
, scanner
, YY_("syntax error"));
2743 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2746 char const *yymsgp
= YY_("syntax error");
2747 int yysyntax_error_status
;
2748 yysyntax_error_status
= YYSYNTAX_ERROR
;
2749 if (yysyntax_error_status
== 0)
2751 else if (yysyntax_error_status
== 1)
2753 if (yymsg
!= yymsgbuf
)
2754 YYSTACK_FREE (yymsg
);
2755 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
2759 yymsg_alloc
= sizeof yymsgbuf
;
2760 yysyntax_error_status
= 2;
2764 yysyntax_error_status
= YYSYNTAX_ERROR
;
2768 yyerror (&yylloc
, scanner
, yymsgp
);
2769 if (yysyntax_error_status
== 2)
2770 goto yyexhaustedlab
;
2772 # undef YYSYNTAX_ERROR
2776 yyerror_range
[1] = yylloc
;
2778 if (yyerrstatus
== 3)
2780 /* If just tried and failed to reuse lookahead token after an
2781 error, discard it. */
2783 if (yychar
<= YYEOF
)
2785 /* Return failure if at end of input. */
2786 if (yychar
== YYEOF
)
2791 yydestruct ("Error: discarding",
2792 yytoken
, &yylval
, &yylloc
, scanner
);
2797 /* Else will try to reuse lookahead token after shifting the error
2802 /*---------------------------------------------------.
2803 | yyerrorlab -- error raised explicitly by YYERROR. |
2804 `---------------------------------------------------*/
2807 /* Pacify compilers like GCC when the user code never invokes
2808 YYERROR and the label yyerrorlab therefore never appears in user
2810 if (/*CONSTCOND*/ 0)
2813 yyerror_range
[1] = yylsp
[1-yylen
];
2814 /* Do not reclaim the symbols of the rule whose action triggered
2818 YY_STACK_PRINT (yyss
, yyssp
);
2823 /*-------------------------------------------------------------.
2824 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2825 `-------------------------------------------------------------*/
2827 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2831 yyn
= yypact
[yystate
];
2832 if (!yypact_value_is_default (yyn
))
2835 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2843 /* Pop the current state because it cannot handle the error token. */
2847 yyerror_range
[1] = *yylsp
;
2848 yydestruct ("Error: popping",
2849 yystos
[yystate
], yyvsp
, yylsp
, scanner
);
2852 YY_STACK_PRINT (yyss
, yyssp
);
2855 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2857 YY_IGNORE_MAYBE_UNINITIALIZED_END
2859 yyerror_range
[2] = yylloc
;
2860 /* Using YYLLOC is tempting, but would change the location of
2861 the lookahead. YYLOC is available though. */
2862 YYLLOC_DEFAULT (yyloc
, yyerror_range
, 2);
2865 /* Shift the error token. */
2866 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2872 /*-------------------------------------.
2873 | yyacceptlab -- YYACCEPT comes here. |
2874 `-------------------------------------*/
2879 /*-----------------------------------.
2880 | yyabortlab -- YYABORT comes here. |
2881 `-----------------------------------*/
2886 #if !defined yyoverflow || YYERROR_VERBOSE
2887 /*-------------------------------------------------.
2888 | yyexhaustedlab -- memory exhaustion comes here. |
2889 `-------------------------------------------------*/
2891 yyerror (&yylloc
, scanner
, YY_("memory exhausted"));
2897 if (yychar
!= YYEMPTY
)
2899 /* Make sure we have latest lookahead translation. See comments at
2900 user semantic actions for why this is necessary. */
2901 yytoken
= YYTRANSLATE (yychar
);
2902 yydestruct ("Cleanup: discarding lookahead",
2903 yytoken
, &yylval
, &yylloc
, scanner
);
2905 /* Do not reclaim the symbols of the rule whose action triggered
2906 this YYABORT or YYACCEPT. */
2908 YY_STACK_PRINT (yyss
, yyssp
);
2909 while (yyssp
!= yyss
)
2911 yydestruct ("Cleanup: popping",
2912 yystos
[*yyssp
], yyvsp
, yylsp
, scanner
);
2917 YYSTACK_FREE (yyss
);
2923 if (yymsg
!= yymsgbuf
)
2924 YYSTACK_FREE (yymsg
);