1 /* A Bison parser, made by GNU Bison 2.6.2. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2012 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 "2.6.2"
50 #define YYSKELETON_NAME "yacc.c"
62 /* Substitute the variable and function names. */
63 #define yypush_parse _gmx_sel_yypush_parse
64 #define yypstate_new _gmx_sel_yypstate_new
65 #define yypstate_delete _gmx_sel_yypstate_delete
66 #define yypstate _gmx_sel_yypstate
67 #define yylex _gmx_sel_yylex
68 #define yyerror _gmx_sel_yyerror
69 #define yylval _gmx_sel_yylval
70 #define yychar _gmx_sel_yychar
71 #define yydebug _gmx_sel_yydebug
72 #define yynerrs _gmx_sel_yynerrs
74 /* Copy the first part of user declarations. */
75 /* Line 336 of yacc.c */
78 /*! \internal \file parser.cpp
79 * \brief Generated (from parser.y by Bison) parser for the selection language.
81 * \ingroup module_selection
83 /*! \internal \file parser.h
84 * \brief Generated (from parser.y by Bison) parser include file.
86 * \ingroup module_selection
88 #include "gromacs/utility/scoped_ptr_sfree.h"
90 #include "parser_internal.h"
92 using gmx::scoped_ptr_sfree;
93 using gmx::SelectionParserValue;
94 using gmx::SelectionParserValueList;
95 using gmx::SelectionParserValueListPointer;
96 using gmx::SelectionParserParameter;
97 using gmx::SelectionParserParameterList;
98 using gmx::SelectionParserParameterListPointer;
99 using gmx::SelectionTreeElement;
100 using gmx::SelectionTreeElementPointer;
103 #pragma warning(disable: 4065)
106 /* Line 336 of yacc.c */
107 #line 108 "parser.cpp"
110 # if defined __cplusplus && 201103L <= __cplusplus
111 # define YY_NULL nullptr
117 /* Enabling verbose error messages. */
118 #ifdef YYERROR_VERBOSE
119 # undef YYERROR_VERBOSE
120 # define YYERROR_VERBOSE 1
122 # define YYERROR_VERBOSE 0
125 /* In a future release of Bison, this section will be replaced
126 by #include "parser.h". */
127 #ifndef _GMX_SEL_YY_PARSER_H
128 # define _GMX_SEL_YY_PARSER_H
129 /* Enabling traces. */
134 extern int _gmx_sel_yydebug;
136 /* "%code requires" blocks. */
137 /* Line 350 of yacc.c */
141 * This file is part of the GROMACS molecular simulation package.
143 * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by
144 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
145 * and including many others, as listed in the AUTHORS file in the
146 * top-level source directory and at http://www.gromacs.org.
148 * GROMACS is free software; you can redistribute it and/or
149 * modify it under the terms of the GNU Lesser General Public License
150 * as published by the Free Software Foundation; either version 2.1
151 * of the License, or (at your option) any later version.
153 * GROMACS is distributed in the hope that it will be useful,
154 * but WITHOUT ANY WARRANTY; without even the implied warranty of
155 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
156 * Lesser General Public License for more details.
158 * You should have received a copy of the GNU Lesser General Public
159 * License along with GROMACS; if not, see
160 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
161 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
163 * If you want to redistribute modifications to GROMACS, please
164 * consider that scientific software is very special. Version
165 * control is crucial - bugs must be traceable. We will be happy to
166 * consider code for inclusion in the official distribution, but
167 * derived work must not be called official GROMACS. Details are found
168 * in the README & COPYING files - if they are missing, get the
169 * official version at http://www.gromacs.org.
171 * To help us fund GROMACS development, we humbly ask that you cite
172 * the research papers on the package. Check out http://www.gromacs.org.
175 /* Line 350 of yacc.c */
178 #include "parsetree.h"
182 /* Line 350 of yacc.c */
183 #line 184 "parser.cpp"
188 /* Put the tokens into the symbol table, so that GDB and other debuggers
199 VARIABLE_NUMERIC = 266,
200 VARIABLE_GROUP = 267,
202 KEYWORD_NUMERIC = 269,
206 METHOD_NUMERIC = 273,
226 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
227 typedef union YYSTYPE
229 /* Line 350 of yacc.c */
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;
246 /* Line 350 of yacc.c */
247 #line 248 "parser.cpp"
249 # define YYSTYPE_IS_TRIVIAL 1
250 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
251 # define YYSTYPE_IS_DECLARED 1
255 #ifndef YYPUSH_MORE_DEFINED
256 # define YYPUSH_MORE_DEFINED
257 enum { YYPUSH_MORE = 4 };
260 typedef struct _gmx_sel_yypstate _gmx_sel_yypstate;
262 #if defined __STDC__ || defined __cplusplus
263 int _gmx_sel_yypush_parse (_gmx_sel_yypstate *ps, int pushed_char, YYSTYPE const *pushed_val, void *scanner);
265 int _gmx_sel_yypush_parse ();
268 #if defined __STDC__ || defined __cplusplus
269 _gmx_sel_yypstate * _gmx_sel_yypstate_new (void);
271 _gmx_sel_yypstate * _gmx_sel_yypstate_new ();
273 #if defined __STDC__ || defined __cplusplus
274 void _gmx_sel_yypstate_delete (_gmx_sel_yypstate *ps);
276 void _gmx_sel_yypstate_delete ();
279 #endif /* !_GMX_SEL_YY_PARSER_H */
281 /* Copy the second part of user declarations. */
283 /* Line 353 of yacc.c */
284 #line 285 "parser.cpp"
291 typedef YYTYPE_UINT8 yytype_uint8;
293 typedef unsigned char yytype_uint8;
297 typedef YYTYPE_INT8 yytype_int8;
298 #elif (defined __STDC__ || defined __C99__FUNC__ \
299 || defined __cplusplus || defined _MSC_VER)
300 typedef signed char yytype_int8;
302 typedef short int yytype_int8;
306 typedef YYTYPE_UINT16 yytype_uint16;
308 typedef unsigned short int yytype_uint16;
312 typedef YYTYPE_INT16 yytype_int16;
314 typedef short int yytype_int16;
318 # ifdef __SIZE_TYPE__
319 # define YYSIZE_T __SIZE_TYPE__
320 # elif defined size_t
321 # define YYSIZE_T size_t
322 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
323 || defined __cplusplus || defined _MSC_VER)
324 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
325 # define YYSIZE_T size_t
327 # define YYSIZE_T unsigned int
331 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
334 # if defined YYENABLE_NLS && YYENABLE_NLS
336 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
337 # define YY_(msgid) dgettext ("bison-runtime", msgid)
341 # define YY_(msgid) msgid
345 /* Suppress unused-variable warnings by "using" E. */
346 #if ! defined lint || defined __GNUC__
347 # define YYUSE(e) ((void) (e))
349 # define YYUSE(e) /* empty */
352 /* Identity function, used to suppress warnings about constant conditions. */
356 #if (defined __STDC__ || defined __C99__FUNC__ \
357 || defined __cplusplus || defined _MSC_VER)
370 #if ! defined yyoverflow || YYERROR_VERBOSE
372 /* The parser invokes alloca or malloc; define the necessary symbols. */
374 # ifdef YYSTACK_ALLOC
375 /* Pacify GCC's `empty if-body' warning. */
376 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
377 # ifndef YYSTACK_ALLOC_MAXIMUM
378 /* The OS might guarantee only one guard page at the bottom of the stack,
379 and a page size can be as small as 4096 bytes. So we cannot safely
380 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
381 to allow for a few compiler-allocated temporary stack slots. */
382 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
385 # define YYSTACK_ALLOC YYMALLOC
386 # define YYSTACK_FREE YYFREE
387 # ifndef YYSTACK_ALLOC_MAXIMUM
388 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
390 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
391 && ! ((defined YYMALLOC || defined malloc) \
392 && (defined YYFREE || defined free)))
393 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
394 # ifndef EXIT_SUCCESS
395 # define EXIT_SUCCESS 0
399 # define YYMALLOC malloc
400 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
401 || defined __cplusplus || defined _MSC_VER)
402 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
407 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
408 || defined __cplusplus || defined _MSC_VER)
409 void free (void *); /* INFRINGES ON USER NAME SPACE */
413 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
416 #if (! defined yyoverflow \
417 && (! defined __cplusplus \
418 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
420 /* A type that is properly aligned for any stack member. */
423 yytype_int16 yyss_alloc;
427 /* The size of the maximum gap between one aligned stack and the next. */
428 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
430 /* The size of an array large to enough to hold all stacks, each with
432 # define YYSTACK_BYTES(N) \
433 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
434 + YYSTACK_GAP_MAXIMUM)
436 # define YYCOPY_NEEDED 1
438 /* Relocate STACK from its old location to the new one. The
439 local variables YYSIZE and YYSTACKSIZE give the old and new number of
440 elements in the stack, and YYPTR gives the new location of the
441 stack. Advance YYPTR to a properly aligned location for the next
443 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
446 YYSIZE_T yynewbytes; \
447 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
448 Stack = &yyptr->Stack_alloc; \
449 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
450 yyptr += yynewbytes / sizeof (*yyptr); \
456 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
457 /* Copy COUNT objects from SRC to DST. The source and destination do
460 # if defined __GNUC__ && 1 < __GNUC__
461 # define YYCOPY(Dst, Src, Count) \
462 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
464 # define YYCOPY(Dst, Src, Count) \
468 for (yyi = 0; yyi < (Count); yyi++) \
469 (Dst)[yyi] = (Src)[yyi]; \
474 #endif /* !YYCOPY_NEEDED */
476 /* YYFINAL -- State number of the termination state. */
478 /* YYLAST -- Last index in YYTABLE. */
481 /* YYNTOKENS -- Number of terminals. */
483 /* YYNNTS -- Number of nonterminals. */
485 /* YYNRULES -- Number of rules. */
487 /* YYNRULES -- Number of states. */
488 #define YYNSTATES 149
490 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
492 #define YYMAXUTOK 288
494 #define YYTRANSLATE(YYX) \
495 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
497 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
498 static const yytype_uint8 yytranslate[] =
500 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
501 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
502 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
503 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
504 40, 41, 34, 32, 45, 33, 2, 35, 2, 2,
505 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
506 2, 39, 2, 43, 2, 2, 2, 2, 2, 2,
507 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
508 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
509 2, 44, 2, 46, 37, 2, 2, 2, 2, 2,
510 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
511 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
512 2, 2, 2, 47, 2, 48, 42, 2, 2, 2,
513 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
514 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
515 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
516 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
517 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
518 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
519 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
520 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
521 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
522 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
523 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
524 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
525 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
526 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
527 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
528 25, 26, 27, 28, 29, 30, 31, 36, 38
532 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
534 static const yytype_uint8 yyprhs[] =
536 0, 0, 3, 4, 7, 10, 13, 14, 16, 18,
537 20, 23, 27, 31, 35, 37, 39, 43, 47, 49,
538 52, 54, 57, 59, 61, 63, 65, 68, 72, 76,
539 80, 84, 87, 90, 92, 94, 96, 98, 100, 103,
540 107, 112, 116, 120, 122, 124, 127, 131, 135, 139,
541 143, 147, 150, 154, 158, 160, 163, 171, 175, 178,
542 182, 184, 186, 188, 190, 193, 194, 197, 200, 202,
543 206, 207, 210, 214, 216, 220, 222, 225, 229, 231,
544 233, 235, 237, 239, 241, 243, 245, 247, 251, 255
547 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
548 static const yytype_int8 yyrhs[] =
550 50, 0, -1, -1, 50, 51, -1, 52, 8, -1,
551 1, 8, -1, -1, 4, -1, 57, -1, 53, -1,
552 57, 53, -1, 7, 39, 58, -1, 7, 39, 61,
553 -1, 7, 39, 63, -1, 63, -1, 58, -1, 40,
554 53, 41, -1, 53, 21, 64, -1, 4, -1, 33,
555 4, -1, 5, -1, 33, 5, -1, 54, -1, 55,
556 -1, 6, -1, 7, -1, 31, 58, -1, 58, 30,
557 58, -1, 58, 29, 58, -1, 40, 58, 41, -1,
558 61, 26, 61, -1, 9, 57, -1, 9, 4, -1,
559 22, -1, 16, -1, 42, -1, 43, -1, 39, -1,
560 59, 17, -1, 59, 15, 69, -1, 59, 15, 60,
561 69, -1, 59, 14, 69, -1, 59, 19, 64, -1,
562 4, -1, 5, -1, 59, 14, -1, 59, 18, 64,
563 -1, 61, 32, 61, -1, 61, 33, 61, -1, 61,
564 34, 61, -1, 61, 35, 61, -1, 33, 61, -1,
565 61, 37, 61, -1, 40, 61, 41, -1, 57, -1,
566 59, 15, -1, 44, 56, 45, 56, 45, 56, 46,
567 -1, 40, 63, 41, -1, 20, 64, -1, 16, 25,
568 58, -1, 12, -1, 11, -1, 13, -1, 65, -1,
569 65, 24, -1, -1, 65, 66, -1, 23, 67, -1,
570 68, -1, 47, 68, 48, -1, -1, 68, 71, -1,
571 68, 45, 71, -1, 70, -1, 47, 70, 48, -1,
572 72, -1, 70, 72, -1, 70, 45, 72, -1, 58,
573 -1, 63, -1, 61, -1, 62, -1, 73, -1, 54,
574 -1, 55, -1, 57, -1, 73, -1, 54, 10, 54,
575 -1, 54, 10, 55, -1, 55, 10, 56, -1
578 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
579 static const yytype_uint16 yyrline[] =
581 0, 193, 193, 198, 209, 210, 232, 237, 248, 260,
582 266, 273, 280, 287, 297, 298, 305, 306, 320, 321,
583 325, 326, 329, 330, 333, 334, 342, 353, 364, 375,
584 379, 390, 397, 406, 407, 412, 413, 414, 418, 426,
585 434, 442, 453, 468, 479, 493, 501, 512, 518, 524,
586 530, 536, 542, 548, 555, 566, 581, 590, 594, 604,
587 618, 626, 634, 647, 649, 655, 660, 671, 680, 681,
588 686, 691, 699, 710, 711, 715, 721, 729, 739, 745,
589 751, 757, 763, 767, 773, 779, 786, 790, 796, 802
593 #if YYDEBUG || YYERROR_VERBOSE || 0
594 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
595 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
596 static const char *const yytname[] =
598 "$end", "error", "$undefined", "INVALID", "TOK_INT", "TOK_REAL", "STR",
599 "IDENTIFIER", "CMD_SEP", "GROUP", "TO", "VARIABLE_NUMERIC",
600 "VARIABLE_GROUP", "VARIABLE_POS", "KEYWORD_NUMERIC", "KEYWORD_STR",
601 "KEYWORD_POS", "KEYWORD_GROUP", "METHOD_NUMERIC", "METHOD_GROUP",
602 "METHOD_POS", "MODIFIER", "EMPTY_POSMOD", "PARAM", "END_OF_METHOD", "OF",
603 "CMP_OP", "PARAM_REDUCT", "XOR", "OR", "AND", "NOT", "'+'", "'-'", "'*'",
604 "'/'", "UNARY_NEG", "'^'", "NUM_REDUCT", "'='", "'('", "')'", "'~'",
605 "'?'", "'['", "','", "']'", "'{'", "'}'", "$accept", "commands",
606 "command", "cmd_plain", "selection", "integer_number", "real_number",
607 "number", "string", "sel_expr", "pos_mod", "str_match_type", "num_expr",
608 "str_expr", "pos_expr", "method_params", "method_param_list",
609 "method_param", "value_list", "value_list_contents", "basic_value_list",
610 "basic_value_list_contents", "value_item", "basic_value_item",
611 "value_item_range", YY_NULL
616 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
618 static const yytype_uint16 yytoknum[] =
620 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
621 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
622 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
623 285, 286, 43, 45, 42, 47, 287, 94, 288, 61,
624 40, 41, 126, 63, 91, 44, 93, 123, 125
628 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
629 static const yytype_uint8 yyr1[] =
631 0, 49, 50, 50, 51, 51, 52, 52, 52, 52,
632 52, 52, 52, 52, 53, 53, 53, 53, 54, 54,
633 55, 55, 56, 56, 57, 57, 58, 58, 58, 58,
634 58, 58, 58, 59, 59, 60, 60, 60, 58, 58,
635 58, 58, 58, 61, 61, 61, 61, 61, 61, 61,
636 61, 61, 61, 61, 62, 62, 63, 63, 63, 63,
637 58, 61, 63, 64, 64, 65, 65, 66, 67, 67,
638 68, 68, 68, 69, 69, 70, 70, 70, 71, 71,
639 71, 71, 71, 72, 72, 72, 72, 73, 73, 73
642 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
643 static const yytype_uint8 yyr2[] =
645 0, 2, 0, 2, 2, 2, 0, 1, 1, 1,
646 2, 3, 3, 3, 1, 1, 3, 3, 1, 2,
647 1, 2, 1, 1, 1, 1, 2, 3, 3, 3,
648 3, 2, 2, 1, 1, 1, 1, 1, 2, 3,
649 4, 3, 3, 1, 1, 2, 3, 3, 3, 3,
650 3, 2, 3, 3, 1, 2, 7, 3, 2, 3,
651 1, 1, 1, 1, 2, 0, 2, 2, 1, 3,
652 0, 2, 3, 1, 3, 1, 2, 3, 1, 1,
653 1, 1, 1, 1, 1, 1, 1, 3, 3, 3
656 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
657 Performed when YYTABLE doesn't specify something else to do. Zero
658 means the default is an error. */
659 static const yytype_uint8 yydefact[] =
661 2, 0, 1, 0, 43, 44, 24, 25, 0, 61,
662 60, 62, 34, 65, 33, 0, 0, 0, 0, 3,
663 0, 9, 8, 15, 0, 0, 14, 5, 0, 32,
664 25, 31, 0, 58, 63, 43, 34, 0, 26, 0,
665 0, 51, 0, 15, 0, 14, 18, 20, 0, 22,
666 23, 0, 4, 65, 10, 0, 0, 45, 0, 38,
667 65, 65, 0, 0, 0, 0, 0, 0, 0, 11,
668 12, 13, 59, 70, 64, 66, 0, 0, 45, 16,
669 29, 53, 57, 19, 21, 0, 17, 28, 27, 0,
670 83, 84, 85, 41, 73, 75, 86, 37, 35, 36,
671 0, 39, 46, 42, 30, 47, 48, 49, 50, 52,
672 0, 70, 67, 68, 0, 0, 0, 0, 0, 76,
673 40, 0, 43, 44, 0, 0, 0, 0, 54, 78,
674 0, 80, 81, 79, 71, 82, 0, 74, 87, 88,
675 89, 77, 69, 43, 44, 72, 55, 0, 56
678 /* YYDEFGOTO[NTERM-NUM]. */
679 static const yytype_int16 yydefgoto[] =
681 -1, 1, 19, 20, 21, 90, 91, 51, 92, 129,
682 24, 100, 25, 132, 133, 33, 34, 75, 112, 113,
686 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
688 #define YYPACT_NINF -84
689 static const yytype_int16 yypact[] =
691 -84, 148, -84, 4, 6, -84, -84, -20, 189, -84,
692 -84, -84, 1, -84, -84, 322, 216, 285, 0, -84,
693 27, 16, 285, 22, 122, 173, -84, -84, 308, -84,
694 -84, -84, 322, -84, 71, -84, -84, 322, -84, 216,
695 49, 24, -11, -13, 232, 23, -84, -84, 140, -84,
696 -84, 21, -84, -84, 16, 322, 322, 40, 197, -84,
697 -84, -84, 216, 216, 216, 216, 216, 216, 308, 22,
698 173, -84, 22, 30, -84, -84, -13, 47, -84, -84,
699 -84, -84, -84, -84, -84, 0, -84, 56, -84, 85,
700 93, 99, -84, -84, 210, -84, -84, -84, -84, -84,
701 36, -84, -84, -84, 139, 94, 94, 24, 24, 24,
702 23, -84, -84, 241, 78, 17, 0, 0, 85, -84,
703 -84, 178, 116, 125, 338, 271, 93, 99, -84, 22,
704 349, 139, -84, -84, -84, -84, 0, -84, -84, -84,
705 -84, -84, -84, 133, 136, -84, 197, 104, -84
708 /* YYPGOTO[NTERM-NUM]. */
709 static const yytype_int8 yypgoto[] =
711 -84, -84, -84, -84, -4, -17, -15, -83, -1, 110,
712 9, -84, -8, -84, 10, 54, -84, -84, -84, 51,
713 -51, 62, 33, -79, -28
716 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
717 positive, shift that token. If negative, reduce the rule which
718 number is the opposite. If YYTABLE_NINF, syntax error. */
719 #define YYTABLE_NINF -22
720 static const yytype_int16 yytable[] =
722 22, 49, 114, 50, 46, 47, 93, 31, 41, 44,
723 53, 26, 27, 42, -7, 119, 55, 56, 54, 28,
724 70, 46, 47, 6, 30, 40, 32, 45, 80, 44,
725 79, 77, 26, 48, 140, 52, 119, 53, 71, 141,
726 46, 47, 6, 30, 46, 47, 6, 30, 40, 120,
727 48, 55, 56, 147, 104, 105, 106, 107, 108, 109,
728 44, 67, 118, 78, 82, 137, 85, 60, 49, 48,
729 50, 40, 40, 40, 40, 40, 40, 111, 110, 63,
730 64, 65, 66, 89, 67, 135, 56, 89, 81, 46,
731 47, 6, 30, 135, 73, 74, 126, 135, 127, 138,
732 49, 139, 50, 116, 126, 131, 127, 86, 126, 117,
733 127, 23, 128, 131, 102, 103, 41, 131, 48, 49,
734 128, 50, 130, 136, 128, 38, -18, 43, 65, 66,
735 130, 67, 23, 40, 130, -20, 57, 58, 69, 59,
736 60, 61, 72, -19, 83, 84, -21, 76, 2, 3,
737 148, 115, 4, 5, 6, 7, -6, 8, 145, 9,
738 10, 11, 121, 0, 12, 87, 88, 0, 13, 0,
739 14, 63, 64, 65, 66, 0, 67, 0, 76, 15,
740 0, 16, 122, 123, 6, 30, 0, 8, 17, 9,
741 10, 11, 18, 29, 12, 6, 30, 0, 13, 62,
742 14, 46, 47, 6, 30, 63, 64, 65, 66, 15,
743 67, 124, 0, 0, 46, 47, 6, 30, 68, 0,
744 35, 5, 18, 125, 0, 0, 142, 9, 0, 0,
745 48, 0, 36, 0, 0, 0, 97, 0, 14, 98,
746 99, 0, 0, 48, 89, 122, 123, 6, 30, 16,
747 8, 0, 9, 10, 11, 118, 39, 12, 62, 0,
748 0, 13, 0, 14, 63, 64, 65, 66, 0, 67,
749 0, 0, 15, 81, 124, 122, 123, 6, 30, 0,
750 8, 68, 9, 10, 11, 18, 125, 12, 0, 35,
751 5, 13, 0, 14, 8, 0, 9, 10, 11, 0,
752 0, 12, 15, 0, 124, 13, 0, 14, 0, 0,
753 0, 68, 35, 5, 0, 18, 15, 8, 16, 9,
754 10, 11, 0, 0, 12, 17, 35, 5, 13, 18,
755 14, 8, 0, 9, 10, 0, 0, 0, 36, 15,
756 0, 16, 143, 144, 14, 0, 0, 0, 68, 9,
757 0, 0, 18, 15, 36, 16, 0, 0, 0, 0,
758 14, 0, 37, 57, 146, 0, 59, 60, 61, 0,
759 0, 16, 0, 0, 0, 0, 0, 0, 39
762 #define yypact_value_is_default(yystate) \
765 #define yytable_value_is_error(yytable_value) \
768 static const yytype_int16 yycheck[] =
770 1, 18, 85, 18, 4, 5, 57, 8, 16, 17,
771 21, 1, 8, 17, 8, 94, 29, 30, 22, 39,
772 28, 4, 5, 6, 7, 16, 25, 17, 41, 37,
773 41, 39, 22, 33, 117, 8, 115, 21, 28, 118,
774 4, 5, 6, 7, 4, 5, 6, 7, 39, 100,
775 33, 29, 30, 136, 62, 63, 64, 65, 66, 67,
776 68, 37, 45, 14, 41, 48, 45, 18, 85, 33,
777 85, 62, 63, 64, 65, 66, 67, 47, 68, 32,
778 33, 34, 35, 47, 37, 113, 30, 47, 41, 4,
779 5, 6, 7, 121, 23, 24, 113, 125, 113, 116,
780 117, 116, 117, 10, 121, 113, 121, 53, 125, 10,
781 125, 1, 113, 121, 60, 61, 124, 125, 33, 136,
782 121, 136, 113, 45, 125, 15, 10, 17, 34, 35,
783 121, 37, 22, 124, 125, 10, 14, 15, 28, 17,
784 18, 19, 32, 10, 4, 5, 10, 37, 0, 1,
785 46, 89, 4, 5, 6, 7, 8, 9, 125, 11,
786 12, 13, 111, -1, 16, 55, 56, -1, 20, -1,
787 22, 32, 33, 34, 35, -1, 37, -1, 68, 31,
788 -1, 33, 4, 5, 6, 7, -1, 9, 40, 11,
789 12, 13, 44, 4, 16, 6, 7, -1, 20, 26,
790 22, 4, 5, 6, 7, 32, 33, 34, 35, 31,
791 37, 33, -1, -1, 4, 5, 6, 7, 40, -1,
792 4, 5, 44, 45, -1, -1, 48, 11, -1, -1,
793 33, -1, 16, -1, -1, -1, 39, -1, 22, 42,
794 43, -1, -1, 33, 47, 4, 5, 6, 7, 33,
795 9, -1, 11, 12, 13, 45, 40, 16, 26, -1,
796 -1, 20, -1, 22, 32, 33, 34, 35, -1, 37,
797 -1, -1, 31, 41, 33, 4, 5, 6, 7, -1,
798 9, 40, 11, 12, 13, 44, 45, 16, -1, 4,
799 5, 20, -1, 22, 9, -1, 11, 12, 13, -1,
800 -1, 16, 31, -1, 33, 20, -1, 22, -1, -1,
801 -1, 40, 4, 5, -1, 44, 31, 9, 33, 11,
802 12, 13, -1, -1, 16, 40, 4, 5, 20, 44,
803 22, 9, -1, 11, 12, -1, -1, -1, 16, 31,
804 -1, 33, 4, 5, 22, -1, -1, -1, 40, 11,
805 -1, -1, 44, 31, 16, 33, -1, -1, -1, -1,
806 22, -1, 40, 14, 15, -1, 17, 18, 19, -1,
807 -1, 33, -1, -1, -1, -1, -1, -1, 40
810 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
811 symbol of state STATE-NUM. */
812 static const yytype_uint8 yystos[] =
814 0, 50, 0, 1, 4, 5, 6, 7, 9, 11,
815 12, 13, 16, 20, 22, 31, 33, 40, 44, 51,
816 52, 53, 57, 58, 59, 61, 63, 8, 39, 4,
817 7, 57, 25, 64, 65, 4, 16, 40, 58, 40,
818 59, 61, 53, 58, 61, 63, 4, 5, 33, 54,
819 55, 56, 8, 21, 53, 29, 30, 14, 15, 17,
820 18, 19, 26, 32, 33, 34, 35, 37, 40, 58,
821 61, 63, 58, 23, 24, 66, 58, 61, 14, 41,
822 41, 41, 41, 4, 5, 45, 64, 58, 58, 47,
823 54, 55, 57, 69, 70, 72, 73, 39, 42, 43,
824 60, 69, 64, 64, 61, 61, 61, 61, 61, 61,
825 63, 47, 67, 68, 56, 70, 10, 10, 45, 72,
826 69, 68, 4, 5, 33, 45, 54, 55, 57, 58,
827 59, 61, 62, 63, 71, 73, 45, 48, 54, 55,
828 56, 72, 48, 4, 5, 71, 15, 56, 46
831 #define yyerrok (yyerrstatus = 0)
832 #define yyclearin (yychar = YYEMPTY)
836 #define YYACCEPT goto yyacceptlab
837 #define YYABORT goto yyabortlab
838 #define YYERROR goto yyerrorlab
841 /* Like YYERROR except do call yyerror. This remains here temporarily
842 to ease the transition to the new meaning of YYERROR, for GCC.
843 Once GCC version 2 has supplanted version 1, this can go. However,
844 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
845 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
848 #define YYFAIL goto yyerrlab
850 /* This is here to suppress warnings from the GCC cpp's
851 -Wunused-macros. Normally we don't worry about that warning, but
852 some users do, and we want to make it easy for users to remove
853 YYFAIL uses, which will produce warnings from Bison 2.5. */
856 #define YYRECOVERING() (!!yyerrstatus)
858 #define YYBACKUP(Token, Value) \
860 if (yychar == YYEMPTY) \
864 YYPOPSTACK (yylen); \
870 yyerror (scanner, YY_("syntax error: cannot back up")); \
877 #define YYERRCODE 256
879 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
880 If N is 0, then set CURRENT to the empty location which ends
881 the previous symbol: RHS[0] (always defined). */
883 #ifndef YYLLOC_DEFAULT
884 # define YYLLOC_DEFAULT(Current, Rhs, N) \
888 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
889 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
890 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
891 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
895 (Current).first_line = (Current).last_line = \
896 YYRHSLOC (Rhs, 0).last_line; \
897 (Current).first_column = (Current).last_column = \
898 YYRHSLOC (Rhs, 0).last_column; \
903 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
907 /* This macro is provided for backward compatibility. */
909 #ifndef YY_LOCATION_PRINT
910 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
914 /* YYLEX -- calling `yylex' with the right arguments. */
917 # define YYLEX yylex (&yylval, YYLEX_PARAM)
919 # define YYLEX yylex (&yylval)
922 /* Enable debugging if requested. */
926 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
927 # define YYFPRINTF fprintf
930 # define YYDPRINTF(Args) \
936 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
940 YYFPRINTF (stderr, "%s ", Title); \
941 yy_symbol_print (stderr, \
942 Type, Value, scanner); \
943 YYFPRINTF (stderr, "\n"); \
948 /*--------------------------------.
949 | Print this symbol on YYOUTPUT. |
950 `--------------------------------*/
953 #if (defined __STDC__ || defined __C99__FUNC__ \
954 || defined __cplusplus || defined _MSC_VER)
956 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *scanner)
959 yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner)
962 YYSTYPE const * const yyvaluep;
966 FILE *yyo = yyoutput;
972 if (yytype < YYNTOKENS)
973 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
985 /*--------------------------------.
986 | Print this symbol on YYOUTPUT. |
987 `--------------------------------*/
989 #if (defined __STDC__ || defined __C99__FUNC__ \
990 || defined __cplusplus || defined _MSC_VER)
992 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *scanner)
995 yy_symbol_print (yyoutput, yytype, yyvaluep, scanner)
998 YYSTYPE const * const yyvaluep;
1002 if (yytype < YYNTOKENS)
1003 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1005 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1007 yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner);
1008 YYFPRINTF (yyoutput, ")");
1011 /*------------------------------------------------------------------.
1012 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1014 `------------------------------------------------------------------*/
1016 #if (defined __STDC__ || defined __C99__FUNC__ \
1017 || defined __cplusplus || defined _MSC_VER)
1019 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1022 yy_stack_print (yybottom, yytop)
1023 yytype_int16 *yybottom;
1024 yytype_int16 *yytop;
1027 YYFPRINTF (stderr, "Stack now");
1028 for (; yybottom <= yytop; yybottom++)
1030 int yybot = *yybottom;
1031 YYFPRINTF (stderr, " %d", yybot);
1033 YYFPRINTF (stderr, "\n");
1036 # define YY_STACK_PRINT(Bottom, Top) \
1039 yy_stack_print ((Bottom), (Top)); \
1043 /*------------------------------------------------.
1044 | Report that the YYRULE is going to be reduced. |
1045 `------------------------------------------------*/
1047 #if (defined __STDC__ || defined __C99__FUNC__ \
1048 || defined __cplusplus || defined _MSC_VER)
1050 yy_reduce_print (YYSTYPE *yyvsp, int yyrule, void *scanner)
1053 yy_reduce_print (yyvsp, yyrule, scanner)
1059 int yynrhs = yyr2[yyrule];
1061 unsigned long int yylno = yyrline[yyrule];
1062 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1064 /* The symbols being reduced. */
1065 for (yyi = 0; yyi < yynrhs; yyi++)
1067 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1068 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1069 &(yyvsp[(yyi + 1) - (yynrhs)])
1071 YYFPRINTF (stderr, "\n");
1075 # define YY_REDUCE_PRINT(Rule) \
1078 yy_reduce_print (yyvsp, Rule, scanner); \
1081 /* Nonzero means print parse trace. It is left uninitialized so that
1082 multiple parsers can coexist. */
1084 #else /* !YYDEBUG */
1085 # define YYDPRINTF(Args)
1086 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1087 # define YY_STACK_PRINT(Bottom, Top)
1088 # define YY_REDUCE_PRINT(Rule)
1089 #endif /* !YYDEBUG */
1092 /* YYINITDEPTH -- initial size of the parser's stacks. */
1094 # define YYINITDEPTH 200
1097 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1098 if the built-in stack extension method is used).
1100 Do not make this value too large; the results are undefined if
1101 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1102 evaluated with infinite-precision integer arithmetic. */
1105 # define YYMAXDEPTH 10000
1112 # if defined __GLIBC__ && defined _STRING_H
1113 # define yystrlen strlen
1115 /* Return the length of YYSTR. */
1116 #if (defined __STDC__ || defined __C99__FUNC__ \
1117 || defined __cplusplus || defined _MSC_VER)
1119 yystrlen (const char *yystr)
1127 for (yylen = 0; yystr[yylen]; yylen++)
1135 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1136 # define yystpcpy stpcpy
1138 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1140 #if (defined __STDC__ || defined __C99__FUNC__ \
1141 || defined __cplusplus || defined _MSC_VER)
1143 yystpcpy (char *yydest, const char *yysrc)
1146 yystpcpy (yydest, yysrc)
1152 const char *yys = yysrc;
1154 while ((*yyd++ = *yys++) != '\0')
1163 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1164 quotes and backslashes, so that it's suitable for yyerror. The
1165 heuristic is that double-quoting is unnecessary unless the string
1166 contains an apostrophe, a comma, or backslash (other than
1167 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1168 null, do not copy; instead, return the length of what the result
1171 yytnamerr (char *yyres, const char *yystr)
1176 char const *yyp = yystr;
1183 goto do_not_strip_quotes;
1187 goto do_not_strip_quotes;
1200 do_not_strip_quotes: ;
1204 return yystrlen (yystr);
1206 return yystpcpy (yyres, yystr) - yyres;
1210 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1211 about the unexpected token YYTOKEN for the state stack whose top is
1214 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1215 not large enough to hold the message. In that case, also set
1216 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1217 required number of bytes is too large to store. */
1219 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1220 yytype_int16 *yyssp, int yytoken)
1222 YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
1223 YYSIZE_T yysize = yysize0;
1225 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1226 /* Internationalized format string. */
1227 const char *yyformat = YY_NULL;
1228 /* Arguments of yyformat. */
1229 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1230 /* Number of reported tokens (one for the "unexpected", one per
1234 /* There are many possibilities here to consider:
1235 - Assume YYFAIL is not used. It's too flawed to consider. See
1236 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1237 for details. YYERROR is fine as it does not invoke this
1239 - If this state is a consistent state with a default action, then
1240 the only way this function was invoked is if the default action
1241 is an error action. In that case, don't check for expected
1242 tokens because there are none.
1243 - The only way there can be no lookahead present (in yychar) is if
1244 this state is a consistent state with a default action. Thus,
1245 detecting the absence of a lookahead is sufficient to determine
1246 that there is no unexpected or expected token to report. In that
1247 case, just report a simple "syntax error".
1248 - Don't assume there isn't a lookahead just because this state is a
1249 consistent state with a default action. There might have been a
1250 previous inconsistent state, consistent state with a non-default
1251 action, or user semantic action that manipulated yychar.
1252 - Of course, the expected token list depends on states to have
1253 correct lookahead information, and it depends on the parser not
1254 to perform extra reductions after fetching a lookahead from the
1255 scanner and before detecting a syntax error. Thus, state merging
1256 (from LALR or IELR) and default reductions corrupt the expected
1257 token list. However, the list is correct for canonical LR with
1258 one exception: it will still contain any token that will not be
1259 accepted due to an error action in a later state.
1261 if (yytoken != YYEMPTY)
1263 int yyn = yypact[*yyssp];
1264 yyarg[yycount++] = yytname[yytoken];
1265 if (!yypact_value_is_default (yyn))
1267 /* Start YYX at -YYN if negative to avoid negative indexes in
1268 YYCHECK. In other words, skip the first -YYN actions for
1269 this state because they are default actions. */
1270 int yyxbegin = yyn < 0 ? -yyn : 0;
1271 /* Stay within bounds of both yycheck and yytname. */
1272 int yychecklim = YYLAST - yyn + 1;
1273 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1276 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1277 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1278 && !yytable_value_is_error (yytable[yyx + yyn]))
1280 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1286 yyarg[yycount++] = yytname[yyx];
1287 yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1288 if (! (yysize <= yysize1
1289 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1298 # define YYCASE_(N, S) \
1302 YYCASE_(0, YY_("syntax error"));
1303 YYCASE_(1, YY_("syntax error, unexpected %s"));
1304 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1305 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1306 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1307 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1311 yysize1 = yysize + yystrlen (yyformat);
1312 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1316 if (*yymsg_alloc < yysize)
1318 *yymsg_alloc = 2 * yysize;
1319 if (! (yysize <= *yymsg_alloc
1320 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1321 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1325 /* Avoid sprintf, as that infringes on the user's name space.
1326 Don't have undefined behavior even if the translation
1327 produced a string with the wrong number of "%s"s. */
1331 while ((*yyp = *yyformat) != '\0')
1332 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1334 yyp += yytnamerr (yyp, yyarg[yyi++]);
1345 #endif /* YYERROR_VERBOSE */
1347 /*-----------------------------------------------.
1348 | Release the memory associated to this symbol. |
1349 `-----------------------------------------------*/
1352 #if (defined __STDC__ || defined __C99__FUNC__ \
1353 || defined __cplusplus || defined _MSC_VER)
1355 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void *scanner)
1358 yydestruct (yymsg, yytype, yyvaluep, scanner)
1370 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1375 /* Line 1381 of yacc.c */
1376 #line 173 "parser.y"
1377 { free(((*yyvaluep).str)); };
1378 /* Line 1381 of yacc.c */
1379 #line 1380 "parser.cpp"
1381 case 7: /* IDENTIFIER */
1382 /* Line 1381 of yacc.c */
1383 #line 173 "parser.y"
1384 { free(((*yyvaluep).str)); };
1385 /* Line 1381 of yacc.c */
1386 #line 1387 "parser.cpp"
1388 case 16: /* KEYWORD_POS */
1389 /* Line 1381 of yacc.c */
1390 #line 173 "parser.y"
1391 { free(((*yyvaluep).str)); };
1392 /* Line 1381 of yacc.c */
1393 #line 1394 "parser.cpp"
1395 case 23: /* PARAM */
1396 /* Line 1381 of yacc.c */
1397 #line 174 "parser.y"
1398 { if(((*yyvaluep).str)) free(((*yyvaluep).str)); };
1399 /* Line 1381 of yacc.c */
1400 #line 1401 "parser.cpp"
1402 case 26: /* CMP_OP */
1403 /* Line 1381 of yacc.c */
1404 #line 173 "parser.y"
1405 { free(((*yyvaluep).str)); };
1406 /* Line 1381 of yacc.c */
1407 #line 1408 "parser.cpp"
1409 case 50: /* commands */
1410 /* Line 1381 of yacc.c */
1411 #line 175 "parser.y"
1412 { delete ((*yyvaluep).sel); };
1413 /* Line 1381 of yacc.c */
1414 #line 1415 "parser.cpp"
1416 case 51: /* command */
1417 /* Line 1381 of yacc.c */
1418 #line 175 "parser.y"
1419 { delete ((*yyvaluep).sel); };
1420 /* Line 1381 of yacc.c */
1421 #line 1422 "parser.cpp"
1423 case 52: /* cmd_plain */
1424 /* Line 1381 of yacc.c */
1425 #line 175 "parser.y"
1426 { delete ((*yyvaluep).sel); };
1427 /* Line 1381 of yacc.c */
1428 #line 1429 "parser.cpp"
1430 case 53: /* selection */
1431 /* Line 1381 of yacc.c */
1432 #line 175 "parser.y"
1433 { delete ((*yyvaluep).sel); };
1434 /* Line 1381 of yacc.c */
1435 #line 1436 "parser.cpp"
1437 case 57: /* string */
1438 /* Line 1381 of yacc.c */
1439 #line 173 "parser.y"
1440 { free(((*yyvaluep).str)); };
1441 /* Line 1381 of yacc.c */
1442 #line 1443 "parser.cpp"
1444 case 58: /* sel_expr */
1445 /* Line 1381 of yacc.c */
1446 #line 176 "parser.y"
1447 { delete ((*yyvaluep).sel); };
1448 /* Line 1381 of yacc.c */
1449 #line 1450 "parser.cpp"
1451 case 59: /* pos_mod */
1452 /* Line 1381 of yacc.c */
1453 #line 174 "parser.y"
1454 { if(((*yyvaluep).str)) free(((*yyvaluep).str)); };
1455 /* Line 1381 of yacc.c */
1456 #line 1457 "parser.cpp"
1458 case 61: /* num_expr */
1459 /* Line 1381 of yacc.c */
1460 #line 176 "parser.y"
1461 { delete ((*yyvaluep).sel); };
1462 /* Line 1381 of yacc.c */
1463 #line 1464 "parser.cpp"
1465 case 62: /* str_expr */
1466 /* Line 1381 of yacc.c */
1467 #line 176 "parser.y"
1468 { delete ((*yyvaluep).sel); };
1469 /* Line 1381 of yacc.c */
1470 #line 1471 "parser.cpp"
1472 case 63: /* pos_expr */
1473 /* Line 1381 of yacc.c */
1474 #line 176 "parser.y"
1475 { delete ((*yyvaluep).sel); };
1476 /* Line 1381 of yacc.c */
1477 #line 1478 "parser.cpp"
1479 case 64: /* method_params */
1480 /* Line 1381 of yacc.c */
1481 #line 177 "parser.y"
1482 { delete ((*yyvaluep).plist); };
1483 /* Line 1381 of yacc.c */
1484 #line 1485 "parser.cpp"
1486 case 65: /* method_param_list */
1487 /* Line 1381 of yacc.c */
1488 #line 177 "parser.y"
1489 { delete ((*yyvaluep).plist); };
1490 /* Line 1381 of yacc.c */
1491 #line 1492 "parser.cpp"
1493 case 66: /* method_param */
1494 /* Line 1381 of yacc.c */
1495 #line 177 "parser.y"
1496 { delete ((*yyvaluep).param); };
1497 /* Line 1381 of yacc.c */
1498 #line 1499 "parser.cpp"
1500 case 67: /* value_list */
1501 /* Line 1381 of yacc.c */
1502 #line 178 "parser.y"
1503 { delete ((*yyvaluep).vlist); };
1504 /* Line 1381 of yacc.c */
1505 #line 1506 "parser.cpp"
1507 case 68: /* value_list_contents */
1508 /* Line 1381 of yacc.c */
1509 #line 178 "parser.y"
1510 { delete ((*yyvaluep).vlist); };
1511 /* Line 1381 of yacc.c */
1512 #line 1513 "parser.cpp"
1514 case 69: /* basic_value_list */
1515 /* Line 1381 of yacc.c */
1516 #line 178 "parser.y"
1517 { delete ((*yyvaluep).vlist); };
1518 /* Line 1381 of yacc.c */
1519 #line 1520 "parser.cpp"
1521 case 70: /* basic_value_list_contents */
1522 /* Line 1381 of yacc.c */
1523 #line 178 "parser.y"
1524 { delete ((*yyvaluep).vlist); };
1525 /* Line 1381 of yacc.c */
1526 #line 1527 "parser.cpp"
1528 case 71: /* value_item */
1529 /* Line 1381 of yacc.c */
1530 #line 179 "parser.y"
1531 { delete ((*yyvaluep).val); };
1532 /* Line 1381 of yacc.c */
1533 #line 1534 "parser.cpp"
1535 case 72: /* basic_value_item */
1536 /* Line 1381 of yacc.c */
1537 #line 179 "parser.y"
1538 { delete ((*yyvaluep).val); };
1539 /* Line 1381 of yacc.c */
1540 #line 1541 "parser.cpp"
1542 case 73: /* value_item_range */
1543 /* Line 1381 of yacc.c */
1544 #line 179 "parser.y"
1545 { delete ((*yyvaluep).val); };
1546 /* Line 1381 of yacc.c */
1547 #line 1548 "parser.cpp"
1559 /* Number of syntax errors so far. */
1563 /* Number of tokens to shift before error messages enabled. */
1566 /* The stacks and their tools:
1567 `yyss': related to states.
1568 `yyvs': related to semantic values.
1570 Refer to the stacks through separate pointers, to allow yyoverflow
1571 to reallocate them elsewhere. */
1573 /* The state stack. */
1574 yytype_int16 yyssa[YYINITDEPTH];
1576 yytype_int16 *yyssp;
1578 /* The semantic value stack. */
1579 YYSTYPE yyvsa[YYINITDEPTH];
1583 YYSIZE_T yystacksize;
1584 /* Used to determine if this is the first time this instance has
1589 /* Initialize the parser data structure. */
1590 #if (defined __STDC__ || defined __C99__FUNC__ \
1591 || defined __cplusplus || defined _MSC_VER)
1601 yyps = (yypstate *) malloc (sizeof *yyps);
1608 #if (defined __STDC__ || defined __C99__FUNC__ \
1609 || defined __cplusplus || defined _MSC_VER)
1611 yypstate_delete (yypstate *yyps)
1614 yypstate_delete (yyps)
1619 /* If the stack was reallocated but the parse did not complete, then the
1620 stack still needs to be freed. */
1621 if (!yyps->yynew && yyps->yyss != yyps->yyssa)
1622 YYSTACK_FREE (yyps->yyss);
1627 #define _gmx_sel_yynerrs yyps->_gmx_sel_yynerrs
1628 #define yystate yyps->yystate
1629 #define yyerrstatus yyps->yyerrstatus
1630 #define yyssa yyps->yyssa
1631 #define yyss yyps->yyss
1632 #define yyssp yyps->yyssp
1633 #define yyvsa yyps->yyvsa
1634 #define yyvs yyps->yyvs
1635 #define yyvsp yyps->yyvsp
1636 #define yystacksize yyps->yystacksize
1643 #if (defined __STDC__ || defined __C99__FUNC__ \
1644 || defined __cplusplus || defined _MSC_VER)
1646 yypush_parse (yypstate *yyps, int yypushed_char, YYSTYPE const *yypushed_val, void *scanner)
1649 yypush_parse (yyps, yypushed_char, yypushed_val, scanner)
1652 YYSTYPE const *yypushed_val;
1656 /* The lookahead symbol. */
1659 /* The semantic value of the lookahead symbol. */
1664 /* Lookahead token as an internal (translated) token number. */
1666 /* The variables used to return semantic value and location from the
1671 /* Buffer for error messages, and its allocated size. */
1673 char *yymsg = yymsgbuf;
1674 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1677 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1679 /* The number of symbols on the RHS of the reduced rule.
1680 Keep to zero when no symbol should be popped. */
1685 yyn = yypact[yystate];
1686 goto yyread_pushed_token;
1692 yystacksize = YYINITDEPTH;
1694 YYDPRINTF ((stderr, "Starting parse\n"));
1699 yychar = YYEMPTY; /* Cause a token to be read. */
1701 /* Initialize stack pointers.
1702 Waste one element of value and location stack
1703 so that they stay on the same level as the state stack.
1704 The wasted elements are never initialized. */
1709 /*------------------------------------------------------------.
1710 | yynewstate -- Push a new state, which is found in yystate. |
1711 `------------------------------------------------------------*/
1713 /* In all cases, when you get here, the value and location stacks
1714 have just been pushed. So pushing a state here evens the stacks. */
1720 if (yyss + yystacksize - 1 <= yyssp)
1722 /* Get the current used size of the three stacks, in elements. */
1723 YYSIZE_T yysize = yyssp - yyss + 1;
1727 /* Give user a chance to reallocate the stack. Use copies of
1728 these so that the &'s don't force the real ones into
1730 YYSTYPE *yyvs1 = yyvs;
1731 yytype_int16 *yyss1 = yyss;
1733 /* Each stack pointer address is followed by the size of the
1734 data in use in that stack, in bytes. This used to be a
1735 conditional around just the two extra args, but that might
1736 be undefined if yyoverflow is a macro. */
1737 yyoverflow (YY_("memory exhausted"),
1738 &yyss1, yysize * sizeof (*yyssp),
1739 &yyvs1, yysize * sizeof (*yyvsp),
1745 #else /* no yyoverflow */
1746 # ifndef YYSTACK_RELOCATE
1747 goto yyexhaustedlab;
1749 /* Extend the stack our own way. */
1750 if (YYMAXDEPTH <= yystacksize)
1751 goto yyexhaustedlab;
1753 if (YYMAXDEPTH < yystacksize)
1754 yystacksize = YYMAXDEPTH;
1757 yytype_int16 *yyss1 = yyss;
1758 union yyalloc *yyptr =
1759 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1761 goto yyexhaustedlab;
1762 YYSTACK_RELOCATE (yyss_alloc, yyss);
1763 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1764 # undef YYSTACK_RELOCATE
1766 YYSTACK_FREE (yyss1);
1769 #endif /* no yyoverflow */
1771 yyssp = yyss + yysize - 1;
1772 yyvsp = yyvs + yysize - 1;
1774 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1775 (unsigned long int) yystacksize));
1777 if (yyss + yystacksize - 1 <= yyssp)
1781 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1783 if (yystate == YYFINAL)
1793 /* Do appropriate processing given the current state. Read a
1794 lookahead token if we need one and don't already have one. */
1796 /* First try to decide what to do without reference to lookahead token. */
1797 yyn = yypact[yystate];
1798 if (yypact_value_is_default (yyn))
1801 /* Not known => get a lookahead token if don't already have one. */
1803 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1804 if (yychar == YYEMPTY)
1808 YYDPRINTF ((stderr, "Return for a new token:\n"));
1809 yyresult = YYPUSH_MORE;
1813 yyread_pushed_token:
1814 YYDPRINTF ((stderr, "Reading a token: "));
1815 yychar = yypushed_char;
1817 yylval = *yypushed_val;
1820 if (yychar <= YYEOF)
1822 yychar = yytoken = YYEOF;
1823 YYDPRINTF ((stderr, "Now at end of input.\n"));
1827 yytoken = YYTRANSLATE (yychar);
1828 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1831 /* If the proper action on seeing token YYTOKEN is to reduce or to
1832 detect an error, take that action. */
1834 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1839 if (yytable_value_is_error (yyn))
1845 /* Count tokens shifted since error; after three, turn off error
1850 /* Shift the lookahead token. */
1851 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1853 /* Discard the shifted token. */
1862 /*-----------------------------------------------------------.
1863 | yydefault -- do the default action for the current state. |
1864 `-----------------------------------------------------------*/
1866 yyn = yydefact[yystate];
1872 /*-----------------------------.
1873 | yyreduce -- Do a reduction. |
1874 `-----------------------------*/
1876 /* yyn is the number of a rule to reduce with. */
1879 /* If YYLEN is nonzero, implement the default value of the action:
1882 Otherwise, the following line sets YYVAL to garbage.
1883 This behavior is undocumented and Bison
1884 users should not rely upon it. Assigning to YYVAL
1885 unconditionally makes the parser a bit smaller, and it avoids a
1886 GCC warning that YYVAL may be used uninitialized. */
1887 yyval = yyvsp[1-yylen];
1890 YY_REDUCE_PRINT (yyn);
1894 /* Line 1787 of yacc.c */
1895 #line 193 "parser.y"
1898 set_empty((yyval.sel));
1904 /* Line 1787 of yacc.c */
1905 #line 199 "parser.y"
1908 set((yyval.sel), _gmx_sel_append_selection(get((yyvsp[(2) - (2)].sel)), get((yyvsp[(1) - (2)].sel)), scanner));
1909 if (_gmx_sel_parser_should_finish(scanner))
1916 /* Line 1787 of yacc.c */
1917 #line 209 "parser.y"
1918 { (yyval.sel) = (yyvsp[(1) - (2)].sel); }
1922 /* Line 1787 of yacc.c */
1923 #line 211 "parser.y"
1926 _gmx_selparser_error(scanner, "invalid selection '%s'",
1927 _gmx_sel_lexer_pselstr(scanner));
1928 _gmx_sel_lexer_clear_method_stack(scanner);
1929 if (_gmx_sel_is_lexer_interactive(scanner))
1931 _gmx_sel_lexer_clear_pselstr(scanner);
1938 set_empty((yyval.sel));
1944 /* Line 1787 of yacc.c */
1945 #line 232 "parser.y"
1948 set_empty((yyval.sel));
1954 /* Line 1787 of yacc.c */
1955 #line 238 "parser.y"
1958 SelectionTreeElementPointer s
1959 = _gmx_sel_init_group_by_id((yyvsp[(1) - (1)].i), scanner);
1960 SelectionTreeElementPointer p
1961 = _gmx_sel_init_position(s, NULL, scanner);
1963 set((yyval.sel), _gmx_sel_init_selection(NULL, p, scanner));
1969 /* Line 1787 of yacc.c */
1970 #line 249 "parser.y"
1973 scoped_ptr_sfree nameGuard((yyvsp[(1) - (1)].str));
1974 SelectionTreeElementPointer s
1975 = _gmx_sel_init_group_by_name((yyvsp[(1) - (1)].str), scanner);
1976 SelectionTreeElementPointer p
1977 = _gmx_sel_init_position(s, NULL, scanner);
1979 set((yyval.sel), _gmx_sel_init_selection(NULL, p, scanner));
1985 /* Line 1787 of yacc.c */
1986 #line 261 "parser.y"
1989 set((yyval.sel), _gmx_sel_init_selection(NULL, get((yyvsp[(1) - (1)].sel)), scanner));
1995 /* Line 1787 of yacc.c */
1996 #line 267 "parser.y"
1999 scoped_ptr_sfree nameGuard((yyvsp[(1) - (2)].str));
2000 set((yyval.sel), _gmx_sel_init_selection((yyvsp[(1) - (2)].str), get((yyvsp[(2) - (2)].sel)), scanner));
2006 /* Line 1787 of yacc.c */
2007 #line 274 "parser.y"
2010 scoped_ptr_sfree nameGuard((yyvsp[(1) - (3)].str));
2011 set((yyval.sel), _gmx_sel_assign_variable((yyvsp[(1) - (3)].str), get((yyvsp[(3) - (3)].sel)), scanner));
2017 /* Line 1787 of yacc.c */
2018 #line 281 "parser.y"
2021 scoped_ptr_sfree nameGuard((yyvsp[(1) - (3)].str));
2022 set((yyval.sel), _gmx_sel_assign_variable((yyvsp[(1) - (3)].str), get((yyvsp[(3) - (3)].sel)), scanner));
2028 /* Line 1787 of yacc.c */
2029 #line 288 "parser.y"
2032 scoped_ptr_sfree nameGuard((yyvsp[(1) - (3)].str));
2033 set((yyval.sel), _gmx_sel_assign_variable((yyvsp[(1) - (3)].str), get((yyvsp[(3) - (3)].sel)), scanner));
2039 /* Line 1787 of yacc.c */
2040 #line 297 "parser.y"
2041 { (yyval.sel) = (yyvsp[(1) - (1)].sel); }
2045 /* Line 1787 of yacc.c */
2046 #line 299 "parser.y"
2049 set((yyval.sel), _gmx_sel_init_position(get((yyvsp[(1) - (1)].sel)), NULL, scanner));
2050 CHECK_SEL((yyval.sel));
2056 /* Line 1787 of yacc.c */
2057 #line 305 "parser.y"
2058 { (yyval.sel) = (yyvsp[(2) - (3)].sel); }
2062 /* Line 1787 of yacc.c */
2063 #line 307 "parser.y"
2066 set((yyval.sel), _gmx_sel_init_modifier((yyvsp[(2) - (3)].meth), get((yyvsp[(3) - (3)].plist)), get((yyvsp[(1) - (3)].sel)), scanner));
2067 CHECK_SEL((yyval.sel));
2073 /* Line 1787 of yacc.c */
2074 #line 320 "parser.y"
2075 { (yyval.i) = (yyvsp[(1) - (1)].i); }
2079 /* Line 1787 of yacc.c */
2080 #line 321 "parser.y"
2081 { (yyval.i) = -(yyvsp[(2) - (2)].i); }
2085 /* Line 1787 of yacc.c */
2086 #line 325 "parser.y"
2087 { (yyval.r) = (yyvsp[(1) - (1)].r); }
2091 /* Line 1787 of yacc.c */
2092 #line 326 "parser.y"
2093 { (yyval.r) = -(yyvsp[(2) - (2)].r); }
2097 /* Line 1787 of yacc.c */
2098 #line 329 "parser.y"
2099 { (yyval.r) = (yyvsp[(1) - (1)].i); }
2103 /* Line 1787 of yacc.c */
2104 #line 330 "parser.y"
2105 { (yyval.r) = (yyvsp[(1) - (1)].r); }
2109 /* Line 1787 of yacc.c */
2110 #line 333 "parser.y"
2111 { (yyval.str) = (yyvsp[(1) - (1)].str); }
2115 /* Line 1787 of yacc.c */
2116 #line 334 "parser.y"
2117 { (yyval.str) = (yyvsp[(1) - (1)].str); }
2121 /* Line 1787 of yacc.c */
2122 #line 343 "parser.y"
2125 SelectionTreeElementPointer arg(get((yyvsp[(2) - (2)].sel)));
2126 SelectionTreeElementPointer sel(
2127 new SelectionTreeElement(SEL_BOOLEAN));
2128 sel->u.boolt = BOOL_NOT;
2130 set((yyval.sel), sel);
2136 /* Line 1787 of yacc.c */
2137 #line 354 "parser.y"
2140 SelectionTreeElementPointer arg1(get((yyvsp[(1) - (3)].sel))), arg2(get((yyvsp[(3) - (3)].sel)));
2141 SelectionTreeElementPointer sel(
2142 new SelectionTreeElement(SEL_BOOLEAN));
2143 sel->u.boolt = BOOL_AND;
2144 sel->child = arg1; sel->child->next = arg2;
2145 set((yyval.sel), sel);
2151 /* Line 1787 of yacc.c */
2152 #line 365 "parser.y"
2155 SelectionTreeElementPointer arg1(get((yyvsp[(1) - (3)].sel))), arg2(get((yyvsp[(3) - (3)].sel)));
2156 SelectionTreeElementPointer sel(
2157 new SelectionTreeElement(SEL_BOOLEAN));
2158 sel->u.boolt = BOOL_OR;
2159 sel->child = arg1; sel->child->next = arg2;
2160 set((yyval.sel), sel);
2166 /* Line 1787 of yacc.c */
2167 #line 375 "parser.y"
2168 { (yyval.sel) = (yyvsp[(2) - (3)].sel); }
2172 /* Line 1787 of yacc.c */
2173 #line 380 "parser.y"
2176 scoped_ptr_sfree opGuard((yyvsp[(2) - (3)].str));
2177 set((yyval.sel), _gmx_sel_init_comparison(get((yyvsp[(1) - (3)].sel)), get((yyvsp[(3) - (3)].sel)), (yyvsp[(2) - (3)].str), scanner));
2178 CHECK_SEL((yyval.sel));
2184 /* Line 1787 of yacc.c */
2185 #line 391 "parser.y"
2188 scoped_ptr_sfree nameGuard((yyvsp[(2) - (2)].str));
2189 set((yyval.sel), _gmx_sel_init_group_by_name((yyvsp[(2) - (2)].str), scanner));
2195 /* Line 1787 of yacc.c */
2196 #line 398 "parser.y"
2199 set((yyval.sel), _gmx_sel_init_group_by_id((yyvsp[(2) - (2)].i), scanner));
2205 /* Line 1787 of yacc.c */
2206 #line 406 "parser.y"
2207 { (yyval.str) = NULL; }
2211 /* Line 1787 of yacc.c */
2212 #line 407 "parser.y"
2213 { (yyval.str) = (yyvsp[(1) - (1)].str); }
2217 /* Line 1787 of yacc.c */
2218 #line 412 "parser.y"
2219 { (yyval.smt) = gmx::eStringMatchType_RegularExpression; }
2223 /* Line 1787 of yacc.c */
2224 #line 413 "parser.y"
2225 { (yyval.smt) = gmx::eStringMatchType_Wildcard; }
2229 /* Line 1787 of yacc.c */
2230 #line 414 "parser.y"
2231 { (yyval.smt) = gmx::eStringMatchType_Exact; }
2235 /* Line 1787 of yacc.c */
2236 #line 419 "parser.y"
2239 scoped_ptr_sfree posmodGuard((yyvsp[(1) - (2)].str));
2240 set((yyval.sel), _gmx_sel_init_keyword((yyvsp[(2) - (2)].meth), SelectionParserValueListPointer(), (yyvsp[(1) - (2)].str), scanner));
2241 CHECK_SEL((yyval.sel));
2247 /* Line 1787 of yacc.c */
2248 #line 427 "parser.y"
2251 scoped_ptr_sfree posmodGuard((yyvsp[(1) - (3)].str));
2252 set((yyval.sel), _gmx_sel_init_keyword_strmatch((yyvsp[(2) - (3)].meth), gmx::eStringMatchType_Auto, get((yyvsp[(3) - (3)].vlist)), (yyvsp[(1) - (3)].str), scanner));
2253 CHECK_SEL((yyval.sel));
2259 /* Line 1787 of yacc.c */
2260 #line 435 "parser.y"
2263 scoped_ptr_sfree posmodGuard((yyvsp[(1) - (4)].str));
2264 set((yyval.sel), _gmx_sel_init_keyword_strmatch((yyvsp[(2) - (4)].meth), (yyvsp[(3) - (4)].smt), get((yyvsp[(4) - (4)].vlist)), (yyvsp[(1) - (4)].str), scanner));
2265 CHECK_SEL((yyval.sel));
2271 /* Line 1787 of yacc.c */
2272 #line 443 "parser.y"
2275 scoped_ptr_sfree posmodGuard((yyvsp[(1) - (3)].str));
2276 set((yyval.sel), _gmx_sel_init_keyword((yyvsp[(2) - (3)].meth), get((yyvsp[(3) - (3)].vlist)), (yyvsp[(1) - (3)].str), scanner));
2277 CHECK_SEL((yyval.sel));
2283 /* Line 1787 of yacc.c */
2284 #line 454 "parser.y"
2287 scoped_ptr_sfree posmodGuard((yyvsp[(1) - (3)].str));
2288 set((yyval.sel), _gmx_sel_init_method((yyvsp[(2) - (3)].meth), get((yyvsp[(3) - (3)].plist)), (yyvsp[(1) - (3)].str), scanner));
2289 CHECK_SEL((yyval.sel));
2295 /* Line 1787 of yacc.c */
2296 #line 469 "parser.y"
2299 SelectionTreeElementPointer sel(
2300 new SelectionTreeElement(SEL_CONST));
2301 _gmx_selelem_set_vtype(sel, INT_VALUE);
2302 _gmx_selvalue_reserve(&sel->v, 1);
2303 sel->v.u.i[0] = (yyvsp[(1) - (1)].i);
2304 set((yyval.sel), sel);
2310 /* Line 1787 of yacc.c */
2311 #line 480 "parser.y"
2314 SelectionTreeElementPointer sel(
2315 new SelectionTreeElement(SEL_CONST));
2316 _gmx_selelem_set_vtype(sel, REAL_VALUE);
2317 _gmx_selvalue_reserve(&sel->v, 1);
2318 sel->v.u.r[0] = (yyvsp[(1) - (1)].r);
2319 set((yyval.sel), sel);
2325 /* Line 1787 of yacc.c */
2326 #line 494 "parser.y"
2329 scoped_ptr_sfree posmodGuard((yyvsp[(1) - (2)].str));
2330 set((yyval.sel), _gmx_sel_init_keyword((yyvsp[(2) - (2)].meth), SelectionParserValueListPointer(), (yyvsp[(1) - (2)].str), scanner));
2331 CHECK_SEL((yyval.sel));
2337 /* Line 1787 of yacc.c */
2338 #line 502 "parser.y"
2341 scoped_ptr_sfree posmodGuard((yyvsp[(1) - (3)].str));
2342 set((yyval.sel), _gmx_sel_init_method((yyvsp[(2) - (3)].meth), get((yyvsp[(3) - (3)].plist)), (yyvsp[(1) - (3)].str), scanner));
2343 CHECK_SEL((yyval.sel));
2349 /* Line 1787 of yacc.c */
2350 #line 513 "parser.y"
2353 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[(1) - (3)].sel)), get((yyvsp[(3) - (3)].sel)), '+', scanner));
2359 /* Line 1787 of yacc.c */
2360 #line 519 "parser.y"
2363 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[(1) - (3)].sel)), get((yyvsp[(3) - (3)].sel)), '-', scanner));
2369 /* Line 1787 of yacc.c */
2370 #line 525 "parser.y"
2373 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[(1) - (3)].sel)), get((yyvsp[(3) - (3)].sel)), '*', scanner));
2379 /* Line 1787 of yacc.c */
2380 #line 531 "parser.y"
2383 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[(1) - (3)].sel)), get((yyvsp[(3) - (3)].sel)), '/', scanner));
2389 /* Line 1787 of yacc.c */
2390 #line 537 "parser.y"
2393 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[(2) - (2)].sel)), SelectionTreeElementPointer(), '-', scanner));
2399 /* Line 1787 of yacc.c */
2400 #line 543 "parser.y"
2403 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[(1) - (3)].sel)), get((yyvsp[(3) - (3)].sel)), '^', scanner));
2409 /* Line 1787 of yacc.c */
2410 #line 548 "parser.y"
2411 { (yyval.sel) = (yyvsp[(2) - (3)].sel); }
2415 /* Line 1787 of yacc.c */
2416 #line 556 "parser.y"
2419 SelectionTreeElementPointer sel(
2420 new SelectionTreeElement(SEL_CONST));
2421 _gmx_selelem_set_vtype(sel, STR_VALUE);
2422 _gmx_selvalue_reserve(&sel->v, 1);
2423 sel->v.u.s[0] = (yyvsp[(1) - (1)].str);
2424 set((yyval.sel), sel);
2430 /* Line 1787 of yacc.c */
2431 #line 567 "parser.y"
2434 scoped_ptr_sfree posmodGuard((yyvsp[(1) - (2)].str));
2435 set((yyval.sel), _gmx_sel_init_keyword((yyvsp[(2) - (2)].meth), SelectionParserValueListPointer(), (yyvsp[(1) - (2)].str), scanner));
2436 CHECK_SEL((yyval.sel));
2442 /* Line 1787 of yacc.c */
2443 #line 582 "parser.y"
2446 set((yyval.sel), _gmx_sel_init_const_position((yyvsp[(2) - (7)].r), (yyvsp[(4) - (7)].r), (yyvsp[(6) - (7)].r)));
2452 /* Line 1787 of yacc.c */
2453 #line 590 "parser.y"
2454 { (yyval.sel) = (yyvsp[(2) - (3)].sel); }
2458 /* Line 1787 of yacc.c */
2459 #line 595 "parser.y"
2462 set((yyval.sel), _gmx_sel_init_method((yyvsp[(1) - (2)].meth), get((yyvsp[(2) - (2)].plist)), NULL, scanner));
2463 CHECK_SEL((yyval.sel));
2469 /* Line 1787 of yacc.c */
2470 #line 605 "parser.y"
2473 scoped_ptr_sfree keywordGuard((yyvsp[(1) - (3)].str));
2474 set((yyval.sel), _gmx_sel_init_position(get((yyvsp[(3) - (3)].sel)), (yyvsp[(1) - (3)].str), scanner));
2475 CHECK_SEL((yyval.sel));
2481 /* Line 1787 of yacc.c */
2482 #line 619 "parser.y"
2485 set((yyval.sel), _gmx_sel_init_variable_ref(get((yyvsp[(1) - (1)].sel))));
2491 /* Line 1787 of yacc.c */
2492 #line 627 "parser.y"
2495 set((yyval.sel), _gmx_sel_init_variable_ref(get((yyvsp[(1) - (1)].sel))));
2501 /* Line 1787 of yacc.c */
2502 #line 635 "parser.y"
2505 set((yyval.sel), _gmx_sel_init_variable_ref(get((yyvsp[(1) - (1)].sel))));
2511 /* Line 1787 of yacc.c */
2512 #line 648 "parser.y"
2513 { (yyval.plist) = (yyvsp[(1) - (1)].plist); }
2517 /* Line 1787 of yacc.c */
2518 #line 650 "parser.y"
2519 { (yyval.plist) = (yyvsp[(1) - (2)].plist); }
2523 /* Line 1787 of yacc.c */
2524 #line 655 "parser.y"
2527 set((yyval.plist), SelectionParserParameter::createList());
2533 /* Line 1787 of yacc.c */
2534 #line 661 "parser.y"
2537 SelectionParserParameterListPointer list(get((yyvsp[(1) - (2)].plist)));
2538 list->push_back(get((yyvsp[(2) - (2)].param)));
2539 set((yyval.plist), move(list));
2545 /* Line 1787 of yacc.c */
2546 #line 672 "parser.y"
2549 scoped_ptr_sfree nameGuard((yyvsp[(1) - (2)].str));
2550 set((yyval.param), SelectionParserParameter::create((yyvsp[(1) - (2)].str), get((yyvsp[(2) - (2)].vlist))));
2556 /* Line 1787 of yacc.c */
2557 #line 680 "parser.y"
2558 { (yyval.vlist) = (yyvsp[(1) - (1)].vlist); }
2562 /* Line 1787 of yacc.c */
2563 #line 681 "parser.y"
2564 { (yyval.vlist) = (yyvsp[(2) - (3)].vlist); }
2568 /* Line 1787 of yacc.c */
2569 #line 686 "parser.y"
2572 set((yyval.vlist), SelectionParserValue::createList());
2578 /* Line 1787 of yacc.c */
2579 #line 692 "parser.y"
2582 SelectionParserValueListPointer list(get((yyvsp[(1) - (2)].vlist)));
2583 list->push_back(get((yyvsp[(2) - (2)].val)));
2584 set((yyval.vlist), move(list));
2590 /* Line 1787 of yacc.c */
2591 #line 700 "parser.y"
2594 SelectionParserValueListPointer list(get((yyvsp[(1) - (3)].vlist)));
2595 list->push_back(get((yyvsp[(3) - (3)].val)));
2596 set((yyval.vlist), move(list));
2602 /* Line 1787 of yacc.c */
2603 #line 710 "parser.y"
2604 { (yyval.vlist) = (yyvsp[(1) - (1)].vlist); }
2608 /* Line 1787 of yacc.c */
2609 #line 711 "parser.y"
2610 { (yyval.vlist) = (yyvsp[(2) - (3)].vlist); }
2614 /* Line 1787 of yacc.c */
2615 #line 716 "parser.y"
2618 set((yyval.vlist), SelectionParserValue::createList(get((yyvsp[(1) - (1)].val))));
2624 /* Line 1787 of yacc.c */
2625 #line 722 "parser.y"
2628 SelectionParserValueListPointer list(get((yyvsp[(1) - (2)].vlist)));
2629 list->push_back(get((yyvsp[(2) - (2)].val)));
2630 set((yyval.vlist), move(list));
2636 /* Line 1787 of yacc.c */
2637 #line 730 "parser.y"
2640 SelectionParserValueListPointer list(get((yyvsp[(1) - (3)].vlist)));
2641 list->push_back(get((yyvsp[(3) - (3)].val)));
2642 set((yyval.vlist), move(list));
2648 /* Line 1787 of yacc.c */
2649 #line 740 "parser.y"
2652 set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[(1) - (1)].sel))));
2658 /* Line 1787 of yacc.c */
2659 #line 746 "parser.y"
2662 set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[(1) - (1)].sel))));
2668 /* Line 1787 of yacc.c */
2669 #line 752 "parser.y"
2672 set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[(1) - (1)].sel))));
2678 /* Line 1787 of yacc.c */
2679 #line 758 "parser.y"
2682 set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[(1) - (1)].sel))));
2688 /* Line 1787 of yacc.c */
2689 #line 763 "parser.y"
2690 { (yyval.val) = (yyvsp[(1) - (1)].val); }
2694 /* Line 1787 of yacc.c */
2695 #line 768 "parser.y"
2698 set((yyval.val), SelectionParserValue::createInteger((yyvsp[(1) - (1)].i)));
2704 /* Line 1787 of yacc.c */
2705 #line 774 "parser.y"
2708 set((yyval.val), SelectionParserValue::createReal((yyvsp[(1) - (1)].r)));
2714 /* Line 1787 of yacc.c */
2715 #line 780 "parser.y"
2718 scoped_ptr_sfree stringGuard((yyvsp[(1) - (1)].str));
2719 set((yyval.val), SelectionParserValue::createString((yyvsp[(1) - (1)].str)));
2725 /* Line 1787 of yacc.c */
2726 #line 786 "parser.y"
2727 { (yyval.val) = (yyvsp[(1) - (1)].val); }
2731 /* Line 1787 of yacc.c */
2732 #line 791 "parser.y"
2735 set((yyval.val), SelectionParserValue::createIntegerRange((yyvsp[(1) - (3)].i), (yyvsp[(3) - (3)].i)));
2741 /* Line 1787 of yacc.c */
2742 #line 797 "parser.y"
2745 set((yyval.val), SelectionParserValue::createRealRange((yyvsp[(1) - (3)].i), (yyvsp[(3) - (3)].r)));
2751 /* Line 1787 of yacc.c */
2752 #line 803 "parser.y"
2755 set((yyval.val), SelectionParserValue::createRealRange((yyvsp[(1) - (3)].r), (yyvsp[(3) - (3)].r)));
2761 /* Line 1787 of yacc.c */
2762 #line 2763 "parser.cpp"
2765 /* User semantic actions sometimes alter yychar, and that requires
2766 that yytoken be updated with the new translation. We take the
2767 approach of translating immediately before every use of yytoken.
2768 One alternative is translating here after every semantic action,
2769 but that translation would be missed if the semantic action invokes
2770 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2771 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2772 incorrect destructor might then be invoked immediately. In the
2773 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2774 to an incorrect destructor call or verbose syntax error message
2775 before the lookahead is translated. */
2776 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2780 YY_STACK_PRINT (yyss, yyssp);
2784 /* Now `shift' the result of the reduction. Determine what state
2785 that goes to, based on the state we popped back to and the rule
2786 number reduced by. */
2790 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2791 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2792 yystate = yytable[yystate];
2794 yystate = yydefgoto[yyn - YYNTOKENS];
2799 /*------------------------------------.
2800 | yyerrlab -- here on detecting error |
2801 `------------------------------------*/
2803 /* Make sure we have latest lookahead translation. See comments at
2804 user semantic actions for why this is necessary. */
2805 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2807 /* If not already recovering from an error, report this error. */
2811 #if ! YYERROR_VERBOSE
2812 yyerror (scanner, YY_("syntax error"));
2814 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2817 char const *yymsgp = YY_("syntax error");
2818 int yysyntax_error_status;
2819 yysyntax_error_status = YYSYNTAX_ERROR;
2820 if (yysyntax_error_status == 0)
2822 else if (yysyntax_error_status == 1)
2824 if (yymsg != yymsgbuf)
2825 YYSTACK_FREE (yymsg);
2826 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2830 yymsg_alloc = sizeof yymsgbuf;
2831 yysyntax_error_status = 2;
2835 yysyntax_error_status = YYSYNTAX_ERROR;
2839 yyerror (scanner, yymsgp);
2840 if (yysyntax_error_status == 2)
2841 goto yyexhaustedlab;
2843 # undef YYSYNTAX_ERROR
2849 if (yyerrstatus == 3)
2851 /* If just tried and failed to reuse lookahead token after an
2852 error, discard it. */
2854 if (yychar <= YYEOF)
2856 /* Return failure if at end of input. */
2857 if (yychar == YYEOF)
2862 yydestruct ("Error: discarding",
2863 yytoken, &yylval, scanner);
2868 /* Else will try to reuse lookahead token after shifting the error
2873 /*---------------------------------------------------.
2874 | yyerrorlab -- error raised explicitly by YYERROR. |
2875 `---------------------------------------------------*/
2878 /* Pacify compilers like GCC when the user code never invokes
2879 YYERROR and the label yyerrorlab therefore never appears in user
2881 if (/*CONSTCOND*/ 0)
2884 /* Do not reclaim the symbols of the rule which action triggered
2888 YY_STACK_PRINT (yyss, yyssp);
2893 /*-------------------------------------------------------------.
2894 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2895 `-------------------------------------------------------------*/
2897 yyerrstatus = 3; /* Each real token shifted decrements this. */
2901 yyn = yypact[yystate];
2902 if (!yypact_value_is_default (yyn))
2905 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2913 /* Pop the current state because it cannot handle the error token. */
2918 yydestruct ("Error: popping",
2919 yystos[yystate], yyvsp, scanner);
2922 YY_STACK_PRINT (yyss, yyssp);
2928 /* Shift the error token. */
2929 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2935 /*-------------------------------------.
2936 | yyacceptlab -- YYACCEPT comes here. |
2937 `-------------------------------------*/
2942 /*-----------------------------------.
2943 | yyabortlab -- YYABORT comes here. |
2944 `-----------------------------------*/
2949 #if !defined yyoverflow || YYERROR_VERBOSE
2950 /*-------------------------------------------------.
2951 | yyexhaustedlab -- memory exhaustion comes here. |
2952 `-------------------------------------------------*/
2954 yyerror (scanner, YY_("memory exhausted"));
2960 if (yychar != YYEMPTY)
2962 /* Make sure we have latest lookahead translation. See comments at
2963 user semantic actions for why this is necessary. */
2964 yytoken = YYTRANSLATE (yychar);
2965 yydestruct ("Cleanup: discarding lookahead",
2966 yytoken, &yylval, scanner);
2968 /* Do not reclaim the symbols of the rule which action triggered
2969 this YYABORT or YYACCEPT. */
2971 YY_STACK_PRINT (yyss, yyssp);
2972 while (yyssp != yyss)
2974 yydestruct ("Cleanup: popping",
2975 yystos[*yyssp], yyvsp, scanner);
2980 YYSTACK_FREE (yyss);
2986 if (yymsg != yymsgbuf)
2987 YYSTACK_FREE (yymsg);
2989 /* Make sure YYID is used. */
2990 return YYID (yyresult);