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