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/legacyheaders/smalloc.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, 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
201 VARIABLE_NUMERIC = 268,
202 VARIABLE_GROUP = 269,
204 KEYWORD_NUMERIC = 271,
208 METHOD_NUMERIC = 275,
228 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
229 typedef union YYSTYPE
231 /* Line 350 of yacc.c */
237 struct gmx_ana_selmethod_t *meth;
239 gmx::SelectionStringMatchType smt;
241 gmx::SelectionTreeElementPointer *sel;
242 gmx::SelectionParserValue *val;
243 gmx::SelectionParserValueListPointer *vlist;
244 gmx::SelectionParserParameter *param;
245 gmx::SelectionParserParameterListPointer *plist;
248 /* Line 350 of yacc.c */
249 #line 250 "parser.cpp"
251 # define YYSTYPE_IS_TRIVIAL 1
252 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
253 # define YYSTYPE_IS_DECLARED 1
257 #ifndef YYPUSH_MORE_DEFINED
258 # define YYPUSH_MORE_DEFINED
259 enum { YYPUSH_MORE = 4 };
262 typedef struct _gmx_sel_yypstate _gmx_sel_yypstate;
264 #if defined __STDC__ || defined __cplusplus
265 int _gmx_sel_yypush_parse (_gmx_sel_yypstate *ps, int pushed_char, YYSTYPE const *pushed_val, void *scanner);
267 int _gmx_sel_yypush_parse ();
270 #if defined __STDC__ || defined __cplusplus
271 _gmx_sel_yypstate * _gmx_sel_yypstate_new (void);
273 _gmx_sel_yypstate * _gmx_sel_yypstate_new ();
275 #if defined __STDC__ || defined __cplusplus
276 void _gmx_sel_yypstate_delete (_gmx_sel_yypstate *ps);
278 void _gmx_sel_yypstate_delete ();
281 #endif /* !_GMX_SEL_YY_PARSER_H */
283 /* Copy the second part of user declarations. */
285 /* Line 353 of yacc.c */
286 #line 287 "parser.cpp"
293 typedef YYTYPE_UINT8 yytype_uint8;
295 typedef unsigned char yytype_uint8;
299 typedef YYTYPE_INT8 yytype_int8;
300 #elif (defined __STDC__ || defined __C99__FUNC__ \
301 || defined __cplusplus || defined _MSC_VER)
302 typedef signed char yytype_int8;
304 typedef short int yytype_int8;
308 typedef YYTYPE_UINT16 yytype_uint16;
310 typedef unsigned short int yytype_uint16;
314 typedef YYTYPE_INT16 yytype_int16;
316 typedef short int yytype_int16;
320 # ifdef __SIZE_TYPE__
321 # define YYSIZE_T __SIZE_TYPE__
322 # elif defined size_t
323 # define YYSIZE_T size_t
324 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
325 || defined __cplusplus || defined _MSC_VER)
326 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
327 # define YYSIZE_T size_t
329 # define YYSIZE_T unsigned int
333 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
336 # if defined YYENABLE_NLS && YYENABLE_NLS
338 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
339 # define YY_(msgid) dgettext ("bison-runtime", msgid)
343 # define YY_(msgid) msgid
347 /* Suppress unused-variable warnings by "using" E. */
348 #if ! defined lint || defined __GNUC__
349 # define YYUSE(e) ((void) (e))
351 # define YYUSE(e) /* empty */
354 /* Identity function, used to suppress warnings about constant conditions. */
358 #if (defined __STDC__ || defined __C99__FUNC__ \
359 || defined __cplusplus || defined _MSC_VER)
372 #if ! defined yyoverflow || YYERROR_VERBOSE
374 /* The parser invokes alloca or malloc; define the necessary symbols. */
376 # ifdef YYSTACK_ALLOC
377 /* Pacify GCC's `empty if-body' warning. */
378 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
379 # ifndef YYSTACK_ALLOC_MAXIMUM
380 /* The OS might guarantee only one guard page at the bottom of the stack,
381 and a page size can be as small as 4096 bytes. So we cannot safely
382 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
383 to allow for a few compiler-allocated temporary stack slots. */
384 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
387 # define YYSTACK_ALLOC YYMALLOC
388 # define YYSTACK_FREE YYFREE
389 # ifndef YYSTACK_ALLOC_MAXIMUM
390 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
392 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
393 && ! ((defined YYMALLOC || defined malloc) \
394 && (defined YYFREE || defined free)))
395 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
396 # ifndef EXIT_SUCCESS
397 # define EXIT_SUCCESS 0
401 # define YYMALLOC malloc
402 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
403 || defined __cplusplus || defined _MSC_VER)
404 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
409 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
410 || defined __cplusplus || defined _MSC_VER)
411 void free (void *); /* INFRINGES ON USER NAME SPACE */
415 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
418 #if (! defined yyoverflow \
419 && (! defined __cplusplus \
420 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
422 /* A type that is properly aligned for any stack member. */
425 yytype_int16 yyss_alloc;
429 /* The size of the maximum gap between one aligned stack and the next. */
430 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
432 /* The size of an array large to enough to hold all stacks, each with
434 # define YYSTACK_BYTES(N) \
435 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
436 + YYSTACK_GAP_MAXIMUM)
438 # define YYCOPY_NEEDED 1
440 /* Relocate STACK from its old location to the new one. The
441 local variables YYSIZE and YYSTACKSIZE give the old and new number of
442 elements in the stack, and YYPTR gives the new location of the
443 stack. Advance YYPTR to a properly aligned location for the next
445 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
448 YYSIZE_T yynewbytes; \
449 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
450 Stack = &yyptr->Stack_alloc; \
451 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
452 yyptr += yynewbytes / sizeof (*yyptr); \
458 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
459 /* Copy COUNT objects from SRC to DST. The source and destination do
462 # if defined __GNUC__ && 1 < __GNUC__
463 # define YYCOPY(Dst, Src, Count) \
464 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
466 # define YYCOPY(Dst, Src, Count) \
470 for (yyi = 0; yyi < (Count); yyi++) \
471 (Dst)[yyi] = (Src)[yyi]; \
476 #endif /* !YYCOPY_NEEDED */
478 /* YYFINAL -- State number of the termination state. */
480 /* YYLAST -- Last index in YYTABLE. */
483 /* YYNTOKENS -- Number of terminals. */
485 /* YYNNTS -- Number of nonterminals. */
487 /* YYNRULES -- Number of rules. */
489 /* YYNRULES -- Number of states. */
490 #define YYNSTATES 153
492 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
494 #define YYMAXUTOK 290
496 #define YYTRANSLATE(YYX) \
497 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
499 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
500 static const yytype_uint8 yytranslate[] =
502 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
503 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
504 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
505 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
506 42, 43, 36, 34, 47, 35, 2, 37, 2, 2,
507 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
508 2, 41, 2, 45, 2, 2, 2, 2, 2, 2,
509 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
510 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
511 2, 46, 2, 48, 39, 2, 2, 2, 2, 2,
512 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
513 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
514 2, 2, 2, 49, 2, 50, 44, 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, 2, 2, 2, 2,
526 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
527 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
528 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
529 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
530 25, 26, 27, 28, 29, 30, 31, 32, 33, 38,
535 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
537 static const yytype_uint16 yyprhs[] =
539 0, 0, 3, 4, 7, 10, 13, 14, 16, 18,
540 20, 22, 25, 29, 33, 37, 40, 41, 44, 46,
541 48, 52, 56, 58, 61, 63, 66, 68, 70, 72,
542 74, 77, 81, 85, 89, 93, 96, 99, 101, 103,
543 105, 107, 109, 112, 116, 121, 125, 129, 131, 133,
544 136, 140, 144, 148, 152, 156, 159, 163, 167, 169,
545 172, 180, 184, 187, 191, 193, 195, 197, 199, 202,
546 203, 206, 209, 211, 215, 216, 219, 223, 225, 229,
547 231, 234, 238, 240, 242, 244, 246, 248, 250, 252,
551 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
552 static const yytype_int8 yyrhs[] =
554 52, 0, -1, -1, 52, 53, -1, 54, 10, -1,
555 1, 10, -1, -1, 55, -1, 6, -1, 61, -1,
556 57, -1, 61, 57, -1, 9, 41, 62, -1, 9,
557 41, 65, -1, 9, 41, 67, -1, 4, 56, -1,
558 -1, 56, 5, -1, 67, -1, 62, -1, 42, 57,
559 43, -1, 57, 23, 68, -1, 6, -1, 35, 6,
560 -1, 7, -1, 35, 7, -1, 58, -1, 59, -1,
561 8, -1, 9, -1, 33, 62, -1, 62, 32, 62,
562 -1, 62, 31, 62, -1, 42, 62, 43, -1, 65,
563 28, 65, -1, 11, 61, -1, 11, 6, -1, 24,
564 -1, 18, -1, 44, -1, 45, -1, 41, -1, 63,
565 19, -1, 63, 17, 73, -1, 63, 17, 64, 73,
566 -1, 63, 16, 73, -1, 63, 21, 68, -1, 6,
567 -1, 7, -1, 63, 16, -1, 63, 20, 68, -1,
568 65, 34, 65, -1, 65, 35, 65, -1, 65, 36,
569 65, -1, 65, 37, 65, -1, 35, 65, -1, 65,
570 39, 65, -1, 42, 65, 43, -1, 61, -1, 63,
571 17, -1, 46, 60, 47, 60, 47, 60, 48, -1,
572 42, 67, 43, -1, 22, 68, -1, 18, 27, 62,
573 -1, 14, -1, 13, -1, 15, -1, 69, -1, 69,
574 26, -1, -1, 69, 70, -1, 25, 71, -1, 72,
575 -1, 49, 72, 50, -1, -1, 72, 75, -1, 72,
576 47, 75, -1, 74, -1, 49, 74, 50, -1, 76,
577 -1, 74, 76, -1, 74, 47, 76, -1, 62, -1,
578 67, -1, 65, -1, 66, -1, 77, -1, 58, -1,
579 59, -1, 61, -1, 77, -1, 58, 12, 58, -1,
580 58, 12, 59, -1, 59, 12, 60, -1
583 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
584 static const yytype_uint16 yyrline[] =
586 0, 199, 199, 204, 215, 216, 238, 244, 250, 261,
587 273, 279, 286, 293, 300, 311, 320, 325, 336, 337,
588 344, 345, 359, 360, 364, 365, 368, 369, 372, 373,
589 381, 392, 403, 414, 418, 429, 436, 445, 446, 451,
590 452, 453, 457, 465, 473, 481, 492, 507, 518, 532,
591 540, 551, 557, 563, 569, 575, 581, 587, 594, 605,
592 620, 629, 633, 643, 657, 665, 673, 686, 688, 694,
593 699, 710, 719, 720, 725, 730, 738, 749, 750, 754,
594 760, 768, 778, 784, 790, 796, 802, 806, 812, 818,
599 #if YYDEBUG || YYERROR_VERBOSE || 0
600 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
601 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
602 static const char *const yytname[] =
604 "$end", "error", "$undefined", "INVALID", "HELP", "HELP_TOPIC",
605 "TOK_INT", "TOK_REAL", "STR", "IDENTIFIER", "CMD_SEP", "GROUP", "TO",
606 "VARIABLE_NUMERIC", "VARIABLE_GROUP", "VARIABLE_POS", "KEYWORD_NUMERIC",
607 "KEYWORD_STR", "KEYWORD_POS", "KEYWORD_GROUP", "METHOD_NUMERIC",
608 "METHOD_GROUP", "METHOD_POS", "MODIFIER", "EMPTY_POSMOD", "PARAM",
609 "END_OF_METHOD", "OF", "CMP_OP", "PARAM_REDUCT", "XOR", "OR", "AND",
610 "NOT", "'+'", "'-'", "'*'", "'/'", "UNARY_NEG", "'^'", "NUM_REDUCT",
611 "'='", "'('", "')'", "'~'", "'?'", "'['", "','", "']'", "'{'", "'}'",
612 "$accept", "commands", "command", "cmd_plain", "help_request",
613 "help_topic", "selection", "integer_number", "real_number", "number",
614 "string", "sel_expr", "pos_mod", "str_match_type", "num_expr",
615 "str_expr", "pos_expr", "method_params", "method_param_list",
616 "method_param", "value_list", "value_list_contents", "basic_value_list",
617 "basic_value_list_contents", "value_item", "basic_value_item",
618 "value_item_range", YY_NULL
623 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
625 static const yytype_uint16 yytoknum[] =
627 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
628 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
629 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
630 285, 286, 287, 288, 43, 45, 42, 47, 289, 94,
631 290, 61, 40, 41, 126, 63, 91, 44, 93, 123,
636 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
637 static const yytype_uint8 yyr1[] =
639 0, 51, 52, 52, 53, 53, 54, 54, 54, 54,
640 54, 54, 54, 54, 54, 55, 56, 56, 57, 57,
641 57, 57, 58, 58, 59, 59, 60, 60, 61, 61,
642 62, 62, 62, 62, 62, 62, 62, 63, 63, 64,
643 64, 64, 62, 62, 62, 62, 62, 65, 65, 65,
644 65, 65, 65, 65, 65, 65, 65, 65, 66, 66,
645 67, 67, 67, 67, 62, 65, 67, 68, 68, 69,
646 69, 70, 71, 71, 72, 72, 72, 73, 73, 74,
647 74, 74, 75, 75, 75, 75, 75, 76, 76, 76,
651 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
652 static const yytype_uint8 yyr2[] =
654 0, 2, 0, 2, 2, 2, 0, 1, 1, 1,
655 1, 2, 3, 3, 3, 2, 0, 2, 1, 1,
656 3, 3, 1, 2, 1, 2, 1, 1, 1, 1,
657 2, 3, 3, 3, 3, 2, 2, 1, 1, 1,
658 1, 1, 2, 3, 4, 3, 3, 1, 1, 2,
659 3, 3, 3, 3, 3, 2, 3, 3, 1, 2,
660 7, 3, 2, 3, 1, 1, 1, 1, 2, 0,
661 2, 2, 1, 3, 0, 2, 3, 1, 3, 1,
662 2, 3, 1, 1, 1, 1, 1, 1, 1, 1,
666 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
667 Performed when YYTABLE doesn't specify something else to do. Zero
668 means the default is an error. */
669 static const yytype_uint8 yydefact[] =
671 2, 0, 1, 0, 16, 47, 48, 28, 29, 0,
672 65, 64, 66, 38, 69, 37, 0, 0, 0, 0,
673 3, 0, 7, 10, 9, 19, 0, 0, 18, 5,
674 15, 0, 36, 29, 35, 0, 62, 67, 47, 38,
675 0, 30, 0, 0, 55, 0, 19, 0, 18, 22,
676 24, 0, 26, 27, 0, 4, 69, 11, 0, 0,
677 49, 0, 42, 69, 69, 0, 0, 0, 0, 0,
678 0, 17, 0, 12, 13, 14, 63, 74, 68, 70,
679 0, 0, 49, 20, 33, 57, 61, 23, 25, 0,
680 21, 32, 31, 0, 87, 88, 89, 45, 77, 79,
681 90, 41, 39, 40, 0, 43, 50, 46, 34, 51,
682 52, 53, 54, 56, 0, 74, 71, 72, 0, 0,
683 0, 0, 0, 80, 44, 0, 47, 48, 0, 0,
684 0, 0, 58, 82, 0, 84, 85, 83, 75, 86,
685 0, 78, 91, 92, 93, 81, 73, 47, 48, 76,
689 /* YYDEFGOTO[NTERM-NUM]. */
690 static const yytype_int16 yydefgoto[] =
692 -1, 1, 20, 21, 22, 30, 23, 94, 95, 54,
693 96, 133, 26, 104, 27, 136, 137, 36, 37, 79,
694 116, 117, 105, 98, 138, 99, 100
697 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
699 #define YYPACT_NINF -95
700 static const yytype_int16 yypact[] =
702 -95, 134, -95, 2, -95, 4, -95, -95, -17, 145,
703 -95, -95, -95, 1, -95, -95, 283, 299, 246, 20,
704 -95, 23, -95, 18, 246, 87, 323, 150, -95, -95,
705 44, 269, -95, -95, -95, 283, -95, 57, -95, -95,
706 283, -95, 299, 78, 15, 19, -22, 193, 58, -95,
707 -95, 167, -95, -95, 59, -95, -95, 18, 283, 283,
708 81, 51, -95, -95, -95, 299, 299, 299, 299, 299,
709 299, -95, 269, 87, 150, -95, 87, 61, -95, -95,
710 -22, 293, -95, -95, -95, -95, -95, -95, -95, 20,
711 -95, 76, -95, 11, 102, 108, -95, -95, 187, -95,
712 -95, -95, -95, -95, 153, -95, -95, -95, 315, 161,
713 161, 15, 15, 15, 58, -95, -95, 202, 82, -3,
714 20, 20, 11, -95, -95, 157, 119, 127, 313, 232,
715 102, 108, -95, 87, 340, 315, -95, -95, -95, -95,
716 20, -95, -95, -95, -95, -95, -95, 138, 143, -95,
720 /* YYPGOTO[NTERM-NUM]. */
721 static const yytype_int8 yypgoto[] =
723 -95, -95, -95, -95, -95, -95, 67, -18, -8, -87,
724 -1, 21, 8, -95, -2, -95, 12, 41, -95, -95,
725 -95, 42, -53, 84, 53, -50, -94
728 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
729 positive, shift that token. If negative, reduce the rule which
730 number is the opposite. If YYTABLE_NINF, syntax error. */
731 #define YYTABLE_NINF -26
732 static const yytype_int16 yytable[] =
734 24, 52, 118, 49, 50, 7, 33, 97, 34, 58,
735 59, 53, 29, 28, -8, 44, 47, 49, 50, 7,
736 33, 84, 25, 139, 31, 43, 49, 50, 35, 74,
737 48, 139, 51, 55, 144, 139, 28, 41, 47, 46,
738 81, 56, 56, 75, 122, 25, 51, 141, 123, 71,
739 43, 124, 73, 151, 70, 51, 76, 49, 50, 7,
740 33, 80, 83, 108, 109, 110, 111, 112, 113, 123,
741 47, 52, 145, 43, 43, 43, 43, 43, 43, 91,
742 92, 53, 77, 78, 114, 45, 51, 49, 50, 7,
743 33, 57, 101, 80, 82, 102, 103, 90, 63, 130,
744 93, 86, 142, 52, 106, 107, 89, 130, 59, 131,
745 115, 130, 143, 53, 120, 135, 132, 131, 58, 59,
746 121, 131, 52, 135, 132, 134, 44, 135, 132, 140,
747 93, -22, 53, 134, 2, 3, 43, 134, 4, -24,
748 5, 6, 7, 8, -6, 9, 152, 10, 11, 12,
749 -23, 32, 13, 7, 33, -25, 14, 125, 15, 49,
750 50, 7, 33, 126, 127, 7, 33, 16, 9, 17,
751 10, 11, 12, 87, 88, 13, 18, 119, 65, 14,
752 19, 15, 149, 0, 66, 67, 68, 69, 51, 70,
753 16, 0, 128, 49, 50, 7, 33, 68, 69, 72,
754 70, 0, 93, 19, 129, 0, 0, 146, 126, 127,
755 7, 33, 0, 9, 0, 10, 11, 12, 0, 0,
756 13, 65, 51, 0, 14, 0, 15, 66, 67, 68,
757 69, 0, 70, 0, 122, 16, 85, 128, 126, 127,
758 7, 33, 0, 9, 72, 10, 11, 12, 19, 129,
759 13, 0, 38, 6, 14, 0, 15, 9, 0, 10,
760 11, 12, 0, 0, 13, 16, 0, 128, 14, 0,
761 15, 0, 0, 0, 72, 38, 6, 0, 19, 16,
762 9, 17, 10, 11, 12, 0, 0, 13, 18, 38,
763 6, 14, 19, 15, 9, 0, 10, 11, 0, 0,
764 0, 39, 16, 0, 17, 38, 6, 15, 0, 0,
765 0, 72, 10, 0, 0, 19, 16, 39, 17, 147,
766 148, 0, 0, 15, 0, 40, 10, 66, 67, 68,
767 69, 39, 70, 0, 17, 0, 85, 15, 0, 60,
768 61, 42, 62, 63, 64, 0, 0, 0, 17, 66,
769 67, 68, 69, 0, 70, 42, 60, 150, 0, 62,
773 #define yypact_value_is_default(yystate) \
776 #define yytable_value_is_error(yytable_value) \
779 static const yytype_int16 yycheck[] =
781 1, 19, 89, 6, 7, 8, 9, 60, 9, 31,
782 32, 19, 10, 1, 10, 17, 18, 6, 7, 8,
783 9, 43, 1, 117, 41, 17, 6, 7, 27, 31,
784 18, 125, 35, 10, 121, 129, 24, 16, 40, 18,
785 42, 23, 23, 31, 47, 24, 35, 50, 98, 5,
786 42, 104, 31, 140, 39, 35, 35, 6, 7, 8,
787 9, 40, 43, 65, 66, 67, 68, 69, 70, 119,
788 72, 89, 122, 65, 66, 67, 68, 69, 70, 58,
789 59, 89, 25, 26, 72, 18, 35, 6, 7, 8,
790 9, 24, 41, 72, 16, 44, 45, 56, 20, 117,
791 49, 43, 120, 121, 63, 64, 47, 125, 32, 117,
792 49, 129, 120, 121, 12, 117, 117, 125, 31, 32,
793 12, 129, 140, 125, 125, 117, 128, 129, 129, 47,
794 49, 12, 140, 125, 0, 1, 128, 129, 4, 12,
795 6, 7, 8, 9, 10, 11, 48, 13, 14, 15,
796 12, 6, 18, 8, 9, 12, 22, 115, 24, 6,
797 7, 8, 9, 6, 7, 8, 9, 33, 11, 35,
798 13, 14, 15, 6, 7, 18, 42, 93, 28, 22,
799 46, 24, 129, -1, 34, 35, 36, 37, 35, 39,
800 33, -1, 35, 6, 7, 8, 9, 36, 37, 42,
801 39, -1, 49, 46, 47, -1, -1, 50, 6, 7,
802 8, 9, -1, 11, -1, 13, 14, 15, -1, -1,
803 18, 28, 35, -1, 22, -1, 24, 34, 35, 36,
804 37, -1, 39, -1, 47, 33, 43, 35, 6, 7,
805 8, 9, -1, 11, 42, 13, 14, 15, 46, 47,
806 18, -1, 6, 7, 22, -1, 24, 11, -1, 13,
807 14, 15, -1, -1, 18, 33, -1, 35, 22, -1,
808 24, -1, -1, -1, 42, 6, 7, -1, 46, 33,
809 11, 35, 13, 14, 15, -1, -1, 18, 42, 6,
810 7, 22, 46, 24, 11, -1, 13, 14, -1, -1,
811 -1, 18, 33, -1, 35, 6, 7, 24, -1, -1,
812 -1, 42, 13, -1, -1, 46, 33, 18, 35, 6,
813 7, -1, -1, 24, -1, 42, 13, 34, 35, 36,
814 37, 18, 39, -1, 35, -1, 43, 24, -1, 16,
815 17, 42, 19, 20, 21, -1, -1, -1, 35, 34,
816 35, 36, 37, -1, 39, 42, 16, 17, -1, 19,
820 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
821 symbol of state STATE-NUM. */
822 static const yytype_uint8 yystos[] =
824 0, 52, 0, 1, 4, 6, 7, 8, 9, 11,
825 13, 14, 15, 18, 22, 24, 33, 35, 42, 46,
826 53, 54, 55, 57, 61, 62, 63, 65, 67, 10,
827 56, 41, 6, 9, 61, 27, 68, 69, 6, 18,
828 42, 62, 42, 63, 65, 57, 62, 65, 67, 6,
829 7, 35, 58, 59, 60, 10, 23, 57, 31, 32,
830 16, 17, 19, 20, 21, 28, 34, 35, 36, 37,
831 39, 5, 42, 62, 65, 67, 62, 25, 26, 70,
832 62, 65, 16, 43, 43, 43, 43, 6, 7, 47,
833 68, 62, 62, 49, 58, 59, 61, 73, 74, 76,
834 77, 41, 44, 45, 64, 73, 68, 68, 65, 65,
835 65, 65, 65, 65, 67, 49, 71, 72, 60, 74,
836 12, 12, 47, 76, 73, 72, 6, 7, 35, 47,
837 58, 59, 61, 62, 63, 65, 66, 67, 75, 77,
838 47, 50, 58, 59, 60, 76, 50, 6, 7, 75,
842 #define yyerrok (yyerrstatus = 0)
843 #define yyclearin (yychar = YYEMPTY)
847 #define YYACCEPT goto yyacceptlab
848 #define YYABORT goto yyabortlab
849 #define YYERROR goto yyerrorlab
852 /* Like YYERROR except do call yyerror. This remains here temporarily
853 to ease the transition to the new meaning of YYERROR, for GCC.
854 Once GCC version 2 has supplanted version 1, this can go. However,
855 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
856 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
859 #define YYFAIL goto yyerrlab
861 /* This is here to suppress warnings from the GCC cpp's
862 -Wunused-macros. Normally we don't worry about that warning, but
863 some users do, and we want to make it easy for users to remove
864 YYFAIL uses, which will produce warnings from Bison 2.5. */
867 #define YYRECOVERING() (!!yyerrstatus)
869 #define YYBACKUP(Token, Value) \
871 if (yychar == YYEMPTY) \
875 YYPOPSTACK (yylen); \
881 yyerror (scanner, YY_("syntax error: cannot back up")); \
888 #define YYERRCODE 256
890 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
891 If N is 0, then set CURRENT to the empty location which ends
892 the previous symbol: RHS[0] (always defined). */
894 #ifndef YYLLOC_DEFAULT
895 # define YYLLOC_DEFAULT(Current, Rhs, N) \
899 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
900 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
901 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
902 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
906 (Current).first_line = (Current).last_line = \
907 YYRHSLOC (Rhs, 0).last_line; \
908 (Current).first_column = (Current).last_column = \
909 YYRHSLOC (Rhs, 0).last_column; \
914 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
918 /* This macro is provided for backward compatibility. */
920 #ifndef YY_LOCATION_PRINT
921 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
925 /* YYLEX -- calling `yylex' with the right arguments. */
928 # define YYLEX yylex (&yylval, YYLEX_PARAM)
930 # define YYLEX yylex (&yylval)
933 /* Enable debugging if requested. */
937 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
938 # define YYFPRINTF fprintf
941 # define YYDPRINTF(Args) \
947 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
951 YYFPRINTF (stderr, "%s ", Title); \
952 yy_symbol_print (stderr, \
953 Type, Value, scanner); \
954 YYFPRINTF (stderr, "\n"); \
959 /*--------------------------------.
960 | Print this symbol on YYOUTPUT. |
961 `--------------------------------*/
964 #if (defined __STDC__ || defined __C99__FUNC__ \
965 || defined __cplusplus || defined _MSC_VER)
967 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *scanner)
970 yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner)
973 YYSTYPE const * const yyvaluep;
977 FILE *yyo = yyoutput;
983 if (yytype < YYNTOKENS)
984 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
996 /*--------------------------------.
997 | Print this symbol on YYOUTPUT. |
998 `--------------------------------*/
1000 #if (defined __STDC__ || defined __C99__FUNC__ \
1001 || defined __cplusplus || defined _MSC_VER)
1003 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *scanner)
1006 yy_symbol_print (yyoutput, yytype, yyvaluep, scanner)
1009 YYSTYPE const * const yyvaluep;
1013 if (yytype < YYNTOKENS)
1014 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1016 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1018 yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner);
1019 YYFPRINTF (yyoutput, ")");
1022 /*------------------------------------------------------------------.
1023 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1025 `------------------------------------------------------------------*/
1027 #if (defined __STDC__ || defined __C99__FUNC__ \
1028 || defined __cplusplus || defined _MSC_VER)
1030 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1033 yy_stack_print (yybottom, yytop)
1034 yytype_int16 *yybottom;
1035 yytype_int16 *yytop;
1038 YYFPRINTF (stderr, "Stack now");
1039 for (; yybottom <= yytop; yybottom++)
1041 int yybot = *yybottom;
1042 YYFPRINTF (stderr, " %d", yybot);
1044 YYFPRINTF (stderr, "\n");
1047 # define YY_STACK_PRINT(Bottom, Top) \
1050 yy_stack_print ((Bottom), (Top)); \
1054 /*------------------------------------------------.
1055 | Report that the YYRULE is going to be reduced. |
1056 `------------------------------------------------*/
1058 #if (defined __STDC__ || defined __C99__FUNC__ \
1059 || defined __cplusplus || defined _MSC_VER)
1061 yy_reduce_print (YYSTYPE *yyvsp, int yyrule, void *scanner)
1064 yy_reduce_print (yyvsp, yyrule, scanner)
1070 int yynrhs = yyr2[yyrule];
1072 unsigned long int yylno = yyrline[yyrule];
1073 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1075 /* The symbols being reduced. */
1076 for (yyi = 0; yyi < yynrhs; yyi++)
1078 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1079 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1080 &(yyvsp[(yyi + 1) - (yynrhs)])
1082 YYFPRINTF (stderr, "\n");
1086 # define YY_REDUCE_PRINT(Rule) \
1089 yy_reduce_print (yyvsp, Rule, scanner); \
1092 /* Nonzero means print parse trace. It is left uninitialized so that
1093 multiple parsers can coexist. */
1095 #else /* !YYDEBUG */
1096 # define YYDPRINTF(Args)
1097 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1098 # define YY_STACK_PRINT(Bottom, Top)
1099 # define YY_REDUCE_PRINT(Rule)
1100 #endif /* !YYDEBUG */
1103 /* YYINITDEPTH -- initial size of the parser's stacks. */
1105 # define YYINITDEPTH 200
1108 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1109 if the built-in stack extension method is used).
1111 Do not make this value too large; the results are undefined if
1112 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1113 evaluated with infinite-precision integer arithmetic. */
1116 # define YYMAXDEPTH 10000
1123 # if defined __GLIBC__ && defined _STRING_H
1124 # define yystrlen strlen
1126 /* Return the length of YYSTR. */
1127 #if (defined __STDC__ || defined __C99__FUNC__ \
1128 || defined __cplusplus || defined _MSC_VER)
1130 yystrlen (const char *yystr)
1138 for (yylen = 0; yystr[yylen]; yylen++)
1146 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1147 # define yystpcpy stpcpy
1149 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1151 #if (defined __STDC__ || defined __C99__FUNC__ \
1152 || defined __cplusplus || defined _MSC_VER)
1154 yystpcpy (char *yydest, const char *yysrc)
1157 yystpcpy (yydest, yysrc)
1163 const char *yys = yysrc;
1165 while ((*yyd++ = *yys++) != '\0')
1174 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1175 quotes and backslashes, so that it's suitable for yyerror. The
1176 heuristic is that double-quoting is unnecessary unless the string
1177 contains an apostrophe, a comma, or backslash (other than
1178 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1179 null, do not copy; instead, return the length of what the result
1182 yytnamerr (char *yyres, const char *yystr)
1187 char const *yyp = yystr;
1194 goto do_not_strip_quotes;
1198 goto do_not_strip_quotes;
1211 do_not_strip_quotes: ;
1215 return yystrlen (yystr);
1217 return yystpcpy (yyres, yystr) - yyres;
1221 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1222 about the unexpected token YYTOKEN for the state stack whose top is
1225 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1226 not large enough to hold the message. In that case, also set
1227 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1228 required number of bytes is too large to store. */
1230 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1231 yytype_int16 *yyssp, int yytoken)
1233 YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
1234 YYSIZE_T yysize = yysize0;
1236 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1237 /* Internationalized format string. */
1238 const char *yyformat = YY_NULL;
1239 /* Arguments of yyformat. */
1240 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1241 /* Number of reported tokens (one for the "unexpected", one per
1245 /* There are many possibilities here to consider:
1246 - Assume YYFAIL is not used. It's too flawed to consider. See
1247 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1248 for details. YYERROR is fine as it does not invoke this
1250 - If this state is a consistent state with a default action, then
1251 the only way this function was invoked is if the default action
1252 is an error action. In that case, don't check for expected
1253 tokens because there are none.
1254 - The only way there can be no lookahead present (in yychar) is if
1255 this state is a consistent state with a default action. Thus,
1256 detecting the absence of a lookahead is sufficient to determine
1257 that there is no unexpected or expected token to report. In that
1258 case, just report a simple "syntax error".
1259 - Don't assume there isn't a lookahead just because this state is a
1260 consistent state with a default action. There might have been a
1261 previous inconsistent state, consistent state with a non-default
1262 action, or user semantic action that manipulated yychar.
1263 - Of course, the expected token list depends on states to have
1264 correct lookahead information, and it depends on the parser not
1265 to perform extra reductions after fetching a lookahead from the
1266 scanner and before detecting a syntax error. Thus, state merging
1267 (from LALR or IELR) and default reductions corrupt the expected
1268 token list. However, the list is correct for canonical LR with
1269 one exception: it will still contain any token that will not be
1270 accepted due to an error action in a later state.
1272 if (yytoken != YYEMPTY)
1274 int yyn = yypact[*yyssp];
1275 yyarg[yycount++] = yytname[yytoken];
1276 if (!yypact_value_is_default (yyn))
1278 /* Start YYX at -YYN if negative to avoid negative indexes in
1279 YYCHECK. In other words, skip the first -YYN actions for
1280 this state because they are default actions. */
1281 int yyxbegin = yyn < 0 ? -yyn : 0;
1282 /* Stay within bounds of both yycheck and yytname. */
1283 int yychecklim = YYLAST - yyn + 1;
1284 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1287 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1288 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1289 && !yytable_value_is_error (yytable[yyx + yyn]))
1291 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1297 yyarg[yycount++] = yytname[yyx];
1298 yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1299 if (! (yysize <= yysize1
1300 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1309 # define YYCASE_(N, S) \
1313 YYCASE_(0, YY_("syntax error"));
1314 YYCASE_(1, YY_("syntax error, unexpected %s"));
1315 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1316 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1317 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1318 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1322 yysize1 = yysize + yystrlen (yyformat);
1323 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1327 if (*yymsg_alloc < yysize)
1329 *yymsg_alloc = 2 * yysize;
1330 if (! (yysize <= *yymsg_alloc
1331 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1332 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1336 /* Avoid sprintf, as that infringes on the user's name space.
1337 Don't have undefined behavior even if the translation
1338 produced a string with the wrong number of "%s"s. */
1342 while ((*yyp = *yyformat) != '\0')
1343 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1345 yyp += yytnamerr (yyp, yyarg[yyi++]);
1356 #endif /* YYERROR_VERBOSE */
1358 /*-----------------------------------------------.
1359 | Release the memory associated to this symbol. |
1360 `-----------------------------------------------*/
1363 #if (defined __STDC__ || defined __C99__FUNC__ \
1364 || defined __cplusplus || defined _MSC_VER)
1366 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void *scanner)
1369 yydestruct (yymsg, yytype, yyvaluep, scanner)
1381 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1385 case 5: /* HELP_TOPIC */
1386 /* Line 1381 of yacc.c */
1387 #line 178 "parser.y"
1388 { free(((*yyvaluep).str)); };
1389 /* Line 1381 of yacc.c */
1390 #line 1391 "parser.cpp"
1393 /* Line 1381 of yacc.c */
1394 #line 178 "parser.y"
1395 { free(((*yyvaluep).str)); };
1396 /* Line 1381 of yacc.c */
1397 #line 1398 "parser.cpp"
1399 case 9: /* IDENTIFIER */
1400 /* Line 1381 of yacc.c */
1401 #line 178 "parser.y"
1402 { free(((*yyvaluep).str)); };
1403 /* Line 1381 of yacc.c */
1404 #line 1405 "parser.cpp"
1406 case 18: /* KEYWORD_POS */
1407 /* Line 1381 of yacc.c */
1408 #line 178 "parser.y"
1409 { free(((*yyvaluep).str)); };
1410 /* Line 1381 of yacc.c */
1411 #line 1412 "parser.cpp"
1413 case 25: /* PARAM */
1414 /* Line 1381 of yacc.c */
1415 #line 179 "parser.y"
1416 { if(((*yyvaluep).str)) free(((*yyvaluep).str)); };
1417 /* Line 1381 of yacc.c */
1418 #line 1419 "parser.cpp"
1420 case 28: /* CMP_OP */
1421 /* Line 1381 of yacc.c */
1422 #line 178 "parser.y"
1423 { free(((*yyvaluep).str)); };
1424 /* Line 1381 of yacc.c */
1425 #line 1426 "parser.cpp"
1427 case 52: /* commands */
1428 /* Line 1381 of yacc.c */
1429 #line 180 "parser.y"
1430 { delete ((*yyvaluep).sel); };
1431 /* Line 1381 of yacc.c */
1432 #line 1433 "parser.cpp"
1434 case 53: /* command */
1435 /* Line 1381 of yacc.c */
1436 #line 180 "parser.y"
1437 { delete ((*yyvaluep).sel); };
1438 /* Line 1381 of yacc.c */
1439 #line 1440 "parser.cpp"
1441 case 54: /* cmd_plain */
1442 /* Line 1381 of yacc.c */
1443 #line 180 "parser.y"
1444 { delete ((*yyvaluep).sel); };
1445 /* Line 1381 of yacc.c */
1446 #line 1447 "parser.cpp"
1448 case 56: /* help_topic */
1449 /* Line 1381 of yacc.c */
1450 #line 185 "parser.y"
1451 { delete ((*yyvaluep).vlist); };
1452 /* Line 1381 of yacc.c */
1453 #line 1454 "parser.cpp"
1455 case 57: /* selection */
1456 /* Line 1381 of yacc.c */
1457 #line 180 "parser.y"
1458 { delete ((*yyvaluep).sel); };
1459 /* Line 1381 of yacc.c */
1460 #line 1461 "parser.cpp"
1462 case 61: /* string */
1463 /* Line 1381 of yacc.c */
1464 #line 178 "parser.y"
1465 { free(((*yyvaluep).str)); };
1466 /* Line 1381 of yacc.c */
1467 #line 1468 "parser.cpp"
1469 case 62: /* sel_expr */
1470 /* Line 1381 of yacc.c */
1471 #line 181 "parser.y"
1472 { delete ((*yyvaluep).sel); };
1473 /* Line 1381 of yacc.c */
1474 #line 1475 "parser.cpp"
1476 case 63: /* pos_mod */
1477 /* Line 1381 of yacc.c */
1478 #line 179 "parser.y"
1479 { if(((*yyvaluep).str)) free(((*yyvaluep).str)); };
1480 /* Line 1381 of yacc.c */
1481 #line 1482 "parser.cpp"
1483 case 65: /* num_expr */
1484 /* Line 1381 of yacc.c */
1485 #line 181 "parser.y"
1486 { delete ((*yyvaluep).sel); };
1487 /* Line 1381 of yacc.c */
1488 #line 1489 "parser.cpp"
1490 case 66: /* str_expr */
1491 /* Line 1381 of yacc.c */
1492 #line 181 "parser.y"
1493 { delete ((*yyvaluep).sel); };
1494 /* Line 1381 of yacc.c */
1495 #line 1496 "parser.cpp"
1497 case 67: /* pos_expr */
1498 /* Line 1381 of yacc.c */
1499 #line 181 "parser.y"
1500 { delete ((*yyvaluep).sel); };
1501 /* Line 1381 of yacc.c */
1502 #line 1503 "parser.cpp"
1504 case 68: /* method_params */
1505 /* Line 1381 of yacc.c */
1506 #line 182 "parser.y"
1507 { delete ((*yyvaluep).plist); };
1508 /* Line 1381 of yacc.c */
1509 #line 1510 "parser.cpp"
1511 case 69: /* method_param_list */
1512 /* Line 1381 of yacc.c */
1513 #line 182 "parser.y"
1514 { delete ((*yyvaluep).plist); };
1515 /* Line 1381 of yacc.c */
1516 #line 1517 "parser.cpp"
1518 case 70: /* method_param */
1519 /* Line 1381 of yacc.c */
1520 #line 182 "parser.y"
1521 { delete ((*yyvaluep).param); };
1522 /* Line 1381 of yacc.c */
1523 #line 1524 "parser.cpp"
1525 case 71: /* value_list */
1526 /* Line 1381 of yacc.c */
1527 #line 183 "parser.y"
1528 { delete ((*yyvaluep).vlist); };
1529 /* Line 1381 of yacc.c */
1530 #line 1531 "parser.cpp"
1532 case 72: /* value_list_contents */
1533 /* Line 1381 of yacc.c */
1534 #line 183 "parser.y"
1535 { delete ((*yyvaluep).vlist); };
1536 /* Line 1381 of yacc.c */
1537 #line 1538 "parser.cpp"
1539 case 73: /* basic_value_list */
1540 /* Line 1381 of yacc.c */
1541 #line 183 "parser.y"
1542 { delete ((*yyvaluep).vlist); };
1543 /* Line 1381 of yacc.c */
1544 #line 1545 "parser.cpp"
1546 case 74: /* basic_value_list_contents */
1547 /* Line 1381 of yacc.c */
1548 #line 183 "parser.y"
1549 { delete ((*yyvaluep).vlist); };
1550 /* Line 1381 of yacc.c */
1551 #line 1552 "parser.cpp"
1553 case 75: /* value_item */
1554 /* Line 1381 of yacc.c */
1555 #line 184 "parser.y"
1556 { delete ((*yyvaluep).val); };
1557 /* Line 1381 of yacc.c */
1558 #line 1559 "parser.cpp"
1560 case 76: /* basic_value_item */
1561 /* Line 1381 of yacc.c */
1562 #line 184 "parser.y"
1563 { delete ((*yyvaluep).val); };
1564 /* Line 1381 of yacc.c */
1565 #line 1566 "parser.cpp"
1567 case 77: /* value_item_range */
1568 /* Line 1381 of yacc.c */
1569 #line 184 "parser.y"
1570 { delete ((*yyvaluep).val); };
1571 /* Line 1381 of yacc.c */
1572 #line 1573 "parser.cpp"
1584 /* Number of syntax errors so far. */
1588 /* Number of tokens to shift before error messages enabled. */
1591 /* The stacks and their tools:
1592 `yyss': related to states.
1593 `yyvs': related to semantic values.
1595 Refer to the stacks through separate pointers, to allow yyoverflow
1596 to reallocate them elsewhere. */
1598 /* The state stack. */
1599 yytype_int16 yyssa[YYINITDEPTH];
1601 yytype_int16 *yyssp;
1603 /* The semantic value stack. */
1604 YYSTYPE yyvsa[YYINITDEPTH];
1608 YYSIZE_T yystacksize;
1609 /* Used to determine if this is the first time this instance has
1614 /* Initialize the parser data structure. */
1615 #if (defined __STDC__ || defined __C99__FUNC__ \
1616 || defined __cplusplus || defined _MSC_VER)
1626 yyps = (yypstate *) malloc (sizeof *yyps);
1633 #if (defined __STDC__ || defined __C99__FUNC__ \
1634 || defined __cplusplus || defined _MSC_VER)
1636 yypstate_delete (yypstate *yyps)
1639 yypstate_delete (yyps)
1644 /* If the stack was reallocated but the parse did not complete, then the
1645 stack still needs to be freed. */
1646 if (!yyps->yynew && yyps->yyss != yyps->yyssa)
1647 YYSTACK_FREE (yyps->yyss);
1652 #define _gmx_sel_yynerrs yyps->_gmx_sel_yynerrs
1653 #define yystate yyps->yystate
1654 #define yyerrstatus yyps->yyerrstatus
1655 #define yyssa yyps->yyssa
1656 #define yyss yyps->yyss
1657 #define yyssp yyps->yyssp
1658 #define yyvsa yyps->yyvsa
1659 #define yyvs yyps->yyvs
1660 #define yyvsp yyps->yyvsp
1661 #define yystacksize yyps->yystacksize
1668 #if (defined __STDC__ || defined __C99__FUNC__ \
1669 || defined __cplusplus || defined _MSC_VER)
1671 yypush_parse (yypstate *yyps, int yypushed_char, YYSTYPE const *yypushed_val, void *scanner)
1674 yypush_parse (yyps, yypushed_char, yypushed_val, scanner)
1677 YYSTYPE const *yypushed_val;
1681 /* The lookahead symbol. */
1684 /* The semantic value of the lookahead symbol. */
1689 /* Lookahead token as an internal (translated) token number. */
1691 /* The variables used to return semantic value and location from the
1696 /* Buffer for error messages, and its allocated size. */
1698 char *yymsg = yymsgbuf;
1699 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1702 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1704 /* The number of symbols on the RHS of the reduced rule.
1705 Keep to zero when no symbol should be popped. */
1710 yyn = yypact[yystate];
1711 goto yyread_pushed_token;
1717 yystacksize = YYINITDEPTH;
1719 YYDPRINTF ((stderr, "Starting parse\n"));
1724 yychar = YYEMPTY; /* Cause a token to be read. */
1726 /* Initialize stack pointers.
1727 Waste one element of value and location stack
1728 so that they stay on the same level as the state stack.
1729 The wasted elements are never initialized. */
1734 /*------------------------------------------------------------.
1735 | yynewstate -- Push a new state, which is found in yystate. |
1736 `------------------------------------------------------------*/
1738 /* In all cases, when you get here, the value and location stacks
1739 have just been pushed. So pushing a state here evens the stacks. */
1745 if (yyss + yystacksize - 1 <= yyssp)
1747 /* Get the current used size of the three stacks, in elements. */
1748 YYSIZE_T yysize = yyssp - yyss + 1;
1752 /* Give user a chance to reallocate the stack. Use copies of
1753 these so that the &'s don't force the real ones into
1755 YYSTYPE *yyvs1 = yyvs;
1756 yytype_int16 *yyss1 = yyss;
1758 /* Each stack pointer address is followed by the size of the
1759 data in use in that stack, in bytes. This used to be a
1760 conditional around just the two extra args, but that might
1761 be undefined if yyoverflow is a macro. */
1762 yyoverflow (YY_("memory exhausted"),
1763 &yyss1, yysize * sizeof (*yyssp),
1764 &yyvs1, yysize * sizeof (*yyvsp),
1770 #else /* no yyoverflow */
1771 # ifndef YYSTACK_RELOCATE
1772 goto yyexhaustedlab;
1774 /* Extend the stack our own way. */
1775 if (YYMAXDEPTH <= yystacksize)
1776 goto yyexhaustedlab;
1778 if (YYMAXDEPTH < yystacksize)
1779 yystacksize = YYMAXDEPTH;
1782 yytype_int16 *yyss1 = yyss;
1783 union yyalloc *yyptr =
1784 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1786 goto yyexhaustedlab;
1787 YYSTACK_RELOCATE (yyss_alloc, yyss);
1788 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1789 # undef YYSTACK_RELOCATE
1791 YYSTACK_FREE (yyss1);
1794 #endif /* no yyoverflow */
1796 yyssp = yyss + yysize - 1;
1797 yyvsp = yyvs + yysize - 1;
1799 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1800 (unsigned long int) yystacksize));
1802 if (yyss + yystacksize - 1 <= yyssp)
1806 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1808 if (yystate == YYFINAL)
1818 /* Do appropriate processing given the current state. Read a
1819 lookahead token if we need one and don't already have one. */
1821 /* First try to decide what to do without reference to lookahead token. */
1822 yyn = yypact[yystate];
1823 if (yypact_value_is_default (yyn))
1826 /* Not known => get a lookahead token if don't already have one. */
1828 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1829 if (yychar == YYEMPTY)
1833 YYDPRINTF ((stderr, "Return for a new token:\n"));
1834 yyresult = YYPUSH_MORE;
1838 yyread_pushed_token:
1839 YYDPRINTF ((stderr, "Reading a token: "));
1840 yychar = yypushed_char;
1842 yylval = *yypushed_val;
1845 if (yychar <= YYEOF)
1847 yychar = yytoken = YYEOF;
1848 YYDPRINTF ((stderr, "Now at end of input.\n"));
1852 yytoken = YYTRANSLATE (yychar);
1853 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1856 /* If the proper action on seeing token YYTOKEN is to reduce or to
1857 detect an error, take that action. */
1859 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1864 if (yytable_value_is_error (yyn))
1870 /* Count tokens shifted since error; after three, turn off error
1875 /* Shift the lookahead token. */
1876 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1878 /* Discard the shifted token. */
1887 /*-----------------------------------------------------------.
1888 | yydefault -- do the default action for the current state. |
1889 `-----------------------------------------------------------*/
1891 yyn = yydefact[yystate];
1897 /*-----------------------------.
1898 | yyreduce -- Do a reduction. |
1899 `-----------------------------*/
1901 /* yyn is the number of a rule to reduce with. */
1904 /* If YYLEN is nonzero, implement the default value of the action:
1907 Otherwise, the following line sets YYVAL to garbage.
1908 This behavior is undocumented and Bison
1909 users should not rely upon it. Assigning to YYVAL
1910 unconditionally makes the parser a bit smaller, and it avoids a
1911 GCC warning that YYVAL may be used uninitialized. */
1912 yyval = yyvsp[1-yylen];
1915 YY_REDUCE_PRINT (yyn);
1919 /* Line 1787 of yacc.c */
1920 #line 199 "parser.y"
1923 set_empty((yyval.sel));
1929 /* Line 1787 of yacc.c */
1930 #line 205 "parser.y"
1933 set((yyval.sel), _gmx_sel_append_selection(get((yyvsp[(2) - (2)].sel)), get((yyvsp[(1) - (2)].sel)), scanner));
1934 if (_gmx_sel_parser_should_finish(scanner))
1941 /* Line 1787 of yacc.c */
1942 #line 215 "parser.y"
1943 { (yyval.sel) = (yyvsp[(1) - (2)].sel); }
1947 /* Line 1787 of yacc.c */
1948 #line 217 "parser.y"
1951 _gmx_selparser_error(scanner, "invalid selection '%s'",
1952 _gmx_sel_lexer_pselstr(scanner));
1953 _gmx_sel_lexer_clear_method_stack(scanner);
1954 if (_gmx_sel_is_lexer_interactive(scanner))
1956 _gmx_sel_lexer_clear_pselstr(scanner);
1963 set_empty((yyval.sel));
1969 /* Line 1787 of yacc.c */
1970 #line 238 "parser.y"
1973 _gmx_sel_handle_empty_cmd(scanner);
1974 set_empty((yyval.sel));
1980 /* Line 1787 of yacc.c */
1981 #line 245 "parser.y"
1984 set_empty((yyval.sel));
1990 /* Line 1787 of yacc.c */
1991 #line 251 "parser.y"
1994 SelectionTreeElementPointer s
1995 = _gmx_sel_init_group_by_id((yyvsp[(1) - (1)].i), scanner);
1996 SelectionTreeElementPointer p
1997 = _gmx_sel_init_position(s, NULL, scanner);
1999 set((yyval.sel), _gmx_sel_init_selection(NULL, p, scanner));
2005 /* Line 1787 of yacc.c */
2006 #line 262 "parser.y"
2009 scoped_ptr_sfree nameGuard((yyvsp[(1) - (1)].str));
2010 SelectionTreeElementPointer s
2011 = _gmx_sel_init_group_by_name((yyvsp[(1) - (1)].str), scanner);
2012 SelectionTreeElementPointer p
2013 = _gmx_sel_init_position(s, NULL, scanner);
2015 set((yyval.sel), _gmx_sel_init_selection(NULL, p, scanner));
2021 /* Line 1787 of yacc.c */
2022 #line 274 "parser.y"
2025 set((yyval.sel), _gmx_sel_init_selection(NULL, get((yyvsp[(1) - (1)].sel)), scanner));
2031 /* Line 1787 of yacc.c */
2032 #line 280 "parser.y"
2035 scoped_ptr_sfree nameGuard((yyvsp[(1) - (2)].str));
2036 set((yyval.sel), _gmx_sel_init_selection((yyvsp[(1) - (2)].str), get((yyvsp[(2) - (2)].sel)), scanner));
2042 /* Line 1787 of yacc.c */
2043 #line 287 "parser.y"
2046 scoped_ptr_sfree nameGuard((yyvsp[(1) - (3)].str));
2047 set((yyval.sel), _gmx_sel_assign_variable((yyvsp[(1) - (3)].str), get((yyvsp[(3) - (3)].sel)), scanner));
2053 /* Line 1787 of yacc.c */
2054 #line 294 "parser.y"
2057 scoped_ptr_sfree nameGuard((yyvsp[(1) - (3)].str));
2058 set((yyval.sel), _gmx_sel_assign_variable((yyvsp[(1) - (3)].str), get((yyvsp[(3) - (3)].sel)), scanner));
2064 /* Line 1787 of yacc.c */
2065 #line 301 "parser.y"
2068 scoped_ptr_sfree nameGuard((yyvsp[(1) - (3)].str));
2069 set((yyval.sel), _gmx_sel_assign_variable((yyvsp[(1) - (3)].str), get((yyvsp[(3) - (3)].sel)), scanner));
2075 /* Line 1787 of yacc.c */
2076 #line 312 "parser.y"
2079 _gmx_sel_handle_help_cmd(get((yyvsp[(2) - (2)].vlist)), scanner);
2085 /* Line 1787 of yacc.c */
2086 #line 320 "parser.y"
2089 set((yyval.vlist), SelectionParserValue::createList());
2095 /* Line 1787 of yacc.c */
2096 #line 326 "parser.y"
2099 SelectionParserValueListPointer list(get((yyvsp[(1) - (2)].vlist)));
2100 list->push_back(SelectionParserValue::createString((yyvsp[(2) - (2)].str)));
2101 set((yyval.vlist), move(list));
2107 /* Line 1787 of yacc.c */
2108 #line 336 "parser.y"
2109 { (yyval.sel) = (yyvsp[(1) - (1)].sel); }
2113 /* Line 1787 of yacc.c */
2114 #line 338 "parser.y"
2117 set((yyval.sel), _gmx_sel_init_position(get((yyvsp[(1) - (1)].sel)), NULL, scanner));
2118 CHECK_SEL((yyval.sel));
2124 /* Line 1787 of yacc.c */
2125 #line 344 "parser.y"
2126 { (yyval.sel) = (yyvsp[(2) - (3)].sel); }
2130 /* Line 1787 of yacc.c */
2131 #line 346 "parser.y"
2134 set((yyval.sel), _gmx_sel_init_modifier((yyvsp[(2) - (3)].meth), get((yyvsp[(3) - (3)].plist)), get((yyvsp[(1) - (3)].sel)), scanner));
2135 CHECK_SEL((yyval.sel));
2141 /* Line 1787 of yacc.c */
2142 #line 359 "parser.y"
2143 { (yyval.i) = (yyvsp[(1) - (1)].i); }
2147 /* Line 1787 of yacc.c */
2148 #line 360 "parser.y"
2149 { (yyval.i) = -(yyvsp[(2) - (2)].i); }
2153 /* Line 1787 of yacc.c */
2154 #line 364 "parser.y"
2155 { (yyval.r) = (yyvsp[(1) - (1)].r); }
2159 /* Line 1787 of yacc.c */
2160 #line 365 "parser.y"
2161 { (yyval.r) = -(yyvsp[(2) - (2)].r); }
2165 /* Line 1787 of yacc.c */
2166 #line 368 "parser.y"
2167 { (yyval.r) = (yyvsp[(1) - (1)].i); }
2171 /* Line 1787 of yacc.c */
2172 #line 369 "parser.y"
2173 { (yyval.r) = (yyvsp[(1) - (1)].r); }
2177 /* Line 1787 of yacc.c */
2178 #line 372 "parser.y"
2179 { (yyval.str) = (yyvsp[(1) - (1)].str); }
2183 /* Line 1787 of yacc.c */
2184 #line 373 "parser.y"
2185 { (yyval.str) = (yyvsp[(1) - (1)].str); }
2189 /* Line 1787 of yacc.c */
2190 #line 382 "parser.y"
2193 SelectionTreeElementPointer arg(get((yyvsp[(2) - (2)].sel)));
2194 SelectionTreeElementPointer sel(
2195 new SelectionTreeElement(SEL_BOOLEAN));
2196 sel->u.boolt = BOOL_NOT;
2198 set((yyval.sel), sel);
2204 /* Line 1787 of yacc.c */
2205 #line 393 "parser.y"
2208 SelectionTreeElementPointer arg1(get((yyvsp[(1) - (3)].sel))), arg2(get((yyvsp[(3) - (3)].sel)));
2209 SelectionTreeElementPointer sel(
2210 new SelectionTreeElement(SEL_BOOLEAN));
2211 sel->u.boolt = BOOL_AND;
2212 sel->child = arg1; sel->child->next = arg2;
2213 set((yyval.sel), sel);
2219 /* Line 1787 of yacc.c */
2220 #line 404 "parser.y"
2223 SelectionTreeElementPointer arg1(get((yyvsp[(1) - (3)].sel))), arg2(get((yyvsp[(3) - (3)].sel)));
2224 SelectionTreeElementPointer sel(
2225 new SelectionTreeElement(SEL_BOOLEAN));
2226 sel->u.boolt = BOOL_OR;
2227 sel->child = arg1; sel->child->next = arg2;
2228 set((yyval.sel), sel);
2234 /* Line 1787 of yacc.c */
2235 #line 414 "parser.y"
2236 { (yyval.sel) = (yyvsp[(2) - (3)].sel); }
2240 /* Line 1787 of yacc.c */
2241 #line 419 "parser.y"
2244 scoped_ptr_sfree opGuard((yyvsp[(2) - (3)].str));
2245 set((yyval.sel), _gmx_sel_init_comparison(get((yyvsp[(1) - (3)].sel)), get((yyvsp[(3) - (3)].sel)), (yyvsp[(2) - (3)].str), scanner));
2246 CHECK_SEL((yyval.sel));
2252 /* Line 1787 of yacc.c */
2253 #line 430 "parser.y"
2256 scoped_ptr_sfree nameGuard((yyvsp[(2) - (2)].str));
2257 set((yyval.sel), _gmx_sel_init_group_by_name((yyvsp[(2) - (2)].str), scanner));
2263 /* Line 1787 of yacc.c */
2264 #line 437 "parser.y"
2267 set((yyval.sel), _gmx_sel_init_group_by_id((yyvsp[(2) - (2)].i), scanner));
2273 /* Line 1787 of yacc.c */
2274 #line 445 "parser.y"
2275 { (yyval.str) = NULL; }
2279 /* Line 1787 of yacc.c */
2280 #line 446 "parser.y"
2281 { (yyval.str) = (yyvsp[(1) - (1)].str); }
2285 /* Line 1787 of yacc.c */
2286 #line 451 "parser.y"
2287 { (yyval.smt) = gmx::eStringMatchType_RegularExpression; }
2291 /* Line 1787 of yacc.c */
2292 #line 452 "parser.y"
2293 { (yyval.smt) = gmx::eStringMatchType_Wildcard; }
2297 /* Line 1787 of yacc.c */
2298 #line 453 "parser.y"
2299 { (yyval.smt) = gmx::eStringMatchType_Exact; }
2303 /* Line 1787 of yacc.c */
2304 #line 458 "parser.y"
2307 scoped_ptr_sfree posmodGuard((yyvsp[(1) - (2)].str));
2308 set((yyval.sel), _gmx_sel_init_keyword((yyvsp[(2) - (2)].meth), SelectionParserValueListPointer(), (yyvsp[(1) - (2)].str), scanner));
2309 CHECK_SEL((yyval.sel));
2315 /* Line 1787 of yacc.c */
2316 #line 466 "parser.y"
2319 scoped_ptr_sfree posmodGuard((yyvsp[(1) - (3)].str));
2320 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));
2321 CHECK_SEL((yyval.sel));
2327 /* Line 1787 of yacc.c */
2328 #line 474 "parser.y"
2331 scoped_ptr_sfree posmodGuard((yyvsp[(1) - (4)].str));
2332 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));
2333 CHECK_SEL((yyval.sel));
2339 /* Line 1787 of yacc.c */
2340 #line 482 "parser.y"
2343 scoped_ptr_sfree posmodGuard((yyvsp[(1) - (3)].str));
2344 set((yyval.sel), _gmx_sel_init_keyword((yyvsp[(2) - (3)].meth), get((yyvsp[(3) - (3)].vlist)), (yyvsp[(1) - (3)].str), scanner));
2345 CHECK_SEL((yyval.sel));
2351 /* Line 1787 of yacc.c */
2352 #line 493 "parser.y"
2355 scoped_ptr_sfree posmodGuard((yyvsp[(1) - (3)].str));
2356 set((yyval.sel), _gmx_sel_init_method((yyvsp[(2) - (3)].meth), get((yyvsp[(3) - (3)].plist)), (yyvsp[(1) - (3)].str), scanner));
2357 CHECK_SEL((yyval.sel));
2363 /* Line 1787 of yacc.c */
2364 #line 508 "parser.y"
2367 SelectionTreeElementPointer sel(
2368 new SelectionTreeElement(SEL_CONST));
2369 _gmx_selelem_set_vtype(sel, INT_VALUE);
2370 _gmx_selvalue_reserve(&sel->v, 1);
2371 sel->v.u.i[0] = (yyvsp[(1) - (1)].i);
2372 set((yyval.sel), sel);
2378 /* Line 1787 of yacc.c */
2379 #line 519 "parser.y"
2382 SelectionTreeElementPointer sel(
2383 new SelectionTreeElement(SEL_CONST));
2384 _gmx_selelem_set_vtype(sel, REAL_VALUE);
2385 _gmx_selvalue_reserve(&sel->v, 1);
2386 sel->v.u.r[0] = (yyvsp[(1) - (1)].r);
2387 set((yyval.sel), sel);
2393 /* Line 1787 of yacc.c */
2394 #line 533 "parser.y"
2397 scoped_ptr_sfree posmodGuard((yyvsp[(1) - (2)].str));
2398 set((yyval.sel), _gmx_sel_init_keyword((yyvsp[(2) - (2)].meth), SelectionParserValueListPointer(), (yyvsp[(1) - (2)].str), scanner));
2399 CHECK_SEL((yyval.sel));
2405 /* Line 1787 of yacc.c */
2406 #line 541 "parser.y"
2409 scoped_ptr_sfree posmodGuard((yyvsp[(1) - (3)].str));
2410 set((yyval.sel), _gmx_sel_init_method((yyvsp[(2) - (3)].meth), get((yyvsp[(3) - (3)].plist)), (yyvsp[(1) - (3)].str), scanner));
2411 CHECK_SEL((yyval.sel));
2417 /* Line 1787 of yacc.c */
2418 #line 552 "parser.y"
2421 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[(1) - (3)].sel)), get((yyvsp[(3) - (3)].sel)), '+', scanner));
2427 /* Line 1787 of yacc.c */
2428 #line 558 "parser.y"
2431 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[(1) - (3)].sel)), get((yyvsp[(3) - (3)].sel)), '-', scanner));
2437 /* Line 1787 of yacc.c */
2438 #line 564 "parser.y"
2441 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[(1) - (3)].sel)), get((yyvsp[(3) - (3)].sel)), '*', scanner));
2447 /* Line 1787 of yacc.c */
2448 #line 570 "parser.y"
2451 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[(1) - (3)].sel)), get((yyvsp[(3) - (3)].sel)), '/', scanner));
2457 /* Line 1787 of yacc.c */
2458 #line 576 "parser.y"
2461 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[(2) - (2)].sel)), SelectionTreeElementPointer(), '-', scanner));
2467 /* Line 1787 of yacc.c */
2468 #line 582 "parser.y"
2471 set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[(1) - (3)].sel)), get((yyvsp[(3) - (3)].sel)), '^', scanner));
2477 /* Line 1787 of yacc.c */
2478 #line 587 "parser.y"
2479 { (yyval.sel) = (yyvsp[(2) - (3)].sel); }
2483 /* Line 1787 of yacc.c */
2484 #line 595 "parser.y"
2487 SelectionTreeElementPointer sel(
2488 new SelectionTreeElement(SEL_CONST));
2489 _gmx_selelem_set_vtype(sel, STR_VALUE);
2490 _gmx_selvalue_reserve(&sel->v, 1);
2491 sel->v.u.s[0] = (yyvsp[(1) - (1)].str);
2492 set((yyval.sel), sel);
2498 /* Line 1787 of yacc.c */
2499 #line 606 "parser.y"
2502 scoped_ptr_sfree posmodGuard((yyvsp[(1) - (2)].str));
2503 set((yyval.sel), _gmx_sel_init_keyword((yyvsp[(2) - (2)].meth), SelectionParserValueListPointer(), (yyvsp[(1) - (2)].str), scanner));
2504 CHECK_SEL((yyval.sel));
2510 /* Line 1787 of yacc.c */
2511 #line 621 "parser.y"
2514 set((yyval.sel), _gmx_sel_init_const_position((yyvsp[(2) - (7)].r), (yyvsp[(4) - (7)].r), (yyvsp[(6) - (7)].r)));
2520 /* Line 1787 of yacc.c */
2521 #line 629 "parser.y"
2522 { (yyval.sel) = (yyvsp[(2) - (3)].sel); }
2526 /* Line 1787 of yacc.c */
2527 #line 634 "parser.y"
2530 set((yyval.sel), _gmx_sel_init_method((yyvsp[(1) - (2)].meth), get((yyvsp[(2) - (2)].plist)), NULL, scanner));
2531 CHECK_SEL((yyval.sel));
2537 /* Line 1787 of yacc.c */
2538 #line 644 "parser.y"
2541 scoped_ptr_sfree keywordGuard((yyvsp[(1) - (3)].str));
2542 set((yyval.sel), _gmx_sel_init_position(get((yyvsp[(3) - (3)].sel)), (yyvsp[(1) - (3)].str), scanner));
2543 CHECK_SEL((yyval.sel));
2549 /* Line 1787 of yacc.c */
2550 #line 658 "parser.y"
2553 set((yyval.sel), _gmx_sel_init_variable_ref(get((yyvsp[(1) - (1)].sel))));
2559 /* Line 1787 of yacc.c */
2560 #line 666 "parser.y"
2563 set((yyval.sel), _gmx_sel_init_variable_ref(get((yyvsp[(1) - (1)].sel))));
2569 /* Line 1787 of yacc.c */
2570 #line 674 "parser.y"
2573 set((yyval.sel), _gmx_sel_init_variable_ref(get((yyvsp[(1) - (1)].sel))));
2579 /* Line 1787 of yacc.c */
2580 #line 687 "parser.y"
2581 { (yyval.plist) = (yyvsp[(1) - (1)].plist); }
2585 /* Line 1787 of yacc.c */
2586 #line 689 "parser.y"
2587 { (yyval.plist) = (yyvsp[(1) - (2)].plist); }
2591 /* Line 1787 of yacc.c */
2592 #line 694 "parser.y"
2595 set((yyval.plist), SelectionParserParameter::createList());
2601 /* Line 1787 of yacc.c */
2602 #line 700 "parser.y"
2605 SelectionParserParameterListPointer list(get((yyvsp[(1) - (2)].plist)));
2606 list->push_back(get((yyvsp[(2) - (2)].param)));
2607 set((yyval.plist), move(list));
2613 /* Line 1787 of yacc.c */
2614 #line 711 "parser.y"
2617 scoped_ptr_sfree nameGuard((yyvsp[(1) - (2)].str));
2618 set((yyval.param), SelectionParserParameter::create((yyvsp[(1) - (2)].str), get((yyvsp[(2) - (2)].vlist))));
2624 /* Line 1787 of yacc.c */
2625 #line 719 "parser.y"
2626 { (yyval.vlist) = (yyvsp[(1) - (1)].vlist); }
2630 /* Line 1787 of yacc.c */
2631 #line 720 "parser.y"
2632 { (yyval.vlist) = (yyvsp[(2) - (3)].vlist); }
2636 /* Line 1787 of yacc.c */
2637 #line 725 "parser.y"
2640 set((yyval.vlist), SelectionParserValue::createList());
2646 /* Line 1787 of yacc.c */
2647 #line 731 "parser.y"
2650 SelectionParserValueListPointer list(get((yyvsp[(1) - (2)].vlist)));
2651 list->push_back(get((yyvsp[(2) - (2)].val)));
2652 set((yyval.vlist), move(list));
2658 /* Line 1787 of yacc.c */
2659 #line 739 "parser.y"
2662 SelectionParserValueListPointer list(get((yyvsp[(1) - (3)].vlist)));
2663 list->push_back(get((yyvsp[(3) - (3)].val)));
2664 set((yyval.vlist), move(list));
2670 /* Line 1787 of yacc.c */
2671 #line 749 "parser.y"
2672 { (yyval.vlist) = (yyvsp[(1) - (1)].vlist); }
2676 /* Line 1787 of yacc.c */
2677 #line 750 "parser.y"
2678 { (yyval.vlist) = (yyvsp[(2) - (3)].vlist); }
2682 /* Line 1787 of yacc.c */
2683 #line 755 "parser.y"
2686 set((yyval.vlist), SelectionParserValue::createList(get((yyvsp[(1) - (1)].val))));
2692 /* Line 1787 of yacc.c */
2693 #line 761 "parser.y"
2696 SelectionParserValueListPointer list(get((yyvsp[(1) - (2)].vlist)));
2697 list->push_back(get((yyvsp[(2) - (2)].val)));
2698 set((yyval.vlist), move(list));
2704 /* Line 1787 of yacc.c */
2705 #line 769 "parser.y"
2708 SelectionParserValueListPointer list(get((yyvsp[(1) - (3)].vlist)));
2709 list->push_back(get((yyvsp[(3) - (3)].val)));
2710 set((yyval.vlist), move(list));
2716 /* Line 1787 of yacc.c */
2717 #line 779 "parser.y"
2720 set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[(1) - (1)].sel))));
2726 /* Line 1787 of yacc.c */
2727 #line 785 "parser.y"
2730 set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[(1) - (1)].sel))));
2736 /* Line 1787 of yacc.c */
2737 #line 791 "parser.y"
2740 set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[(1) - (1)].sel))));
2746 /* Line 1787 of yacc.c */
2747 #line 797 "parser.y"
2750 set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[(1) - (1)].sel))));
2756 /* Line 1787 of yacc.c */
2757 #line 802 "parser.y"
2758 { (yyval.val) = (yyvsp[(1) - (1)].val); }
2762 /* Line 1787 of yacc.c */
2763 #line 807 "parser.y"
2766 set((yyval.val), SelectionParserValue::createInteger((yyvsp[(1) - (1)].i)));
2772 /* Line 1787 of yacc.c */
2773 #line 813 "parser.y"
2776 set((yyval.val), SelectionParserValue::createReal((yyvsp[(1) - (1)].r)));
2782 /* Line 1787 of yacc.c */
2783 #line 819 "parser.y"
2786 scoped_ptr_sfree stringGuard((yyvsp[(1) - (1)].str));
2787 set((yyval.val), SelectionParserValue::createString((yyvsp[(1) - (1)].str)));
2793 /* Line 1787 of yacc.c */
2794 #line 825 "parser.y"
2795 { (yyval.val) = (yyvsp[(1) - (1)].val); }
2799 /* Line 1787 of yacc.c */
2800 #line 830 "parser.y"
2803 set((yyval.val), SelectionParserValue::createIntegerRange((yyvsp[(1) - (3)].i), (yyvsp[(3) - (3)].i)));
2809 /* Line 1787 of yacc.c */
2810 #line 836 "parser.y"
2813 set((yyval.val), SelectionParserValue::createRealRange((yyvsp[(1) - (3)].i), (yyvsp[(3) - (3)].r)));
2819 /* Line 1787 of yacc.c */
2820 #line 842 "parser.y"
2823 set((yyval.val), SelectionParserValue::createRealRange((yyvsp[(1) - (3)].r), (yyvsp[(3) - (3)].r)));
2829 /* Line 1787 of yacc.c */
2830 #line 2831 "parser.cpp"
2833 /* User semantic actions sometimes alter yychar, and that requires
2834 that yytoken be updated with the new translation. We take the
2835 approach of translating immediately before every use of yytoken.
2836 One alternative is translating here after every semantic action,
2837 but that translation would be missed if the semantic action invokes
2838 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2839 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2840 incorrect destructor might then be invoked immediately. In the
2841 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2842 to an incorrect destructor call or verbose syntax error message
2843 before the lookahead is translated. */
2844 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2848 YY_STACK_PRINT (yyss, yyssp);
2852 /* Now `shift' the result of the reduction. Determine what state
2853 that goes to, based on the state we popped back to and the rule
2854 number reduced by. */
2858 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2859 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2860 yystate = yytable[yystate];
2862 yystate = yydefgoto[yyn - YYNTOKENS];
2867 /*------------------------------------.
2868 | yyerrlab -- here on detecting error |
2869 `------------------------------------*/
2871 /* Make sure we have latest lookahead translation. See comments at
2872 user semantic actions for why this is necessary. */
2873 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2875 /* If not already recovering from an error, report this error. */
2879 #if ! YYERROR_VERBOSE
2880 yyerror (scanner, YY_("syntax error"));
2882 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2885 char const *yymsgp = YY_("syntax error");
2886 int yysyntax_error_status;
2887 yysyntax_error_status = YYSYNTAX_ERROR;
2888 if (yysyntax_error_status == 0)
2890 else if (yysyntax_error_status == 1)
2892 if (yymsg != yymsgbuf)
2893 YYSTACK_FREE (yymsg);
2894 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2898 yymsg_alloc = sizeof yymsgbuf;
2899 yysyntax_error_status = 2;
2903 yysyntax_error_status = YYSYNTAX_ERROR;
2907 yyerror (scanner, yymsgp);
2908 if (yysyntax_error_status == 2)
2909 goto yyexhaustedlab;
2911 # undef YYSYNTAX_ERROR
2917 if (yyerrstatus == 3)
2919 /* If just tried and failed to reuse lookahead token after an
2920 error, discard it. */
2922 if (yychar <= YYEOF)
2924 /* Return failure if at end of input. */
2925 if (yychar == YYEOF)
2930 yydestruct ("Error: discarding",
2931 yytoken, &yylval, scanner);
2936 /* Else will try to reuse lookahead token after shifting the error
2941 /*---------------------------------------------------.
2942 | yyerrorlab -- error raised explicitly by YYERROR. |
2943 `---------------------------------------------------*/
2946 /* Pacify compilers like GCC when the user code never invokes
2947 YYERROR and the label yyerrorlab therefore never appears in user
2949 if (/*CONSTCOND*/ 0)
2952 /* Do not reclaim the symbols of the rule which action triggered
2956 YY_STACK_PRINT (yyss, yyssp);
2961 /*-------------------------------------------------------------.
2962 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2963 `-------------------------------------------------------------*/
2965 yyerrstatus = 3; /* Each real token shifted decrements this. */
2969 yyn = yypact[yystate];
2970 if (!yypact_value_is_default (yyn))
2973 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2981 /* Pop the current state because it cannot handle the error token. */
2986 yydestruct ("Error: popping",
2987 yystos[yystate], yyvsp, scanner);
2990 YY_STACK_PRINT (yyss, yyssp);
2996 /* Shift the error token. */
2997 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
3003 /*-------------------------------------.
3004 | yyacceptlab -- YYACCEPT comes here. |
3005 `-------------------------------------*/
3010 /*-----------------------------------.
3011 | yyabortlab -- YYABORT comes here. |
3012 `-----------------------------------*/
3017 #if !defined yyoverflow || YYERROR_VERBOSE
3018 /*-------------------------------------------------.
3019 | yyexhaustedlab -- memory exhaustion comes here. |
3020 `-------------------------------------------------*/
3022 yyerror (scanner, YY_("memory exhausted"));
3028 if (yychar != YYEMPTY)
3030 /* Make sure we have latest lookahead translation. See comments at
3031 user semantic actions for why this is necessary. */
3032 yytoken = YYTRANSLATE (yychar);
3033 yydestruct ("Cleanup: discarding lookahead",
3034 yytoken, &yylval, scanner);
3036 /* Do not reclaim the symbols of the rule which action triggered
3037 this YYABORT or YYACCEPT. */
3039 YY_STACK_PRINT (yyss, yyssp);
3040 while (yyssp != yyss)
3042 yydestruct ("Cleanup: popping",
3043 yystos[*yyssp], yyvsp, scanner);
3048 YYSTACK_FREE (yyss);
3054 if (yymsg != yymsgbuf)
3055 YYSTACK_FREE (yymsg);
3057 /* Make sure YYID is used. */
3058 return YYID (yyresult);