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