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