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 by the GROMACS development team.
146 * Copyright (c) 2014,2015,2016, by the GROMACS development team, led by
147 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
148 * and including many others, as listed in the AUTHORS file in the
149 * top-level source directory and at http://www.gromacs.org.
151 * GROMACS is free software; you can redistribute it and/or
152 * modify it under the terms of the GNU Lesser General Public License
153 * as published by the Free Software Foundation; either version 2.1
154 * of the License, or (at your option) any later version.
156 * GROMACS is distributed in the hope that it will be useful,
157 * but WITHOUT ANY WARRANTY; without even the implied warranty of
158 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
159 * Lesser General Public License for more details.
161 * You should have received a copy of the GNU Lesser General Public
162 * License along with GROMACS; if not, see
163 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
164 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
166 * If you want to redistribute modifications to GROMACS, please
167 * consider that scientific software is very special. Version
168 * control is crucial - bugs must be traceable. We will be happy to
169 * consider code for inclusion in the official distribution, but
170 * derived work must not be called official GROMACS. Details are found
171 * in the README & COPYING files - if they are missing, get the
172 * official version at http://www.gromacs.org.
174 * To help us fund GROMACS development, we humbly ask that you cite
175 * the research papers on the package. Check out http://www.gromacs.org.
177 #line 76 "parser.y" /* yacc.c:355 */
179 #include "parsetree.h"
182 #define YYLTYPE ::gmx::SelectionLocation
184 #line 184 "parser.cpp" /* yacc.c:355 */
199 VARIABLE_NUMERIC = 266,
200 VARIABLE_GROUP = 267,
202 KEYWORD_NUMERIC = 269,
206 METHOD_NUMERIC = 273,
226 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
230 #line 83 "parser.y" /* yacc.c:355 */
235 struct gmx_ana_selmethod_t *meth;
237 gmx::SelectionStringMatchType smt;
239 gmx::SelectionTreeElementPointer *sel;
240 gmx::SelectionParserValue *val;
241 gmx::SelectionParserValueListPointer *vlist;
242 gmx::SelectionParserParameter *param;
243 gmx::SelectionParserParameterListPointer *plist;
245 #line 245 "parser.cpp" /* yacc.c:355 */
248 typedef union YYSTYPE YYSTYPE;
249 # define YYSTYPE_IS_TRIVIAL 1
250 # define YYSTYPE_IS_DECLARED 1
254 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
255 typedef struct YYLTYPE YYLTYPE;
263 # define YYLTYPE_IS_DECLARED 1
264 # define YYLTYPE_IS_TRIVIAL 1
269 #ifndef YYPUSH_MORE_DEFINED
270 # define YYPUSH_MORE_DEFINED
271 enum { YYPUSH_MORE = 4 };
274 typedef struct _gmx_sel_yypstate _gmx_sel_yypstate;
276 int _gmx_sel_yypush_parse (_gmx_sel_yypstate *ps, int pushed_char, YYSTYPE const *pushed_val, YYLTYPE *pushed_loc, void *scanner);
278 _gmx_sel_yypstate * _gmx_sel_yypstate_new (void);
279 void _gmx_sel_yypstate_delete (_gmx_sel_yypstate *ps);
281 #endif /* !YY__GMX_SEL_YY_PARSER_H_INCLUDED */
283 /* Copy the second part of user declarations. */
285 #line 285 "parser.cpp" /* yacc.c:358 */
292 typedef YYTYPE_UINT8 yytype_uint8;
294 typedef unsigned char yytype_uint8;
298 typedef YYTYPE_INT8 yytype_int8;
300 typedef signed char yytype_int8;
304 typedef YYTYPE_UINT16 yytype_uint16;
306 typedef unsigned short int yytype_uint16;
310 typedef YYTYPE_INT16 yytype_int16;
312 typedef short int yytype_int16;
316 # ifdef __SIZE_TYPE__
317 # define YYSIZE_T __SIZE_TYPE__
318 # elif defined size_t
319 # define YYSIZE_T size_t
320 # elif ! defined YYSIZE_T
321 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
322 # define YYSIZE_T size_t
324 # define YYSIZE_T unsigned int
328 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
331 # if defined YYENABLE_NLS && YYENABLE_NLS
333 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
334 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
338 # define YY_(Msgid) Msgid
343 # if (defined __GNUC__ \
344 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
345 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
346 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
348 # define YY_ATTRIBUTE(Spec) /* empty */
352 #ifndef YY_ATTRIBUTE_PURE
353 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
356 #ifndef YY_ATTRIBUTE_UNUSED
357 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
360 #if !defined _Noreturn \
361 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
362 # if defined _MSC_VER && 1200 <= _MSC_VER
363 # define _Noreturn __declspec (noreturn)
365 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
369 /* Suppress unused-variable warnings by "using" E. */
370 #if ! defined lint || defined __GNUC__
371 # define YYUSE(E) ((void) (E))
373 # define YYUSE(E) /* empty */
376 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
377 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
378 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
379 _Pragma ("GCC diagnostic push") \
380 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
381 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
382 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
383 _Pragma ("GCC diagnostic pop")
385 # define YY_INITIAL_VALUE(Value) Value
387 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
388 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
389 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
391 #ifndef YY_INITIAL_VALUE
392 # define YY_INITIAL_VALUE(Value) /* Nothing. */
396 #if ! defined yyoverflow || YYERROR_VERBOSE
398 /* The parser invokes alloca or malloc; define the necessary symbols. */
400 # ifdef YYSTACK_ALLOC
401 /* Pacify GCC's 'empty if-body' warning. */
402 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
403 # ifndef YYSTACK_ALLOC_MAXIMUM
404 /* The OS might guarantee only one guard page at the bottom of the stack,
405 and a page size can be as small as 4096 bytes. So we cannot safely
406 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
407 to allow for a few compiler-allocated temporary stack slots. */
408 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
411 # define YYSTACK_ALLOC YYMALLOC
412 # define YYSTACK_FREE YYFREE
413 # ifndef YYSTACK_ALLOC_MAXIMUM
414 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
416 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
417 && ! ((defined YYMALLOC || defined malloc) \
418 && (defined YYFREE || defined free)))
419 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
420 # ifndef EXIT_SUCCESS
421 # define EXIT_SUCCESS 0
425 # define YYMALLOC malloc
426 # if ! defined malloc && ! defined EXIT_SUCCESS
427 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
432 # if ! defined free && ! defined EXIT_SUCCESS
433 void free (void *); /* INFRINGES ON USER NAME SPACE */
437 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
440 #if (! defined yyoverflow \
441 && (! defined __cplusplus || defined GMX_YYFORCE_C_STACK_EXTENSION \
442 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
443 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
445 /* A type that is properly aligned for any stack member. */
448 yytype_int16 yyss_alloc;
453 /* The size of the maximum gap between one aligned stack and the next. */
454 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
456 /* The size of an array large to enough to hold all stacks, each with
458 # define YYSTACK_BYTES(N) \
459 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
460 + 2 * YYSTACK_GAP_MAXIMUM)
462 # define YYCOPY_NEEDED 1
464 /* Relocate STACK from its old location to the new one. The
465 local variables YYSIZE and YYSTACKSIZE give the old and new number of
466 elements in the stack, and YYPTR gives the new location of the
467 stack. Advance YYPTR to a properly aligned location for the next
469 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
472 YYSIZE_T yynewbytes; \
473 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
474 Stack = &yyptr->Stack_alloc; \
475 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
476 yyptr += yynewbytes / sizeof (*yyptr); \
482 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
483 /* Copy COUNT objects from SRC to DST. The source and destination do
486 # if defined __GNUC__ && 1 < __GNUC__
487 # define YYCOPY(Dst, Src, Count) \
488 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
490 # define YYCOPY(Dst, Src, Count) \
494 for (yyi = 0; yyi < (Count); yyi++) \
495 (Dst)[yyi] = (Src)[yyi]; \
500 #endif /* !YYCOPY_NEEDED */
502 /* YYFINAL -- State number of the termination state. */
504 /* YYLAST -- Last index in YYTABLE. */
507 /* YYNTOKENS -- Number of terminals. */
509 /* YYNNTS -- Number of nonterminals. */
511 /* YYNRULES -- Number of rules. */
513 /* YYNSTATES -- Number of states. */
514 #define YYNSTATES 154
516 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
517 by yylex, with out-of-bounds checking. */
519 #define YYMAXUTOK 288
521 #define YYTRANSLATE(YYX) \
522 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
524 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
525 as returned by yylex, without out-of-bounds checking. */
526 static const yytype_uint8 yytranslate[] =
528 0, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
532 40, 41, 34, 32, 45, 33, 2, 35, 2, 2,
533 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
534 2, 39, 2, 43, 2, 2, 2, 2, 2, 2,
535 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
536 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
537 2, 44, 2, 46, 37, 2, 2, 2, 2, 2,
538 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
539 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
540 2, 2, 2, 47, 2, 48, 42, 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, 2, 2, 2, 2,
553 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
554 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
555 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
556 25, 26, 27, 28, 29, 30, 31, 36, 38
560 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
561 static const yytype_uint16 yyrline[] =
563 0, 199, 199, 204, 217, 218, 238, 243, 254, 266,
564 272, 279, 286, 293, 303, 304, 311, 312, 326, 327,
565 331, 332, 335, 336, 339, 340, 348, 359, 370, 381,
566 385, 396, 403, 412, 413, 418, 419, 420, 424, 432,
567 440, 448, 459, 474, 485, 499, 507, 515, 526, 532,
568 538, 544, 550, 556, 562, 569, 580, 595, 604, 608,
569 618, 632, 640, 648, 661, 663, 669, 674, 685, 694,
570 695, 700, 705, 713, 724, 725, 729, 735, 743, 753,
571 759, 765, 771, 777, 781, 787, 793, 800, 804, 810,
576 #if YYDEBUG || YYERROR_VERBOSE || 0
577 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
578 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
579 static const char *const yytname[] =
581 "$end", "error", "$undefined", "INVALID", "TOK_INT", "TOK_REAL", "STR",
582 "IDENTIFIER", "CMD_SEP", "GROUP", "TO", "VARIABLE_NUMERIC",
583 "VARIABLE_GROUP", "VARIABLE_POS", "KEYWORD_NUMERIC", "KEYWORD_STR",
584 "KEYWORD_POS", "KEYWORD_GROUP", "METHOD_NUMERIC", "METHOD_GROUP",
585 "METHOD_POS", "MODIFIER", "EMPTY_POSMOD", "PARAM", "END_OF_METHOD", "OF",
586 "CMP_OP", "PARAM_REDUCT", "OR", "XOR", "AND", "NOT", "'+'", "'-'", "'*'",
587 "'/'", "UNARY_NEG", "'^'", "NUM_REDUCT", "'='", "'('", "')'", "'~'",
588 "'?'", "'['", "','", "']'", "'{'", "'}'", "$accept", "commands",
589 "command", "cmd_plain", "selection", "integer_number", "real_number",
590 "number", "string", "sel_expr", "pos_mod", "str_match_type", "num_expr",
591 "str_expr", "pos_expr", "method_params", "method_param_list",
592 "method_param", "value_list", "value_list_contents", "basic_value_list",
593 "basic_value_list_contents", "value_item", "basic_value_item",
594 "value_item_range", YY_NULLPTR
599 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
600 (internal) symbol number NUM (which must be that of a token). */
601 static const yytype_uint16 yytoknum[] =
603 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
604 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
605 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
606 285, 286, 43, 45, 42, 47, 287, 94, 288, 61,
607 40, 41, 126, 63, 91, 44, 93, 123, 125
611 #define YYPACT_NINF -85
613 #define yypact_value_is_default(Yystate) \
614 (!!((Yystate) == (-85)))
616 #define YYTABLE_NINF -22
618 #define yytable_value_is_error(Yytable_value) \
621 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
623 static const yytype_int16 yypact[] =
625 -85, 10, -85, -2, 26, -85, 273, 0, 55, -85,
626 -85, -85, 40, -85, -85, 310, 204, 273, 69, -85,
627 62, 82, -85, -3, 139, 312, -85, -85, -85, 82,
628 296, -85, -85, -85, -85, 310, -85, 96, -85, 310,
629 -85, 204, -6, 73, 15, 71, 220, 67, -85, -85,
630 135, -85, -85, 83, -85, -85, 310, 310, 41, 185,
631 -85, -85, -85, 204, 204, 204, 204, 204, 204, 296,
632 -3, 312, -85, -3, 97, -85, -85, 71, 319, 91,
633 -85, -85, -85, -85, -85, -85, 69, -85, 113, -85,
634 24, 206, 137, 140, -85, -85, 90, -85, -85, -85,
635 -85, -85, 85, -85, -85, -85, 330, 167, 167, 73,
636 73, 73, 67, -85, -85, 229, 107, 40, 24, -85,
637 174, 69, 69, 206, -85, -85, 155, 153, 159, 326,
638 259, 137, 140, -85, -3, 179, 330, -85, -85, -85,
639 -85, 69, -85, -85, -85, -85, -85, -85, 160, 164,
643 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
644 Performed when YYTABLE does not specify something else to do. Zero
645 means the default is an error. */
646 static const yytype_uint8 yydefact[] =
648 2, 0, 1, 0, 43, 44, 24, 25, 0, 62,
649 61, 63, 34, 66, 33, 0, 0, 0, 0, 3,
650 0, 9, 8, 15, 0, 0, 14, 5, 43, 10,
651 0, 32, 24, 25, 31, 0, 59, 64, 34, 0,
652 26, 0, 0, 52, 0, 15, 0, 14, 18, 20,
653 0, 22, 23, 0, 4, 66, 0, 0, 45, 0,
654 38, 66, 66, 0, 0, 0, 0, 0, 0, 0,
655 11, 12, 13, 60, 71, 65, 67, 0, 0, 45,
656 16, 29, 54, 58, 19, 21, 0, 17, 28, 27,
657 0, 0, 84, 85, 86, 41, 74, 76, 87, 37,
658 35, 36, 0, 39, 47, 42, 30, 48, 49, 50,
659 51, 53, 0, 71, 68, 69, 0, 0, 0, 46,
660 0, 0, 0, 0, 77, 40, 0, 43, 44, 0,
661 0, 0, 0, 55, 79, 0, 81, 82, 80, 72,
662 83, 0, 75, 88, 89, 90, 78, 70, 43, 44,
666 /* YYPGOTO[NTERM-NUM]. */
667 static const yytype_int8 yypgoto[] =
669 -85, -85, -85, -85, 7, -17, -15, -84, -1, 116,
670 19, -85, 12, -85, 3, 75, -85, -85, -85, 63,
671 -53, 92, 52, -65, -63
674 /* YYDEFGOTO[NTERM-NUM]. */
675 static const yytype_int16 yydefgoto[] =
677 -1, 1, 19, 20, 21, 92, 93, 53, 94, 134,
678 24, 102, 25, 137, 138, 36, 37, 76, 114, 115,
682 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
683 positive, shift that token. If negative, reduce the rule whose
684 number is the opposite. If YYTABLE_NINF, syntax error. */
685 static const yytype_int16 yytable[] =
687 22, 51, 116, 52, 26, 95, 27, 34, 79, 26,
688 2, 3, 61, 29, 4, 5, 6, 7, -6, 8,
689 47, 9, 10, 11, 44, 56, 12, 57, 43, 46,
690 13, 124, 14, 72, -7, 42, 55, 11, 145, 30,
691 117, 15, 71, 16, 13, 48, 49, 32, 33, 125,
692 17, 46, 140, 78, 18, 124, 80, 152, 146, 31,
693 42, 32, 33, 140, 118, 35, 90, 140, 18, 51,
694 54, 52, 112, 48, 49, 106, 107, 108, 109, 110,
695 111, 46, 42, 42, 42, 42, 42, 42, 91, 48,
696 49, 32, 33, 119, 48, 49, 32, 33, 131, 56,
697 132, 57, 50, 55, 143, 51, 144, 52, 83, 131,
698 68, 132, 81, 131, 133, 132, 90, 23, 50, 74,
699 75, 112, 23, 50, 51, 133, 52, 136, 86, 133,
700 87, 40, 91, 45, 135, 123, 104, 105, 136, 84,
701 85, 43, 136, 57, 113, 135, 70, 121, 42, 135,
702 122, 73, 141, 58, 59, 77, 60, 61, 62, 127,
703 128, 32, 33, -18, 8, 153, 9, 10, 11, -20,
704 -19, 12, 88, 89, -21, 13, 126, 14, 48, 49,
705 32, 33, 150, 120, 0, 77, 15, 0, 129, 48,
706 49, 32, 33, 58, 151, 69, 60, 61, 62, 18,
707 130, 66, 67, 147, 68, 0, 0, 50, 28, 5,
708 48, 49, 32, 33, 0, 9, 0, 0, 50, 123,
709 38, 0, 142, 0, 99, 0, 14, 100, 101, 0,
710 0, 0, 91, 127, 128, 32, 33, 16, 8, 50,
711 9, 10, 11, 0, 41, 12, 63, 0, 0, 13,
712 0, 14, 64, 65, 66, 67, 0, 68, 0, 0,
713 15, 82, 129, 127, 128, 32, 33, 0, 8, 69,
714 9, 10, 11, 18, 130, 12, 0, 28, 5, 13,
715 0, 14, 8, 0, 9, 10, 11, 0, 0, 12,
716 15, 0, 129, 13, 0, 14, 0, 0, 0, 69,
717 28, 5, 0, 18, 15, 8, 16, 9, 10, 11,
718 0, 0, 12, 17, 28, 5, 13, 18, 14, 8,
719 0, 9, 10, 0, 0, 0, 38, 15, 0, 16,
720 148, 149, 14, 0, 0, 0, 69, 9, 63, 0,
721 18, 15, 38, 16, 64, 65, 66, 67, 14, 68,
722 39, 64, 65, 66, 67, 0, 68, 0, 0, 16,
723 82, 0, 64, 65, 66, 67, 41, 68
726 static const yytype_int16 yycheck[] =
728 1, 18, 86, 18, 1, 58, 8, 8, 14, 6,
729 0, 1, 18, 6, 4, 5, 6, 7, 8, 9,
730 17, 11, 12, 13, 17, 28, 16, 30, 16, 17,
731 20, 96, 22, 30, 8, 16, 21, 13, 122, 39,
732 16, 31, 30, 33, 20, 4, 5, 6, 7, 102,
733 40, 39, 115, 41, 44, 120, 41, 141, 123, 4,
734 41, 6, 7, 126, 40, 25, 25, 130, 44, 86,
735 8, 86, 69, 4, 5, 63, 64, 65, 66, 67,
736 68, 69, 63, 64, 65, 66, 67, 68, 47, 4,
737 5, 6, 7, 90, 4, 5, 6, 7, 115, 28,
738 115, 30, 33, 21, 121, 122, 121, 122, 41, 126,
739 37, 126, 41, 130, 115, 130, 25, 1, 33, 23,
740 24, 118, 6, 33, 141, 126, 141, 115, 45, 130,
741 55, 15, 47, 17, 115, 45, 61, 62, 126, 4,
742 5, 129, 130, 30, 47, 126, 30, 10, 129, 130,
743 10, 35, 45, 14, 15, 39, 17, 18, 19, 4,
744 5, 6, 7, 10, 9, 46, 11, 12, 13, 10,
745 10, 16, 56, 57, 10, 20, 113, 22, 4, 5,
746 6, 7, 130, 91, -1, 69, 31, -1, 33, 4,
747 5, 6, 7, 14, 15, 40, 17, 18, 19, 44,
748 45, 34, 35, 48, 37, -1, -1, 33, 4, 5,
749 4, 5, 6, 7, -1, 11, -1, -1, 33, 45,
750 16, -1, 48, -1, 39, -1, 22, 42, 43, -1,
751 -1, -1, 47, 4, 5, 6, 7, 33, 9, 33,
752 11, 12, 13, -1, 40, 16, 26, -1, -1, 20,
753 -1, 22, 32, 33, 34, 35, -1, 37, -1, -1,
754 31, 41, 33, 4, 5, 6, 7, -1, 9, 40,
755 11, 12, 13, 44, 45, 16, -1, 4, 5, 20,
756 -1, 22, 9, -1, 11, 12, 13, -1, -1, 16,
757 31, -1, 33, 20, -1, 22, -1, -1, -1, 40,
758 4, 5, -1, 44, 31, 9, 33, 11, 12, 13,
759 -1, -1, 16, 40, 4, 5, 20, 44, 22, 9,
760 -1, 11, 12, -1, -1, -1, 16, 31, -1, 33,
761 4, 5, 22, -1, -1, -1, 40, 11, 26, -1,
762 44, 31, 16, 33, 32, 33, 34, 35, 22, 37,
763 40, 32, 33, 34, 35, -1, 37, -1, -1, 33,
764 41, -1, 32, 33, 34, 35, 40, 37
767 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
768 symbol of state STATE-NUM. */
769 static const yytype_uint8 yystos[] =
771 0, 50, 0, 1, 4, 5, 6, 7, 9, 11,
772 12, 13, 16, 20, 22, 31, 33, 40, 44, 51,
773 52, 53, 57, 58, 59, 61, 63, 8, 4, 53,
774 39, 4, 6, 7, 57, 25, 64, 65, 16, 40,
775 58, 40, 59, 61, 53, 58, 61, 63, 4, 5,
776 33, 54, 55, 56, 8, 21, 28, 30, 14, 15,
777 17, 18, 19, 26, 32, 33, 34, 35, 37, 40,
778 58, 61, 63, 58, 23, 24, 66, 58, 61, 14,
779 41, 41, 41, 41, 4, 5, 45, 64, 58, 58,
780 25, 47, 54, 55, 57, 69, 70, 72, 73, 39,
781 42, 43, 60, 69, 64, 64, 61, 61, 61, 61,
782 61, 61, 63, 47, 67, 68, 56, 16, 40, 63,
783 70, 10, 10, 45, 72, 69, 68, 4, 5, 33,
784 45, 54, 55, 57, 58, 59, 61, 62, 63, 71,
785 73, 45, 48, 54, 55, 56, 72, 48, 4, 5,
789 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
790 static const yytype_uint8 yyr1[] =
792 0, 49, 50, 50, 51, 51, 52, 52, 52, 52,
793 52, 52, 52, 52, 53, 53, 53, 53, 54, 54,
794 55, 55, 56, 56, 57, 57, 58, 58, 58, 58,
795 58, 58, 58, 59, 59, 60, 60, 60, 58, 58,
796 58, 58, 58, 61, 61, 61, 61, 61, 61, 61,
797 61, 61, 61, 61, 61, 62, 62, 63, 63, 63,
798 63, 58, 61, 63, 64, 64, 65, 65, 66, 67,
799 67, 68, 68, 68, 69, 69, 70, 70, 70, 71,
800 71, 71, 71, 71, 72, 72, 72, 72, 73, 73,
804 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
805 static const yytype_uint8 yyr2[] =
807 0, 2, 0, 2, 2, 2, 0, 1, 1, 1,
808 2, 3, 3, 3, 1, 1, 3, 3, 1, 2,
809 1, 2, 1, 1, 1, 1, 2, 3, 3, 3,
810 3, 2, 2, 1, 1, 1, 1, 1, 2, 3,
811 4, 3, 3, 1, 1, 2, 4, 3, 3, 3,
812 3, 3, 2, 3, 3, 1, 2, 7, 3, 2,
813 3, 1, 1, 1, 1, 2, 0, 2, 2, 1,
814 3, 0, 2, 3, 1, 3, 1, 2, 3, 1,
815 1, 1, 1, 1, 1, 1, 1, 1, 3, 3,
820 #define yyerrok (yyerrstatus = 0)
821 #define yyclearin (yychar = YYEMPTY)
825 #define YYACCEPT goto yyacceptlab
826 #define YYABORT goto yyabortlab
827 #define YYERROR goto yyerrorlab
830 #define YYRECOVERING() (!!yyerrstatus)
832 #define YYBACKUP(Token, Value) \
834 if (yychar == YYEMPTY) \
838 YYPOPSTACK (yylen); \
844 yyerror (&yylloc, scanner, YY_("syntax error: cannot back up")); \
849 /* Error token number */
851 #define YYERRCODE 256
854 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
855 If N is 0, then set CURRENT to the empty location which ends
856 the previous symbol: RHS[0] (always defined). */
858 #ifndef YYLLOC_DEFAULT
859 # define YYLLOC_DEFAULT(Current, Rhs, N) \
863 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
864 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
865 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
866 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
870 (Current).first_line = (Current).last_line = \
871 YYRHSLOC (Rhs, 0).last_line; \
872 (Current).first_column = (Current).last_column = \
873 YYRHSLOC (Rhs, 0).last_column; \
878 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
881 /* Enable debugging if requested. */
885 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
886 # define YYFPRINTF fprintf
889 # define YYDPRINTF(Args) \
896 /* YY_LOCATION_PRINT -- Print the location on the stream.
897 This macro was not mandated originally: define only if we know
898 we won't break user code: when these are the locations we know. */
900 #ifndef YY_LOCATION_PRINT
901 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
903 /* Print *YYLOCP on YYO. Private, do not rely on its existence. */
907 yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
910 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
911 if (0 <= yylocp->first_line)
913 res += YYFPRINTF (yyo, "%d", yylocp->first_line);
914 if (0 <= yylocp->first_column)
915 res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
917 if (0 <= yylocp->last_line)
919 if (yylocp->first_line < yylocp->last_line)
921 res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
923 res += YYFPRINTF (yyo, ".%d", end_col);
925 else if (0 <= end_col && yylocp->first_column < end_col)
926 res += YYFPRINTF (yyo, "-%d", end_col);
931 # define YY_LOCATION_PRINT(File, Loc) \
932 yy_location_print_ (File, &(Loc))
935 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
940 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
944 YYFPRINTF (stderr, "%s ", Title); \
945 yy_symbol_print (stderr, \
946 Type, Value, Location, scanner); \
947 YYFPRINTF (stderr, "\n"); \
952 /*----------------------------------------.
953 | Print this symbol's value on YYOUTPUT. |
954 `----------------------------------------*/
957 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *scanner)
959 FILE *yyo gmx_unused = yyoutput;
966 if (yytype < YYNTOKENS)
967 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
973 /*--------------------------------.
974 | Print this symbol on YYOUTPUT. |
975 `--------------------------------*/
978 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *scanner)
980 YYFPRINTF (yyoutput, "%s %s (",
981 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
983 YY_LOCATION_PRINT (yyoutput, *yylocationp);
984 YYFPRINTF (yyoutput, ": ");
985 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, scanner);
986 YYFPRINTF (yyoutput, ")");
989 /*------------------------------------------------------------------.
990 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
992 `------------------------------------------------------------------*/
995 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
997 YYFPRINTF (stderr, "Stack now");
998 for (; yybottom <= yytop; yybottom++)
1000 int yybot = *yybottom;
1001 YYFPRINTF (stderr, " %d", yybot);
1003 YYFPRINTF (stderr, "\n");
1006 # define YY_STACK_PRINT(Bottom, Top) \
1009 yy_stack_print ((Bottom), (Top)); \
1013 /*------------------------------------------------.
1014 | Report that the YYRULE is going to be reduced. |
1015 `------------------------------------------------*/
1018 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, void *scanner)
1020 unsigned long int yylno = yyrline[yyrule];
1021 int yynrhs = yyr2[yyrule];
1023 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1025 /* The symbols being reduced. */
1026 for (yyi = 0; yyi < yynrhs; yyi++)
1028 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1029 yy_symbol_print (stderr,
1030 yystos[yyssp[yyi + 1 - yynrhs]],
1031 &(yyvsp[(yyi + 1) - (yynrhs)])
1032 , &(yylsp[(yyi + 1) - (yynrhs)]) , scanner);
1033 YYFPRINTF (stderr, "\n");
1037 # define YY_REDUCE_PRINT(Rule) \
1040 yy_reduce_print (yyssp, yyvsp, yylsp, Rule, scanner); \
1043 /* Nonzero means print parse trace. It is left uninitialized so that
1044 multiple parsers can coexist. */
1046 #else /* !YYDEBUG */
1047 # define YYDPRINTF(Args)
1048 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1049 # define YY_STACK_PRINT(Bottom, Top)
1050 # define YY_REDUCE_PRINT(Rule)
1051 #endif /* !YYDEBUG */
1054 /* YYINITDEPTH -- initial size of the parser's stacks. */
1056 # define YYINITDEPTH 200
1059 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1060 if the built-in stack extension method is used).
1062 Do not make this value too large; the results are undefined if
1063 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1064 evaluated with infinite-precision integer arithmetic. */
1067 # define YYMAXDEPTH 10000
1074 # if defined __GLIBC__ && defined _STRING_H
1075 # define yystrlen strlen
1077 /* Return the length of YYSTR. */
1079 yystrlen (const char *yystr)
1082 for (yylen = 0; yystr[yylen]; yylen++)
1090 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1091 # define yystpcpy stpcpy
1093 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1096 yystpcpy (char *yydest, const char *yysrc)
1099 const char *yys = yysrc;
1101 while ((*yyd++ = *yys++) != '\0')
1110 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1111 quotes and backslashes, so that it's suitable for yyerror. The
1112 heuristic is that double-quoting is unnecessary unless the string
1113 contains an apostrophe, a comma, or backslash (other than
1114 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1115 null, do not copy; instead, return the length of what the result
1118 yytnamerr (char *yyres, const char *yystr)
1123 char const *yyp = yystr;
1130 goto do_not_strip_quotes;
1134 goto do_not_strip_quotes;
1147 do_not_strip_quotes: ;
1151 return yystrlen (yystr);
1153 return yystpcpy (yyres, yystr) - yyres;
1157 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1158 about the unexpected token YYTOKEN for the state stack whose top is
1161 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1162 not large enough to hold the message. In that case, also set
1163 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1164 required number of bytes is too large to store. */
1166 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1167 yytype_int16 *yyssp, int yytoken)
1169 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1170 YYSIZE_T yysize = yysize0;
1171 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1172 /* Internationalized format string. */
1173 const char *yyformat = YY_NULLPTR;
1174 /* Arguments of yyformat. */
1175 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1176 /* Number of reported tokens (one for the "unexpected", one per
1180 /* There are many possibilities here to consider:
1181 - If this state is a consistent state with a default action, then
1182 the only way this function was invoked is if the default action
1183 is an error action. In that case, don't check for expected
1184 tokens because there are none.
1185 - The only way there can be no lookahead present (in yychar) is if
1186 this state is a consistent state with a default action. Thus,
1187 detecting the absence of a lookahead is sufficient to determine
1188 that there is no unexpected or expected token to report. In that
1189 case, just report a simple "syntax error".
1190 - Don't assume there isn't a lookahead just because this state is a
1191 consistent state with a default action. There might have been a
1192 previous inconsistent state, consistent state with a non-default
1193 action, or user semantic action that manipulated yychar.
1194 - Of course, the expected token list depends on states to have
1195 correct lookahead information, and it depends on the parser not
1196 to perform extra reductions after fetching a lookahead from the
1197 scanner and before detecting a syntax error. Thus, state merging
1198 (from LALR or IELR) and default reductions corrupt the expected
1199 token list. However, the list is correct for canonical LR with
1200 one exception: it will still contain any token that will not be
1201 accepted due to an error action in a later state.
1203 if (yytoken != YYEMPTY)
1205 int yyn = yypact[*yyssp];
1206 yyarg[yycount++] = yytname[yytoken];
1207 if (!yypact_value_is_default (yyn))
1209 /* Start YYX at -YYN if negative to avoid negative indexes in
1210 YYCHECK. In other words, skip the first -YYN actions for
1211 this state because they are default actions. */
1212 int yyxbegin = yyn < 0 ? -yyn : 0;
1213 /* Stay within bounds of both yycheck and yytname. */
1214 int yychecklim = YYLAST - yyn + 1;
1215 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1218 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1219 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1220 && !yytable_value_is_error (yytable[yyx + yyn]))
1222 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1228 yyarg[yycount++] = yytname[yyx];
1230 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1231 if (! (yysize <= yysize1
1232 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1242 # define YYCASE_(N, S) \
1246 YYCASE_(0, YY_("syntax error"));
1247 YYCASE_(1, YY_("syntax error, unexpected %s"));
1248 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1249 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1250 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1251 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1256 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1257 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1262 if (*yymsg_alloc < yysize)
1264 *yymsg_alloc = 2 * yysize;
1265 if (! (yysize <= *yymsg_alloc
1266 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1267 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1271 /* Avoid sprintf, as that infringes on the user's name space.
1272 Don't have undefined behavior even if the translation
1273 produced a string with the wrong number of "%s"s. */
1277 while ((*yyp = *yyformat) != '\0')
1278 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1280 yyp += yytnamerr (yyp, yyarg[yyi++]);
1291 #endif /* YYERROR_VERBOSE */
1293 /*-----------------------------------------------.
1294 | Release the memory associated to this symbol. |
1295 `-----------------------------------------------*/
1298 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, void *scanner)
1301 YYUSE (yylocationp);
1305 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1307 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1311 #line 178 "parser.y" /* yacc.c:1257 */
1312 { free(((*yyvaluep).str)); }
1313 #line 1313 "parser.cpp" /* yacc.c:1257 */
1316 case 7: /* IDENTIFIER */
1317 #line 178 "parser.y" /* yacc.c:1257 */
1318 { free(((*yyvaluep).str)); }
1319 #line 1319 "parser.cpp" /* yacc.c:1257 */
1322 case 16: /* KEYWORD_POS */
1323 #line 178 "parser.y" /* yacc.c:1257 */
1324 { free(((*yyvaluep).str)); }
1325 #line 1325 "parser.cpp" /* yacc.c:1257 */
1328 case 23: /* PARAM */
1329 #line 179 "parser.y" /* yacc.c:1257 */
1330 { if(((*yyvaluep).str)) free(((*yyvaluep).str)); }
1331 #line 1331 "parser.cpp" /* yacc.c:1257 */
1334 case 26: /* CMP_OP */
1335 #line 178 "parser.y" /* yacc.c:1257 */
1336 { free(((*yyvaluep).str)); }
1337 #line 1337 "parser.cpp" /* yacc.c:1257 */
1340 case 50: /* commands */
1341 #line 180 "parser.y" /* yacc.c:1257 */
1342 { delete ((*yyvaluep).sel); }
1343 #line 1343 "parser.cpp" /* yacc.c:1257 */
1346 case 51: /* command */
1347 #line 180 "parser.y" /* yacc.c:1257 */
1348 { delete ((*yyvaluep).sel); }
1349 #line 1349 "parser.cpp" /* yacc.c:1257 */
1352 case 52: /* cmd_plain */
1353 #line 180 "parser.y" /* yacc.c:1257 */
1354 { delete ((*yyvaluep).sel); }
1355 #line 1355 "parser.cpp" /* yacc.c:1257 */
1358 case 53: /* selection */
1359 #line 180 "parser.y" /* yacc.c:1257 */
1360 { delete ((*yyvaluep).sel); }
1361 #line 1361 "parser.cpp" /* yacc.c:1257 */
1364 case 57: /* string */
1365 #line 178 "parser.y" /* yacc.c:1257 */
1366 { free(((*yyvaluep).str)); }
1367 #line 1367 "parser.cpp" /* yacc.c:1257 */
1370 case 58: /* sel_expr */
1371 #line 181 "parser.y" /* yacc.c:1257 */
1372 { delete ((*yyvaluep).sel); }
1373 #line 1373 "parser.cpp" /* yacc.c:1257 */
1376 case 59: /* pos_mod */
1377 #line 179 "parser.y" /* yacc.c:1257 */
1378 { if(((*yyvaluep).str)) free(((*yyvaluep).str)); }
1379 #line 1379 "parser.cpp" /* yacc.c:1257 */
1382 case 61: /* num_expr */
1383 #line 181 "parser.y" /* yacc.c:1257 */
1384 { delete ((*yyvaluep).sel); }
1385 #line 1385 "parser.cpp" /* yacc.c:1257 */
1388 case 62: /* str_expr */
1389 #line 181 "parser.y" /* yacc.c:1257 */
1390 { delete ((*yyvaluep).sel); }
1391 #line 1391 "parser.cpp" /* yacc.c:1257 */
1394 case 63: /* pos_expr */
1395 #line 181 "parser.y" /* yacc.c:1257 */
1396 { delete ((*yyvaluep).sel); }
1397 #line 1397 "parser.cpp" /* yacc.c:1257 */
1400 case 64: /* method_params */
1401 #line 182 "parser.y" /* yacc.c:1257 */
1402 { delete ((*yyvaluep).plist); }
1403 #line 1403 "parser.cpp" /* yacc.c:1257 */
1406 case 65: /* method_param_list */
1407 #line 182 "parser.y" /* yacc.c:1257 */
1408 { delete ((*yyvaluep).plist); }
1409 #line 1409 "parser.cpp" /* yacc.c:1257 */
1412 case 66: /* method_param */
1413 #line 182 "parser.y" /* yacc.c:1257 */
1414 { delete ((*yyvaluep).param); }
1415 #line 1415 "parser.cpp" /* yacc.c:1257 */
1418 case 67: /* value_list */
1419 #line 183 "parser.y" /* yacc.c:1257 */
1420 { delete ((*yyvaluep).vlist); }
1421 #line 1421 "parser.cpp" /* yacc.c:1257 */
1424 case 68: /* value_list_contents */
1425 #line 183 "parser.y" /* yacc.c:1257 */
1426 { delete ((*yyvaluep).vlist); }
1427 #line 1427 "parser.cpp" /* yacc.c:1257 */
1430 case 69: /* basic_value_list */
1431 #line 183 "parser.y" /* yacc.c:1257 */
1432 { delete ((*yyvaluep).vlist); }
1433 #line 1433 "parser.cpp" /* yacc.c:1257 */
1436 case 70: /* basic_value_list_contents */
1437 #line 183 "parser.y" /* yacc.c:1257 */
1438 { delete ((*yyvaluep).vlist); }
1439 #line 1439 "parser.cpp" /* yacc.c:1257 */
1442 case 71: /* value_item */
1443 #line 184 "parser.y" /* yacc.c:1257 */
1444 { delete ((*yyvaluep).val); }
1445 #line 1445 "parser.cpp" /* yacc.c:1257 */
1448 case 72: /* basic_value_item */
1449 #line 184 "parser.y" /* yacc.c:1257 */
1450 { delete ((*yyvaluep).val); }
1451 #line 1451 "parser.cpp" /* yacc.c:1257 */
1454 case 73: /* value_item_range */
1455 #line 184 "parser.y" /* yacc.c:1257 */
1456 { delete ((*yyvaluep).val); }
1457 #line 1457 "parser.cpp" /* yacc.c:1257 */
1464 YY_IGNORE_MAYBE_UNINITIALIZED_END
1471 /* Number of syntax errors so far. */
1475 /* Number of tokens to shift before error messages enabled. */
1478 /* The stacks and their tools:
1479 'yyss': related to states.
1480 'yyvs': related to semantic values.
1481 'yyls': related to locations.
1483 Refer to the stacks through separate pointers, to allow yyoverflow
1484 to reallocate them elsewhere. */
1486 /* The state stack. */
1487 yytype_int16 yyssa[YYINITDEPTH];
1489 yytype_int16 *yyssp;
1491 /* The semantic value stack. */
1492 YYSTYPE yyvsa[YYINITDEPTH];
1496 /* The location stack. */
1497 YYLTYPE yylsa[YYINITDEPTH];
1501 /* The locations where the error started and ended. */
1502 YYLTYPE yyerror_range[3];
1504 YYSIZE_T yystacksize;
1505 /* Used to determine if this is the first time this instance has
1510 /* Initialize the parser data structure. */
1515 yyps = (yypstate *) malloc (sizeof *yyps);
1523 yypstate_delete (yypstate *yyps)
1526 /* If the stack was reallocated but the parse did not complete, then the
1527 stack still needs to be freed. */
1528 if (!yyps->yynew && yyps->yyss != yyps->yyssa)
1529 YYSTACK_FREE (yyps->yyss);
1534 #define _gmx_sel_yynerrs yyps->_gmx_sel_yynerrs
1535 #define yystate yyps->yystate
1536 #define yyerrstatus yyps->yyerrstatus
1537 #define yyssa yyps->yyssa
1538 #define yyss yyps->yyss
1539 #define yyssp yyps->yyssp
1540 #define yyvsa yyps->yyvsa
1541 #define yyvs yyps->yyvs
1542 #define yyvsp yyps->yyvsp
1543 #define yylsa yyps->yylsa
1544 #define yyls yyps->yyls
1545 #define yylsp yyps->yylsp
1546 #define yyerror_range yyps->yyerror_range
1547 #define yystacksize yyps->yystacksize
1555 yypush_parse (yypstate *yyps, int yypushed_char, YYSTYPE const *yypushed_val, YYLTYPE *yypushed_loc, void *scanner)
1557 /* The lookahead symbol. */
1561 /* The semantic value of the lookahead symbol. */
1562 /* Default value used for initialization, for pacifying older GCCs
1563 or non-GCC compilers. */
1564 YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1565 YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1567 /* Location data for the lookahead symbol. */
1568 static YYLTYPE yyloc_default
1569 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1573 YYLTYPE yylloc = yyloc_default;
1577 /* Lookahead token as an internal (translated) token number. */
1579 /* The variables used to return semantic value and location from the
1585 /* Buffer for error messages, and its allocated size. */
1587 char *yymsg = yymsgbuf;
1588 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1591 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1593 /* The number of symbols on the RHS of the reduced rule.
1594 Keep to zero when no symbol should be popped. */
1599 yyn = yypact[yystate];
1600 goto yyread_pushed_token;
1603 yyssp = yyss = yyssa;
1604 yyvsp = yyvs = yyvsa;
1605 yylsp = yyls = yylsa;
1606 yystacksize = YYINITDEPTH;
1608 YYDPRINTF ((stderr, "Starting parse\n"));
1613 yychar = YYEMPTY; /* Cause a token to be read. */
1614 yylsp[0] = *yypushed_loc;
1617 /*------------------------------------------------------------.
1618 | yynewstate -- Push a new state, which is found in yystate. |
1619 `------------------------------------------------------------*/
1621 /* In all cases, when you get here, the value and location stacks
1622 have just been pushed. So pushing a state here evens the stacks. */
1628 if (yyss + yystacksize - 1 <= yyssp)
1630 /* Get the current used size of the three stacks, in elements. */
1631 YYSIZE_T yysize = yyssp - yyss + 1;
1635 /* Give user a chance to reallocate the stack. Use copies of
1636 these so that the &'s don't force the real ones into
1638 YYSTYPE *yyvs1 = yyvs;
1639 yytype_int16 *yyss1 = yyss;
1640 YYLTYPE *yyls1 = yyls;
1642 /* Each stack pointer address is followed by the size of the
1643 data in use in that stack, in bytes. This used to be a
1644 conditional around just the two extra args, but that might
1645 be undefined if yyoverflow is a macro. */
1646 yyoverflow (YY_("memory exhausted"),
1647 &yyss1, yysize * sizeof (*yyssp),
1648 &yyvs1, yysize * sizeof (*yyvsp),
1649 &yyls1, yysize * sizeof (*yylsp),
1656 #else /* no yyoverflow */
1657 # ifndef YYSTACK_RELOCATE
1658 goto yyexhaustedlab;
1660 /* Extend the stack our own way. */
1661 if (YYMAXDEPTH <= yystacksize)
1662 goto yyexhaustedlab;
1664 if (YYMAXDEPTH < yystacksize)
1665 yystacksize = YYMAXDEPTH;
1668 yytype_int16 *yyss1 = yyss;
1669 union yyalloc *yyptr =
1670 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1672 goto yyexhaustedlab;
1673 YYSTACK_RELOCATE (yyss_alloc, yyss);
1674 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1675 YYSTACK_RELOCATE (yyls_alloc, yyls);
1676 # undef YYSTACK_RELOCATE
1678 YYSTACK_FREE (yyss1);
1681 #endif /* no yyoverflow */
1683 yyssp = yyss + yysize - 1;
1684 yyvsp = yyvs + yysize - 1;
1685 yylsp = yyls + yysize - 1;
1687 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1688 (unsigned long int) yystacksize));
1690 if (yyss + yystacksize - 1 <= yyssp)
1694 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1696 if (yystate == YYFINAL)
1706 /* Do appropriate processing given the current state. Read a
1707 lookahead token if we need one and don't already have one. */
1709 /* First try to decide what to do without reference to lookahead token. */
1710 yyn = yypact[yystate];
1711 if (yypact_value_is_default (yyn))
1714 /* Not known => get a lookahead token if don't already have one. */
1716 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1717 if (yychar == YYEMPTY)
1721 YYDPRINTF ((stderr, "Return for a new token:\n"));
1722 yyresult = YYPUSH_MORE;
1726 yyread_pushed_token:
1727 YYDPRINTF ((stderr, "Reading a token: "));
1728 yychar = yypushed_char;
1730 yylval = *yypushed_val;
1732 yylloc = *yypushed_loc;
1735 if (yychar <= YYEOF)
1737 yychar = yytoken = YYEOF;
1738 YYDPRINTF ((stderr, "Now at end of input.\n"));
1742 yytoken = YYTRANSLATE (yychar);
1743 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1746 /* If the proper action on seeing token YYTOKEN is to reduce or to
1747 detect an error, take that action. */
1749 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1754 if (yytable_value_is_error (yyn))
1760 /* Count tokens shifted since error; after three, turn off error
1765 /* Shift the lookahead token. */
1766 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1768 /* Discard the shifted token. */
1772 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1774 YY_IGNORE_MAYBE_UNINITIALIZED_END
1779 /*-----------------------------------------------------------.
1780 | yydefault -- do the default action for the current state. |
1781 `-----------------------------------------------------------*/
1783 yyn = yydefact[yystate];
1789 /*-----------------------------.
1790 | yyreduce -- Do a reduction. |
1791 `-----------------------------*/
1793 /* yyn is the number of a rule to reduce with. */
1796 /* If YYLEN is nonzero, implement the default value of the action:
1799 Otherwise, the following line sets YYVAL to garbage.
1800 This behavior is undocumented and Bison
1801 users should not rely upon it. Assigning to YYVAL
1802 unconditionally makes the parser a bit smaller, and it avoids a
1803 GCC warning that YYVAL may be used uninitialized. */
1804 yyval = yyvsp[1-yylen];
1806 /* Default location. */
1807 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1808 YY_REDUCE_PRINT (yyn);
1812 #line 199 "parser.y" /* yacc.c:1646 */
1815 set_empty((yyval.sel));
1816 END_ACTION_TOPLEVEL;
1818 #line 1818 "parser.cpp" /* yacc.c:1646 */
1822 #line 205 "parser.y" /* yacc.c:1646 */
1825 set((yyval.sel), _gmx_sel_append_selection(get((yyvsp[0].sel)), get((yyvsp[-1].sel)), scanner));
1826 if (_gmx_sel_parser_should_finish(scanner)) {
1830 END_ACTION_TOPLEVEL;
1832 #line 1832 "parser.cpp" /* yacc.c:1646 */
1836 #line 217 "parser.y" /* yacc.c:1646 */
1837 { (yyval.sel) = (yyvsp[-1].sel); }
1838 #line 1838 "parser.cpp" /* yacc.c:1646 */
1842 #line 219 "parser.y" /* yacc.c:1646 */
1845 _gmx_sel_lexer_clear_method_stack(scanner);
1846 if (_gmx_selparser_handle_error(scanner))
1854 _gmx_sel_lexer_clear_pselstr(scanner);
1855 set_empty((yyval.sel));
1856 END_ACTION_TOPLEVEL;
1858 #line 1858 "parser.cpp" /* yacc.c:1646 */
1862 #line 238 "parser.y" /* yacc.c:1646 */
1865 set_empty((yyval.sel));
1868 #line 1868 "parser.cpp" /* yacc.c:1646 */
1872 #line 244 "parser.y" /* yacc.c:1646 */
1875 SelectionTreeElementPointer s
1876 = _gmx_sel_init_group_by_id((yyvsp[0].i), scanner);
1877 SelectionTreeElementPointer p
1878 = _gmx_sel_init_position(s, NULL, scanner);
1880 set((yyval.sel), _gmx_sel_init_selection(NULL, p, scanner));
1883 #line 1883 "parser.cpp" /* yacc.c:1646 */
1887 #line 255 "parser.y" /* yacc.c:1646 */
1890 const sfree_guard nameGuard((yyvsp[0].str));
1891 SelectionTreeElementPointer s
1892 = _gmx_sel_init_group_by_name((yyvsp[0].str), scanner);
1893 SelectionTreeElementPointer p
1894 = _gmx_sel_init_position(s, NULL, scanner);
1896 set((yyval.sel), _gmx_sel_init_selection(NULL, p, scanner));
1899 #line 1899 "parser.cpp" /* yacc.c:1646 */
1903 #line 267 "parser.y" /* yacc.c:1646 */
1906 set((yyval.sel), _gmx_sel_init_selection(NULL, get((yyvsp[0].sel)), scanner));
1909 #line 1909 "parser.cpp" /* yacc.c:1646 */
1913 #line 273 "parser.y" /* yacc.c:1646 */
1916 const sfree_guard nameGuard((yyvsp[-1].str));
1917 set((yyval.sel), _gmx_sel_init_selection((yyvsp[-1].str), get((yyvsp[0].sel)), scanner));
1920 #line 1920 "parser.cpp" /* yacc.c:1646 */
1924 #line 280 "parser.y" /* yacc.c:1646 */
1927 const sfree_guard nameGuard((yyvsp[-2].str));
1928 set((yyval.sel), _gmx_sel_assign_variable((yyvsp[-2].str), get((yyvsp[0].sel)), scanner));
1931 #line 1931 "parser.cpp" /* yacc.c:1646 */
1935 #line 287 "parser.y" /* yacc.c:1646 */
1938 const sfree_guard nameGuard((yyvsp[-2].str));
1939 set((yyval.sel), _gmx_sel_assign_variable((yyvsp[-2].str), get((yyvsp[0].sel)), scanner));
1942 #line 1942 "parser.cpp" /* yacc.c:1646 */
1946 #line 294 "parser.y" /* yacc.c:1646 */
1949 const sfree_guard nameGuard((yyvsp[-2].str));
1950 set((yyval.sel), _gmx_sel_assign_variable((yyvsp[-2].str), get((yyvsp[0].sel)), scanner));
1953 #line 1953 "parser.cpp" /* yacc.c:1646 */
1957 #line 303 "parser.y" /* yacc.c:1646 */
1958 { (yyval.sel) = (yyvsp[0].sel); }
1959 #line 1959 "parser.cpp" /* yacc.c:1646 */
1963 #line 305 "parser.y" /* yacc.c:1646 */
1966 set((yyval.sel), _gmx_sel_init_position(get((yyvsp[0].sel)), NULL, scanner));
1967 CHECK_SEL((yyval.sel));
1970 #line 1970 "parser.cpp" /* yacc.c:1646 */
1974 #line 311 "parser.y" /* yacc.c:1646 */
1975 { (yyval.sel) = (yyvsp[-1].sel); }
1976 #line 1976 "parser.cpp" /* yacc.c:1646 */
1980 #line 313 "parser.y" /* yacc.c:1646 */
1983 set((yyval.sel), _gmx_sel_init_modifier((yyvsp[-1].meth), get((yyvsp[0].plist)), get((yyvsp[-2].sel)), scanner));
1984 CHECK_SEL((yyval.sel));
1987 #line 1987 "parser.cpp" /* yacc.c:1646 */
1991 #line 326 "parser.y" /* yacc.c:1646 */
1992 { (yyval.i) = (yyvsp[0].i); }
1993 #line 1993 "parser.cpp" /* yacc.c:1646 */
1997 #line 327 "parser.y" /* yacc.c:1646 */
1998 { (yyval.i) = -(yyvsp[0].i); }
1999 #line 1999 "parser.cpp" /* yacc.c:1646 */
2003 #line 331 "parser.y" /* yacc.c:1646 */
2004 { (yyval.r) = (yyvsp[0].r); }
2005 #line 2005 "parser.cpp" /* yacc.c:1646 */
2009 #line 332 "parser.y" /* yacc.c:1646 */
2010 { (yyval.r) = -(yyvsp[0].r); }
2011 #line 2011 "parser.cpp" /* yacc.c:1646 */
2015 #line 335 "parser.y" /* yacc.c:1646 */
2016 { (yyval.r) = (yyvsp[0].i); }
2017 #line 2017 "parser.cpp" /* yacc.c:1646 */
2021 #line 336 "parser.y" /* yacc.c:1646 */
2022 { (yyval.r) = (yyvsp[0].r); }
2023 #line 2023 "parser.cpp" /* yacc.c:1646 */
2027 #line 339 "parser.y" /* yacc.c:1646 */
2028 { (yyval.str) = (yyvsp[0].str); }
2029 #line 2029 "parser.cpp" /* yacc.c:1646 */
2033 #line 340 "parser.y" /* yacc.c:1646 */
2034 { (yyval.str) = (yyvsp[0].str); }
2035 #line 2035 "parser.cpp" /* yacc.c:1646 */
2039 #line 349 "parser.y" /* yacc.c:1646 */
2042 SelectionTreeElementPointer arg(get((yyvsp[0].sel)));
2043 SelectionTreeElementPointer sel(
2044 new SelectionTreeElement(SEL_BOOLEAN, (yyloc)));
2045 sel->u.boolt = BOOL_NOT;
2047 set((yyval.sel), sel);
2050 #line 2050 "parser.cpp" /* yacc.c:1646 */
2054 #line 360 "parser.y" /* yacc.c:1646 */
2057 SelectionTreeElementPointer arg1(get((yyvsp[-2].sel))), arg2(get((yyvsp[0].sel)));
2058 SelectionTreeElementPointer sel(
2059 new SelectionTreeElement(SEL_BOOLEAN, (yyloc)));
2060 sel->u.boolt = BOOL_AND;
2061 sel->child = arg1; sel->child->next = arg2;
2062 set((yyval.sel), sel);
2065 #line 2065 "parser.cpp" /* yacc.c:1646 */
2069 #line 371 "parser.y" /* yacc.c:1646 */
2072 SelectionTreeElementPointer arg1(get((yyvsp[-2].sel))), arg2(get((yyvsp[0].sel)));
2073 SelectionTreeElementPointer sel(
2074 new SelectionTreeElement(SEL_BOOLEAN, (yyloc)));
2075 sel->u.boolt = BOOL_OR;
2076 sel->child = arg1; sel->child->next = arg2;
2077 set((yyval.sel), sel);
2080 #line 2080 "parser.cpp" /* yacc.c:1646 */
2084 #line 381 "parser.y" /* yacc.c:1646 */
2085 { (yyval.sel) = (yyvsp[-1].sel); }
2086 #line 2086 "parser.cpp" /* yacc.c:1646 */
2090 #line 386 "parser.y" /* yacc.c:1646 */
2093 const sfree_guard opGuard((yyvsp[-1].str));
2094 set((yyval.sel), _gmx_sel_init_comparison(get((yyvsp[-2].sel)), get((yyvsp[0].sel)), (yyvsp[-1].str), scanner));
2095 CHECK_SEL((yyval.sel));
2098 #line 2098 "parser.cpp" /* yacc.c:1646 */
2102 #line 397 "parser.y" /* yacc.c:1646 */
2105 const sfree_guard nameGuard((yyvsp[0].str));
2106 set((yyval.sel), _gmx_sel_init_group_by_name((yyvsp[0].str), scanner));
2109 #line 2109 "parser.cpp" /* yacc.c:1646 */
2113 #line 404 "parser.y" /* yacc.c:1646 */
2116 set((yyval.sel), _gmx_sel_init_group_by_id((yyvsp[0].i), scanner));
2119 #line 2119 "parser.cpp" /* yacc.c:1646 */
2123 #line 412 "parser.y" /* yacc.c:1646 */
2124 { (yyval.str) = NULL; }
2125 #line 2125 "parser.cpp" /* yacc.c:1646 */
2129 #line 413 "parser.y" /* yacc.c:1646 */
2130 { (yyval.str) = (yyvsp[0].str); }
2131 #line 2131 "parser.cpp" /* yacc.c:1646 */
2135 #line 418 "parser.y" /* yacc.c:1646 */
2136 { (yyval.smt) = gmx::eStringMatchType_RegularExpression; }
2137 #line 2137 "parser.cpp" /* yacc.c:1646 */
2141 #line 419 "parser.y" /* yacc.c:1646 */
2142 { (yyval.smt) = gmx::eStringMatchType_Wildcard; }
2143 #line 2143 "parser.cpp" /* yacc.c:1646 */
2147 #line 420 "parser.y" /* yacc.c:1646 */
2148 { (yyval.smt) = gmx::eStringMatchType_Exact; }
2149 #line 2149 "parser.cpp" /* yacc.c:1646 */
2153 #line 425 "parser.y" /* yacc.c:1646 */
2156 const sfree_guard posmodGuard((yyvsp[-1].str));
2157 set((yyval.sel), _gmx_sel_init_keyword((yyvsp[0].meth), SelectionParserValueListPointer(), (yyvsp[-1].str), scanner));
2158 CHECK_SEL((yyval.sel));
2161 #line 2161 "parser.cpp" /* yacc.c:1646 */
2165 #line 433 "parser.y" /* yacc.c:1646 */
2168 const sfree_guard posmodGuard((yyvsp[-2].str));
2169 set((yyval.sel), _gmx_sel_init_keyword_strmatch((yyvsp[-1].meth), gmx::eStringMatchType_Auto, get((yyvsp[0].vlist)), (yyvsp[-2].str), scanner));
2170 CHECK_SEL((yyval.sel));
2173 #line 2173 "parser.cpp" /* yacc.c:1646 */
2177 #line 441 "parser.y" /* yacc.c:1646 */
2180 const sfree_guard posmodGuard((yyvsp[-3].str));
2181 set((yyval.sel), _gmx_sel_init_keyword_strmatch((yyvsp[-2].meth), (yyvsp[-1].smt), get((yyvsp[0].vlist)), (yyvsp[-3].str), scanner));
2182 CHECK_SEL((yyval.sel));
2185 #line 2185 "parser.cpp" /* yacc.c:1646 */
2189 #line 449 "parser.y" /* yacc.c:1646 */
2192 const sfree_guard posmodGuard((yyvsp[-2].str));
2193 set((yyval.sel), _gmx_sel_init_keyword((yyvsp[-1].meth), get((yyvsp[0].vlist)), (yyvsp[-2].str), scanner));
2194 CHECK_SEL((yyval.sel));
2197 #line 2197 "parser.cpp" /* yacc.c:1646 */
2201 #line 460 "parser.y" /* yacc.c:1646 */
2204 const sfree_guard posmodGuard((yyvsp[-2].str));
2205 set((yyval.sel), _gmx_sel_init_method((yyvsp[-1].meth), get((yyvsp[0].plist)), (yyvsp[-2].str), scanner));
2206 CHECK_SEL((yyval.sel));
2209 #line 2209 "parser.cpp" /* yacc.c:1646 */
2213 #line 475 "parser.y" /* yacc.c:1646 */
2216 SelectionTreeElementPointer sel(
2217 new SelectionTreeElement(SEL_CONST, (yyloc)));
2218 _gmx_selelem_set_vtype(sel, INT_VALUE);
2219 _gmx_selvalue_reserve(&sel->v, 1);
2220 sel->v.u.i[0] = (yyvsp[0].i);
2221 set((yyval.sel), sel);
2224 #line 2224 "parser.cpp" /* yacc.c:1646 */
2228 #line 486 "parser.y" /* yacc.c:1646 */
2231 SelectionTreeElementPointer sel(
2232 new SelectionTreeElement(SEL_CONST, (yyloc)));
2233 _gmx_selelem_set_vtype(sel, REAL_VALUE);
2234 _gmx_selvalue_reserve(&sel->v, 1);
2235 sel->v.u.r[0] = (yyvsp[0].r);
2236 set((yyval.sel), sel);
2239 #line 2239 "parser.cpp" /* yacc.c:1646 */
2243 #line 500 "parser.y" /* yacc.c:1646 */
2246 const sfree_guard posmodGuard((yyvsp[-1].str));
2247 set((yyval.sel), _gmx_sel_init_keyword((yyvsp[0].meth), SelectionParserValueListPointer(), (yyvsp[-1].str), scanner));
2248 CHECK_SEL((yyval.sel));
2251 #line 2251 "parser.cpp" /* yacc.c:1646 */
2255 #line 508 "parser.y" /* yacc.c:1646 */
2258 const sfree_guard posmodGuard((yyvsp[-3].str));
2259 set((yyval.sel), _gmx_sel_init_keyword_of((yyvsp[-2].meth), get((yyvsp[0].sel)), (yyvsp[-3].str), scanner));
2260 CHECK_SEL((yyval.sel));
2263 #line 2263 "parser.cpp" /* yacc.c:1646 */
2267 #line 516 "parser.y" /* yacc.c:1646 */
2270 const sfree_guard posmodGuard((yyvsp[-2].str));
2271 set((yyval.sel), _gmx_sel_init_method((yyvsp[-1].meth), get((yyvsp[0].plist)), (yyvsp[-2].str), scanner));
2272 CHECK_SEL((yyval.sel));
2275 #line 2275 "parser.cpp" /* yacc.c:1646 */
2279 #line 527 "parser.y" /* yacc.c:1646 */
2282 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[-2].sel)), get((yyvsp[0].sel)), '+', scanner));
2285 #line 2285 "parser.cpp" /* yacc.c:1646 */
2289 #line 533 "parser.y" /* yacc.c:1646 */
2292 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[-2].sel)), get((yyvsp[0].sel)), '-', scanner));
2295 #line 2295 "parser.cpp" /* yacc.c:1646 */
2299 #line 539 "parser.y" /* yacc.c:1646 */
2302 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[-2].sel)), get((yyvsp[0].sel)), '*', scanner));
2305 #line 2305 "parser.cpp" /* yacc.c:1646 */
2309 #line 545 "parser.y" /* yacc.c:1646 */
2312 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[-2].sel)), get((yyvsp[0].sel)), '/', scanner));
2315 #line 2315 "parser.cpp" /* yacc.c:1646 */
2319 #line 551 "parser.y" /* yacc.c:1646 */
2322 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[0].sel)), SelectionTreeElementPointer(), '-', scanner));
2325 #line 2325 "parser.cpp" /* yacc.c:1646 */
2329 #line 557 "parser.y" /* yacc.c:1646 */
2332 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[-2].sel)), get((yyvsp[0].sel)), '^', scanner));
2335 #line 2335 "parser.cpp" /* yacc.c:1646 */
2339 #line 562 "parser.y" /* yacc.c:1646 */
2340 { (yyval.sel) = (yyvsp[-1].sel); }
2341 #line 2341 "parser.cpp" /* yacc.c:1646 */
2345 #line 570 "parser.y" /* yacc.c:1646 */
2348 SelectionTreeElementPointer sel(
2349 new SelectionTreeElement(SEL_CONST, (yyloc)));
2350 _gmx_selelem_set_vtype(sel, STR_VALUE);
2351 _gmx_selvalue_reserve(&sel->v, 1);
2352 sel->v.u.s[0] = (yyvsp[0].str);
2353 set((yyval.sel), sel);
2356 #line 2356 "parser.cpp" /* yacc.c:1646 */
2360 #line 581 "parser.y" /* yacc.c:1646 */
2363 const sfree_guard posmodGuard((yyvsp[-1].str));
2364 set((yyval.sel), _gmx_sel_init_keyword((yyvsp[0].meth), SelectionParserValueListPointer(), (yyvsp[-1].str), scanner));
2365 CHECK_SEL((yyval.sel));
2368 #line 2368 "parser.cpp" /* yacc.c:1646 */
2372 #line 596 "parser.y" /* yacc.c:1646 */
2375 set((yyval.sel), _gmx_sel_init_const_position((yyvsp[-5].r), (yyvsp[-3].r), (yyvsp[-1].r), scanner));
2378 #line 2378 "parser.cpp" /* yacc.c:1646 */
2382 #line 604 "parser.y" /* yacc.c:1646 */
2383 { (yyval.sel) = (yyvsp[-1].sel); }
2384 #line 2384 "parser.cpp" /* yacc.c:1646 */
2388 #line 609 "parser.y" /* yacc.c:1646 */
2391 set((yyval.sel), _gmx_sel_init_method((yyvsp[-1].meth), get((yyvsp[0].plist)), NULL, scanner));
2392 CHECK_SEL((yyval.sel));
2395 #line 2395 "parser.cpp" /* yacc.c:1646 */
2399 #line 619 "parser.y" /* yacc.c:1646 */
2402 const sfree_guard keywordGuard((yyvsp[-2].str));
2403 set((yyval.sel), _gmx_sel_init_position(get((yyvsp[0].sel)), (yyvsp[-2].str), scanner));
2404 CHECK_SEL((yyval.sel));
2407 #line 2407 "parser.cpp" /* yacc.c:1646 */
2411 #line 633 "parser.y" /* yacc.c:1646 */
2414 set((yyval.sel), _gmx_sel_init_variable_ref(get((yyvsp[0].sel)), scanner));
2417 #line 2417 "parser.cpp" /* yacc.c:1646 */
2421 #line 641 "parser.y" /* yacc.c:1646 */
2424 set((yyval.sel), _gmx_sel_init_variable_ref(get((yyvsp[0].sel)), scanner));
2427 #line 2427 "parser.cpp" /* yacc.c:1646 */
2431 #line 649 "parser.y" /* yacc.c:1646 */
2434 set((yyval.sel), _gmx_sel_init_variable_ref(get((yyvsp[0].sel)), scanner));
2437 #line 2437 "parser.cpp" /* yacc.c:1646 */
2441 #line 662 "parser.y" /* yacc.c:1646 */
2442 { (yyval.plist) = (yyvsp[0].plist); }
2443 #line 2443 "parser.cpp" /* yacc.c:1646 */
2447 #line 664 "parser.y" /* yacc.c:1646 */
2448 { (yyval.plist) = (yyvsp[-1].plist); }
2449 #line 2449 "parser.cpp" /* yacc.c:1646 */
2453 #line 669 "parser.y" /* yacc.c:1646 */
2456 set((yyval.plist), SelectionParserParameter::createList());
2459 #line 2459 "parser.cpp" /* yacc.c:1646 */
2463 #line 675 "parser.y" /* yacc.c:1646 */
2466 SelectionParserParameterListPointer list(get((yyvsp[-1].plist)));
2467 list->push_back(get((yyvsp[0].param)));
2468 set((yyval.plist), std::move(list));
2471 #line 2471 "parser.cpp" /* yacc.c:1646 */
2475 #line 686 "parser.y" /* yacc.c:1646 */
2478 const sfree_guard nameGuard((yyvsp[-1].str));
2479 set((yyval.param), SelectionParserParameter::create((yyvsp[-1].str), get((yyvsp[0].vlist)), (yyloc)));
2482 #line 2482 "parser.cpp" /* yacc.c:1646 */
2486 #line 694 "parser.y" /* yacc.c:1646 */
2487 { (yyval.vlist) = (yyvsp[0].vlist); }
2488 #line 2488 "parser.cpp" /* yacc.c:1646 */
2492 #line 695 "parser.y" /* yacc.c:1646 */
2493 { (yyval.vlist) = (yyvsp[-1].vlist); }
2494 #line 2494 "parser.cpp" /* yacc.c:1646 */
2498 #line 700 "parser.y" /* yacc.c:1646 */
2501 set((yyval.vlist), SelectionParserValue::createList());
2504 #line 2504 "parser.cpp" /* yacc.c:1646 */
2508 #line 706 "parser.y" /* yacc.c:1646 */
2511 SelectionParserValueListPointer list(get((yyvsp[-1].vlist)));
2512 list->push_back(get((yyvsp[0].val)));
2513 set((yyval.vlist), std::move(list));
2516 #line 2516 "parser.cpp" /* yacc.c:1646 */
2520 #line 714 "parser.y" /* yacc.c:1646 */
2523 SelectionParserValueListPointer list(get((yyvsp[-2].vlist)));
2524 list->push_back(get((yyvsp[0].val)));
2525 set((yyval.vlist), std::move(list));
2528 #line 2528 "parser.cpp" /* yacc.c:1646 */
2532 #line 724 "parser.y" /* yacc.c:1646 */
2533 { (yyval.vlist) = (yyvsp[0].vlist); }
2534 #line 2534 "parser.cpp" /* yacc.c:1646 */
2538 #line 725 "parser.y" /* yacc.c:1646 */
2539 { (yyval.vlist) = (yyvsp[-1].vlist); }
2540 #line 2540 "parser.cpp" /* yacc.c:1646 */
2544 #line 730 "parser.y" /* yacc.c:1646 */
2547 set((yyval.vlist), SelectionParserValue::createList(get((yyvsp[0].val))));
2550 #line 2550 "parser.cpp" /* yacc.c:1646 */
2554 #line 736 "parser.y" /* yacc.c:1646 */
2557 SelectionParserValueListPointer list(get((yyvsp[-1].vlist)));
2558 list->push_back(get((yyvsp[0].val)));
2559 set((yyval.vlist), std::move(list));
2562 #line 2562 "parser.cpp" /* yacc.c:1646 */
2566 #line 744 "parser.y" /* yacc.c:1646 */
2569 SelectionParserValueListPointer list(get((yyvsp[-2].vlist)));
2570 list->push_back(get((yyvsp[0].val)));
2571 set((yyval.vlist), std::move(list));
2574 #line 2574 "parser.cpp" /* yacc.c:1646 */
2578 #line 754 "parser.y" /* yacc.c:1646 */
2581 set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[0].sel))));
2584 #line 2584 "parser.cpp" /* yacc.c:1646 */
2588 #line 760 "parser.y" /* yacc.c:1646 */
2591 set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[0].sel))));
2594 #line 2594 "parser.cpp" /* yacc.c:1646 */
2598 #line 766 "parser.y" /* yacc.c:1646 */
2601 set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[0].sel))));
2604 #line 2604 "parser.cpp" /* yacc.c:1646 */
2608 #line 772 "parser.y" /* yacc.c:1646 */
2611 set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[0].sel))));
2614 #line 2614 "parser.cpp" /* yacc.c:1646 */
2618 #line 777 "parser.y" /* yacc.c:1646 */
2619 { (yyval.val) = (yyvsp[0].val); }
2620 #line 2620 "parser.cpp" /* yacc.c:1646 */
2624 #line 782 "parser.y" /* yacc.c:1646 */
2627 set((yyval.val), SelectionParserValue::createInteger((yyvsp[0].i), (yyloc)));
2630 #line 2630 "parser.cpp" /* yacc.c:1646 */
2634 #line 788 "parser.y" /* yacc.c:1646 */
2637 set((yyval.val), SelectionParserValue::createReal((yyvsp[0].r), (yyloc)));
2640 #line 2640 "parser.cpp" /* yacc.c:1646 */
2644 #line 794 "parser.y" /* yacc.c:1646 */
2647 const sfree_guard stringGuard((yyvsp[0].str));
2648 set((yyval.val), SelectionParserValue::createString((yyvsp[0].str), (yyloc)));
2651 #line 2651 "parser.cpp" /* yacc.c:1646 */
2655 #line 800 "parser.y" /* yacc.c:1646 */
2656 { (yyval.val) = (yyvsp[0].val); }
2657 #line 2657 "parser.cpp" /* yacc.c:1646 */
2661 #line 805 "parser.y" /* yacc.c:1646 */
2664 set((yyval.val), SelectionParserValue::createIntegerRange((yyvsp[-2].i), (yyvsp[0].i), (yyloc)));
2667 #line 2667 "parser.cpp" /* yacc.c:1646 */
2671 #line 811 "parser.y" /* yacc.c:1646 */
2674 set((yyval.val), SelectionParserValue::createRealRange((yyvsp[-2].i), (yyvsp[0].r), (yyloc)));
2677 #line 2677 "parser.cpp" /* yacc.c:1646 */
2681 #line 817 "parser.y" /* yacc.c:1646 */
2684 set((yyval.val), SelectionParserValue::createRealRange((yyvsp[-2].r), (yyvsp[0].r), (yyloc)));
2687 #line 2687 "parser.cpp" /* yacc.c:1646 */
2691 #line 2691 "parser.cpp" /* yacc.c:1646 */
2694 /* User semantic actions sometimes alter yychar, and that requires
2695 that yytoken be updated with the new translation. We take the
2696 approach of translating immediately before every use of yytoken.
2697 One alternative is translating here after every semantic action,
2698 but that translation would be missed if the semantic action invokes
2699 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2700 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2701 incorrect destructor might then be invoked immediately. In the
2702 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2703 to an incorrect destructor call or verbose syntax error message
2704 before the lookahead is translated. */
2705 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2709 YY_STACK_PRINT (yyss, yyssp);
2714 /* Now 'shift' the result of the reduction. Determine what state
2715 that goes to, based on the state we popped back to and the rule
2716 number reduced by. */
2720 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2721 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2722 yystate = yytable[yystate];
2724 yystate = yydefgoto[yyn - YYNTOKENS];
2729 /*--------------------------------------.
2730 | yyerrlab -- here on detecting error. |
2731 `--------------------------------------*/
2733 /* Make sure we have latest lookahead translation. See comments at
2734 user semantic actions for why this is necessary. */
2735 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2737 /* If not already recovering from an error, report this error. */
2741 #if ! YYERROR_VERBOSE
2742 yyerror (&yylloc, scanner, YY_("syntax error"));
2744 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2747 char const *yymsgp = YY_("syntax error");
2748 int yysyntax_error_status;
2749 yysyntax_error_status = YYSYNTAX_ERROR;
2750 if (yysyntax_error_status == 0)
2752 else if (yysyntax_error_status == 1)
2754 if (yymsg != yymsgbuf)
2755 YYSTACK_FREE (yymsg);
2756 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2760 yymsg_alloc = sizeof yymsgbuf;
2761 yysyntax_error_status = 2;
2765 yysyntax_error_status = YYSYNTAX_ERROR;
2769 yyerror (&yylloc, scanner, yymsgp);
2770 if (yysyntax_error_status == 2)
2771 goto yyexhaustedlab;
2773 # undef YYSYNTAX_ERROR
2777 yyerror_range[1] = yylloc;
2779 if (yyerrstatus == 3)
2781 /* If just tried and failed to reuse lookahead token after an
2782 error, discard it. */
2784 if (yychar <= YYEOF)
2786 /* Return failure if at end of input. */
2787 if (yychar == YYEOF)
2792 yydestruct ("Error: discarding",
2793 yytoken, &yylval, &yylloc, scanner);
2798 /* Else will try to reuse lookahead token after shifting the error
2803 /*---------------------------------------------------.
2804 | yyerrorlab -- error raised explicitly by YYERROR. |
2805 `---------------------------------------------------*/
2808 /* Pacify compilers like GCC when the user code never invokes
2809 YYERROR and the label yyerrorlab therefore never appears in user
2811 if (/*CONSTCOND*/ 0)
2814 yyerror_range[1] = yylsp[1-yylen];
2815 /* Do not reclaim the symbols of the rule whose action triggered
2819 YY_STACK_PRINT (yyss, yyssp);
2824 /*-------------------------------------------------------------.
2825 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2826 `-------------------------------------------------------------*/
2828 yyerrstatus = 3; /* Each real token shifted decrements this. */
2832 yyn = yypact[yystate];
2833 if (!yypact_value_is_default (yyn))
2836 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2844 /* Pop the current state because it cannot handle the error token. */
2848 yyerror_range[1] = *yylsp;
2849 yydestruct ("Error: popping",
2850 yystos[yystate], yyvsp, yylsp, scanner);
2853 YY_STACK_PRINT (yyss, yyssp);
2856 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2858 YY_IGNORE_MAYBE_UNINITIALIZED_END
2860 yyerror_range[2] = yylloc;
2861 /* Using YYLLOC is tempting, but would change the location of
2862 the lookahead. YYLOC is available though. */
2863 YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
2866 /* Shift the error token. */
2867 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2873 /*-------------------------------------.
2874 | yyacceptlab -- YYACCEPT comes here. |
2875 `-------------------------------------*/
2880 /*-----------------------------------.
2881 | yyabortlab -- YYABORT comes here. |
2882 `-----------------------------------*/
2887 #if !defined yyoverflow || YYERROR_VERBOSE
2888 /*-------------------------------------------------.
2889 | yyexhaustedlab -- memory exhaustion comes here. |
2890 `-------------------------------------------------*/
2892 yyerror (&yylloc, scanner, YY_("memory exhausted"));
2898 if (yychar != YYEMPTY)
2900 /* Make sure we have latest lookahead translation. See comments at
2901 user semantic actions for why this is necessary. */
2902 yytoken = YYTRANSLATE (yychar);
2903 yydestruct ("Cleanup: discarding lookahead",
2904 yytoken, &yylval, &yylloc, scanner);
2906 /* Do not reclaim the symbols of the rule whose action triggered
2907 this YYABORT or YYACCEPT. */
2909 YY_STACK_PRINT (yyss, yyssp);
2910 while (yyssp != yyss)
2912 yydestruct ("Cleanup: popping",
2913 yystos[*yyssp], yyvsp, yylsp, scanner);
2918 YYSTACK_FREE (yyss);
2924 if (yymsg != yymsgbuf)
2925 YYSTACK_FREE (yymsg);