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