COPASI API  4.16.103
CChemEqParser_yacc.cpp
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/model/CChemEqParser_yacc.cpp,v $
3 // $Revision: 1.12 $
4 // $Name: $
5 // $Author: shoops $
6 // $Date: 2011/04/26 16:10:36 $
7 // End CVS Header
8 
9 // Copyright (C) 2011 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., University of Heidelberg, and The University
11 // of Manchester.
12 // All rights reserved.
13 
14 /* A Bison parser, made by GNU Bison 2.3. */
15 
16 /* Skeleton implementation for Bison's Yacc-like parsers in C
17 
18  Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
19  Free Software Foundation, Inc.
20 
21  This program is free software; you can redistribute it and/or modify
22  it under the terms of the GNU General Public License as published by
23  the Free Software Foundation; either version 2, or (at your option)
24  any later version.
25 
26  This program is distributed in the hope that it will be useful,
27  but WITHOUT ANY WARRANTY; without even the implied warranty of
28  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29  GNU General Public License for more details.
30 
31  You should have received a copy of the GNU General Public License
32  along with this program; if not, write to the Free Software
33  Foundation, Inc., 51 Franklin Street, Fifth Floor,
34  Boston, MA 02110-1301, USA. */
35 
36 /* As a special exception, you may create a larger work that contains
37  part or all of the Bison parser skeleton and distribute that work
38  under terms of your choice, so long as that work isn't itself a
39  parser generator using the skeleton or a modified version thereof
40  as a parser skeleton. Alternatively, if you modify or redistribute
41  the parser skeleton itself, you may (at your option) remove this
42  special exception, which will cause the skeleton and the resulting
43  Bison output files to be licensed under the GNU General Public
44  License without this special exception.
45 
46  This special exception was added by the Free Software Foundation in
47  version 2.2 of Bison. */
48 
49 /* C LALR(1) parser skeleton written by Richard Stallman, by
50  simplifying the original so-called "semantic" parser. */
51 
52 /* All symbols defined below should begin with yy or YY, to avoid
53  infringing on user name space. This should be done even for local
54  variables, as they might otherwise be expanded by user macros.
55  There are some unavoidable exceptions within include files to
56  define necessary library symbols; they are noted "INFRINGES ON
57  USER NAME SPACE" below. */
58 
59 /* Identify Bison output. */
60 #define YYBISON 1
61 
62 /* Bison version. */
63 #define YYBISON_VERSION "2.3"
64 
65 /* Skeleton name. */
66 #define YYSKELETON_NAME "yacc.c"
67 
68 /* Pure parsers. */
69 #define YYPURE 0
70 
71 /* Using locations. */
72 #define YYLSP_NEEDED 0
73 
74 /* Substitute the variable and function names. */
75 #define yyparse yyparse
76 #define yyerror CChemEqParsererror
77 #define yylval CChemEqParserlval
78 #define yychar CChemEqParserchar
79 #define yydebug CChemEqParserdebug
80 #define yynerrs CChemEqParsernerrs
81 
82 
83 /* Tokens. */
84 #ifndef YYTOKENTYPE
85 # define YYTOKENTYPE
86 /* Put the tokens into the symbol table, so that GDB and other debuggers
87  know about them. */
89 {
90  TOKEN_NUMBER = 258,
92  TOKEN_PLUS = 260,
93  TOKEN_NAME = 261,
98 };
99 #endif
100 /* Tokens. */
101 #define TOKEN_NUMBER 258
102 #define TOKEN_MULTIPLY 259
103 #define TOKEN_PLUS 260
104 #define TOKEN_NAME 261
105 #define TOKEN_BEGIN_PRODUCTS 262
106 #define TOKEN_BEGIN_MODIFIERS 263
107 #define TOKEN_BEGIN_COMPARTMENT 264
108 #define TOKEN_END_COMPARTMENT 265
109 
110 
111 
112 
113 /* Copy the first part of user declarations. */
114 #line 4 "CChemEqParser.ypp"
115 
116 
117 #define YYSTYPE CChemEqParserBase::Data *
118 
119 #ifdef yylval
120 # undef yylval
121 #endif
122 #define yylval mpData
123 
124 #ifdef yyerror
125 # undef yyerror
126 #endif
127 #define yyerror(__str) \
128  if (yychar != YYERRCODE) correctErrorPosition(); \
129  CCopasiMessage(CCopasiMessage::ERROR, MCFunction + 1, mPosition)
130 
131 #include "copasi.h"
132 #include "CChemEqParser.h"
133 
135 #include "utilities/utility.h"
136 
137 #undef yyparse
138 #define yyparse CChemEqParserBase::yyparse
139 
140 
141 /* Enabling traces. */
142 #ifndef YYDEBUG
143 # define YYDEBUG 1
144 #endif
145 
146 /* Enabling verbose error messages. */
147 #ifdef YYERROR_VERBOSE
148 # undef YYERROR_VERBOSE
149 # define YYERROR_VERBOSE 1
150 #else
151 # define YYERROR_VERBOSE 0
152 #endif
153 
154 /* Enabling the token table. */
155 #ifndef YYTOKEN_TABLE
156 # define YYTOKEN_TABLE 0
157 #endif
158 
159 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
160 typedef int YYSTYPE;
161 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
162 # define YYSTYPE_IS_DECLARED 1
163 # define YYSTYPE_IS_TRIVIAL 1
164 #endif
165 
166 
167 
168 /* Copy the second part of user declarations. */
169 
170 
171 /* Line 216 of yacc.c. */
172 #line 160 "CChemEqParser_yacc.cpp"
173 
174 #ifdef short
175 # undef short
176 #endif
177 
178 #ifdef YYTYPE_UINT8
179 typedef YYTYPE_UINT8 yytype_uint8;
180 #else
181 typedef unsigned char yytype_uint8;
182 #endif
183 
184 #ifdef YYTYPE_INT8
185 typedef YYTYPE_INT8 yytype_int8;
186 #elif (defined __STDC__ || defined __C99__FUNC__ \
187  || defined __cplusplus || defined _MSC_VER)
188 typedef signed char yytype_int8;
189 #else
190 typedef short int yytype_int8;
191 #endif
192 
193 #ifdef YYTYPE_UINT16
194 typedef YYTYPE_UINT16 yytype_uint16;
195 #else
196 typedef unsigned short int yytype_uint16;
197 #endif
198 
199 #ifdef YYTYPE_INT16
200 typedef YYTYPE_INT16 yytype_int16;
201 #else
202 typedef short int yytype_int16;
203 #endif
204 
205 #ifndef YYSIZE_T
206 # ifdef __SIZE_TYPE__
207 # define YYSIZE_T __SIZE_TYPE__
208 # elif defined size_t
209 # define YYSIZE_T size_t
210 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
211  || defined __cplusplus || defined _MSC_VER)
212 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
213 # define YYSIZE_T size_t
214 # else
215 # define YYSIZE_T unsigned int
216 # endif
217 #endif
218 
219 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
220 
221 #ifndef YY_
222 # if defined YYENABLE_NLS && YYENABLE_NLS
223 # if ENABLE_NLS
224 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
225 # define YY_(msgid) dgettext ("bison-runtime", msgid)
226 # endif
227 # endif
228 # ifndef YY_
229 # define YY_(msgid) msgid
230 # endif
231 #endif
232 
233 /* Suppress unused-variable warnings by "using" E. */
234 #if ! defined lint || defined __GNUC__
235 # define YYUSE(e) ((void) (e))
236 #else
237 # define YYUSE(e) /* empty */
238 #endif
239 
240 /* Identity function, used to suppress warnings about constant conditions. */
241 #ifndef lint
242 # define YYID(n) (n)
243 #else
244 #if (defined __STDC__ || defined __C99__FUNC__ \
245  || defined __cplusplus || defined _MSC_VER)
246 static int
247 YYID(int i)
248 #else
249 static int
250 YYID(i)
251 int i;
252 #endif
253 {
254  return i;
255 }
256 #endif
257 
258 #if ! defined yyoverflow || YYERROR_VERBOSE
259 
260 /* The parser invokes alloca or malloc; define the necessary symbols. */
261 
262 # ifdef YYSTACK_USE_ALLOCA
263 # if YYSTACK_USE_ALLOCA
264 # ifdef __GNUC__
265 # define YYSTACK_ALLOC __builtin_alloca
266 # elif defined __BUILTIN_VA_ARG_INCR
267 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
268 # elif defined _AIX
269 # define YYSTACK_ALLOC __alloca
270 # elif defined _MSC_VER
271 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
272 # define alloca _alloca
273 # else
274 # define YYSTACK_ALLOC alloca
275 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
276  || defined __cplusplus || defined _MSC_VER)
277 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
278 # ifndef _STDLIB_H
279 # define _STDLIB_H 1
280 # endif
281 # endif
282 # endif
283 # endif
284 # endif
285 
286 # ifdef YYSTACK_ALLOC
287 /* Pacify GCC's `empty if-body' warning. */
288 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
289 # ifndef YYSTACK_ALLOC_MAXIMUM
290 /* The OS might guarantee only one guard page at the bottom of the stack,
291  and a page size can be as small as 4096 bytes. So we cannot safely
292  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
293  to allow for a few compiler-allocated temporary stack slots. */
294 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
295 # endif
296 # else
297 # define YYSTACK_ALLOC YYMALLOC
298 # define YYSTACK_FREE YYFREE
299 # ifndef YYSTACK_ALLOC_MAXIMUM
300 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
301 # endif
302 # if (defined __cplusplus && ! defined _STDLIB_H \
303  && ! ((defined YYMALLOC || defined malloc) \
304  && (defined YYFREE || defined free)))
305 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
306 # ifndef _STDLIB_H
307 # define _STDLIB_H 1
308 # endif
309 # endif
310 # ifndef YYMALLOC
311 # define YYMALLOC malloc
312 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
313  || defined __cplusplus || defined _MSC_VER)
314 void *malloc(YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
315 # endif
316 # endif
317 # ifndef YYFREE
318 # define YYFREE free
319 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
320  || defined __cplusplus || defined _MSC_VER)
321 void free(void *); /* INFRINGES ON USER NAME SPACE */
322 # endif
323 # endif
324 # endif
325 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
326 
327 
328 #if (! defined yyoverflow \
329  && (! defined __cplusplus \
330  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
331 
332 /* A type that is properly aligned for any stack member. */
333 union yyalloc
334 {
335  yytype_int16 yyss;
336  YYSTYPE yyvs;
337 };
338 
339 /* The size of the maximum gap between one aligned stack and the next. */
340 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
341 
342 /* The size of an array large to enough to hold all stacks, each with
343  N elements. */
344 # define YYSTACK_BYTES(N) \
345  ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
346  + YYSTACK_GAP_MAXIMUM)
347 
348 /* Copy COUNT objects from FROM to TO. The source and destination do
349  not overlap. */
350 # ifndef YYCOPY
351 # if defined __GNUC__ && 1 < __GNUC__
352 # define YYCOPY(To, From, Count) \
353  __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
354 # else
355 # define YYCOPY(To, From, Count) \
356  do \
357  { \
358  YYSIZE_T yyi; \
359  for (yyi = 0; yyi < (Count); yyi++) \
360  (To)[yyi] = (From)[yyi]; \
361  } \
362  while (YYID (0))
363 # endif
364 # endif
365 
366 /* Relocate STACK from its old location to the new one. The
367  local variables YYSIZE and YYSTACKSIZE give the old and new number of
368  elements in the stack, and YYPTR gives the new location of the
369  stack. Advance YYPTR to a properly aligned location for the next
370  stack. */
371 # define YYSTACK_RELOCATE(Stack) \
372  do \
373  { \
374  YYSIZE_T yynewbytes; \
375  YYCOPY (&yyptr->Stack, Stack, yysize); \
376  Stack = &yyptr->Stack; \
377  yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
378  yyptr += yynewbytes / sizeof (*yyptr); \
379  } \
380  while (YYID (0))
381 
382 #endif
383 
384 /* YYFINAL -- State number of the termination state. */
385 #define YYFINAL 12
386 /* YYLAST -- Last index in YYTABLE. */
387 #define YYLAST 27
388 
389 /* YYNTOKENS -- Number of terminals. */
390 #define YYNTOKENS 11
391 /* YYNNTS -- Number of nonterminals. */
392 #define YYNNTS 8
393 /* YYNRULES -- Number of rules. */
394 #define YYNRULES 19
395 /* YYNRULES -- Number of states. */
396 #define YYNSTATES 30
397 
398 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
399 #define YYUNDEFTOK 2
400 #define YYMAXUTOK 265
401 
402 #define YYTRANSLATE(YYX) \
403  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
404 
405 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
406 static const yytype_uint8 yytranslate[] =
407 {
408  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
409  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
410  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
411  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
412  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
413  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
414  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
415  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
416  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
417  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
418  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
419  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
420  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
421  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
422  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
423  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
424  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
425  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
426  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
427  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
428  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
429  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
430  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
431  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
432  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
433  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
434  5, 6, 7, 8, 9, 10
435 };
436 
437 #if YYDEBUG
438 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
439  YYRHS. */
440 static const yytype_uint8 yyprhs[] =
441 {
442  0, 0, 3, 7, 11, 14, 17, 20, 22, 24,
443  28, 31, 35, 38, 41, 43, 46, 48, 51, 55
444 };
445 
446 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
447 static const yytype_int8 yyrhs[] =
448 {
449  12, 0, -1, 13, 14, 15, -1, 13, 7, 15,
450  -1, 13, 14, -1, 13, 7, -1, 14, 15, -1,
451  14, -1, 16, -1, 13, 5, 16, -1, 7, 16,
452  -1, 14, 5, 16, -1, 8, 16, -1, 15, 16,
453  -1, 17, -1, 17, 18, -1, 6, -1, 3, 6,
454  -1, 3, 4, 6, -1, 9, 6, 10, -1
455 };
456 
457 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
458 static const yytype_uint8 yyrline[] =
459 {
460  0, 47, 47, 50, 55, 58, 63, 67, 71, 78,
461  87, 97, 106, 114, 122, 127, 135, 140, 146, 154
462 };
463 #endif
464 
465 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
466 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
467  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
468 static const char *const yytname[] =
469 {
470  "$end", "error", "$undefined", "TOKEN_NUMBER", "TOKEN_MULTIPLY",
471  "TOKEN_PLUS", "TOKEN_NAME", "TOKEN_BEGIN_PRODUCTS",
472  "TOKEN_BEGIN_MODIFIERS", "TOKEN_BEGIN_COMPARTMENT",
473  "TOKEN_END_COMPARTMENT", "$accept", "reaction", "substrates", "products",
474  "modifiers", "reactant", "prereactant", "compartment", 0
475 };
476 #endif
477 
478 # ifdef YYPRINT
479 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
480  token YYLEX-NUM. */
481 static const yytype_uint16 yytoknum[] =
482 {
483  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
484  265
485 };
486 # endif
487 
488 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
489 static const yytype_uint8 yyr1[] =
490 {
491  0, 11, 12, 12, 12, 12, 12, 12, 13, 13,
492  14, 14, 15, 15, 16, 16, 17, 17, 17, 18
493 };
494 
495 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
496 static const yytype_uint8 yyr2[] =
497 {
498  0, 2, 3, 3, 2, 2, 2, 1, 1, 3,
499  2, 3, 2, 2, 1, 2, 1, 2, 3, 3
500 };
501 
502 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
503  STATE-NUM when YYTABLE doesn't specify something else to do. Zero
504  means the default is an error. */
505 static const yytype_uint8 yydefact[] =
506 {
507  0, 0, 16, 0, 0, 0, 7, 8, 14, 0,
508  17, 10, 1, 0, 5, 4, 0, 0, 6, 0,
509  15, 18, 9, 3, 2, 11, 12, 13, 0, 19
510 };
511 
512 /* YYDEFGOTO[NTERM-NUM]. */
513 static const yytype_int8 yydefgoto[] =
514 {
515  -1, 4, 5, 6, 18, 27, 8, 20
516 };
517 
518 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
519  STATE-NUM. */
520 #define YYPACT_NINF -8
521 static const yytype_int8 yypact[] =
522 {
523  2, 14, -8, 4, 11, 16, 7, -8, -7, 13,
524  -8, -8, -8, 4, -2, 7, 4, 4, 4, 20,
525  -8, -8, -8, 4, 4, -8, -8, -8, 12, -8
526 };
527 
528 /* YYPGOTO[NTERM-NUM]. */
529 static const yytype_int8 yypgoto[] =
530 {
531  -8, -8, -8, 22, 10, 0, -8, -8
532 };
533 
534 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
535  positive, shift that token. If negative, reduce the rule which
536  number is the opposite. If zero, do what YYDEFACT says.
537  If YYTABLE_NINF, syntax error. */
538 #define YYTABLE_NINF -1
539 static const yytype_uint8 yytable[] =
540 {
541  7, 1, 19, 11, 2, 1, 17, 1, 2, 3,
542  2, 12, 16, 22, 11, 17, 25, 26, 9, 21,
543  10, 13, 29, 14, 23, 24, 28, 15
544 };
545 
546 static const yytype_uint8 yycheck[] =
547 {
548  0, 3, 9, 3, 6, 3, 8, 3, 6, 7,
549  6, 0, 5, 13, 14, 8, 16, 17, 4, 6,
550  6, 5, 10, 7, 14, 15, 6, 5
551 };
552 
553 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
554  symbol of state STATE-NUM. */
555 static const yytype_uint8 yystos[] =
556 {
557  0, 3, 6, 7, 12, 13, 14, 16, 17, 4,
558  6, 16, 0, 5, 7, 14, 5, 8, 15, 9,
559  18, 6, 16, 15, 15, 16, 16, 16, 6, 10
560 };
561 
562 #define yyerrok (yyerrstatus = 0)
563 #define yyclearin (yychar = YYEMPTY)
564 #define YYEMPTY (-2)
565 #define YYEOF 0
566 
567 #define YYACCEPT goto yyacceptlab
568 #define YYABORT goto yyabortlab
569 #define YYERROR goto yyerrorlab
570 
571 
572 /* Like YYERROR except do call yyerror. This remains here temporarily
573  to ease the transition to the new meaning of YYERROR, for GCC.
574  Once GCC version 2 has supplanted version 1, this can go. */
575 
576 #define YYFAIL goto yyerrlab
577 
578 #define YYRECOVERING() (!!yyerrstatus)
579 
580 #define YYBACKUP(Token, Value) \
581  do \
582  if (yychar == YYEMPTY && yylen == 1) \
583  { \
584  yychar = (Token); \
585  yylval = (Value); \
586  yytoken = YYTRANSLATE (yychar); \
587  YYPOPSTACK (1); \
588  goto yybackup; \
589  } \
590  else \
591  { \
592  yyerror (YY_("syntax error: cannot back up")); \
593  YYERROR; \
594  } \
595  while (YYID (0))
596 
597 
598 #define YYTERROR 1
599 #define YYERRCODE 256
600 
601 
602 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
603  If N is 0, then set CURRENT to the empty location which ends
604  the previous symbol: RHS[0] (always defined). */
605 
606 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
607 #ifndef YYLLOC_DEFAULT
608 # define YYLLOC_DEFAULT(Current, Rhs, N) \
609  do \
610  if (YYID (N)) \
611  { \
612  (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
613  (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
614  (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
615  (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
616  } \
617  else \
618  { \
619  (Current).first_line = (Current).last_line = \
620  YYRHSLOC (Rhs, 0).last_line; \
621  (Current).first_column = (Current).last_column = \
622  YYRHSLOC (Rhs, 0).last_column; \
623  } \
624  while (YYID (0))
625 #endif
626 
627 
628 /* YY_LOCATION_PRINT -- Print the location on the stream.
629  This macro was not mandated originally: define only if we know
630  we won't break user code: when these are the locations we know. */
631 
632 #ifndef YY_LOCATION_PRINT
633 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
634 # define YY_LOCATION_PRINT(File, Loc) \
635  fprintf (File, "%d.%d-%d.%d", \
636  (Loc).first_line, (Loc).first_column, \
637  (Loc).last_line, (Loc).last_column)
638 # else
639 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
640 # endif
641 #endif
642 
643 
644 /* YYLEX -- calling `yylex' with the right arguments. */
645 
646 #ifdef YYLEX_PARAM
647 # define YYLEX yylex (YYLEX_PARAM)
648 #else
649 # define YYLEX yylex ()
650 #endif
651 
652 /* Enable debugging if requested. */
653 #if YYDEBUG
654 
655 # ifndef YYFPRINTF
656 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
657 # define YYFPRINTF fprintf
658 # endif
659 
660 # define YYDPRINTF(Args) \
661  do { \
662  if (yydebug) \
663  YYFPRINTF Args; \
664  } while (YYID (0))
665 
666 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
667  do { \
668  if (yydebug) \
669  { \
670  YYFPRINTF (stderr, "%s ", Title); \
671  yy_symbol_print (stderr, \
672  Type, Value); \
673  YYFPRINTF (stderr, "\n"); \
674  } \
675  } while (YYID (0))
676 
677 
678 /*--------------------------------.
679 | Print this symbol on YYOUTPUT. |
680 `--------------------------------*/
681 
682 /*ARGSUSED*/
683 #if (defined __STDC__ || defined __C99__FUNC__ \
684  || defined __cplusplus || defined _MSC_VER)
685 static void
686 yy_symbol_value_print(FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
687 #else
688 static void
689 yy_symbol_value_print(yyoutput, yytype, yyvaluep)
690 FILE *yyoutput;
691 int yytype;
692 YYSTYPE const * const yyvaluep;
693 #endif
694 {
695 
696  if (!yyvaluep)
697  return;
698 
699 # ifdef YYPRINT
700 
701  if (yytype < YYNTOKENS)
702  YYPRINT(yyoutput, yytoknum[yytype], *yyvaluep);
703 
704 # else
705  YYUSE(yyoutput);
706 # endif
707 
708  switch (yytype)
709  {
710  default:
711  break;
712  }
713 }
714 
715 
716 /*--------------------------------.
717 | Print this symbol on YYOUTPUT. |
718 `--------------------------------*/
719 
720 #if (defined __STDC__ || defined __C99__FUNC__ \
721  || defined __cplusplus || defined _MSC_VER)
722 static void
723 yy_symbol_print(FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
724 #else
725 static void
726 yy_symbol_print(yyoutput, yytype, yyvaluep)
727 FILE *yyoutput;
728 int yytype;
729 YYSTYPE const * const yyvaluep;
730 #endif
731 {
732 
733  if (yytype < YYNTOKENS)
734  YYFPRINTF(yyoutput, "token %s (", yytname[yytype]);
735  else
736  YYFPRINTF(yyoutput, "nterm %s (", yytname[yytype]);
737 
738  yy_symbol_value_print(yyoutput, yytype, yyvaluep);
739  YYFPRINTF(yyoutput, ")");
740 }
741 
742 /*------------------------------------------------------------------.
743 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
744 | TOP (included). |
745 `------------------------------------------------------------------*/
746 
747 #if (defined __STDC__ || defined __C99__FUNC__ \
748  || defined __cplusplus || defined _MSC_VER)
749 static void
750 yy_stack_print(yytype_int16 *bottom, yytype_int16 *top)
751 #else
752 static void
753 yy_stack_print(bottom, top)
754 yytype_int16 *bottom;
755 yytype_int16 *top;
756 #endif
757 {
758  YYFPRINTF(stderr, "Stack now");
759 
760  for (; bottom <= top; ++bottom)
761  YYFPRINTF(stderr, " %d", *bottom);
762 
763  YYFPRINTF(stderr, "\n");
764 }
765 
766 # define YY_STACK_PRINT(Bottom, Top) \
767  do { \
768  if (yydebug) \
769  yy_stack_print ((Bottom), (Top)); \
770  } while (YYID (0))
771 
772 
773 /*------------------------------------------------.
774 | Report that the YYRULE is going to be reduced. |
775 `------------------------------------------------*/
776 
777 #if (defined __STDC__ || defined __C99__FUNC__ \
778  || defined __cplusplus || defined _MSC_VER)
779 static void
780 yy_reduce_print(YYSTYPE *yyvsp, int yyrule)
781 #else
782 static void
783 yy_reduce_print(yyvsp, yyrule)
784 YYSTYPE *yyvsp;
785 int yyrule;
786 #endif
787 {
788  int yynrhs = yyr2[yyrule];
789  int yyi;
790  unsigned long int yylno = yyrline[yyrule];
791  YYFPRINTF(stderr, "Reducing stack by rule %d (line %lu):\n",
792  yyrule - 1, yylno);
793 
794  /* The symbols being reduced. */
795  for (yyi = 0; yyi < yynrhs; yyi++)
796  {
797  fprintf(stderr, " $%d = ", yyi + 1);
798  yy_symbol_print(stderr, yyrhs[yyprhs[yyrule] + yyi],
799  &(yyvsp[(yyi + 1) - (yynrhs)])
800  );
801  fprintf(stderr, "\n");
802  }
803 }
804 
805 # define YY_REDUCE_PRINT(Rule) \
806  do { \
807  if (yydebug) \
808  yy_reduce_print (yyvsp, Rule); \
809  } while (YYID (0))
810 
811 /* Nonzero means print parse trace. It is left uninitialized so that
812  multiple parsers can coexist. */
813 int yydebug = YYDEBUG;
814 #else /* !YYDEBUG */
815 # define YYDPRINTF(Args)
816 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
817 # define YY_STACK_PRINT(Bottom, Top)
818 # define YY_REDUCE_PRINT(Rule)
819 #endif /* !YYDEBUG */
820 
821 
822 /* YYINITDEPTH -- initial size of the parser's stacks. */
823 #ifndef YYINITDEPTH
824 # define YYINITDEPTH 200
825 #endif
826 
827 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
828  if the built-in stack extension method is used).
829 
830  Do not make this value too large; the results are undefined if
831  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
832  evaluated with infinite-precision integer arithmetic. */
833 
834 #ifndef YYMAXDEPTH
835 # define YYMAXDEPTH 10000
836 #endif
837 
838 
839 
840 #if YYERROR_VERBOSE
841 
842 # ifndef yystrlen
843 # if defined __GLIBC__ && defined _STRING_H
844 # define yystrlen strlen
845 # else
846 /* Return the length of YYSTR. */
847 #if (defined __STDC__ || defined __C99__FUNC__ \
848  || defined __cplusplus || defined _MSC_VER)
849 static YYSIZE_T
850 yystrlen(const char *yystr)
851 #else
852 static YYSIZE_T
853 yystrlen(yystr)
854 const char *yystr;
855 #endif
856 {
857  YYSIZE_T yylen;
858 
859  for (yylen = 0; yystr[yylen]; yylen++)
860  continue;
861 
862  return yylen;
863 }
864 # endif
865 # endif
866 
867 # ifndef yystpcpy
868 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
869 # define yystpcpy stpcpy
870 # else
871 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
872  YYDEST. */
873 #if (defined __STDC__ || defined __C99__FUNC__ \
874  || defined __cplusplus || defined _MSC_VER)
875 static char *
876 yystpcpy(char *yydest, const char *yysrc)
877 #else
878 static char *
879 yystpcpy(yydest, yysrc)
880 char *yydest;
881 const char *yysrc;
882 #endif
883 {
884  char *yyd = yydest;
885  const char *yys = yysrc;
886 
887  while ((*yyd++ = *yys++) != '\0')
888  continue;
889 
890  return yyd - 1;
891 }
892 # endif
893 # endif
894 
895 # ifndef yytnamerr
896 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
897  quotes and backslashes, so that it's suitable for yyerror. The
898  heuristic is that double-quoting is unnecessary unless the string
899  contains an apostrophe, a comma, or backslash (other than
900  backslash-backslash). YYSTR is taken from yytname. If YYRES is
901  null, do not copy; instead, return the length of what the result
902  would have been. */
903 static YYSIZE_T
904 yytnamerr(char *yyres, const char *yystr)
905 {
906  if (*yystr == '"')
907  {
908  YYSIZE_T yyn = 0;
909  char const *yyp = yystr;
910 
911  for (;;)
912  switch (*++yyp)
913  {
914  case '\'':
915  case ',':
916  goto do_not_strip_quotes;
917 
918  case '\\':
919 
920  if (*++yyp != '\\')
921  goto do_not_strip_quotes;
922 
923  /* Fall through. */
924  default:
925 
926  if (yyres)
927  yyres[yyn] = *yyp;
928 
929  yyn++;
930  break;
931 
932  case '"':
933 
934  if (yyres)
935  yyres[yyn] = '\0';
936 
937  return yyn;
938  }
939 
940 do_not_strip_quotes: ;
941  }
942 
943  if (! yyres)
944  return yystrlen(yystr);
945 
946  return yystpcpy(yyres, yystr) - yyres;
947 }
948 # endif
949 
950 /* Copy into YYRESULT an error message about the unexpected token
951  YYCHAR while in state YYSTATE. Return the number of bytes copied,
952  including the terminating null byte. If YYRESULT is null, do not
953  copy anything; just return the number of bytes that would be
954  copied. As a special case, return 0 if an ordinary "syntax error"
955  message will do. Return YYSIZE_MAXIMUM if overflow occurs during
956  size calculation. */
957 static YYSIZE_T
958 yysyntax_error(char *yyresult, int yystate, int yychar)
959 {
960  int yyn = yypact[yystate];
961 
962  if (!(YYPACT_NINF < yyn && yyn <= YYLAST))
963  return 0;
964  else
965  {
966  int yytype = YYTRANSLATE(yychar);
967  YYSIZE_T yysize0 = yytnamerr(0, yytname[yytype]);
968  YYSIZE_T yysize = yysize0;
969  YYSIZE_T yysize1;
970  int yysize_overflow = 0;
971  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
972  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
973  int yyx;
974 
975 # if 0
976  /* This is so xgettext sees the translatable formats that are
977  constructed on the fly. */
978  YY_("syntax error, unexpected %s");
979  YY_("syntax error, unexpected %s, expecting %s");
980  YY_("syntax error, unexpected %s, expecting %s or %s");
981  YY_("syntax error, unexpected %s, expecting %s or %s or %s");
982  YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
983 # endif
984  char *yyfmt;
985  char const *yyf;
986  static char const yyunexpected[] = "syntax error, unexpected %s";
987  static char const yyexpecting[] = ", expecting %s";
988  static char const yyor[] = " or %s";
989  char yyformat[sizeof yyunexpected
990  + sizeof yyexpecting - 1
991  + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
992  *(sizeof yyor - 1))];
993  char const *yyprefix = yyexpecting;
994 
995  /* Start YYX at -YYN if negative to avoid negative indexes in
996  YYCHECK. */
997  int yyxbegin = yyn < 0 ? -yyn : 0;
998 
999  /* Stay within bounds of both yycheck and yytname. */
1000  int yychecklim = YYLAST - yyn + 1;
1001  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1002  int yycount = 1;
1003 
1004  yyarg[0] = yytname[yytype];
1005  yyfmt = yystpcpy(yyformat, yyunexpected);
1006 
1007  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1008  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1009  {
1010  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1011  {
1012  yycount = 1;
1013  yysize = yysize0;
1014  yyformat[sizeof yyunexpected - 1] = '\0';
1015  break;
1016  }
1017 
1018  yyarg[yycount++] = yytname[yyx];
1019  yysize1 = yysize + yytnamerr(0, yytname[yyx]);
1020  yysize_overflow |= (yysize1 < yysize);
1021  yysize = yysize1;
1022  yyfmt = yystpcpy(yyfmt, yyprefix);
1023  yyprefix = yyor;
1024  }
1025 
1026  yyf = YY_(yyformat);
1027  yysize1 = yysize + yystrlen(yyf);
1028  yysize_overflow |= (yysize1 < yysize);
1029  yysize = yysize1;
1030 
1031  if (yysize_overflow)
1032  return YYSIZE_MAXIMUM;
1033 
1034  if (yyresult)
1035  {
1036  /* Avoid sprintf, as that infringes on the user's name space.
1037  Don't have undefined behavior even if the translation
1038  produced a string with the wrong number of "%s"s. */
1039  char *yyp = yyresult;
1040  int yyi = 0;
1041 
1042  while ((*yyp = *yyf) != '\0')
1043  {
1044  if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1045  {
1046  yyp += yytnamerr(yyp, yyarg[yyi++]);
1047  yyf += 2;
1048  }
1049  else
1050  {
1051  yyp++;
1052  yyf++;
1053  }
1054  }
1055  }
1056 
1057  return yysize;
1058  }
1059 }
1060 #endif /* YYERROR_VERBOSE */
1061 
1062 
1063 /*-----------------------------------------------.
1064 | Release the memory associated to this symbol. |
1065 `-----------------------------------------------*/
1066 
1067 /*ARGSUSED*/
1068 #if (defined __STDC__ || defined __C99__FUNC__ \
1069  || defined __cplusplus || defined _MSC_VER)
1070 static void
1071 yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1072 #else
1073 static void
1074 yydestruct(yymsg, yytype, yyvaluep)
1075 const char *yymsg;
1076 int yytype;
1077 YYSTYPE *yyvaluep;
1078 #endif
1079 {
1080  YYUSE(yyvaluep);
1081 
1082  if (!yymsg)
1083  yymsg = "Deleting";
1084 
1085  YY_SYMBOL_PRINT(yymsg, yytype, yyvaluep, yylocationp);
1086 
1087  switch (yytype)
1088  {
1089 
1090  default:
1091  break;
1092  }
1093 }
1094 
1095 
1096 /* Prevent warnings from -Wmissing-prototypes. */
1097 
1098 #ifdef YYPARSE_PARAM
1099 #if defined __STDC__ || defined __cplusplus
1100 #else
1101 #endif
1102 #else /* ! YYPARSE_PARAM */
1103 #if defined __STDC__ || defined __cplusplus
1104 #else
1105 #endif
1106 #endif /* ! YYPARSE_PARAM */
1107 
1108 
1109 
1110 /* The look-ahead symbol. */
1112 
1113 /* The semantic value of the look-ahead symbol. */
1114 YYSTYPE yylval;
1115 
1116 /* Number of syntax errors so far. */
1118 
1119 
1120 
1121 /*----------.
1122 | yyparse. |
1123 `----------*/
1124 
1125 #ifdef YYPARSE_PARAM
1126 #if (defined __STDC__ || defined __C99__FUNC__ \
1127  || defined __cplusplus || defined _MSC_VER)
1128 int
1129 yyparse(void *YYPARSE_PARAM)
1130 #else
1131 int
1132 yyparse(YYPARSE_PARAM)
1133 void *YYPARSE_PARAM;
1134 #endif
1135 #else /* ! YYPARSE_PARAM */
1136 #if (defined __STDC__ || defined __C99__FUNC__ \
1137  || defined __cplusplus || defined _MSC_VER)
1138 int
1139 yyparse(void)
1140 #else
1141 int
1143 
1144 #endif
1145 #endif
1146 {
1147 
1148  int yystate;
1149  int yyn;
1150  int yyresult;
1151  /* Number of tokens to shift before error messages enabled. */
1152  int yyerrstatus;
1153  /* Look-ahead token as an internal (translated) token number. */
1154  int yytoken = 0;
1155 #if YYERROR_VERBOSE
1156  /* Buffer for error messages, and its allocated size. */
1157  char yymsgbuf[128];
1158  char *yymsg = yymsgbuf;
1159  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1160 #endif
1161 
1162  /* Three stacks and their tools:
1163  `yyss': related to states,
1164  `yyvs': related to semantic values,
1165  `yyls': related to locations.
1166 
1167  Refer to the stacks thru separate pointers, to allow yyoverflow
1168  to reallocate them elsewhere. */
1169 
1170  /* The state stack. */
1171  yytype_int16 yyssa[YYINITDEPTH];
1172  yytype_int16 *yyss = yyssa;
1173  yytype_int16 *yyssp;
1174 
1175  /* The semantic value stack. */
1176  YYSTYPE yyvsa[YYINITDEPTH];
1177  YYSTYPE *yyvs = yyvsa;
1178  YYSTYPE *yyvsp;
1179 
1180 
1181 
1182 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1183 
1184  YYSIZE_T yystacksize = YYINITDEPTH;
1185 
1186  /* The variables used to return semantic value and location from the
1187  action routines. */
1188  YYSTYPE yyval;
1189 
1190 
1191  /* The number of symbols on the RHS of the reduced rule.
1192  Keep to zero when no symbol should be popped. */
1193  int yylen = 0;
1194 
1195  YYDPRINTF((stderr, "Starting parse\n"));
1196 
1197  yystate = 0;
1198  yyerrstatus = 0;
1199  yynerrs = 0;
1200  yychar = YYEMPTY; /* Cause a token to be read. */
1201 
1202  /* Initialize stack pointers.
1203  Waste one element of value and location stack
1204  so that they stay on the same level as the state stack.
1205  The wasted elements are never initialized. */
1206 
1207  yyssp = yyss;
1208  yyvsp = yyvs;
1209 
1210  goto yysetstate;
1211 
1212  /*------------------------------------------------------------.
1213  | yynewstate -- Push a new state, which is found in yystate. |
1214  `------------------------------------------------------------*/
1215 yynewstate:
1216  /* In all cases, when you get here, the value and location stacks
1217  have just been pushed. So pushing a state here evens the stacks. */
1218  yyssp++;
1219 
1220 yysetstate:
1221  *yyssp = yystate;
1222 
1223  if (yyss + yystacksize - 1 <= yyssp)
1224  {
1225  /* Get the current used size of the three stacks, in elements. */
1226  YYSIZE_T yysize = yyssp - yyss + 1;
1227 
1228 #ifdef yyoverflow
1229  {
1230  /* Give user a chance to reallocate the stack. Use copies of
1231  these so that the &'s don't force the real ones into
1232  memory. */
1233  YYSTYPE *yyvs1 = yyvs;
1234  yytype_int16 *yyss1 = yyss;
1235 
1236 
1237  /* Each stack pointer address is followed by the size of the
1238  data in use in that stack, in bytes. This used to be a
1239  conditional around just the two extra args, but that might
1240  be undefined if yyoverflow is a macro. */
1241  yyoverflow(YY_("memory exhausted"),
1242  &yyss1, yysize * sizeof(*yyssp),
1243  &yyvs1, yysize * sizeof(*yyvsp),
1244 
1245  &yystacksize);
1246 
1247  yyss = yyss1;
1248  yyvs = yyvs1;
1249  }
1250 #else /* no yyoverflow */
1251 # ifndef YYSTACK_RELOCATE
1252  goto yyexhaustedlab;
1253 # else
1254 
1255  /* Extend the stack our own way. */
1256  if (YYMAXDEPTH <= yystacksize)
1257  goto yyexhaustedlab;
1258 
1259  yystacksize *= 2;
1260 
1261  if (YYMAXDEPTH < yystacksize)
1262  yystacksize = YYMAXDEPTH;
1263 
1264  {
1265  yytype_int16 *yyss1 = yyss;
1266  union yyalloc *yyptr =
1267  (union yyalloc *) YYSTACK_ALLOC(YYSTACK_BYTES(yystacksize));
1268 
1269  if (! yyptr)
1270  goto yyexhaustedlab;
1271 
1272  YYSTACK_RELOCATE(yyss);
1273  YYSTACK_RELOCATE(yyvs);
1274 
1275 # undef YYSTACK_RELOCATE
1276 
1277  if (yyss1 != yyssa)
1278  YYSTACK_FREE(yyss1);
1279  }
1280 # endif
1281 #endif /* no yyoverflow */
1282 
1283  yyssp = yyss + yysize - 1;
1284  yyvsp = yyvs + yysize - 1;
1285 
1286 
1287  YYDPRINTF((stderr, "Stack size increased to %lu\n",
1288  (unsigned long int) yystacksize));
1289 
1290  if (yyss + yystacksize - 1 <= yyssp)
1291  YYABORT;
1292  }
1293 
1294  YYDPRINTF((stderr, "Entering state %d\n", yystate));
1295 
1296  goto yybackup;
1297 
1298  /*-----------.
1299  | yybackup. |
1300  `-----------*/
1301 yybackup:
1302 
1303  /* Do appropriate processing given the current state. Read a
1304  look-ahead token if we need one and don't already have one. */
1305 
1306  /* First try to decide what to do without reference to look-ahead token. */
1307  yyn = yypact[yystate];
1308 
1309  if (yyn == YYPACT_NINF)
1310  goto yydefault;
1311 
1312  /* Not known => get a look-ahead token if don't already have one. */
1313 
1314  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1315  if (yychar == YYEMPTY)
1316  {
1317  YYDPRINTF((stderr, "Reading a token: "));
1318  yychar = YYLEX;
1319  }
1320 
1321  if (yychar <= YYEOF)
1322  {
1323  yychar = yytoken = YYEOF;
1324  YYDPRINTF((stderr, "Now at end of input.\n"));
1325  }
1326  else
1327  {
1328  yytoken = YYTRANSLATE(yychar);
1329  YY_SYMBOL_PRINT("Next token is", yytoken, &yylval, &yylloc);
1330  }
1331 
1332  /* If the proper action on seeing token YYTOKEN is to reduce or to
1333  detect an error, take that action. */
1334  yyn += yytoken;
1335 
1336  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1337  goto yydefault;
1338 
1339  yyn = yytable[yyn];
1340 
1341  if (yyn <= 0)
1342  {
1343  if (yyn == 0 || yyn == YYTABLE_NINF)
1344  goto yyerrlab;
1345 
1346  yyn = -yyn;
1347  goto yyreduce;
1348  }
1349 
1350  if (yyn == YYFINAL)
1351  YYACCEPT;
1352 
1353  /* Count tokens shifted since error; after three, turn off error
1354  status. */
1355  if (yyerrstatus)
1356  yyerrstatus--;
1357 
1358  /* Shift the look-ahead token. */
1359  YY_SYMBOL_PRINT("Shifting", yytoken, &yylval, &yylloc);
1360 
1361  /* Discard the shifted token unless it is eof. */
1362  if (yychar != YYEOF)
1363  yychar = YYEMPTY;
1364 
1365  yystate = yyn;
1366  *++yyvsp = yylval;
1367 
1368  goto yynewstate;
1369 
1370 
1371  /*-----------------------------------------------------------.
1372  | yydefault -- do the default action for the current state. |
1373  `-----------------------------------------------------------*/
1374 yydefault:
1375  yyn = yydefact[yystate];
1376 
1377  if (yyn == 0)
1378  goto yyerrlab;
1379 
1380  goto yyreduce;
1381 
1382 
1383  /*-----------------------------.
1384  | yyreduce -- Do a reduction. |
1385  `-----------------------------*/
1386 yyreduce:
1387  /* yyn is the number of a rule to reduce with. */
1388  yylen = yyr2[yyn];
1389 
1390  /* If YYLEN is nonzero, implement the default value of the action:
1391  `$$ = $1'.
1392 
1393  Otherwise, the following line sets YYVAL to garbage.
1394  This behavior is undocumented and Bison
1395  users should not rely upon it. Assigning to YYVAL
1396  unconditionally makes the parser a bit smaller, and it avoids a
1397  GCC warning that YYVAL may be used uninitialized. */
1398  yyval = yyvsp[1-yylen];
1399 
1400 
1401  YY_REDUCE_PRINT(yyn);
1402 
1403  switch (yyn)
1404  {
1405  case 2:
1406 #line 48 "CChemEqParser.ypp"
1407  {
1408  }
1409  break;
1410 
1411  case 3:
1412 #line 51 "CChemEqParser.ypp"
1413  {
1414  mReversibility = ((yyvsp[(2) - (3)])->name == "=") ? true : false;
1415  pdelete((yyvsp[(2) - (3)]));
1416  }
1417  break;
1418 
1419  case 4:
1420 #line 56 "CChemEqParser.ypp"
1421  {
1422  }
1423  break;
1424 
1425  case 5:
1426 #line 59 "CChemEqParser.ypp"
1427  {
1428  mReversibility = ((yyvsp[(2) - (2)])->name == "=") ? true : false;
1429  pdelete((yyvsp[(2) - (2)]));
1430  }
1431  break;
1432 
1433  case 6:
1434 #line 64 "CChemEqParser.ypp"
1435  {
1436  }
1437  break;
1438 
1439  case 7:
1440 #line 68 "CChemEqParser.ypp"
1441  {
1442  }
1443  break;
1444 
1445  case 8:
1446 #line 72 "CChemEqParser.ypp"
1447  {
1448  mSubstrateNames.push_back((yyvsp[(1) - (1)])->name);
1449  mSubstrateMult.push_back((yyvsp[(1) - (1)])->multiplicity);
1450  mSubstrateCompartments.push_back((yyvsp[(1) - (1)])->compartment);
1451  pdelete((yyvsp[(1) - (1)]));
1452  }
1453  break;
1454 
1455  case 9:
1456 #line 79 "CChemEqParser.ypp"
1457  {
1458  mSubstrateNames.push_back((yyvsp[(3) - (3)])->name);
1459  mSubstrateMult.push_back((yyvsp[(3) - (3)])->multiplicity);
1460  mSubstrateCompartments.push_back((yyvsp[(3) - (3)])->compartment);
1461  pdelete((yyvsp[(2) - (3)]));
1462  pdelete((yyvsp[(3) - (3)]));
1463  }
1464  break;
1465 
1466  case 10:
1467 #line 88 "CChemEqParser.ypp"
1468  {
1469  mReversibility = ((yyvsp[(1) - (2)])->name == "=") ? true : false;
1470 
1471  mProductNames.push_back((yyvsp[(2) - (2)])->name);
1472  mProductMult.push_back((yyvsp[(2) - (2)])->multiplicity);
1473  mProductCompartments.push_back((yyvsp[(2) - (2)])->compartment);
1474  pdelete((yyvsp[(1) - (2)]));
1475  pdelete((yyvsp[(2) - (2)]));
1476  }
1477  break;
1478 
1479  case 11:
1480 #line 98 "CChemEqParser.ypp"
1481  {
1482  mProductNames.push_back((yyvsp[(3) - (3)])->name);
1483  mProductMult.push_back((yyvsp[(3) - (3)])->multiplicity);
1484  mProductCompartments.push_back((yyvsp[(3) - (3)])->compartment);
1485  pdelete((yyvsp[(2) - (3)]));
1486  pdelete((yyvsp[(3) - (3)]));
1487  }
1488  break;
1489 
1490  case 12:
1491 #line 107 "CChemEqParser.ypp"
1492  {
1493  mModifierNames.push_back((yyvsp[(2) - (2)])->name);
1494  mModifierMult.push_back((yyvsp[(2) - (2)])->multiplicity);
1495  mModifierCompartments.push_back((yyvsp[(2) - (2)])->compartment);
1496  pdelete((yyvsp[(1) - (2)]));
1497  pdelete((yyvsp[(2) - (2)]));
1498  }
1499  break;
1500 
1501  case 13:
1502 #line 115 "CChemEqParser.ypp"
1503  {
1504  mModifierNames.push_back((yyvsp[(2) - (2)])->name);
1505  mModifierMult.push_back((yyvsp[(2) - (2)])->multiplicity);
1506  mModifierCompartments.push_back((yyvsp[(2) - (2)])->compartment);
1507  pdelete((yyvsp[(2) - (2)]));
1508  }
1509  break;
1510 
1511  case 14:
1512 #line 123 "CChemEqParser.ypp"
1513  {
1514  (yyval) = (yyvsp[(1) - (1)]);
1515  (yyval)->compartment = "";
1516  }
1517  break;
1518 
1519  case 15:
1520 #line 128 "CChemEqParser.ypp"
1521  {
1522  (yyval) = (yyvsp[(1) - (2)]);
1523  (yyval)->compartment = (yyvsp[(2) - (2)])->name;
1524  pdelete((yyvsp[(2) - (2)]));
1525  }
1526  break;
1527 
1528  case 16:
1529 #line 136 "CChemEqParser.ypp"
1530  {
1531  (yyval) = (yyvsp[(1) - (1)]);
1532  (yyval)->multiplicity = 1.0;
1533  }
1534  break;
1535 
1536  case 17:
1537 #line 141 "CChemEqParser.ypp"
1538  {
1539  (yyval) = (yyvsp[(2) - (2)]);
1540  (yyval)->multiplicity = strToDouble((yyvsp[(1) - (2)])->name.c_str(), NULL);
1541  pdelete((yyvsp[(1) - (2)]));
1542  }
1543  break;
1544 
1545  case 18:
1546 #line 147 "CChemEqParser.ypp"
1547  {
1548  (yyval) = (yyvsp[(3) - (3)]);
1549  (yyval)->multiplicity = strToDouble((yyvsp[(1) - (3)])->name.c_str(), NULL);
1550  pdelete((yyvsp[(1) - (3)]));
1551  pdelete((yyvsp[(2) - (3)]));
1552  }
1553  break;
1554 
1555  case 19:
1556 #line 155 "CChemEqParser.ypp"
1557  {
1558  (yyval) = (yyvsp[(2) - (3)]);
1559  pdelete((yyvsp[(1) - (3)]));
1560  pdelete((yyvsp[(3) - (3)]));
1561  }
1562  break;
1563 
1564 
1565  /* Line 1267 of yacc.c. */
1566 #line 1522 "CChemEqParser_yacc.cpp"
1567  default: break;
1568  }
1569 
1570  YY_SYMBOL_PRINT("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1571 
1572  YYPOPSTACK(yylen);
1573  yylen = 0;
1574  YY_STACK_PRINT(yyss, yyssp);
1575 
1576  *++yyvsp = yyval;
1577 
1578 
1579  /* Now `shift' the result of the reduction. Determine what state
1580  that goes to, based on the state we popped back to and the rule
1581  number reduced by. */
1582 
1583  yyn = yyr1[yyn];
1584 
1585  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1586 
1587  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1588  yystate = yytable[yystate];
1589  else
1590  yystate = yydefgoto[yyn - YYNTOKENS];
1591 
1592  goto yynewstate;
1593 
1594 
1595  /*------------------------------------.
1596  | yyerrlab -- here on detecting error |
1597  `------------------------------------*/
1598 yyerrlab:
1599 
1600  /* If not already recovering from an error, report this error. */
1601  if (!yyerrstatus)
1602  {
1603  ++yynerrs;
1604 #if ! YYERROR_VERBOSE
1605  yyerror(YY_("syntax error"));
1606 #else
1607  {
1608  YYSIZE_T yysize = yysyntax_error(0, yystate, yychar);
1609 
1610  if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1611  {
1612  YYSIZE_T yyalloc = 2 * yysize;
1613 
1614  if (!(yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1615  yyalloc = YYSTACK_ALLOC_MAXIMUM;
1616 
1617  if (yymsg != yymsgbuf)
1618  YYSTACK_FREE(yymsg);
1619 
1620  yymsg = (char *) YYSTACK_ALLOC(yyalloc);
1621 
1622  if (yymsg)
1623  yymsg_alloc = yyalloc;
1624  else
1625  {
1626  yymsg = yymsgbuf;
1627  yymsg_alloc = sizeof yymsgbuf;
1628  }
1629  }
1630 
1631  if (0 < yysize && yysize <= yymsg_alloc)
1632  {
1633  (void) yysyntax_error(yymsg, yystate, yychar);
1634  yyerror(yymsg);
1635  }
1636  else
1637  {
1638  yyerror(YY_("syntax error"));
1639 
1640  if (yysize != 0)
1641  goto yyexhaustedlab;
1642  }
1643  }
1644 #endif
1645  }
1646 
1647 
1648 
1649  if (yyerrstatus == 3)
1650  {
1651  /* If just tried and failed to reuse look-ahead token after an
1652  error, discard it. */
1653 
1654  if (yychar <= YYEOF)
1655  {
1656  /* Return failure if at end of input. */
1657  if (yychar == YYEOF)
1658  YYABORT;
1659  }
1660  else
1661  {
1662  yydestruct("Error: discarding",
1663  yytoken, &yylval);
1664  yychar = YYEMPTY;
1665  }
1666  }
1667 
1668  /* Else will try to reuse look-ahead token after shifting the error
1669  token. */
1670  goto yyerrlab1;
1671 
1672 
1673  /*---------------------------------------------------.
1674  | yyerrorlab -- error raised explicitly by YYERROR. |
1675  `---------------------------------------------------*/
1676 yyerrorlab:
1677 
1678  /* Pacify compilers like GCC when the user code never invokes
1679  YYERROR and the label yyerrorlab therefore never appears in user
1680  code. */
1681  if (/*CONSTCOND*/ 0)
1682  goto yyerrorlab;
1683 
1684  /* Do not reclaim the symbols of the rule which action triggered
1685  this YYERROR. */
1686  YYPOPSTACK(yylen);
1687  yylen = 0;
1688  YY_STACK_PRINT(yyss, yyssp);
1689  yystate = *yyssp;
1690  goto yyerrlab1;
1691 
1692 
1693  /*-------------------------------------------------------------.
1694  | yyerrlab1 -- common code for both syntax error and YYERROR. |
1695  `-------------------------------------------------------------*/
1696 yyerrlab1:
1697  yyerrstatus = 3; /* Each real token shifted decrements this. */
1698 
1699  for (;;)
1700  {
1701  yyn = yypact[yystate];
1702 
1703  if (yyn != YYPACT_NINF)
1704  {
1705  yyn += YYTERROR;
1706 
1707  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1708  {
1709  yyn = yytable[yyn];
1710 
1711  if (0 < yyn)
1712  break;
1713  }
1714  }
1715 
1716  /* Pop the current state because it cannot handle the error token. */
1717  if (yyssp == yyss)
1718  YYABORT;
1719 
1720 
1721  yydestruct("Error: popping",
1722  yystos[yystate], yyvsp);
1723  YYPOPSTACK(1);
1724  yystate = *yyssp;
1725  YY_STACK_PRINT(yyss, yyssp);
1726  }
1727 
1728  if (yyn == YYFINAL)
1729  YYACCEPT;
1730 
1731  *++yyvsp = yylval;
1732 
1733 
1734  /* Shift the error token. */
1735  YY_SYMBOL_PRINT("Shifting", yystos[yyn], yyvsp, yylsp);
1736 
1737  yystate = yyn;
1738  goto yynewstate;
1739 
1740 
1741  /*-------------------------------------.
1742  | yyacceptlab -- YYACCEPT comes here. |
1743  `-------------------------------------*/
1744 yyacceptlab:
1745  yyresult = 0;
1746  goto yyreturn;
1747 
1748  /*-----------------------------------.
1749  | yyabortlab -- YYABORT comes here. |
1750  `-----------------------------------*/
1751 yyabortlab:
1752  yyresult = 1;
1753  goto yyreturn;
1754 
1755 #ifndef yyoverflow
1756  /*-------------------------------------------------.
1757  | yyexhaustedlab -- memory exhaustion comes here. |
1758  `-------------------------------------------------*/
1759 yyexhaustedlab:
1760  yyerror(YY_("memory exhausted"));
1761  yyresult = 2;
1762  /* Fall through. */
1763 #endif
1764 
1765 yyreturn:
1766 
1767  if (yychar != YYEOF && yychar != YYEMPTY)
1768  yydestruct("Cleanup: discarding lookahead",
1769  yytoken, &yylval);
1770 
1771  /* Do not reclaim the symbols of the rule which action triggered
1772  this YYABORT or YYACCEPT. */
1773  YYPOPSTACK(yylen);
1774  YY_STACK_PRINT(yyss, yyssp);
1775 
1776  while (yyssp != yyss)
1777  {
1778  yydestruct("Cleanup: popping",
1779  yystos[*yyssp], yyvsp);
1780  YYPOPSTACK(1);
1781  }
1782 
1783 #ifndef yyoverflow
1784 
1785  if (yyss != yyssa)
1786  YYSTACK_FREE(yyss);
1787 
1788 #endif
1789 #if YYERROR_VERBOSE
1790 
1791  if (yymsg != yymsgbuf)
1792  YYSTACK_FREE(yymsg);
1793 
1794 #endif
1795  /* Make sure YYID is used. */
1796  return YYID(yyresult);
1797 }
1798 
1799 
1800 #line 162 "CChemEqParser.ypp"
1801 
1802 
1803 
#define YYMAXDEPTH
#define YYSIZE_MAXIMUM
#define YYSTACK_BYTES(N)
#define pdelete(p)
Definition: copasi.h:215
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
#define YYSIZE_T
#define YYLEX
short int yytype_int16
#define YYDEBUG
#define YYSTACK_ALLOC
unsigned short int yytype_uint16
#define YYINITDEPTH
#define YY_REDUCE_PRINT(Rule)
#define YYTERROR
#define yychar
#define YYFINAL
static void yydestruct(yymsg, yytype, yyvaluep) const char *yymsg
#define yyerror
int yytype
#define YYACCEPT
#define YYSTACK_FREE
#define TOKEN_BEGIN_COMPARTMENT
yytype_int16 yyss
#define yynerrs
CChemEqParserBase::Data * yyvs
#define TOKEN_MULTIPLY
#define TOKEN_PLUS
#define YYSTYPE
#define TOKEN_END_COMPARTMENT
#define yyparse
() void(yyvaluep))
#define YYUSE(e)
#define YYEMPTY
#define TOKEN_BEGIN_PRODUCTS
#define YYLAST
#define YYEOF
#define YYTABLE_NINF
double strToDouble(const char *str, char const **pTail)
Definition: utility.cpp:325
#define TOKEN_NUMBER
#define YYDPRINTF(Args)
#define YYPOPSTACK(N)
#define YYSTACK_ALLOC_MAXIMUM
#define YYPACT_NINF
#define YYABORT
#define TOKEN_BEGIN_MODIFIERS
#define YYID(n)
unsigned char yytype_uint8
#define YYSTACK_RELOCATE(Stack)
short int yytype_int8
#define YY_STACK_PRINT(Bottom, Top)
#define TOKEN_NAME
#define YYTRANSLATE(YYX)
#define YYNTOKENS
#define yylval
#define YY_(msgid)