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