Split lines with many copyright years
[alexxy/gromacs.git] / src / gromacs / selection / parser.cpp
1 /* A Bison parser, made by GNU Bison 3.0.4.  */
2
3 /* Bison implementation for Yacc-like parsers in C
4
5    Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
6
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.
11
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.
16
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/>.  */
19
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.
29
30    This special exception was added by the Free Software Foundation in
31    version 2.2 of Bison.  */
32
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34    simplifying the original so-called "semantic" parser.  */
35
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.  */
42
43 /* Identify Bison output.  */
44 #define YYBISON 1
45
46 /* Bison version.  */
47 #define YYBISON_VERSION "3.0.4"
48
49 /* Skeleton name.  */
50 #define YYSKELETON_NAME "yacc.c"
51
52 /* Pure parsers.  */
53 #define YYPURE 1
54
55 /* Push parsers.  */
56 #define YYPUSH 1
57
58 /* Pull parsers.  */
59 #define YYPULL 0
60
61 /* "%code top" blocks.  */
62 #line 43 "parser.y" /* yacc.c:316  */
63
64 /*! \internal \file parser.cpp
65  * \brief Generated (from parser.y by Bison) parser for the selection language.
66  *
67  * \ingroup module_selection
68  */
69 /*! \internal \file parser.h
70  * \brief Generated (from parser.y by Bison) parser include file.
71  *
72  * \ingroup module_selection
73  */
74 #include "gmxpre.h"
75
76 #line 77 "parser.cpp" /* yacc.c:316  */
77
78 /* Substitute the variable and function names.  */
79 #define yypush_parse    _gmx_sel_yypush_parse
80 #define yypstate_new    _gmx_sel_yypstate_new
81 #define yypstate_delete _gmx_sel_yypstate_delete
82 #define yypstate        _gmx_sel_yypstate
83 #define yylex           _gmx_sel_yylex
84 #define yyerror         _gmx_sel_yyerror
85 #define yydebug         _gmx_sel_yydebug
86 #define yynerrs         _gmx_sel_yynerrs
87
88
89 /* Copy the first part of user declarations.  */
90 #line 56 "parser.y" /* yacc.c:339  */
91
92 #include "gromacs/utility/unique_cptr.h"
93
94 #include "parser_internal.h"
95
96 using gmx::sfree_guard;
97 using gmx::SelectionParserValue;
98 using gmx::SelectionParserValueList;
99 using gmx::SelectionParserValueListPointer;
100 using gmx::SelectionParserParameter;
101 using gmx::SelectionParserParameterList;
102 using gmx::SelectionParserParameterListPointer;
103 using gmx::SelectionTreeElement;
104 using gmx::SelectionTreeElementPointer;
105
106 #ifdef _MSC_VER
107 #pragma warning(disable: 4065)
108 #endif
109
110 #line 111 "parser.cpp" /* yacc.c:339  */
111
112 # ifndef YY_NULLPTR
113 #  if defined __cplusplus && 201103L <= __cplusplus
114 #   define YY_NULLPTR nullptr
115 #  else
116 #   define YY_NULLPTR 0
117 #  endif
118 # endif
119
120 /* Enabling verbose error messages.  */
121 #ifdef YYERROR_VERBOSE
122 # undef YYERROR_VERBOSE
123 # define YYERROR_VERBOSE 1
124 #else
125 # define YYERROR_VERBOSE 0
126 #endif
127
128 /* In a future release of Bison, this section will be replaced
129    by #include "parser.h".  */
130 #ifndef YY__GMX_SEL_YY_PARSER_H_INCLUDED
131 # define YY__GMX_SEL_YY_PARSER_H_INCLUDED
132 /* Debug traces.  */
133 #ifndef YYDEBUG
134 # define YYDEBUG 1
135 #endif
136 #if YYDEBUG
137 extern int _gmx_sel_yydebug;
138 #endif
139 /* "%code requires" blocks.  */
140 #line 1 "parser.y" /* yacc.c:355  */
141
142 /*
143  * This file is part of the GROMACS molecular simulation package.
144  *
145  * Copyright (c) 2009,2010,2011,2012,2013 by the GROMACS development team.
146  * Copyright (c) 2014,2015,2016, by the GROMACS development team, led by
147  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
148  * and including many others, as listed in the AUTHORS file in the
149  * top-level source directory and at http://www.gromacs.org.
150  *
151  * GROMACS is free software; you can redistribute it and/or
152  * modify it under the terms of the GNU Lesser General Public License
153  * as published by the Free Software Foundation; either version 2.1
154  * of the License, or (at your option) any later version.
155  *
156  * GROMACS is distributed in the hope that it will be useful,
157  * but WITHOUT ANY WARRANTY; without even the implied warranty of
158  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
159  * Lesser General Public License for more details.
160  *
161  * You should have received a copy of the GNU Lesser General Public
162  * License along with GROMACS; if not, see
163  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
164  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
165  *
166  * If you want to redistribute modifications to GROMACS, please
167  * consider that scientific software is very special. Version
168  * control is crucial - bugs must be traceable. We will be happy to
169  * consider code for inclusion in the official distribution, but
170  * derived work must not be called official GROMACS. Details are found
171  * in the README & COPYING files - if they are missing, get the
172  * official version at http://www.gromacs.org.
173  *
174  * To help us fund GROMACS development, we humbly ask that you cite
175  * the research papers on the package. Check out http://www.gromacs.org.
176  */
177 #line 76 "parser.y" /* yacc.c:355  */
178
179 #include "parsetree.h"
180 #include "selelem.h"
181
182 #define YYLTYPE ::gmx::SelectionLocation
183
184 #line 184 "parser.cpp" /* yacc.c:355  */
185
186 /* Token type.  */
187 #ifndef YYTOKENTYPE
188 # define YYTOKENTYPE
189   enum yytokentype
190   {
191     INVALID = 258,
192     TOK_INT = 259,
193     TOK_REAL = 260,
194     STR = 261,
195     IDENTIFIER = 262,
196     CMD_SEP = 263,
197     GROUP = 264,
198     TO = 265,
199     VARIABLE_NUMERIC = 266,
200     VARIABLE_GROUP = 267,
201     VARIABLE_POS = 268,
202     KEYWORD_NUMERIC = 269,
203     KEYWORD_STR = 270,
204     KEYWORD_POS = 271,
205     KEYWORD_GROUP = 272,
206     METHOD_NUMERIC = 273,
207     METHOD_GROUP = 274,
208     METHOD_POS = 275,
209     MODIFIER = 276,
210     EMPTY_POSMOD = 277,
211     PARAM = 278,
212     END_OF_METHOD = 279,
213     OF = 280,
214     CMP_OP = 281,
215     PARAM_REDUCT = 282,
216     OR = 283,
217     XOR = 284,
218     AND = 285,
219     NOT = 286,
220     UNARY_NEG = 287,
221     NUM_REDUCT = 288
222   };
223 #endif
224
225 /* Value type.  */
226 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
227
228 union YYSTYPE
229 {
230 #line 83 "parser.y" /* yacc.c:355  */
231
232     int                         i;
233     real                        r;
234     char                       *str;
235     struct gmx_ana_selmethod_t *meth;
236
237     gmx::SelectionStringMatchType                smt;
238
239     gmx::SelectionTreeElementPointer            *sel;
240     gmx::SelectionParserValue                   *val;
241     gmx::SelectionParserValueListPointer        *vlist;
242     gmx::SelectionParserParameter               *param;
243     gmx::SelectionParserParameterListPointer    *plist;
244
245 #line 245 "parser.cpp" /* yacc.c:355  */
246 };
247
248 typedef union YYSTYPE YYSTYPE;
249 # define YYSTYPE_IS_TRIVIAL 1
250 # define YYSTYPE_IS_DECLARED 1
251 #endif
252
253 /* Location type.  */
254 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
255 typedef struct YYLTYPE YYLTYPE;
256 struct YYLTYPE
257 {
258   int first_line;
259   int first_column;
260   int last_line;
261   int last_column;
262 };
263 # define YYLTYPE_IS_DECLARED 1
264 # define YYLTYPE_IS_TRIVIAL 1
265 #endif
266
267
268
269 #ifndef YYPUSH_MORE_DEFINED
270 # define YYPUSH_MORE_DEFINED
271 enum { YYPUSH_MORE = 4 };
272 #endif
273
274 typedef struct _gmx_sel_yypstate _gmx_sel_yypstate;
275
276 int _gmx_sel_yypush_parse (_gmx_sel_yypstate *ps, int pushed_char, YYSTYPE const *pushed_val, YYLTYPE *pushed_loc, void *scanner);
277
278 _gmx_sel_yypstate * _gmx_sel_yypstate_new (void);
279 void _gmx_sel_yypstate_delete (_gmx_sel_yypstate *ps);
280
281 #endif /* !YY__GMX_SEL_YY_PARSER_H_INCLUDED  */
282
283 /* Copy the second part of user declarations.  */
284
285 #line 285 "parser.cpp" /* yacc.c:358  */
286
287 #ifdef short
288 # undef short
289 #endif
290
291 #ifdef YYTYPE_UINT8
292 typedef YYTYPE_UINT8 yytype_uint8;
293 #else
294 typedef unsigned char yytype_uint8;
295 #endif
296
297 #ifdef YYTYPE_INT8
298 typedef YYTYPE_INT8 yytype_int8;
299 #else
300 typedef signed char yytype_int8;
301 #endif
302
303 #ifdef YYTYPE_UINT16
304 typedef YYTYPE_UINT16 yytype_uint16;
305 #else
306 typedef unsigned short int yytype_uint16;
307 #endif
308
309 #ifdef YYTYPE_INT16
310 typedef YYTYPE_INT16 yytype_int16;
311 #else
312 typedef short int yytype_int16;
313 #endif
314
315 #ifndef YYSIZE_T
316 # ifdef __SIZE_TYPE__
317 #  define YYSIZE_T __SIZE_TYPE__
318 # elif defined size_t
319 #  define YYSIZE_T size_t
320 # elif ! defined YYSIZE_T
321 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
322 #  define YYSIZE_T size_t
323 # else
324 #  define YYSIZE_T unsigned int
325 # endif
326 #endif
327
328 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
329
330 #ifndef YY_
331 # if defined YYENABLE_NLS && YYENABLE_NLS
332 #  if ENABLE_NLS
333 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
334 #   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
335 #  endif
336 # endif
337 # ifndef YY_
338 #  define YY_(Msgid) Msgid
339 # endif
340 #endif
341
342 #ifndef YY_ATTRIBUTE
343 # if (defined __GNUC__                                               \
344       && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
345      || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
346 #  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
347 # else
348 #  define YY_ATTRIBUTE(Spec) /* empty */
349 # endif
350 #endif
351
352 #ifndef YY_ATTRIBUTE_PURE
353 # define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
354 #endif
355
356 #ifndef YY_ATTRIBUTE_UNUSED
357 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
358 #endif
359
360 #if !defined _Noreturn \
361      && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
362 # if defined _MSC_VER && 1200 <= _MSC_VER
363 #  define _Noreturn __declspec (noreturn)
364 # else
365 #  define _Noreturn YY_ATTRIBUTE ((__noreturn__))
366 # endif
367 #endif
368
369 /* Suppress unused-variable warnings by "using" E.  */
370 #if ! defined lint || defined __GNUC__
371 # define YYUSE(E) ((void) (E))
372 #else
373 # define YYUSE(E) /* empty */
374 #endif
375
376 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
377 /* Suppress an incorrect diagnostic about yylval being uninitialized.  */
378 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
379     _Pragma ("GCC diagnostic push") \
380     _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
381     _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
382 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
383     _Pragma ("GCC diagnostic pop")
384 #else
385 # define YY_INITIAL_VALUE(Value) Value
386 #endif
387 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
388 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
389 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
390 #endif
391 #ifndef YY_INITIAL_VALUE
392 # define YY_INITIAL_VALUE(Value) /* Nothing. */
393 #endif
394
395
396 #if ! defined yyoverflow || YYERROR_VERBOSE
397
398 /* The parser invokes alloca or malloc; define the necessary symbols.  */
399
400 # ifdef YYSTACK_ALLOC
401    /* Pacify GCC's 'empty if-body' warning.  */
402 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
403 #  ifndef YYSTACK_ALLOC_MAXIMUM
404     /* The OS might guarantee only one guard page at the bottom of the stack,
405        and a page size can be as small as 4096 bytes.  So we cannot safely
406        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
407        to allow for a few compiler-allocated temporary stack slots.  */
408 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
409 #  endif
410 # else
411 #  define YYSTACK_ALLOC YYMALLOC
412 #  define YYSTACK_FREE YYFREE
413 #  ifndef YYSTACK_ALLOC_MAXIMUM
414 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
415 #  endif
416 #  if (defined __cplusplus && ! defined EXIT_SUCCESS \
417        && ! ((defined YYMALLOC || defined malloc) \
418              && (defined YYFREE || defined free)))
419 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
420 #   ifndef EXIT_SUCCESS
421 #    define EXIT_SUCCESS 0
422 #   endif
423 #  endif
424 #  ifndef YYMALLOC
425 #   define YYMALLOC malloc
426 #   if ! defined malloc && ! defined EXIT_SUCCESS
427 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
428 #   endif
429 #  endif
430 #  ifndef YYFREE
431 #   define YYFREE free
432 #   if ! defined free && ! defined EXIT_SUCCESS
433 void free (void *); /* INFRINGES ON USER NAME SPACE */
434 #   endif
435 #  endif
436 # endif
437 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
438
439
440 #if (! defined yyoverflow \
441      && (! defined __cplusplus || defined GMX_YYFORCE_C_STACK_EXTENSION \
442          || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
443              && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
444
445 /* A type that is properly aligned for any stack member.  */
446 union yyalloc
447 {
448   yytype_int16 yyss_alloc;
449   YYSTYPE yyvs_alloc;
450   YYLTYPE yyls_alloc;
451 };
452
453 /* The size of the maximum gap between one aligned stack and the next.  */
454 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
455
456 /* The size of an array large to enough to hold all stacks, each with
457    N elements.  */
458 # define YYSTACK_BYTES(N) \
459      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
460       + 2 * YYSTACK_GAP_MAXIMUM)
461
462 # define YYCOPY_NEEDED 1
463
464 /* Relocate STACK from its old location to the new one.  The
465    local variables YYSIZE and YYSTACKSIZE give the old and new number of
466    elements in the stack, and YYPTR gives the new location of the
467    stack.  Advance YYPTR to a properly aligned location for the next
468    stack.  */
469 # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
470     do                                                                  \
471       {                                                                 \
472         YYSIZE_T yynewbytes;                                            \
473         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
474         Stack = &yyptr->Stack_alloc;                                    \
475         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
476         yyptr += yynewbytes / sizeof (*yyptr);                          \
477       }                                                                 \
478     while (0)
479
480 #endif
481
482 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
483 /* Copy COUNT objects from SRC to DST.  The source and destination do
484    not overlap.  */
485 # ifndef YYCOPY
486 #  if defined __GNUC__ && 1 < __GNUC__
487 #   define YYCOPY(Dst, Src, Count) \
488       __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
489 #  else
490 #   define YYCOPY(Dst, Src, Count)              \
491       do                                        \
492         {                                       \
493           YYSIZE_T yyi;                         \
494           for (yyi = 0; yyi < (Count); yyi++)   \
495             (Dst)[yyi] = (Src)[yyi];            \
496         }                                       \
497       while (0)
498 #  endif
499 # endif
500 #endif /* !YYCOPY_NEEDED */
501
502 /* YYFINAL -- State number of the termination state.  */
503 #define YYFINAL  2
504 /* YYLAST -- Last index in YYTABLE.  */
505 #define YYLAST   367
506
507 /* YYNTOKENS -- Number of terminals.  */
508 #define YYNTOKENS  49
509 /* YYNNTS -- Number of nonterminals.  */
510 #define YYNNTS  25
511 /* YYNRULES -- Number of rules.  */
512 #define YYNRULES  90
513 /* YYNSTATES -- Number of states.  */
514 #define YYNSTATES  154
515
516 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
517    by yylex, with out-of-bounds checking.  */
518 #define YYUNDEFTOK  2
519 #define YYMAXUTOK   288
520
521 #define YYTRANSLATE(YYX)                                                \
522   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
523
524 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
525    as returned by yylex, without out-of-bounds checking.  */
526 static const yytype_uint8 yytranslate[] =
527 {
528        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
529        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
530        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
531        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
532       40,    41,    34,    32,    45,    33,     2,    35,     2,     2,
533        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
534        2,    39,     2,    43,     2,     2,     2,     2,     2,     2,
535        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
536        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
537        2,    44,     2,    46,    37,     2,     2,     2,     2,     2,
538        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
539        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
540        2,     2,     2,    47,     2,    48,    42,     2,     2,     2,
541        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
542        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
543        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
544        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
545        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
546        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
547        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
548        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
549        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
550        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
551        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
552        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
553        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
554        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
555       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
556       25,    26,    27,    28,    29,    30,    31,    36,    38
557 };
558
559 #if YYDEBUG
560   /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
561 static const yytype_uint16 yyrline[] =
562 {
563        0,   199,   199,   204,   217,   218,   238,   243,   254,   266,
564      272,   279,   286,   293,   303,   304,   311,   312,   326,   327,
565      331,   332,   335,   336,   339,   340,   348,   359,   370,   381,
566      385,   396,   403,   412,   413,   418,   419,   420,   424,   432,
567      440,   448,   459,   474,   485,   499,   507,   515,   526,   532,
568      538,   544,   550,   556,   562,   569,   580,   595,   604,   608,
569      618,   632,   640,   648,   661,   663,   669,   674,   685,   694,
570      695,   700,   705,   713,   724,   725,   729,   735,   743,   753,
571      759,   765,   771,   777,   781,   787,   793,   800,   804,   810,
572      816
573 };
574 #endif
575
576 #if YYDEBUG || YYERROR_VERBOSE || 0
577 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
578    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
579 static const char *const yytname[] =
580 {
581   "$end", "error", "$undefined", "INVALID", "TOK_INT", "TOK_REAL", "STR",
582   "IDENTIFIER", "CMD_SEP", "GROUP", "TO", "VARIABLE_NUMERIC",
583   "VARIABLE_GROUP", "VARIABLE_POS", "KEYWORD_NUMERIC", "KEYWORD_STR",
584   "KEYWORD_POS", "KEYWORD_GROUP", "METHOD_NUMERIC", "METHOD_GROUP",
585   "METHOD_POS", "MODIFIER", "EMPTY_POSMOD", "PARAM", "END_OF_METHOD", "OF",
586   "CMP_OP", "PARAM_REDUCT", "OR", "XOR", "AND", "NOT", "'+'", "'-'", "'*'",
587   "'/'", "UNARY_NEG", "'^'", "NUM_REDUCT", "'='", "'('", "')'", "'~'",
588   "'?'", "'['", "','", "']'", "'{'", "'}'", "$accept", "commands",
589   "command", "cmd_plain", "selection", "integer_number", "real_number",
590   "number", "string", "sel_expr", "pos_mod", "str_match_type", "num_expr",
591   "str_expr", "pos_expr", "method_params", "method_param_list",
592   "method_param", "value_list", "value_list_contents", "basic_value_list",
593   "basic_value_list_contents", "value_item", "basic_value_item",
594   "value_item_range", YY_NULLPTR
595 };
596 #endif
597
598 # ifdef YYPRINT
599 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
600    (internal) symbol number NUM (which must be that of a token).  */
601 static const yytype_uint16 yytoknum[] =
602 {
603        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
604      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
605      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
606      285,   286,    43,    45,    42,    47,   287,    94,   288,    61,
607       40,    41,   126,    63,    91,    44,    93,   123,   125
608 };
609 # endif
610
611 #define YYPACT_NINF -85
612
613 #define yypact_value_is_default(Yystate) \
614   (!!((Yystate) == (-85)))
615
616 #define YYTABLE_NINF -22
617
618 #define yytable_value_is_error(Yytable_value) \
619   0
620
621   /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
622      STATE-NUM.  */
623 static const yytype_int16 yypact[] =
624 {
625      -85,    10,   -85,    -2,    26,   -85,   273,     0,    55,   -85,
626      -85,   -85,    40,   -85,   -85,   310,   204,   273,    69,   -85,
627       62,    82,   -85,    -3,   139,   312,   -85,   -85,   -85,    82,
628      296,   -85,   -85,   -85,   -85,   310,   -85,    96,   -85,   310,
629      -85,   204,    -6,    73,    15,    71,   220,    67,   -85,   -85,
630      135,   -85,   -85,    83,   -85,   -85,   310,   310,    41,   185,
631      -85,   -85,   -85,   204,   204,   204,   204,   204,   204,   296,
632       -3,   312,   -85,    -3,    97,   -85,   -85,    71,   319,    91,
633      -85,   -85,   -85,   -85,   -85,   -85,    69,   -85,   113,   -85,
634       24,   206,   137,   140,   -85,   -85,    90,   -85,   -85,   -85,
635      -85,   -85,    85,   -85,   -85,   -85,   330,   167,   167,    73,
636       73,    73,    67,   -85,   -85,   229,   107,    40,    24,   -85,
637      174,    69,    69,   206,   -85,   -85,   155,   153,   159,   326,
638      259,   137,   140,   -85,    -3,   179,   330,   -85,   -85,   -85,
639      -85,    69,   -85,   -85,   -85,   -85,   -85,   -85,   160,   164,
640      -85,   185,   119,   -85
641 };
642
643   /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
644      Performed when YYTABLE does not specify something else to do.  Zero
645      means the default is an error.  */
646 static const yytype_uint8 yydefact[] =
647 {
648        2,     0,     1,     0,    43,    44,    24,    25,     0,    62,
649       61,    63,    34,    66,    33,     0,     0,     0,     0,     3,
650        0,     9,     8,    15,     0,     0,    14,     5,    43,    10,
651        0,    32,    24,    25,    31,     0,    59,    64,    34,     0,
652       26,     0,     0,    52,     0,    15,     0,    14,    18,    20,
653        0,    22,    23,     0,     4,    66,     0,     0,    45,     0,
654       38,    66,    66,     0,     0,     0,     0,     0,     0,     0,
655       11,    12,    13,    60,    71,    65,    67,     0,     0,    45,
656       16,    29,    54,    58,    19,    21,     0,    17,    28,    27,
657        0,     0,    84,    85,    86,    41,    74,    76,    87,    37,
658       35,    36,     0,    39,    47,    42,    30,    48,    49,    50,
659       51,    53,     0,    71,    68,    69,     0,     0,     0,    46,
660        0,     0,     0,     0,    77,    40,     0,    43,    44,     0,
661        0,     0,     0,    55,    79,     0,    81,    82,    80,    72,
662       83,     0,    75,    88,    89,    90,    78,    70,    43,    44,
663       73,    56,     0,    57
664 };
665
666   /* YYPGOTO[NTERM-NUM].  */
667 static const yytype_int8 yypgoto[] =
668 {
669      -85,   -85,   -85,   -85,     7,   -17,   -15,   -84,    -1,   116,
670       19,   -85,    12,   -85,     3,    75,   -85,   -85,   -85,    63,
671      -53,    92,    52,   -65,   -63
672 };
673
674   /* YYDEFGOTO[NTERM-NUM].  */
675 static const yytype_int16 yydefgoto[] =
676 {
677       -1,     1,    19,    20,    21,    92,    93,    53,    94,   134,
678       24,   102,    25,   137,   138,    36,    37,    76,   114,   115,
679      103,    96,   139,    97,    98
680 };
681
682   /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
683      positive, shift that token.  If negative, reduce the rule whose
684      number is the opposite.  If YYTABLE_NINF, syntax error.  */
685 static const yytype_int16 yytable[] =
686 {
687       22,    51,   116,    52,    26,    95,    27,    34,    79,    26,
688        2,     3,    61,    29,     4,     5,     6,     7,    -6,     8,
689       47,     9,    10,    11,    44,    56,    12,    57,    43,    46,
690       13,   124,    14,    72,    -7,    42,    55,    11,   145,    30,
691      117,    15,    71,    16,    13,    48,    49,    32,    33,   125,
692       17,    46,   140,    78,    18,   124,    80,   152,   146,    31,
693       42,    32,    33,   140,   118,    35,    90,   140,    18,    51,
694       54,    52,   112,    48,    49,   106,   107,   108,   109,   110,
695      111,    46,    42,    42,    42,    42,    42,    42,    91,    48,
696       49,    32,    33,   119,    48,    49,    32,    33,   131,    56,
697      132,    57,    50,    55,   143,    51,   144,    52,    83,   131,
698       68,   132,    81,   131,   133,   132,    90,    23,    50,    74,
699       75,   112,    23,    50,    51,   133,    52,   136,    86,   133,
700       87,    40,    91,    45,   135,   123,   104,   105,   136,    84,
701       85,    43,   136,    57,   113,   135,    70,   121,    42,   135,
702      122,    73,   141,    58,    59,    77,    60,    61,    62,   127,
703      128,    32,    33,   -18,     8,   153,     9,    10,    11,   -20,
704      -19,    12,    88,    89,   -21,    13,   126,    14,    48,    49,
705       32,    33,   150,   120,     0,    77,    15,     0,   129,    48,
706       49,    32,    33,    58,   151,    69,    60,    61,    62,    18,
707      130,    66,    67,   147,    68,     0,     0,    50,    28,     5,
708       48,    49,    32,    33,     0,     9,     0,     0,    50,   123,
709       38,     0,   142,     0,    99,     0,    14,   100,   101,     0,
710        0,     0,    91,   127,   128,    32,    33,    16,     8,    50,
711        9,    10,    11,     0,    41,    12,    63,     0,     0,    13,
712        0,    14,    64,    65,    66,    67,     0,    68,     0,     0,
713       15,    82,   129,   127,   128,    32,    33,     0,     8,    69,
714        9,    10,    11,    18,   130,    12,     0,    28,     5,    13,
715        0,    14,     8,     0,     9,    10,    11,     0,     0,    12,
716       15,     0,   129,    13,     0,    14,     0,     0,     0,    69,
717       28,     5,     0,    18,    15,     8,    16,     9,    10,    11,
718        0,     0,    12,    17,    28,     5,    13,    18,    14,     8,
719        0,     9,    10,     0,     0,     0,    38,    15,     0,    16,
720      148,   149,    14,     0,     0,     0,    69,     9,    63,     0,
721       18,    15,    38,    16,    64,    65,    66,    67,    14,    68,
722       39,    64,    65,    66,    67,     0,    68,     0,     0,    16,
723       82,     0,    64,    65,    66,    67,    41,    68
724 };
725
726 static const yytype_int16 yycheck[] =
727 {
728        1,    18,    86,    18,     1,    58,     8,     8,    14,     6,
729        0,     1,    18,     6,     4,     5,     6,     7,     8,     9,
730       17,    11,    12,    13,    17,    28,    16,    30,    16,    17,
731       20,    96,    22,    30,     8,    16,    21,    13,   122,    39,
732       16,    31,    30,    33,    20,     4,     5,     6,     7,   102,
733       40,    39,   115,    41,    44,   120,    41,   141,   123,     4,
734       41,     6,     7,   126,    40,    25,    25,   130,    44,    86,
735        8,    86,    69,     4,     5,    63,    64,    65,    66,    67,
736       68,    69,    63,    64,    65,    66,    67,    68,    47,     4,
737        5,     6,     7,    90,     4,     5,     6,     7,   115,    28,
738      115,    30,    33,    21,   121,   122,   121,   122,    41,   126,
739       37,   126,    41,   130,   115,   130,    25,     1,    33,    23,
740       24,   118,     6,    33,   141,   126,   141,   115,    45,   130,
741       55,    15,    47,    17,   115,    45,    61,    62,   126,     4,
742        5,   129,   130,    30,    47,   126,    30,    10,   129,   130,
743       10,    35,    45,    14,    15,    39,    17,    18,    19,     4,
744        5,     6,     7,    10,     9,    46,    11,    12,    13,    10,
745       10,    16,    56,    57,    10,    20,   113,    22,     4,     5,
746        6,     7,   130,    91,    -1,    69,    31,    -1,    33,     4,
747        5,     6,     7,    14,    15,    40,    17,    18,    19,    44,
748       45,    34,    35,    48,    37,    -1,    -1,    33,     4,     5,
749        4,     5,     6,     7,    -1,    11,    -1,    -1,    33,    45,
750       16,    -1,    48,    -1,    39,    -1,    22,    42,    43,    -1,
751       -1,    -1,    47,     4,     5,     6,     7,    33,     9,    33,
752       11,    12,    13,    -1,    40,    16,    26,    -1,    -1,    20,
753       -1,    22,    32,    33,    34,    35,    -1,    37,    -1,    -1,
754       31,    41,    33,     4,     5,     6,     7,    -1,     9,    40,
755       11,    12,    13,    44,    45,    16,    -1,     4,     5,    20,
756       -1,    22,     9,    -1,    11,    12,    13,    -1,    -1,    16,
757       31,    -1,    33,    20,    -1,    22,    -1,    -1,    -1,    40,
758        4,     5,    -1,    44,    31,     9,    33,    11,    12,    13,
759       -1,    -1,    16,    40,     4,     5,    20,    44,    22,     9,
760       -1,    11,    12,    -1,    -1,    -1,    16,    31,    -1,    33,
761        4,     5,    22,    -1,    -1,    -1,    40,    11,    26,    -1,
762       44,    31,    16,    33,    32,    33,    34,    35,    22,    37,
763       40,    32,    33,    34,    35,    -1,    37,    -1,    -1,    33,
764       41,    -1,    32,    33,    34,    35,    40,    37
765 };
766
767   /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
768      symbol of state STATE-NUM.  */
769 static const yytype_uint8 yystos[] =
770 {
771        0,    50,     0,     1,     4,     5,     6,     7,     9,    11,
772       12,    13,    16,    20,    22,    31,    33,    40,    44,    51,
773       52,    53,    57,    58,    59,    61,    63,     8,     4,    53,
774       39,     4,     6,     7,    57,    25,    64,    65,    16,    40,
775       58,    40,    59,    61,    53,    58,    61,    63,     4,     5,
776       33,    54,    55,    56,     8,    21,    28,    30,    14,    15,
777       17,    18,    19,    26,    32,    33,    34,    35,    37,    40,
778       58,    61,    63,    58,    23,    24,    66,    58,    61,    14,
779       41,    41,    41,    41,     4,     5,    45,    64,    58,    58,
780       25,    47,    54,    55,    57,    69,    70,    72,    73,    39,
781       42,    43,    60,    69,    64,    64,    61,    61,    61,    61,
782       61,    61,    63,    47,    67,    68,    56,    16,    40,    63,
783       70,    10,    10,    45,    72,    69,    68,     4,     5,    33,
784       45,    54,    55,    57,    58,    59,    61,    62,    63,    71,
785       73,    45,    48,    54,    55,    56,    72,    48,     4,     5,
786       71,    15,    56,    46
787 };
788
789   /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
790 static const yytype_uint8 yyr1[] =
791 {
792        0,    49,    50,    50,    51,    51,    52,    52,    52,    52,
793       52,    52,    52,    52,    53,    53,    53,    53,    54,    54,
794       55,    55,    56,    56,    57,    57,    58,    58,    58,    58,
795       58,    58,    58,    59,    59,    60,    60,    60,    58,    58,
796       58,    58,    58,    61,    61,    61,    61,    61,    61,    61,
797       61,    61,    61,    61,    61,    62,    62,    63,    63,    63,
798       63,    58,    61,    63,    64,    64,    65,    65,    66,    67,
799       67,    68,    68,    68,    69,    69,    70,    70,    70,    71,
800       71,    71,    71,    71,    72,    72,    72,    72,    73,    73,
801       73
802 };
803
804   /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
805 static const yytype_uint8 yyr2[] =
806 {
807        0,     2,     0,     2,     2,     2,     0,     1,     1,     1,
808        2,     3,     3,     3,     1,     1,     3,     3,     1,     2,
809        1,     2,     1,     1,     1,     1,     2,     3,     3,     3,
810        3,     2,     2,     1,     1,     1,     1,     1,     2,     3,
811        4,     3,     3,     1,     1,     2,     4,     3,     3,     3,
812        3,     3,     2,     3,     3,     1,     2,     7,     3,     2,
813        3,     1,     1,     1,     1,     2,     0,     2,     2,     1,
814        3,     0,     2,     3,     1,     3,     1,     2,     3,     1,
815        1,     1,     1,     1,     1,     1,     1,     1,     3,     3,
816        3
817 };
818
819
820 #define yyerrok         (yyerrstatus = 0)
821 #define yyclearin       (yychar = YYEMPTY)
822 #define YYEMPTY         (-2)
823 #define YYEOF           0
824
825 #define YYACCEPT        goto yyacceptlab
826 #define YYABORT         goto yyabortlab
827 #define YYERROR         goto yyerrorlab
828
829
830 #define YYRECOVERING()  (!!yyerrstatus)
831
832 #define YYBACKUP(Token, Value)                                  \
833 do                                                              \
834   if (yychar == YYEMPTY)                                        \
835     {                                                           \
836       yychar = (Token);                                         \
837       yylval = (Value);                                         \
838       YYPOPSTACK (yylen);                                       \
839       yystate = *yyssp;                                         \
840       goto yybackup;                                            \
841     }                                                           \
842   else                                                          \
843     {                                                           \
844       yyerror (&yylloc, scanner, YY_("syntax error: cannot back up")); \
845       YYERROR;                                                  \
846     }                                                           \
847 while (0)
848
849 /* Error token number */
850 #define YYTERROR        1
851 #define YYERRCODE       256
852
853
854 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
855    If N is 0, then set CURRENT to the empty location which ends
856    the previous symbol: RHS[0] (always defined).  */
857
858 #ifndef YYLLOC_DEFAULT
859 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
860     do                                                                  \
861       if (N)                                                            \
862         {                                                               \
863           (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
864           (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
865           (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
866           (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
867         }                                                               \
868       else                                                              \
869         {                                                               \
870           (Current).first_line   = (Current).last_line   =              \
871             YYRHSLOC (Rhs, 0).last_line;                                \
872           (Current).first_column = (Current).last_column =              \
873             YYRHSLOC (Rhs, 0).last_column;                              \
874         }                                                               \
875     while (0)
876 #endif
877
878 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
879
880
881 /* Enable debugging if requested.  */
882 #if YYDEBUG
883
884 # ifndef YYFPRINTF
885 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
886 #  define YYFPRINTF fprintf
887 # endif
888
889 # define YYDPRINTF(Args)                        \
890 do {                                            \
891   if (yydebug)                                  \
892     YYFPRINTF Args;                             \
893 } while (0)
894
895
896 /* YY_LOCATION_PRINT -- Print the location on the stream.
897    This macro was not mandated originally: define only if we know
898    we won't break user code: when these are the locations we know.  */
899
900 #ifndef YY_LOCATION_PRINT
901 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
902
903 /* Print *YYLOCP on YYO.  Private, do not rely on its existence. */
904
905 YY_ATTRIBUTE_UNUSED
906 static unsigned
907 yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
908 {
909   unsigned res = 0;
910   int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
911   if (0 <= yylocp->first_line)
912     {
913       res += YYFPRINTF (yyo, "%d", yylocp->first_line);
914       if (0 <= yylocp->first_column)
915         res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
916     }
917   if (0 <= yylocp->last_line)
918     {
919       if (yylocp->first_line < yylocp->last_line)
920         {
921           res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
922           if (0 <= end_col)
923             res += YYFPRINTF (yyo, ".%d", end_col);
924         }
925       else if (0 <= end_col && yylocp->first_column < end_col)
926         res += YYFPRINTF (yyo, "-%d", end_col);
927     }
928   return res;
929  }
930
931 #  define YY_LOCATION_PRINT(File, Loc)          \
932   yy_location_print_ (File, &(Loc))
933
934 # else
935 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
936 # endif
937 #endif
938
939
940 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
941 do {                                                                      \
942   if (yydebug)                                                            \
943     {                                                                     \
944       YYFPRINTF (stderr, "%s ", Title);                                   \
945       yy_symbol_print (stderr,                                            \
946                   Type, Value, Location, scanner); \
947       YYFPRINTF (stderr, "\n");                                           \
948     }                                                                     \
949 } while (0)
950
951
952 /*----------------------------------------.
953 | Print this symbol's value on YYOUTPUT.  |
954 `----------------------------------------*/
955
956 static void
957 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *scanner)
958 {
959   FILE *yyo gmx_unused = yyoutput;
960   YYUSE (yyo);
961   YYUSE (yylocationp);
962   YYUSE (scanner);
963   if (!yyvaluep)
964     return;
965 # ifdef YYPRINT
966   if (yytype < YYNTOKENS)
967     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
968 # endif
969   YYUSE (yytype);
970 }
971
972
973 /*--------------------------------.
974 | Print this symbol on YYOUTPUT.  |
975 `--------------------------------*/
976
977 static void
978 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *scanner)
979 {
980   YYFPRINTF (yyoutput, "%s %s (",
981              yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
982
983   YY_LOCATION_PRINT (yyoutput, *yylocationp);
984   YYFPRINTF (yyoutput, ": ");
985   yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, scanner);
986   YYFPRINTF (yyoutput, ")");
987 }
988
989 /*------------------------------------------------------------------.
990 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
991 | TOP (included).                                                   |
992 `------------------------------------------------------------------*/
993
994 static void
995 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
996 {
997   YYFPRINTF (stderr, "Stack now");
998   for (; yybottom <= yytop; yybottom++)
999     {
1000       int yybot = *yybottom;
1001       YYFPRINTF (stderr, " %d", yybot);
1002     }
1003   YYFPRINTF (stderr, "\n");
1004 }
1005
1006 # define YY_STACK_PRINT(Bottom, Top)                            \
1007 do {                                                            \
1008   if (yydebug)                                                  \
1009     yy_stack_print ((Bottom), (Top));                           \
1010 } while (0)
1011
1012
1013 /*------------------------------------------------.
1014 | Report that the YYRULE is going to be reduced.  |
1015 `------------------------------------------------*/
1016
1017 static void
1018 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, void *scanner)
1019 {
1020   unsigned long int yylno = yyrline[yyrule];
1021   int yynrhs = yyr2[yyrule];
1022   int yyi;
1023   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1024              yyrule - 1, yylno);
1025   /* The symbols being reduced.  */
1026   for (yyi = 0; yyi < yynrhs; yyi++)
1027     {
1028       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
1029       yy_symbol_print (stderr,
1030                        yystos[yyssp[yyi + 1 - yynrhs]],
1031                        &(yyvsp[(yyi + 1) - (yynrhs)])
1032                        , &(yylsp[(yyi + 1) - (yynrhs)])                       , scanner);
1033       YYFPRINTF (stderr, "\n");
1034     }
1035 }
1036
1037 # define YY_REDUCE_PRINT(Rule)          \
1038 do {                                    \
1039   if (yydebug)                          \
1040     yy_reduce_print (yyssp, yyvsp, yylsp, Rule, scanner); \
1041 } while (0)
1042
1043 /* Nonzero means print parse trace.  It is left uninitialized so that
1044    multiple parsers can coexist.  */
1045 int yydebug;
1046 #else /* !YYDEBUG */
1047 # define YYDPRINTF(Args)
1048 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1049 # define YY_STACK_PRINT(Bottom, Top)
1050 # define YY_REDUCE_PRINT(Rule)
1051 #endif /* !YYDEBUG */
1052
1053
1054 /* YYINITDEPTH -- initial size of the parser's stacks.  */
1055 #ifndef YYINITDEPTH
1056 # define YYINITDEPTH 200
1057 #endif
1058
1059 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1060    if the built-in stack extension method is used).
1061
1062    Do not make this value too large; the results are undefined if
1063    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1064    evaluated with infinite-precision integer arithmetic.  */
1065
1066 #ifndef YYMAXDEPTH
1067 # define YYMAXDEPTH 10000
1068 #endif
1069
1070
1071 #if YYERROR_VERBOSE
1072
1073 # ifndef yystrlen
1074 #  if defined __GLIBC__ && defined _STRING_H
1075 #   define yystrlen strlen
1076 #  else
1077 /* Return the length of YYSTR.  */
1078 static YYSIZE_T
1079 yystrlen (const char *yystr)
1080 {
1081   YYSIZE_T yylen;
1082   for (yylen = 0; yystr[yylen]; yylen++)
1083     continue;
1084   return yylen;
1085 }
1086 #  endif
1087 # endif
1088
1089 # ifndef yystpcpy
1090 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1091 #   define yystpcpy stpcpy
1092 #  else
1093 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1094    YYDEST.  */
1095 static char *
1096 yystpcpy (char *yydest, const char *yysrc)
1097 {
1098   char *yyd = yydest;
1099   const char *yys = yysrc;
1100
1101   while ((*yyd++ = *yys++) != '\0')
1102     continue;
1103
1104   return yyd - 1;
1105 }
1106 #  endif
1107 # endif
1108
1109 # ifndef yytnamerr
1110 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1111    quotes and backslashes, so that it's suitable for yyerror.  The
1112    heuristic is that double-quoting is unnecessary unless the string
1113    contains an apostrophe, a comma, or backslash (other than
1114    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
1115    null, do not copy; instead, return the length of what the result
1116    would have been.  */
1117 static YYSIZE_T
1118 yytnamerr (char *yyres, const char *yystr)
1119 {
1120   if (*yystr == '"')
1121     {
1122       YYSIZE_T yyn = 0;
1123       char const *yyp = yystr;
1124
1125       for (;;)
1126         switch (*++yyp)
1127           {
1128           case '\'':
1129           case ',':
1130             goto do_not_strip_quotes;
1131
1132           case '\\':
1133             if (*++yyp != '\\')
1134               goto do_not_strip_quotes;
1135             /* Fall through.  */
1136           default:
1137             if (yyres)
1138               yyres[yyn] = *yyp;
1139             yyn++;
1140             break;
1141
1142           case '"':
1143             if (yyres)
1144               yyres[yyn] = '\0';
1145             return yyn;
1146           }
1147     do_not_strip_quotes: ;
1148     }
1149
1150   if (! yyres)
1151     return yystrlen (yystr);
1152
1153   return yystpcpy (yyres, yystr) - yyres;
1154 }
1155 # endif
1156
1157 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1158    about the unexpected token YYTOKEN for the state stack whose top is
1159    YYSSP.
1160
1161    Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
1162    not large enough to hold the message.  In that case, also set
1163    *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
1164    required number of bytes is too large to store.  */
1165 static int
1166 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1167                 yytype_int16 *yyssp, int yytoken)
1168 {
1169   YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1170   YYSIZE_T yysize = yysize0;
1171   enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1172   /* Internationalized format string. */
1173   const char *yyformat = YY_NULLPTR;
1174   /* Arguments of yyformat. */
1175   char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1176   /* Number of reported tokens (one for the "unexpected", one per
1177      "expected"). */
1178   int yycount = 0;
1179
1180   /* There are many possibilities here to consider:
1181      - If this state is a consistent state with a default action, then
1182        the only way this function was invoked is if the default action
1183        is an error action.  In that case, don't check for expected
1184        tokens because there are none.
1185      - The only way there can be no lookahead present (in yychar) is if
1186        this state is a consistent state with a default action.  Thus,
1187        detecting the absence of a lookahead is sufficient to determine
1188        that there is no unexpected or expected token to report.  In that
1189        case, just report a simple "syntax error".
1190      - Don't assume there isn't a lookahead just because this state is a
1191        consistent state with a default action.  There might have been a
1192        previous inconsistent state, consistent state with a non-default
1193        action, or user semantic action that manipulated yychar.
1194      - Of course, the expected token list depends on states to have
1195        correct lookahead information, and it depends on the parser not
1196        to perform extra reductions after fetching a lookahead from the
1197        scanner and before detecting a syntax error.  Thus, state merging
1198        (from LALR or IELR) and default reductions corrupt the expected
1199        token list.  However, the list is correct for canonical LR with
1200        one exception: it will still contain any token that will not be
1201        accepted due to an error action in a later state.
1202   */
1203   if (yytoken != YYEMPTY)
1204     {
1205       int yyn = yypact[*yyssp];
1206       yyarg[yycount++] = yytname[yytoken];
1207       if (!yypact_value_is_default (yyn))
1208         {
1209           /* Start YYX at -YYN if negative to avoid negative indexes in
1210              YYCHECK.  In other words, skip the first -YYN actions for
1211              this state because they are default actions.  */
1212           int yyxbegin = yyn < 0 ? -yyn : 0;
1213           /* Stay within bounds of both yycheck and yytname.  */
1214           int yychecklim = YYLAST - yyn + 1;
1215           int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1216           int yyx;
1217
1218           for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1219             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1220                 && !yytable_value_is_error (yytable[yyx + yyn]))
1221               {
1222                 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1223                   {
1224                     yycount = 1;
1225                     yysize = yysize0;
1226                     break;
1227                   }
1228                 yyarg[yycount++] = yytname[yyx];
1229                 {
1230                   YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1231                   if (! (yysize <= yysize1
1232                          && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1233                     return 2;
1234                   yysize = yysize1;
1235                 }
1236               }
1237         }
1238     }
1239
1240   switch (yycount)
1241     {
1242 # define YYCASE_(N, S)                      \
1243       case N:                               \
1244         yyformat = S;                       \
1245       break
1246       YYCASE_(0, YY_("syntax error"));
1247       YYCASE_(1, YY_("syntax error, unexpected %s"));
1248       YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1249       YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1250       YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1251       YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1252 # undef YYCASE_
1253     }
1254
1255   {
1256     YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1257     if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1258       return 2;
1259     yysize = yysize1;
1260   }
1261
1262   if (*yymsg_alloc < yysize)
1263     {
1264       *yymsg_alloc = 2 * yysize;
1265       if (! (yysize <= *yymsg_alloc
1266              && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1267         *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1268       return 1;
1269     }
1270
1271   /* Avoid sprintf, as that infringes on the user's name space.
1272      Don't have undefined behavior even if the translation
1273      produced a string with the wrong number of "%s"s.  */
1274   {
1275     char *yyp = *yymsg;
1276     int yyi = 0;
1277     while ((*yyp = *yyformat) != '\0')
1278       if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1279         {
1280           yyp += yytnamerr (yyp, yyarg[yyi++]);
1281           yyformat += 2;
1282         }
1283       else
1284         {
1285           yyp++;
1286           yyformat++;
1287         }
1288   }
1289   return 0;
1290 }
1291 #endif /* YYERROR_VERBOSE */
1292
1293 /*-----------------------------------------------.
1294 | Release the memory associated to this symbol.  |
1295 `-----------------------------------------------*/
1296
1297 static void
1298 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, void *scanner)
1299 {
1300   YYUSE (yyvaluep);
1301   YYUSE (yylocationp);
1302   YYUSE (scanner);
1303   if (!yymsg)
1304     yymsg = "Deleting";
1305   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1306
1307   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1308   switch (yytype)
1309     {
1310           case 6: /* STR  */
1311 #line 178 "parser.y" /* yacc.c:1257  */
1312       { free(((*yyvaluep).str));        }
1313 #line 1313 "parser.cpp" /* yacc.c:1257  */
1314         break;
1315
1316     case 7: /* IDENTIFIER  */
1317 #line 178 "parser.y" /* yacc.c:1257  */
1318       { free(((*yyvaluep).str));        }
1319 #line 1319 "parser.cpp" /* yacc.c:1257  */
1320         break;
1321
1322     case 16: /* KEYWORD_POS  */
1323 #line 178 "parser.y" /* yacc.c:1257  */
1324       { free(((*yyvaluep).str));        }
1325 #line 1325 "parser.cpp" /* yacc.c:1257  */
1326         break;
1327
1328     case 23: /* PARAM  */
1329 #line 179 "parser.y" /* yacc.c:1257  */
1330       { if(((*yyvaluep).str)) free(((*yyvaluep).str)); }
1331 #line 1331 "parser.cpp" /* yacc.c:1257  */
1332         break;
1333
1334     case 26: /* CMP_OP  */
1335 #line 178 "parser.y" /* yacc.c:1257  */
1336       { free(((*yyvaluep).str));        }
1337 #line 1337 "parser.cpp" /* yacc.c:1257  */
1338         break;
1339
1340     case 50: /* commands  */
1341 #line 180 "parser.y" /* yacc.c:1257  */
1342       { delete ((*yyvaluep).sel);       }
1343 #line 1343 "parser.cpp" /* yacc.c:1257  */
1344         break;
1345
1346     case 51: /* command  */
1347 #line 180 "parser.y" /* yacc.c:1257  */
1348       { delete ((*yyvaluep).sel);       }
1349 #line 1349 "parser.cpp" /* yacc.c:1257  */
1350         break;
1351
1352     case 52: /* cmd_plain  */
1353 #line 180 "parser.y" /* yacc.c:1257  */
1354       { delete ((*yyvaluep).sel);       }
1355 #line 1355 "parser.cpp" /* yacc.c:1257  */
1356         break;
1357
1358     case 53: /* selection  */
1359 #line 180 "parser.y" /* yacc.c:1257  */
1360       { delete ((*yyvaluep).sel);       }
1361 #line 1361 "parser.cpp" /* yacc.c:1257  */
1362         break;
1363
1364     case 57: /* string  */
1365 #line 178 "parser.y" /* yacc.c:1257  */
1366       { free(((*yyvaluep).str));        }
1367 #line 1367 "parser.cpp" /* yacc.c:1257  */
1368         break;
1369
1370     case 58: /* sel_expr  */
1371 #line 181 "parser.y" /* yacc.c:1257  */
1372       { delete ((*yyvaluep).sel);       }
1373 #line 1373 "parser.cpp" /* yacc.c:1257  */
1374         break;
1375
1376     case 59: /* pos_mod  */
1377 #line 179 "parser.y" /* yacc.c:1257  */
1378       { if(((*yyvaluep).str)) free(((*yyvaluep).str)); }
1379 #line 1379 "parser.cpp" /* yacc.c:1257  */
1380         break;
1381
1382     case 61: /* num_expr  */
1383 #line 181 "parser.y" /* yacc.c:1257  */
1384       { delete ((*yyvaluep).sel);       }
1385 #line 1385 "parser.cpp" /* yacc.c:1257  */
1386         break;
1387
1388     case 62: /* str_expr  */
1389 #line 181 "parser.y" /* yacc.c:1257  */
1390       { delete ((*yyvaluep).sel);       }
1391 #line 1391 "parser.cpp" /* yacc.c:1257  */
1392         break;
1393
1394     case 63: /* pos_expr  */
1395 #line 181 "parser.y" /* yacc.c:1257  */
1396       { delete ((*yyvaluep).sel);       }
1397 #line 1397 "parser.cpp" /* yacc.c:1257  */
1398         break;
1399
1400     case 64: /* method_params  */
1401 #line 182 "parser.y" /* yacc.c:1257  */
1402       { delete ((*yyvaluep).plist);       }
1403 #line 1403 "parser.cpp" /* yacc.c:1257  */
1404         break;
1405
1406     case 65: /* method_param_list  */
1407 #line 182 "parser.y" /* yacc.c:1257  */
1408       { delete ((*yyvaluep).plist);       }
1409 #line 1409 "parser.cpp" /* yacc.c:1257  */
1410         break;
1411
1412     case 66: /* method_param  */
1413 #line 182 "parser.y" /* yacc.c:1257  */
1414       { delete ((*yyvaluep).param);       }
1415 #line 1415 "parser.cpp" /* yacc.c:1257  */
1416         break;
1417
1418     case 67: /* value_list  */
1419 #line 183 "parser.y" /* yacc.c:1257  */
1420       { delete ((*yyvaluep).vlist);       }
1421 #line 1421 "parser.cpp" /* yacc.c:1257  */
1422         break;
1423
1424     case 68: /* value_list_contents  */
1425 #line 183 "parser.y" /* yacc.c:1257  */
1426       { delete ((*yyvaluep).vlist);       }
1427 #line 1427 "parser.cpp" /* yacc.c:1257  */
1428         break;
1429
1430     case 69: /* basic_value_list  */
1431 #line 183 "parser.y" /* yacc.c:1257  */
1432       { delete ((*yyvaluep).vlist);       }
1433 #line 1433 "parser.cpp" /* yacc.c:1257  */
1434         break;
1435
1436     case 70: /* basic_value_list_contents  */
1437 #line 183 "parser.y" /* yacc.c:1257  */
1438       { delete ((*yyvaluep).vlist);       }
1439 #line 1439 "parser.cpp" /* yacc.c:1257  */
1440         break;
1441
1442     case 71: /* value_item  */
1443 #line 184 "parser.y" /* yacc.c:1257  */
1444       { delete ((*yyvaluep).val);       }
1445 #line 1445 "parser.cpp" /* yacc.c:1257  */
1446         break;
1447
1448     case 72: /* basic_value_item  */
1449 #line 184 "parser.y" /* yacc.c:1257  */
1450       { delete ((*yyvaluep).val);       }
1451 #line 1451 "parser.cpp" /* yacc.c:1257  */
1452         break;
1453
1454     case 73: /* value_item_range  */
1455 #line 184 "parser.y" /* yacc.c:1257  */
1456       { delete ((*yyvaluep).val);       }
1457 #line 1457 "parser.cpp" /* yacc.c:1257  */
1458         break;
1459
1460
1461       default:
1462         break;
1463     }
1464   YY_IGNORE_MAYBE_UNINITIALIZED_END
1465 }
1466
1467
1468
1469 struct yypstate
1470   {
1471     /* Number of syntax errors so far.  */
1472     int yynerrs;
1473
1474     int yystate;
1475     /* Number of tokens to shift before error messages enabled.  */
1476     int yyerrstatus;
1477
1478     /* The stacks and their tools:
1479        'yyss': related to states.
1480        'yyvs': related to semantic values.
1481        'yyls': related to locations.
1482
1483        Refer to the stacks through separate pointers, to allow yyoverflow
1484        to reallocate them elsewhere.  */
1485
1486     /* The state stack.  */
1487     yytype_int16 yyssa[YYINITDEPTH];
1488     yytype_int16 *yyss;
1489     yytype_int16 *yyssp;
1490
1491     /* The semantic value stack.  */
1492     YYSTYPE yyvsa[YYINITDEPTH];
1493     YYSTYPE *yyvs;
1494     YYSTYPE *yyvsp;
1495
1496     /* The location stack.  */
1497     YYLTYPE yylsa[YYINITDEPTH];
1498     YYLTYPE *yyls;
1499     YYLTYPE *yylsp;
1500
1501     /* The locations where the error started and ended.  */
1502     YYLTYPE yyerror_range[3];
1503
1504     YYSIZE_T yystacksize;
1505     /* Used to determine if this is the first time this instance has
1506        been used.  */
1507     int yynew;
1508   };
1509
1510 /* Initialize the parser data structure.  */
1511 yypstate *
1512 yypstate_new (void)
1513 {
1514   yypstate *yyps;
1515   yyps = (yypstate *) malloc (sizeof *yyps);
1516   if (!yyps)
1517     return YY_NULLPTR;
1518   yyps->yynew = 1;
1519   return yyps;
1520 }
1521
1522 void
1523 yypstate_delete (yypstate *yyps)
1524 {
1525 #ifndef yyoverflow
1526   /* If the stack was reallocated but the parse did not complete, then the
1527      stack still needs to be freed.  */
1528   if (!yyps->yynew && yyps->yyss != yyps->yyssa)
1529     YYSTACK_FREE (yyps->yyss);
1530 #endif
1531   free (yyps);
1532 }
1533
1534 #define _gmx_sel_yynerrs yyps->_gmx_sel_yynerrs
1535 #define yystate yyps->yystate
1536 #define yyerrstatus yyps->yyerrstatus
1537 #define yyssa yyps->yyssa
1538 #define yyss yyps->yyss
1539 #define yyssp yyps->yyssp
1540 #define yyvsa yyps->yyvsa
1541 #define yyvs yyps->yyvs
1542 #define yyvsp yyps->yyvsp
1543 #define yylsa yyps->yylsa
1544 #define yyls yyps->yyls
1545 #define yylsp yyps->yylsp
1546 #define yyerror_range yyps->yyerror_range
1547 #define yystacksize yyps->yystacksize
1548
1549
1550 /*---------------.
1551 | yypush_parse.  |
1552 `---------------*/
1553
1554 int
1555 yypush_parse (yypstate *yyps, int yypushed_char, YYSTYPE const *yypushed_val, YYLTYPE *yypushed_loc, void *scanner)
1556 {
1557 /* The lookahead symbol.  */
1558 int yychar;
1559
1560
1561 /* The semantic value of the lookahead symbol.  */
1562 /* Default value used for initialization, for pacifying older GCCs
1563    or non-GCC compilers.  */
1564 YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1565 YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1566
1567 /* Location data for the lookahead symbol.  */
1568 static YYLTYPE yyloc_default
1569 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1570   = { 1, 1, 1, 1 }
1571 # endif
1572 ;
1573 YYLTYPE yylloc = yyloc_default;
1574
1575   int yyn;
1576   int yyresult;
1577   /* Lookahead token as an internal (translated) token number.  */
1578   int yytoken = 0;
1579   /* The variables used to return semantic value and location from the
1580      action routines.  */
1581   YYSTYPE yyval;
1582   YYLTYPE yyloc;
1583
1584 #if YYERROR_VERBOSE
1585   /* Buffer for error messages, and its allocated size.  */
1586   char yymsgbuf[128];
1587   char *yymsg = yymsgbuf;
1588   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1589 #endif
1590
1591 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1592
1593   /* The number of symbols on the RHS of the reduced rule.
1594      Keep to zero when no symbol should be popped.  */
1595   int yylen = 0;
1596
1597   if (!yyps->yynew)
1598     {
1599       yyn = yypact[yystate];
1600       goto yyread_pushed_token;
1601     }
1602
1603   yyssp = yyss = yyssa;
1604   yyvsp = yyvs = yyvsa;
1605   yylsp = yyls = yylsa;
1606   yystacksize = YYINITDEPTH;
1607
1608   YYDPRINTF ((stderr, "Starting parse\n"));
1609
1610   yystate = 0;
1611   yyerrstatus = 0;
1612   yynerrs = 0;
1613   yychar = YYEMPTY; /* Cause a token to be read.  */
1614   yylsp[0] = *yypushed_loc;
1615   goto yysetstate;
1616
1617 /*------------------------------------------------------------.
1618 | yynewstate -- Push a new state, which is found in yystate.  |
1619 `------------------------------------------------------------*/
1620  yynewstate:
1621   /* In all cases, when you get here, the value and location stacks
1622      have just been pushed.  So pushing a state here evens the stacks.  */
1623   yyssp++;
1624
1625  yysetstate:
1626   *yyssp = yystate;
1627
1628   if (yyss + yystacksize - 1 <= yyssp)
1629     {
1630       /* Get the current used size of the three stacks, in elements.  */
1631       YYSIZE_T yysize = yyssp - yyss + 1;
1632
1633 #ifdef yyoverflow
1634       {
1635         /* Give user a chance to reallocate the stack.  Use copies of
1636            these so that the &'s don't force the real ones into
1637            memory.  */
1638         YYSTYPE *yyvs1 = yyvs;
1639         yytype_int16 *yyss1 = yyss;
1640         YYLTYPE *yyls1 = yyls;
1641
1642         /* Each stack pointer address is followed by the size of the
1643            data in use in that stack, in bytes.  This used to be a
1644            conditional around just the two extra args, but that might
1645            be undefined if yyoverflow is a macro.  */
1646         yyoverflow (YY_("memory exhausted"),
1647                     &yyss1, yysize * sizeof (*yyssp),
1648                     &yyvs1, yysize * sizeof (*yyvsp),
1649                     &yyls1, yysize * sizeof (*yylsp),
1650                     &yystacksize);
1651
1652         yyls = yyls1;
1653         yyss = yyss1;
1654         yyvs = yyvs1;
1655       }
1656 #else /* no yyoverflow */
1657 # ifndef YYSTACK_RELOCATE
1658       goto yyexhaustedlab;
1659 # else
1660       /* Extend the stack our own way.  */
1661       if (YYMAXDEPTH <= yystacksize)
1662         goto yyexhaustedlab;
1663       yystacksize *= 2;
1664       if (YYMAXDEPTH < yystacksize)
1665         yystacksize = YYMAXDEPTH;
1666
1667       {
1668         yytype_int16 *yyss1 = yyss;
1669         union yyalloc *yyptr =
1670           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1671         if (! yyptr)
1672           goto yyexhaustedlab;
1673         YYSTACK_RELOCATE (yyss_alloc, yyss);
1674         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1675         YYSTACK_RELOCATE (yyls_alloc, yyls);
1676 #  undef YYSTACK_RELOCATE
1677         if (yyss1 != yyssa)
1678           YYSTACK_FREE (yyss1);
1679       }
1680 # endif
1681 #endif /* no yyoverflow */
1682
1683       yyssp = yyss + yysize - 1;
1684       yyvsp = yyvs + yysize - 1;
1685       yylsp = yyls + yysize - 1;
1686
1687       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1688                   (unsigned long int) yystacksize));
1689
1690       if (yyss + yystacksize - 1 <= yyssp)
1691         YYABORT;
1692     }
1693
1694   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1695
1696   if (yystate == YYFINAL)
1697     YYACCEPT;
1698
1699   goto yybackup;
1700
1701 /*-----------.
1702 | yybackup.  |
1703 `-----------*/
1704 yybackup:
1705
1706   /* Do appropriate processing given the current state.  Read a
1707      lookahead token if we need one and don't already have one.  */
1708
1709   /* First try to decide what to do without reference to lookahead token.  */
1710   yyn = yypact[yystate];
1711   if (yypact_value_is_default (yyn))
1712     goto yydefault;
1713
1714   /* Not known => get a lookahead token if don't already have one.  */
1715
1716   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1717   if (yychar == YYEMPTY)
1718     {
1719       if (!yyps->yynew)
1720         {
1721           YYDPRINTF ((stderr, "Return for a new token:\n"));
1722           yyresult = YYPUSH_MORE;
1723           goto yypushreturn;
1724         }
1725       yyps->yynew = 0;
1726 yyread_pushed_token:
1727       YYDPRINTF ((stderr, "Reading a token: "));
1728       yychar = yypushed_char;
1729       if (yypushed_val)
1730         yylval = *yypushed_val;
1731       if (yypushed_loc)
1732         yylloc = *yypushed_loc;
1733     }
1734
1735   if (yychar <= YYEOF)
1736     {
1737       yychar = yytoken = YYEOF;
1738       YYDPRINTF ((stderr, "Now at end of input.\n"));
1739     }
1740   else
1741     {
1742       yytoken = YYTRANSLATE (yychar);
1743       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1744     }
1745
1746   /* If the proper action on seeing token YYTOKEN is to reduce or to
1747      detect an error, take that action.  */
1748   yyn += yytoken;
1749   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1750     goto yydefault;
1751   yyn = yytable[yyn];
1752   if (yyn <= 0)
1753     {
1754       if (yytable_value_is_error (yyn))
1755         goto yyerrlab;
1756       yyn = -yyn;
1757       goto yyreduce;
1758     }
1759
1760   /* Count tokens shifted since error; after three, turn off error
1761      status.  */
1762   if (yyerrstatus)
1763     yyerrstatus--;
1764
1765   /* Shift the lookahead token.  */
1766   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1767
1768   /* Discard the shifted token.  */
1769   yychar = YYEMPTY;
1770
1771   yystate = yyn;
1772   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1773   *++yyvsp = yylval;
1774   YY_IGNORE_MAYBE_UNINITIALIZED_END
1775   *++yylsp = yylloc;
1776   goto yynewstate;
1777
1778
1779 /*-----------------------------------------------------------.
1780 | yydefault -- do the default action for the current state.  |
1781 `-----------------------------------------------------------*/
1782 yydefault:
1783   yyn = yydefact[yystate];
1784   if (yyn == 0)
1785     goto yyerrlab;
1786   goto yyreduce;
1787
1788
1789 /*-----------------------------.
1790 | yyreduce -- Do a reduction.  |
1791 `-----------------------------*/
1792 yyreduce:
1793   /* yyn is the number of a rule to reduce with.  */
1794   yylen = yyr2[yyn];
1795
1796   /* If YYLEN is nonzero, implement the default value of the action:
1797      '$$ = $1'.
1798
1799      Otherwise, the following line sets YYVAL to garbage.
1800      This behavior is undocumented and Bison
1801      users should not rely upon it.  Assigning to YYVAL
1802      unconditionally makes the parser a bit smaller, and it avoids a
1803      GCC warning that YYVAL may be used uninitialized.  */
1804   yyval = yyvsp[1-yylen];
1805
1806   /* Default location.  */
1807   YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1808   YY_REDUCE_PRINT (yyn);
1809   switch (yyn)
1810     {
1811         case 2:
1812 #line 199 "parser.y" /* yacc.c:1646  */
1813     {
1814                  BEGIN_ACTION;
1815                  set_empty((yyval.sel));
1816                  END_ACTION_TOPLEVEL;
1817              }
1818 #line 1818 "parser.cpp" /* yacc.c:1646  */
1819     break;
1820
1821   case 3:
1822 #line 205 "parser.y" /* yacc.c:1646  */
1823     {
1824                  BEGIN_ACTION;
1825                  set((yyval.sel), _gmx_sel_append_selection(get((yyvsp[0].sel)), get((yyvsp[-1].sel)), scanner));
1826                  if (_gmx_sel_parser_should_finish(scanner)) {
1827                      delete (yyval.sel);
1828                      YYACCEPT;
1829                  }
1830                  END_ACTION_TOPLEVEL;
1831              }
1832 #line 1832 "parser.cpp" /* yacc.c:1646  */
1833     break;
1834
1835   case 4:
1836 #line 217 "parser.y" /* yacc.c:1646  */
1837     { (yyval.sel) = (yyvsp[-1].sel); }
1838 #line 1838 "parser.cpp" /* yacc.c:1646  */
1839     break;
1840
1841   case 5:
1842 #line 219 "parser.y" /* yacc.c:1646  */
1843     {
1844                  BEGIN_ACTION;
1845                  _gmx_sel_lexer_clear_method_stack(scanner);
1846                  if (_gmx_selparser_handle_error(scanner))
1847                  {
1848                      yyerrok;
1849                  }
1850                  else
1851                  {
1852                      YYABORT;
1853                  }
1854                  _gmx_sel_lexer_clear_pselstr(scanner);
1855                  set_empty((yyval.sel));
1856                  END_ACTION_TOPLEVEL;
1857              }
1858 #line 1858 "parser.cpp" /* yacc.c:1646  */
1859     break;
1860
1861   case 6:
1862 #line 238 "parser.y" /* yacc.c:1646  */
1863     {
1864                  BEGIN_ACTION;
1865                  set_empty((yyval.sel));
1866                  END_ACTION;
1867              }
1868 #line 1868 "parser.cpp" /* yacc.c:1646  */
1869     break;
1870
1871   case 7:
1872 #line 244 "parser.y" /* yacc.c:1646  */
1873     {
1874                  BEGIN_ACTION;
1875                  SelectionTreeElementPointer s
1876                         = _gmx_sel_init_group_by_id((yyvsp[0].i), scanner);
1877                  SelectionTreeElementPointer p
1878                         = _gmx_sel_init_position(s, NULL, scanner);
1879                  if (!p) YYERROR;
1880                  set((yyval.sel), _gmx_sel_init_selection(NULL, p, scanner));
1881                  END_ACTION;
1882              }
1883 #line 1883 "parser.cpp" /* yacc.c:1646  */
1884     break;
1885
1886   case 8:
1887 #line 255 "parser.y" /* yacc.c:1646  */
1888     {
1889                  BEGIN_ACTION;
1890                  const sfree_guard nameGuard((yyvsp[0].str));
1891                  SelectionTreeElementPointer s
1892                         = _gmx_sel_init_group_by_name((yyvsp[0].str), scanner);
1893                  SelectionTreeElementPointer p
1894                         = _gmx_sel_init_position(s, NULL, scanner);
1895                  if (!p) YYERROR;
1896                  set((yyval.sel), _gmx_sel_init_selection(NULL, p, scanner));
1897                  END_ACTION;
1898              }
1899 #line 1899 "parser.cpp" /* yacc.c:1646  */
1900     break;
1901
1902   case 9:
1903 #line 267 "parser.y" /* yacc.c:1646  */
1904     {
1905                  BEGIN_ACTION;
1906                  set((yyval.sel), _gmx_sel_init_selection(NULL, get((yyvsp[0].sel)), scanner));
1907                  END_ACTION;
1908              }
1909 #line 1909 "parser.cpp" /* yacc.c:1646  */
1910     break;
1911
1912   case 10:
1913 #line 273 "parser.y" /* yacc.c:1646  */
1914     {
1915                  BEGIN_ACTION;
1916                  const sfree_guard nameGuard((yyvsp[-1].str));
1917                  set((yyval.sel), _gmx_sel_init_selection((yyvsp[-1].str), get((yyvsp[0].sel)), scanner));
1918                  END_ACTION;
1919              }
1920 #line 1920 "parser.cpp" /* yacc.c:1646  */
1921     break;
1922
1923   case 11:
1924 #line 280 "parser.y" /* yacc.c:1646  */
1925     {
1926                  BEGIN_ACTION;
1927                  const sfree_guard nameGuard((yyvsp[-2].str));
1928                  set((yyval.sel), _gmx_sel_assign_variable((yyvsp[-2].str), get((yyvsp[0].sel)), scanner));
1929                  END_ACTION;
1930              }
1931 #line 1931 "parser.cpp" /* yacc.c:1646  */
1932     break;
1933
1934   case 12:
1935 #line 287 "parser.y" /* yacc.c:1646  */
1936     {
1937                  BEGIN_ACTION;
1938                  const sfree_guard nameGuard((yyvsp[-2].str));
1939                  set((yyval.sel), _gmx_sel_assign_variable((yyvsp[-2].str), get((yyvsp[0].sel)), scanner));
1940                  END_ACTION;
1941              }
1942 #line 1942 "parser.cpp" /* yacc.c:1646  */
1943     break;
1944
1945   case 13:
1946 #line 294 "parser.y" /* yacc.c:1646  */
1947     {
1948                  BEGIN_ACTION;
1949                  const sfree_guard nameGuard((yyvsp[-2].str));
1950                  set((yyval.sel), _gmx_sel_assign_variable((yyvsp[-2].str), get((yyvsp[0].sel)), scanner));
1951                  END_ACTION;
1952              }
1953 #line 1953 "parser.cpp" /* yacc.c:1646  */
1954     break;
1955
1956   case 14:
1957 #line 303 "parser.y" /* yacc.c:1646  */
1958     { (yyval.sel) = (yyvsp[0].sel); }
1959 #line 1959 "parser.cpp" /* yacc.c:1646  */
1960     break;
1961
1962   case 15:
1963 #line 305 "parser.y" /* yacc.c:1646  */
1964     {
1965                  BEGIN_ACTION;
1966                  set((yyval.sel), _gmx_sel_init_position(get((yyvsp[0].sel)), NULL, scanner));
1967                  CHECK_SEL((yyval.sel));
1968                  END_ACTION;
1969              }
1970 #line 1970 "parser.cpp" /* yacc.c:1646  */
1971     break;
1972
1973   case 16:
1974 #line 311 "parser.y" /* yacc.c:1646  */
1975     { (yyval.sel) = (yyvsp[-1].sel); }
1976 #line 1976 "parser.cpp" /* yacc.c:1646  */
1977     break;
1978
1979   case 17:
1980 #line 313 "parser.y" /* yacc.c:1646  */
1981     {
1982                  BEGIN_ACTION;
1983                  set((yyval.sel), _gmx_sel_init_modifier((yyvsp[-1].meth), get((yyvsp[0].plist)), get((yyvsp[-2].sel)), scanner));
1984                  CHECK_SEL((yyval.sel));
1985                  END_ACTION;
1986              }
1987 #line 1987 "parser.cpp" /* yacc.c:1646  */
1988     break;
1989
1990   case 18:
1991 #line 326 "parser.y" /* yacc.c:1646  */
1992     { (yyval.i) = (yyvsp[0].i); }
1993 #line 1993 "parser.cpp" /* yacc.c:1646  */
1994     break;
1995
1996   case 19:
1997 #line 327 "parser.y" /* yacc.c:1646  */
1998     { (yyval.i) = -(yyvsp[0].i); }
1999 #line 1999 "parser.cpp" /* yacc.c:1646  */
2000     break;
2001
2002   case 20:
2003 #line 331 "parser.y" /* yacc.c:1646  */
2004     { (yyval.r) = (yyvsp[0].r); }
2005 #line 2005 "parser.cpp" /* yacc.c:1646  */
2006     break;
2007
2008   case 21:
2009 #line 332 "parser.y" /* yacc.c:1646  */
2010     { (yyval.r) = -(yyvsp[0].r); }
2011 #line 2011 "parser.cpp" /* yacc.c:1646  */
2012     break;
2013
2014   case 22:
2015 #line 335 "parser.y" /* yacc.c:1646  */
2016     { (yyval.r) = (yyvsp[0].i); }
2017 #line 2017 "parser.cpp" /* yacc.c:1646  */
2018     break;
2019
2020   case 23:
2021 #line 336 "parser.y" /* yacc.c:1646  */
2022     { (yyval.r) = (yyvsp[0].r); }
2023 #line 2023 "parser.cpp" /* yacc.c:1646  */
2024     break;
2025
2026   case 24:
2027 #line 339 "parser.y" /* yacc.c:1646  */
2028     { (yyval.str) = (yyvsp[0].str); }
2029 #line 2029 "parser.cpp" /* yacc.c:1646  */
2030     break;
2031
2032   case 25:
2033 #line 340 "parser.y" /* yacc.c:1646  */
2034     { (yyval.str) = (yyvsp[0].str); }
2035 #line 2035 "parser.cpp" /* yacc.c:1646  */
2036     break;
2037
2038   case 26:
2039 #line 349 "parser.y" /* yacc.c:1646  */
2040     {
2041                  BEGIN_ACTION;
2042                  SelectionTreeElementPointer arg(get((yyvsp[0].sel)));
2043                  SelectionTreeElementPointer sel(
2044                         new SelectionTreeElement(SEL_BOOLEAN, (yyloc)));
2045                  sel->u.boolt = BOOL_NOT;
2046                  sel->child = arg;
2047                  set((yyval.sel), sel);
2048                  END_ACTION;
2049              }
2050 #line 2050 "parser.cpp" /* yacc.c:1646  */
2051     break;
2052
2053   case 27:
2054 #line 360 "parser.y" /* yacc.c:1646  */
2055     {
2056                  BEGIN_ACTION;
2057                  SelectionTreeElementPointer arg1(get((yyvsp[-2].sel))), arg2(get((yyvsp[0].sel)));
2058                  SelectionTreeElementPointer sel(
2059                         new SelectionTreeElement(SEL_BOOLEAN, (yyloc)));
2060                  sel->u.boolt = BOOL_AND;
2061                  sel->child = arg1; sel->child->next = arg2;
2062                  set((yyval.sel), sel);
2063                  END_ACTION;
2064              }
2065 #line 2065 "parser.cpp" /* yacc.c:1646  */
2066     break;
2067
2068   case 28:
2069 #line 371 "parser.y" /* yacc.c:1646  */
2070     {
2071                  BEGIN_ACTION;
2072                  SelectionTreeElementPointer arg1(get((yyvsp[-2].sel))), arg2(get((yyvsp[0].sel)));
2073                  SelectionTreeElementPointer sel(
2074                         new SelectionTreeElement(SEL_BOOLEAN, (yyloc)));
2075                  sel->u.boolt = BOOL_OR;
2076                  sel->child = arg1; sel->child->next = arg2;
2077                  set((yyval.sel), sel);
2078                  END_ACTION;
2079              }
2080 #line 2080 "parser.cpp" /* yacc.c:1646  */
2081     break;
2082
2083   case 29:
2084 #line 381 "parser.y" /* yacc.c:1646  */
2085     { (yyval.sel) = (yyvsp[-1].sel); }
2086 #line 2086 "parser.cpp" /* yacc.c:1646  */
2087     break;
2088
2089   case 30:
2090 #line 386 "parser.y" /* yacc.c:1646  */
2091     {
2092                  BEGIN_ACTION;
2093                  const sfree_guard opGuard((yyvsp[-1].str));
2094                  set((yyval.sel), _gmx_sel_init_comparison(get((yyvsp[-2].sel)), get((yyvsp[0].sel)), (yyvsp[-1].str), scanner));
2095                  CHECK_SEL((yyval.sel));
2096                  END_ACTION;
2097              }
2098 #line 2098 "parser.cpp" /* yacc.c:1646  */
2099     break;
2100
2101   case 31:
2102 #line 397 "parser.y" /* yacc.c:1646  */
2103     {
2104                  BEGIN_ACTION;
2105                  const sfree_guard nameGuard((yyvsp[0].str));
2106                  set((yyval.sel), _gmx_sel_init_group_by_name((yyvsp[0].str), scanner));
2107                  END_ACTION;
2108              }
2109 #line 2109 "parser.cpp" /* yacc.c:1646  */
2110     break;
2111
2112   case 32:
2113 #line 404 "parser.y" /* yacc.c:1646  */
2114     {
2115                  BEGIN_ACTION;
2116                  set((yyval.sel), _gmx_sel_init_group_by_id((yyvsp[0].i), scanner));
2117                  END_ACTION;
2118              }
2119 #line 2119 "parser.cpp" /* yacc.c:1646  */
2120     break;
2121
2122   case 33:
2123 #line 412 "parser.y" /* yacc.c:1646  */
2124     { (yyval.str) = NULL; }
2125 #line 2125 "parser.cpp" /* yacc.c:1646  */
2126     break;
2127
2128   case 34:
2129 #line 413 "parser.y" /* yacc.c:1646  */
2130     { (yyval.str) = (yyvsp[0].str);   }
2131 #line 2131 "parser.cpp" /* yacc.c:1646  */
2132     break;
2133
2134   case 35:
2135 #line 418 "parser.y" /* yacc.c:1646  */
2136     { (yyval.smt) = gmx::eStringMatchType_RegularExpression; }
2137 #line 2137 "parser.cpp" /* yacc.c:1646  */
2138     break;
2139
2140   case 36:
2141 #line 419 "parser.y" /* yacc.c:1646  */
2142     { (yyval.smt) = gmx::eStringMatchType_Wildcard; }
2143 #line 2143 "parser.cpp" /* yacc.c:1646  */
2144     break;
2145
2146   case 37:
2147 #line 420 "parser.y" /* yacc.c:1646  */
2148     { (yyval.smt) = gmx::eStringMatchType_Exact; }
2149 #line 2149 "parser.cpp" /* yacc.c:1646  */
2150     break;
2151
2152   case 38:
2153 #line 425 "parser.y" /* yacc.c:1646  */
2154     {
2155                  BEGIN_ACTION;
2156                  const sfree_guard posmodGuard((yyvsp[-1].str));
2157                  set((yyval.sel), _gmx_sel_init_keyword((yyvsp[0].meth), SelectionParserValueListPointer(), (yyvsp[-1].str), scanner));
2158                  CHECK_SEL((yyval.sel));
2159                  END_ACTION;
2160              }
2161 #line 2161 "parser.cpp" /* yacc.c:1646  */
2162     break;
2163
2164   case 39:
2165 #line 433 "parser.y" /* yacc.c:1646  */
2166     {
2167                  BEGIN_ACTION;
2168                  const sfree_guard posmodGuard((yyvsp[-2].str));
2169                  set((yyval.sel), _gmx_sel_init_keyword_strmatch((yyvsp[-1].meth), gmx::eStringMatchType_Auto, get((yyvsp[0].vlist)), (yyvsp[-2].str), scanner));
2170                  CHECK_SEL((yyval.sel));
2171                  END_ACTION;
2172              }
2173 #line 2173 "parser.cpp" /* yacc.c:1646  */
2174     break;
2175
2176   case 40:
2177 #line 441 "parser.y" /* yacc.c:1646  */
2178     {
2179                  BEGIN_ACTION;
2180                  const sfree_guard posmodGuard((yyvsp[-3].str));
2181                  set((yyval.sel), _gmx_sel_init_keyword_strmatch((yyvsp[-2].meth), (yyvsp[-1].smt), get((yyvsp[0].vlist)), (yyvsp[-3].str), scanner));
2182                  CHECK_SEL((yyval.sel));
2183                  END_ACTION;
2184              }
2185 #line 2185 "parser.cpp" /* yacc.c:1646  */
2186     break;
2187
2188   case 41:
2189 #line 449 "parser.y" /* yacc.c:1646  */
2190     {
2191                  BEGIN_ACTION;
2192                  const sfree_guard posmodGuard((yyvsp[-2].str));
2193                  set((yyval.sel), _gmx_sel_init_keyword((yyvsp[-1].meth), get((yyvsp[0].vlist)), (yyvsp[-2].str), scanner));
2194                  CHECK_SEL((yyval.sel));
2195                  END_ACTION;
2196              }
2197 #line 2197 "parser.cpp" /* yacc.c:1646  */
2198     break;
2199
2200   case 42:
2201 #line 460 "parser.y" /* yacc.c:1646  */
2202     {
2203                  BEGIN_ACTION;
2204                  const sfree_guard posmodGuard((yyvsp[-2].str));
2205                  set((yyval.sel), _gmx_sel_init_method((yyvsp[-1].meth), get((yyvsp[0].plist)), (yyvsp[-2].str), scanner));
2206                  CHECK_SEL((yyval.sel));
2207                  END_ACTION;
2208              }
2209 #line 2209 "parser.cpp" /* yacc.c:1646  */
2210     break;
2211
2212   case 43:
2213 #line 475 "parser.y" /* yacc.c:1646  */
2214     {
2215                  BEGIN_ACTION;
2216                  SelectionTreeElementPointer sel(
2217                         new SelectionTreeElement(SEL_CONST, (yyloc)));
2218                  _gmx_selelem_set_vtype(sel, INT_VALUE);
2219                  _gmx_selvalue_reserve(&sel->v, 1);
2220                  sel->v.u.i[0] = (yyvsp[0].i);
2221                  set((yyval.sel), sel);
2222                  END_ACTION;
2223              }
2224 #line 2224 "parser.cpp" /* yacc.c:1646  */
2225     break;
2226
2227   case 44:
2228 #line 486 "parser.y" /* yacc.c:1646  */
2229     {
2230                  BEGIN_ACTION;
2231                  SelectionTreeElementPointer sel(
2232                         new SelectionTreeElement(SEL_CONST, (yyloc)));
2233                  _gmx_selelem_set_vtype(sel, REAL_VALUE);
2234                  _gmx_selvalue_reserve(&sel->v, 1);
2235                  sel->v.u.r[0] = (yyvsp[0].r);
2236                  set((yyval.sel), sel);
2237                  END_ACTION;
2238              }
2239 #line 2239 "parser.cpp" /* yacc.c:1646  */
2240     break;
2241
2242   case 45:
2243 #line 500 "parser.y" /* yacc.c:1646  */
2244     {
2245                  BEGIN_ACTION;
2246                  const sfree_guard posmodGuard((yyvsp[-1].str));
2247                  set((yyval.sel), _gmx_sel_init_keyword((yyvsp[0].meth), SelectionParserValueListPointer(), (yyvsp[-1].str), scanner));
2248                  CHECK_SEL((yyval.sel));
2249                  END_ACTION;
2250              }
2251 #line 2251 "parser.cpp" /* yacc.c:1646  */
2252     break;
2253
2254   case 46:
2255 #line 508 "parser.y" /* yacc.c:1646  */
2256     {
2257                  BEGIN_ACTION;
2258                  const sfree_guard posmodGuard((yyvsp[-3].str));
2259                  set((yyval.sel), _gmx_sel_init_keyword_of((yyvsp[-2].meth), get((yyvsp[0].sel)), (yyvsp[-3].str), scanner));
2260                  CHECK_SEL((yyval.sel));
2261                  END_ACTION;
2262              }
2263 #line 2263 "parser.cpp" /* yacc.c:1646  */
2264     break;
2265
2266   case 47:
2267 #line 516 "parser.y" /* yacc.c:1646  */
2268     {
2269                  BEGIN_ACTION;
2270                  const sfree_guard posmodGuard((yyvsp[-2].str));
2271                  set((yyval.sel), _gmx_sel_init_method((yyvsp[-1].meth), get((yyvsp[0].plist)), (yyvsp[-2].str), scanner));
2272                  CHECK_SEL((yyval.sel));
2273                  END_ACTION;
2274              }
2275 #line 2275 "parser.cpp" /* yacc.c:1646  */
2276     break;
2277
2278   case 48:
2279 #line 527 "parser.y" /* yacc.c:1646  */
2280     {
2281                  BEGIN_ACTION;
2282                  set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[-2].sel)), get((yyvsp[0].sel)), '+', scanner));
2283                  END_ACTION;
2284              }
2285 #line 2285 "parser.cpp" /* yacc.c:1646  */
2286     break;
2287
2288   case 49:
2289 #line 533 "parser.y" /* yacc.c:1646  */
2290     {
2291                  BEGIN_ACTION;
2292                  set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[-2].sel)), get((yyvsp[0].sel)), '-', scanner));
2293                  END_ACTION;
2294              }
2295 #line 2295 "parser.cpp" /* yacc.c:1646  */
2296     break;
2297
2298   case 50:
2299 #line 539 "parser.y" /* yacc.c:1646  */
2300     {
2301                  BEGIN_ACTION;
2302                  set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[-2].sel)), get((yyvsp[0].sel)), '*', scanner));
2303                  END_ACTION;
2304              }
2305 #line 2305 "parser.cpp" /* yacc.c:1646  */
2306     break;
2307
2308   case 51:
2309 #line 545 "parser.y" /* yacc.c:1646  */
2310     {
2311                  BEGIN_ACTION;
2312                  set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[-2].sel)), get((yyvsp[0].sel)), '/', scanner));
2313                  END_ACTION;
2314              }
2315 #line 2315 "parser.cpp" /* yacc.c:1646  */
2316     break;
2317
2318   case 52:
2319 #line 551 "parser.y" /* yacc.c:1646  */
2320     {
2321                  BEGIN_ACTION;
2322                  set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[0].sel)), SelectionTreeElementPointer(), '-', scanner));
2323                  END_ACTION;
2324              }
2325 #line 2325 "parser.cpp" /* yacc.c:1646  */
2326     break;
2327
2328   case 53:
2329 #line 557 "parser.y" /* yacc.c:1646  */
2330     {
2331                  BEGIN_ACTION;
2332                  set((yyval.sel), _gmx_sel_init_arithmetic(get((yyvsp[-2].sel)), get((yyvsp[0].sel)), '^', scanner));
2333                  END_ACTION;
2334              }
2335 #line 2335 "parser.cpp" /* yacc.c:1646  */
2336     break;
2337
2338   case 54:
2339 #line 562 "parser.y" /* yacc.c:1646  */
2340     { (yyval.sel) = (yyvsp[-1].sel); }
2341 #line 2341 "parser.cpp" /* yacc.c:1646  */
2342     break;
2343
2344   case 55:
2345 #line 570 "parser.y" /* yacc.c:1646  */
2346     {
2347                  BEGIN_ACTION;
2348                  SelectionTreeElementPointer sel(
2349                         new SelectionTreeElement(SEL_CONST, (yyloc)));
2350                  _gmx_selelem_set_vtype(sel, STR_VALUE);
2351                  _gmx_selvalue_reserve(&sel->v, 1);
2352                  sel->v.u.s[0] = (yyvsp[0].str);
2353                  set((yyval.sel), sel);
2354                  END_ACTION;
2355              }
2356 #line 2356 "parser.cpp" /* yacc.c:1646  */
2357     break;
2358
2359   case 56:
2360 #line 581 "parser.y" /* yacc.c:1646  */
2361     {
2362                  BEGIN_ACTION;
2363                  const sfree_guard posmodGuard((yyvsp[-1].str));
2364                  set((yyval.sel), _gmx_sel_init_keyword((yyvsp[0].meth), SelectionParserValueListPointer(), (yyvsp[-1].str), scanner));
2365                  CHECK_SEL((yyval.sel));
2366                  END_ACTION;
2367              }
2368 #line 2368 "parser.cpp" /* yacc.c:1646  */
2369     break;
2370
2371   case 57:
2372 #line 596 "parser.y" /* yacc.c:1646  */
2373     {
2374                  BEGIN_ACTION;
2375                  set((yyval.sel), _gmx_sel_init_const_position((yyvsp[-5].r), (yyvsp[-3].r), (yyvsp[-1].r), scanner));
2376                  END_ACTION;
2377              }
2378 #line 2378 "parser.cpp" /* yacc.c:1646  */
2379     break;
2380
2381   case 58:
2382 #line 604 "parser.y" /* yacc.c:1646  */
2383     { (yyval.sel) = (yyvsp[-1].sel); }
2384 #line 2384 "parser.cpp" /* yacc.c:1646  */
2385     break;
2386
2387   case 59:
2388 #line 609 "parser.y" /* yacc.c:1646  */
2389     {
2390                  BEGIN_ACTION;
2391                  set((yyval.sel), _gmx_sel_init_method((yyvsp[-1].meth), get((yyvsp[0].plist)), NULL, scanner));
2392                  CHECK_SEL((yyval.sel));
2393                  END_ACTION;
2394              }
2395 #line 2395 "parser.cpp" /* yacc.c:1646  */
2396     break;
2397
2398   case 60:
2399 #line 619 "parser.y" /* yacc.c:1646  */
2400     {
2401                  BEGIN_ACTION;
2402                  const sfree_guard keywordGuard((yyvsp[-2].str));
2403                  set((yyval.sel), _gmx_sel_init_position(get((yyvsp[0].sel)), (yyvsp[-2].str), scanner));
2404                  CHECK_SEL((yyval.sel));
2405                  END_ACTION;
2406              }
2407 #line 2407 "parser.cpp" /* yacc.c:1646  */
2408     break;
2409
2410   case 61:
2411 #line 633 "parser.y" /* yacc.c:1646  */
2412     {
2413                  BEGIN_ACTION;
2414                  set((yyval.sel), _gmx_sel_init_variable_ref(get((yyvsp[0].sel)), scanner));
2415                  END_ACTION;
2416              }
2417 #line 2417 "parser.cpp" /* yacc.c:1646  */
2418     break;
2419
2420   case 62:
2421 #line 641 "parser.y" /* yacc.c:1646  */
2422     {
2423                  BEGIN_ACTION;
2424                  set((yyval.sel), _gmx_sel_init_variable_ref(get((yyvsp[0].sel)), scanner));
2425                  END_ACTION;
2426              }
2427 #line 2427 "parser.cpp" /* yacc.c:1646  */
2428     break;
2429
2430   case 63:
2431 #line 649 "parser.y" /* yacc.c:1646  */
2432     {
2433                  BEGIN_ACTION;
2434                  set((yyval.sel), _gmx_sel_init_variable_ref(get((yyvsp[0].sel)), scanner));
2435                  END_ACTION;
2436              }
2437 #line 2437 "parser.cpp" /* yacc.c:1646  */
2438     break;
2439
2440   case 64:
2441 #line 662 "parser.y" /* yacc.c:1646  */
2442     { (yyval.plist) = (yyvsp[0].plist); }
2443 #line 2443 "parser.cpp" /* yacc.c:1646  */
2444     break;
2445
2446   case 65:
2447 #line 664 "parser.y" /* yacc.c:1646  */
2448     { (yyval.plist) = (yyvsp[-1].plist); }
2449 #line 2449 "parser.cpp" /* yacc.c:1646  */
2450     break;
2451
2452   case 66:
2453 #line 669 "parser.y" /* yacc.c:1646  */
2454     {
2455                  BEGIN_ACTION;
2456                  set((yyval.plist), SelectionParserParameter::createList());
2457                  END_ACTION;
2458              }
2459 #line 2459 "parser.cpp" /* yacc.c:1646  */
2460     break;
2461
2462   case 67:
2463 #line 675 "parser.y" /* yacc.c:1646  */
2464     {
2465                  BEGIN_ACTION;
2466                  SelectionParserParameterListPointer list(get((yyvsp[-1].plist)));
2467                  list->push_back(get((yyvsp[0].param)));
2468                  set((yyval.plist), std::move(list));
2469                  END_ACTION;
2470              }
2471 #line 2471 "parser.cpp" /* yacc.c:1646  */
2472     break;
2473
2474   case 68:
2475 #line 686 "parser.y" /* yacc.c:1646  */
2476     {
2477                  BEGIN_ACTION;
2478                  const sfree_guard nameGuard((yyvsp[-1].str));
2479                  set((yyval.param), SelectionParserParameter::create((yyvsp[-1].str), get((yyvsp[0].vlist)), (yyloc)));
2480                  END_ACTION;
2481              }
2482 #line 2482 "parser.cpp" /* yacc.c:1646  */
2483     break;
2484
2485   case 69:
2486 #line 694 "parser.y" /* yacc.c:1646  */
2487     { (yyval.vlist) = (yyvsp[0].vlist);   }
2488 #line 2488 "parser.cpp" /* yacc.c:1646  */
2489     break;
2490
2491   case 70:
2492 #line 695 "parser.y" /* yacc.c:1646  */
2493     { (yyval.vlist) = (yyvsp[-1].vlist);   }
2494 #line 2494 "parser.cpp" /* yacc.c:1646  */
2495     break;
2496
2497   case 71:
2498 #line 700 "parser.y" /* yacc.c:1646  */
2499     {
2500                  BEGIN_ACTION;
2501                  set((yyval.vlist), SelectionParserValue::createList());
2502                  END_ACTION;
2503              }
2504 #line 2504 "parser.cpp" /* yacc.c:1646  */
2505     break;
2506
2507   case 72:
2508 #line 706 "parser.y" /* yacc.c:1646  */
2509     {
2510                  BEGIN_ACTION;
2511                  SelectionParserValueListPointer list(get((yyvsp[-1].vlist)));
2512                  list->push_back(get((yyvsp[0].val)));
2513                  set((yyval.vlist), std::move(list));
2514                  END_ACTION;
2515              }
2516 #line 2516 "parser.cpp" /* yacc.c:1646  */
2517     break;
2518
2519   case 73:
2520 #line 714 "parser.y" /* yacc.c:1646  */
2521     {
2522                  BEGIN_ACTION;
2523                  SelectionParserValueListPointer list(get((yyvsp[-2].vlist)));
2524                  list->push_back(get((yyvsp[0].val)));
2525                  set((yyval.vlist), std::move(list));
2526                  END_ACTION;
2527              }
2528 #line 2528 "parser.cpp" /* yacc.c:1646  */
2529     break;
2530
2531   case 74:
2532 #line 724 "parser.y" /* yacc.c:1646  */
2533     { (yyval.vlist) = (yyvsp[0].vlist); }
2534 #line 2534 "parser.cpp" /* yacc.c:1646  */
2535     break;
2536
2537   case 75:
2538 #line 725 "parser.y" /* yacc.c:1646  */
2539     { (yyval.vlist) = (yyvsp[-1].vlist); }
2540 #line 2540 "parser.cpp" /* yacc.c:1646  */
2541     break;
2542
2543   case 76:
2544 #line 730 "parser.y" /* yacc.c:1646  */
2545     {
2546                  BEGIN_ACTION;
2547                  set((yyval.vlist), SelectionParserValue::createList(get((yyvsp[0].val))));
2548                  END_ACTION;
2549              }
2550 #line 2550 "parser.cpp" /* yacc.c:1646  */
2551     break;
2552
2553   case 77:
2554 #line 736 "parser.y" /* yacc.c:1646  */
2555     {
2556                  BEGIN_ACTION;
2557                  SelectionParserValueListPointer list(get((yyvsp[-1].vlist)));
2558                  list->push_back(get((yyvsp[0].val)));
2559                  set((yyval.vlist), std::move(list));
2560                  END_ACTION;
2561              }
2562 #line 2562 "parser.cpp" /* yacc.c:1646  */
2563     break;
2564
2565   case 78:
2566 #line 744 "parser.y" /* yacc.c:1646  */
2567     {
2568                  BEGIN_ACTION;
2569                  SelectionParserValueListPointer list(get((yyvsp[-2].vlist)));
2570                  list->push_back(get((yyvsp[0].val)));
2571                  set((yyval.vlist), std::move(list));
2572                  END_ACTION;
2573              }
2574 #line 2574 "parser.cpp" /* yacc.c:1646  */
2575     break;
2576
2577   case 79:
2578 #line 754 "parser.y" /* yacc.c:1646  */
2579     {
2580                  BEGIN_ACTION;
2581                  set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[0].sel))));
2582                  END_ACTION;
2583              }
2584 #line 2584 "parser.cpp" /* yacc.c:1646  */
2585     break;
2586
2587   case 80:
2588 #line 760 "parser.y" /* yacc.c:1646  */
2589     {
2590                  BEGIN_ACTION;
2591                  set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[0].sel))));
2592                  END_ACTION;
2593              }
2594 #line 2594 "parser.cpp" /* yacc.c:1646  */
2595     break;
2596
2597   case 81:
2598 #line 766 "parser.y" /* yacc.c:1646  */
2599     {
2600                  BEGIN_ACTION;
2601                  set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[0].sel))));
2602                  END_ACTION;
2603              }
2604 #line 2604 "parser.cpp" /* yacc.c:1646  */
2605     break;
2606
2607   case 82:
2608 #line 772 "parser.y" /* yacc.c:1646  */
2609     {
2610                  BEGIN_ACTION;
2611                  set((yyval.val), SelectionParserValue::createExpr(get((yyvsp[0].sel))));
2612                  END_ACTION;
2613              }
2614 #line 2614 "parser.cpp" /* yacc.c:1646  */
2615     break;
2616
2617   case 83:
2618 #line 777 "parser.y" /* yacc.c:1646  */
2619     { (yyval.val) = (yyvsp[0].val); }
2620 #line 2620 "parser.cpp" /* yacc.c:1646  */
2621     break;
2622
2623   case 84:
2624 #line 782 "parser.y" /* yacc.c:1646  */
2625     {
2626                  BEGIN_ACTION;
2627                  set((yyval.val), SelectionParserValue::createInteger((yyvsp[0].i), (yyloc)));
2628                  END_ACTION;
2629              }
2630 #line 2630 "parser.cpp" /* yacc.c:1646  */
2631     break;
2632
2633   case 85:
2634 #line 788 "parser.y" /* yacc.c:1646  */
2635     {
2636                  BEGIN_ACTION;
2637                  set((yyval.val), SelectionParserValue::createReal((yyvsp[0].r), (yyloc)));
2638                  END_ACTION;
2639              }
2640 #line 2640 "parser.cpp" /* yacc.c:1646  */
2641     break;
2642
2643   case 86:
2644 #line 794 "parser.y" /* yacc.c:1646  */
2645     {
2646                  BEGIN_ACTION;
2647                  const sfree_guard stringGuard((yyvsp[0].str));
2648                  set((yyval.val), SelectionParserValue::createString((yyvsp[0].str), (yyloc)));
2649                  END_ACTION;
2650              }
2651 #line 2651 "parser.cpp" /* yacc.c:1646  */
2652     break;
2653
2654   case 87:
2655 #line 800 "parser.y" /* yacc.c:1646  */
2656     { (yyval.val) = (yyvsp[0].val); }
2657 #line 2657 "parser.cpp" /* yacc.c:1646  */
2658     break;
2659
2660   case 88:
2661 #line 805 "parser.y" /* yacc.c:1646  */
2662     {
2663                  BEGIN_ACTION;
2664                  set((yyval.val), SelectionParserValue::createIntegerRange((yyvsp[-2].i), (yyvsp[0].i), (yyloc)));
2665                  END_ACTION;
2666              }
2667 #line 2667 "parser.cpp" /* yacc.c:1646  */
2668     break;
2669
2670   case 89:
2671 #line 811 "parser.y" /* yacc.c:1646  */
2672     {
2673                  BEGIN_ACTION;
2674                  set((yyval.val), SelectionParserValue::createRealRange((yyvsp[-2].i), (yyvsp[0].r), (yyloc)));
2675                  END_ACTION;
2676              }
2677 #line 2677 "parser.cpp" /* yacc.c:1646  */
2678     break;
2679
2680   case 90:
2681 #line 817 "parser.y" /* yacc.c:1646  */
2682     {
2683                  BEGIN_ACTION;
2684                  set((yyval.val), SelectionParserValue::createRealRange((yyvsp[-2].r), (yyvsp[0].r), (yyloc)));
2685                  END_ACTION;
2686              }
2687 #line 2687 "parser.cpp" /* yacc.c:1646  */
2688     break;
2689
2690
2691 #line 2691 "parser.cpp" /* yacc.c:1646  */
2692       default: break;
2693     }
2694   /* User semantic actions sometimes alter yychar, and that requires
2695      that yytoken be updated with the new translation.  We take the
2696      approach of translating immediately before every use of yytoken.
2697      One alternative is translating here after every semantic action,
2698      but that translation would be missed if the semantic action invokes
2699      YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2700      if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
2701      incorrect destructor might then be invoked immediately.  In the
2702      case of YYERROR or YYBACKUP, subsequent parser actions might lead
2703      to an incorrect destructor call or verbose syntax error message
2704      before the lookahead is translated.  */
2705   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2706
2707   YYPOPSTACK (yylen);
2708   yylen = 0;
2709   YY_STACK_PRINT (yyss, yyssp);
2710
2711   *++yyvsp = yyval;
2712   *++yylsp = yyloc;
2713
2714   /* Now 'shift' the result of the reduction.  Determine what state
2715      that goes to, based on the state we popped back to and the rule
2716      number reduced by.  */
2717
2718   yyn = yyr1[yyn];
2719
2720   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2721   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2722     yystate = yytable[yystate];
2723   else
2724     yystate = yydefgoto[yyn - YYNTOKENS];
2725
2726   goto yynewstate;
2727
2728
2729 /*--------------------------------------.
2730 | yyerrlab -- here on detecting error.  |
2731 `--------------------------------------*/
2732 yyerrlab:
2733   /* Make sure we have latest lookahead translation.  See comments at
2734      user semantic actions for why this is necessary.  */
2735   yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2736
2737   /* If not already recovering from an error, report this error.  */
2738   if (!yyerrstatus)
2739     {
2740       ++yynerrs;
2741 #if ! YYERROR_VERBOSE
2742       yyerror (&yylloc, scanner, YY_("syntax error"));
2743 #else
2744 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2745                                         yyssp, yytoken)
2746       {
2747         char const *yymsgp = YY_("syntax error");
2748         int yysyntax_error_status;
2749         yysyntax_error_status = YYSYNTAX_ERROR;
2750         if (yysyntax_error_status == 0)
2751           yymsgp = yymsg;
2752         else if (yysyntax_error_status == 1)
2753           {
2754             if (yymsg != yymsgbuf)
2755               YYSTACK_FREE (yymsg);
2756             yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2757             if (!yymsg)
2758               {
2759                 yymsg = yymsgbuf;
2760                 yymsg_alloc = sizeof yymsgbuf;
2761                 yysyntax_error_status = 2;
2762               }
2763             else
2764               {
2765                 yysyntax_error_status = YYSYNTAX_ERROR;
2766                 yymsgp = yymsg;
2767               }
2768           }
2769         yyerror (&yylloc, scanner, yymsgp);
2770         if (yysyntax_error_status == 2)
2771           goto yyexhaustedlab;
2772       }
2773 # undef YYSYNTAX_ERROR
2774 #endif
2775     }
2776
2777   yyerror_range[1] = yylloc;
2778
2779   if (yyerrstatus == 3)
2780     {
2781       /* If just tried and failed to reuse lookahead token after an
2782          error, discard it.  */
2783
2784       if (yychar <= YYEOF)
2785         {
2786           /* Return failure if at end of input.  */
2787           if (yychar == YYEOF)
2788             YYABORT;
2789         }
2790       else
2791         {
2792           yydestruct ("Error: discarding",
2793                       yytoken, &yylval, &yylloc, scanner);
2794           yychar = YYEMPTY;
2795         }
2796     }
2797
2798   /* Else will try to reuse lookahead token after shifting the error
2799      token.  */
2800   goto yyerrlab1;
2801
2802
2803 /*---------------------------------------------------.
2804 | yyerrorlab -- error raised explicitly by YYERROR.  |
2805 `---------------------------------------------------*/
2806 yyerrorlab:
2807
2808   /* Pacify compilers like GCC when the user code never invokes
2809      YYERROR and the label yyerrorlab therefore never appears in user
2810      code.  */
2811   if (/*CONSTCOND*/ 0)
2812      goto yyerrorlab;
2813
2814   yyerror_range[1] = yylsp[1-yylen];
2815   /* Do not reclaim the symbols of the rule whose action triggered
2816      this YYERROR.  */
2817   YYPOPSTACK (yylen);
2818   yylen = 0;
2819   YY_STACK_PRINT (yyss, yyssp);
2820   yystate = *yyssp;
2821   goto yyerrlab1;
2822
2823
2824 /*-------------------------------------------------------------.
2825 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
2826 `-------------------------------------------------------------*/
2827 yyerrlab1:
2828   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
2829
2830   for (;;)
2831     {
2832       yyn = yypact[yystate];
2833       if (!yypact_value_is_default (yyn))
2834         {
2835           yyn += YYTERROR;
2836           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2837             {
2838               yyn = yytable[yyn];
2839               if (0 < yyn)
2840                 break;
2841             }
2842         }
2843
2844       /* Pop the current state because it cannot handle the error token.  */
2845       if (yyssp == yyss)
2846         YYABORT;
2847
2848       yyerror_range[1] = *yylsp;
2849       yydestruct ("Error: popping",
2850                   yystos[yystate], yyvsp, yylsp, scanner);
2851       YYPOPSTACK (1);
2852       yystate = *yyssp;
2853       YY_STACK_PRINT (yyss, yyssp);
2854     }
2855
2856   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2857   *++yyvsp = yylval;
2858   YY_IGNORE_MAYBE_UNINITIALIZED_END
2859
2860   yyerror_range[2] = yylloc;
2861   /* Using YYLLOC is tempting, but would change the location of
2862      the lookahead.  YYLOC is available though.  */
2863   YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
2864   *++yylsp = yyloc;
2865
2866   /* Shift the error token.  */
2867   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2868
2869   yystate = yyn;
2870   goto yynewstate;
2871
2872
2873 /*-------------------------------------.
2874 | yyacceptlab -- YYACCEPT comes here.  |
2875 `-------------------------------------*/
2876 yyacceptlab:
2877   yyresult = 0;
2878   goto yyreturn;
2879
2880 /*-----------------------------------.
2881 | yyabortlab -- YYABORT comes here.  |
2882 `-----------------------------------*/
2883 yyabortlab:
2884   yyresult = 1;
2885   goto yyreturn;
2886
2887 #if !defined yyoverflow || YYERROR_VERBOSE
2888 /*-------------------------------------------------.
2889 | yyexhaustedlab -- memory exhaustion comes here.  |
2890 `-------------------------------------------------*/
2891 yyexhaustedlab:
2892   yyerror (&yylloc, scanner, YY_("memory exhausted"));
2893   yyresult = 2;
2894   /* Fall through.  */
2895 #endif
2896
2897 yyreturn:
2898   if (yychar != YYEMPTY)
2899     {
2900       /* Make sure we have latest lookahead translation.  See comments at
2901          user semantic actions for why this is necessary.  */
2902       yytoken = YYTRANSLATE (yychar);
2903       yydestruct ("Cleanup: discarding lookahead",
2904                   yytoken, &yylval, &yylloc, scanner);
2905     }
2906   /* Do not reclaim the symbols of the rule whose action triggered
2907      this YYABORT or YYACCEPT.  */
2908   YYPOPSTACK (yylen);
2909   YY_STACK_PRINT (yyss, yyssp);
2910   while (yyssp != yyss)
2911     {
2912       yydestruct ("Cleanup: popping",
2913                   yystos[*yyssp], yyvsp, yylsp, scanner);
2914       YYPOPSTACK (1);
2915     }
2916 #ifndef yyoverflow
2917   if (yyss != yyssa)
2918     YYSTACK_FREE (yyss);
2919 #endif
2920   yyps->yynew = 1;
2921
2922 yypushreturn:
2923 #if YYERROR_VERBOSE
2924   if (yymsg != yymsgbuf)
2925     YYSTACK_FREE (yymsg);
2926 #endif
2927   return yyresult;
2928 }