COPASI API  4.16.103
CChemEqParser_lex.cpp
Go to the documentation of this file.
1 // Copyright (C) 2010 - 2015 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
6 // Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual
7 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
8 // and The University of Manchester.
9 // All rights reserved.
10 
11 // Copyright (C) 2005 - 2007 by Pedro Mendes, Virginia Tech Intellectual
12 // Properties, Inc. and EML Research, gGmbH.
13 // All rights reserved.
14 
15 #line 2 "CChemEqParser_lex.cpp"
16 
17 #line 4 "CChemEqParser_lex.cpp"
18 
19 #define YY_INT_ALIGNED short int
20 
21 /* A lexical scanner generated by flex */
22 
23 #define FLEX_SCANNER
24 #define YY_FLEX_MAJOR_VERSION 2
25 #define YY_FLEX_MINOR_VERSION 5
26 #define YY_FLEX_SUBMINOR_VERSION 35
27 #if YY_FLEX_SUBMINOR_VERSION > 0
28 #define FLEX_BETA
29 #endif
30 
31 /* The c++ scanner is a mess. The FlexLexer.h header file relies on the
32  * following macro. This is required in order to pass the c++-multiple-scanners
33  * test in the regression suite. We get reports that it breaks inheritance.
34  * We will address this in a future release of flex, or omit the C++ scanner
35  * altogether.
36  */
37 #define yyFlexLexer CChemEqParserFlexLexer
38 
39 /* First, we deal with platform-specific or compiler-specific issues. */
40 
41 /* begin standard C headers. */
42 
43 /* end standard C headers. */
44 
45 /* flex integer type definitions */
46 
47 #ifndef FLEXINT_H
48 #define FLEXINT_H
49 
50 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
51 
52 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
53 
54 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
55  * if you want the limit (max/min) macros for int types.
56  */
57 #ifndef __STDC_LIMIT_MACROS
58 #define __STDC_LIMIT_MACROS 1
59 #endif
60 
61 #include <inttypes.h>
62 typedef int8_t flex_int8_t;
63 typedef uint8_t flex_uint8_t;
64 typedef int16_t flex_int16_t;
65 typedef uint16_t flex_uint16_t;
66 typedef int32_t flex_int32_t;
67 typedef uint32_t flex_uint32_t;
68 #else
69 typedef signed char flex_int8_t;
70 typedef short int flex_int16_t;
71 typedef int flex_int32_t;
72 typedef unsigned char flex_uint8_t;
73 typedef unsigned short int flex_uint16_t;
74 typedef unsigned int flex_uint32_t;
75 
76 /* Limits of integral types. */
77 #ifndef INT8_MIN
78 #define INT8_MIN (-128)
79 #endif
80 #ifndef INT16_MIN
81 #define INT16_MIN (-32767-1)
82 #endif
83 #ifndef INT32_MIN
84 #define INT32_MIN (-2147483647-1)
85 #endif
86 #ifndef INT8_MAX
87 #define INT8_MAX (127)
88 #endif
89 #ifndef INT16_MAX
90 #define INT16_MAX (32767)
91 #endif
92 #ifndef INT32_MAX
93 #define INT32_MAX (2147483647)
94 #endif
95 #ifndef UINT8_MAX
96 #define UINT8_MAX (255U)
97 #endif
98 #ifndef UINT16_MAX
99 #define UINT16_MAX (65535U)
100 #endif
101 #ifndef UINT32_MAX
102 #define UINT32_MAX (4294967295U)
103 #endif
104 
105 #endif /* ! C99 */
106 
107 #endif /* ! FLEXINT_H */
108 
109 /* begin standard C++ headers. */
110 #include <iostream>
111 #include <errno.h>
112 #include <cstdlib>
113 #include <cstdio>
114 #include <cstring>
115 /* end standard C++ headers. */
116 
117 #ifdef __cplusplus
118 
119 /* The "const" storage-class-modifier is valid. */
120 #define YY_USE_CONST
121 
122 #else /* ! __cplusplus */
123 
124 /* C99 requires __STDC__ to be defined as 1. */
125 #if defined (__STDC__)
126 
127 #define YY_USE_CONST
128 
129 #endif /* defined (__STDC__) */
130 #endif /* ! __cplusplus */
131 
132 #ifdef YY_USE_CONST
133 #define yyconst const
134 #else
135 #define yyconst
136 #endif
137 
138 /* Returned upon end-of-file. */
139 #define YY_NULL 0
140 
141 /* Promotes a possibly negative, possibly signed char to an unsigned
142  * integer for use as an array index. If the signed char is negative,
143  * we want to instead treat it as an 8-bit unsigned char, hence the
144  * double cast.
145  */
146 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
147 
148 /* Enter a start condition. This macro really ought to take a parameter,
149  * but we do it the disgusting crufty way forced on us by the ()-less
150  * definition of BEGIN.
151  */
152 #define BEGIN (yy_start) = 1 + 2 *
153 
154 /* Translate the current start state into a value that can be later handed
155  * to BEGIN to return to the state. The YYSTATE alias is for lex
156  * compatibility.
157  */
158 #define YY_START (((yy_start) - 1) / 2)
159 #define YYSTATE YY_START
160 
161 /* Action number for EOF rule of a given start state. */
162 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
163 
164 /* Special action meaning "start processing a new file". */
165 #define YY_NEW_FILE yyrestart(yyin)
166 
167 #define YY_END_OF_BUFFER_CHAR 0
168 
169 /* Size of default input buffer. */
170 #ifndef YY_BUF_SIZE
171 #ifdef __ia64__
172 /* On IA-64, the buffer size is 16k, not 8k.
173  * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
174  * Ditto for the __ia64__ case accordingly.
175  */
176 #define YY_BUF_SIZE 32768
177 #else
178 #define YY_BUF_SIZE 16384
179 #endif /* __ia64__ */
180 #endif
181 
182 /* The state buf must be large enough to hold one state per character in the main buffer.
183  */
184 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
185 
186 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
187 #define YY_TYPEDEF_YY_BUFFER_STATE
189 #endif
190 
191 extern int yyleng;
192 
193 #define EOB_ACT_CONTINUE_SCAN 0
194 #define EOB_ACT_END_OF_FILE 1
195 #define EOB_ACT_LAST_MATCH 2
196 
197 #define YY_LESS_LINENO(n)
198 
199 /* Return all but the first "n" matched characters back to the input stream. */
200 #define yyless(n) \
201  do \
202  {\
203  /* Undo effects of setting up yytext. */ \
204  int yyless_macro_arg = (n); \
205  YY_LESS_LINENO(yyless_macro_arg);\
206  *yy_cp = (yy_hold_char); \
207  YY_RESTORE_YY_MORE_OFFSET \
208  (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
209  YY_DO_BEFORE_ACTION; /* set up yytext again */ \
210  } \
211  while (0)
212 
213 #define unput(c) yyunput(c, (yytext_ptr))
214 
215 #ifndef YY_TYPEDEF_YY_SIZE_T
216 #define YY_TYPEDEF_YY_SIZE_T
217 typedef size_t yy_size_t;
218 #endif
219 
220 #ifndef YY_STRUCT_YY_BUFFER_STATE
221 #define YY_STRUCT_YY_BUFFER_STATE
222 struct yy_buffer_state
223 {
224 
225  std::istream* yy_input_file;
226 
227  char *yy_ch_buf; /* input buffer */
228  char *yy_buf_pos; /* current position in input buffer */
229 
230  /* Size of input buffer in bytes, not including room for EOB
231  * characters.
232  */
233  yy_size_t yy_buf_size;
234 
235  /* Number of characters read into yy_ch_buf, not including EOB
236  * characters.
237  */
239 
240  /* Whether we "own" the buffer - i.e., we know we created it,
241  * and can realloc() it to grow it, and should free() it to
242  * delete it.
243  */
244  int yy_is_our_buffer;
245 
246  /* Whether this is an "interactive" input source; if so, and
247  * if we're using stdio for input, then we want to use getc()
248  * instead of fread(), to make sure we stop fetching input after
249  * each newline.
250  */
251  int yy_is_interactive;
252 
253  /* Whether we're considered to be at the beginning of a line.
254  * If so, '^' rules will be active on the next match, otherwise
255  * not.
256  */
257  int yy_at_bol;
258 
259  int yy_bs_lineno; /**< The line count. */
260  int yy_bs_column; /**< The column count. */
261 
262  /* Whether to try to fill the input buffer when we reach the
263  * end of it.
264  */
265  int yy_fill_buffer;
266 
267  int yy_buffer_status;
268 
269 #define YY_BUFFER_NEW 0
270 #define YY_BUFFER_NORMAL 1
271  /* When an EOF's been seen but there's still some text to process
272  * then we mark the buffer as YY_EOF_PENDING, to indicate that we
273  * shouldn't try reading from the input source any more. We might
274  * still have a bunch of tokens to match, though, because of
275  * possible backing-up.
276  *
277  * When we actually see the EOF, we change the status to "new"
278  * (via yyrestart()), so that the user can continue scanning by
279  * just pointing yyin at a new input file.
280  */
281 #define YY_BUFFER_EOF_PENDING 2
282 };
283 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
284 
285 /* We provide macros for accessing buffer states in case in the
286  * future we want to put the buffer states in a more general
287  * "scanner state".
288  *
289  * Returns the top of the stack, or NULL.
290  */
291 #define YY_CURRENT_BUFFER ((yy_buffer_stack) \
292  ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
293  : NULL)
294 
295 /* Same as previous macro, but useful when we know that the buffer stack is not
296  * NULL or when we need an lvalue. For internal use only.
297  */
298 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
299 
300 void *CChemEqParseralloc(yy_size_t);
301 void *CChemEqParserrealloc(void *, yy_size_t);
302 void CChemEqParserfree(void *);
303 
304 #define yy_new_buffer yy_create_buffer
305 
306 #define yy_set_interactive(is_interactive) \
307  {\
308  if (! YY_CURRENT_BUFFER ){\
309  yyensure_buffer_stack (); \
310  YY_CURRENT_BUFFER_LVALUE = \
311  yy_create_buffer(yyin, YY_BUF_SIZE ); \
312  } \
313  YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
314  }
315 
316 #define yy_set_bol(at_bol) \
317  {\
318  if (! YY_CURRENT_BUFFER ){\
319  yyensure_buffer_stack (); \
320  YY_CURRENT_BUFFER_LVALUE = \
321  yy_create_buffer(yyin, YY_BUF_SIZE ); \
322  } \
323  YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
324  }
325 
326 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
327 
328 /* Begin user sect3 */
329 
330 typedef unsigned char YY_CHAR;
331 
332 #define yytext_ptr yytext
333 
334 #include "copasi/FlexLexer.h"
335 
336 /* Done after the current pattern has been matched and before the
337  * corresponding action - sets up yytext.
338  */
339 #define YY_DO_BEFORE_ACTION \
340  (yytext_ptr) = yy_bp; \
341  yyleng = (size_t) (yy_cp - yy_bp); \
342  (yy_hold_char) = *yy_cp; \
343  *yy_cp = '\0'; \
344  (yy_c_buf_p) = yy_cp;
345 
346 #define YY_NUM_RULES 12
347 #define YY_END_OF_BUFFER 13
348 /* This struct is not used in this scanner,
349  but its presence is necessary. */
350 struct yy_trans_info
351 {
352  flex_int32_t yy_verify;
353  flex_int32_t yy_nxt;
354 };
355 static yyconst flex_int16_t yy_accept[32] =
356 {
357  0,
358  0, 0, 13, 9, 9, 9, 10, 11, 3, 2,
359  9, 1, 6, 7, 4, 5, 9, 0, 9, 10,
360  0, 8, 0, 7, 1, 1, 9, 1, 9, 1,
361  0
362 };
363 
364 static yyconst flex_int32_t yy_ec[256] =
365 {
366  0,
367  1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
368  1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
369  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
370  1, 4, 1, 5, 1, 1, 1, 1, 1, 1,
371  1, 6, 7, 1, 8, 9, 1, 10, 10, 10,
372  10, 10, 10, 10, 10, 10, 10, 1, 11, 1,
373  12, 13, 1, 1, 1, 1, 1, 1, 14, 1,
374  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
375  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
376  1, 15, 1, 1, 1, 1, 1, 1, 1, 1,
377 
378  16, 1, 1, 1, 1, 1, 1, 1, 1, 1,
379  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
380  1, 1, 17, 1, 18, 1, 1, 1, 1, 1,
381  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
382  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
383  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
384  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
385  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
386  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
387  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
388 
389  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
390  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
391  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
392  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
393  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
394  1, 1, 1, 1, 1
395 };
396 
397 static yyconst flex_int32_t yy_meta[19] =
398 {
399  0,
400  1, 2, 2, 3, 4, 1, 1, 1, 1, 1,
401  1, 1, 1, 1, 1, 1, 4, 4
402 };
403 
404 static yyconst flex_int16_t yy_base[35] =
405 {
406  0,
407  0, 0, 63, 51, 17, 0, 0, 17, 50, 49,
408  12, 24, 32, 28, 64, 64, 26, 20, 0, 0,
409  21, 64, 24, 13, 20, 0, 34, 37, 38, 40,
410  64, 51, 52, 55
411 };
412 
413 static yyconst flex_int16_t yy_def[35] =
414 {
415  0,
416  31, 1, 31, 32, 32, 5, 33, 34, 32, 32,
417  32, 32, 32, 32, 31, 31, 32, 32, 5, 33,
418  34, 31, 34, 32, 12, 12, 32, 12, 32, 32,
419  0, 31, 31, 31
420 };
421 
422 static yyconst flex_int16_t yy_nxt[83] =
423 {
424  0,
425  4, 5, 6, 7, 8, 9, 10, 11, 4, 12,
426  13, 14, 4, 4, 4, 4, 15, 16, 19, 19,
427  20, 22, 18, 18, 24, 22, 31, 18, 17, 28,
428  18, 23, 25, 26, 18, 23, 18, 27, 18, 27,
429  29, 29, 18, 30, 18, 17, 28, 30, 18, 30,
430  18, 17, 17, 20, 20, 21, 21, 21, 21, 18,
431  18, 18, 31, 3, 31, 31, 31, 31, 31, 31,
432  31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
433  31, 31
434 };
435 
436 static yyconst flex_int16_t yy_chk[83] =
437 {
438  0,
439  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
440  1, 1, 1, 1, 1, 1, 1, 1, 5, 5,
441  5, 8, 11, 24, 11, 21, 23, 5, 25, 25,
442  18, 8, 12, 12, 12, 21, 17, 12, 14, 12,
443  27, 27, 13, 27, 27, 28, 28, 29, 29, 30,
444  30, 32, 32, 33, 33, 34, 34, 34, 34, 10,
445  9, 4, 3, 31, 31, 31, 31, 31, 31, 31,
446  31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
447  31, 31
448 };
449 
450 /* The intent behind this definition is that it'll catch
451  * any uses of REJECT which flex missed.
452  */
453 #define REJECT reject_used_but_not_detected
454 #define yymore() yymore_used_but_not_detected
455 #define YY_MORE_ADJ 0
456 #define YY_RESTORE_YY_MORE_OFFSET
457 #line 1 "model/CChemEqParser.lpp"
458 /* scanner for kinetic functions */
459 #line 9 "model/CChemEqParser.lpp"
460 #include <vector>
461 
462 #include "copasi.h"
463 #include "CChemEqParser.h"
464 #include "CChemEqParser_yacc.hpp"
465 
467 #include "utilities/utility.h"
468 
469 #ifndef YYERRCODE
470 #define YYERRCODE 256
471 #endif
472 
473 #define YY_USER_INIT \
474  mPosition = 0;
475 
476 #define COMMON_ACTION \
477  mpData = new Data; \
478  mpData->name = yytext; \
479  mPosition += yyleng;
480 
481 #line 463 "CChemEqParser_lex.cpp"
482 
483 #define INITIAL 0
484 
485 #ifndef YY_NO_UNISTD_H
486 /* Special case for "unistd.h", since it is non-ANSI. We include it way
487  * down here because we want the user's section 1 to have been scanned first.
488  * The user has a chance to override it with an option.
489  */
490 #endif
491 
492 #ifndef YY_EXTRA_TYPE
493 #define YY_EXTRA_TYPE void *
494 #endif
495 
496 #ifndef yytext_ptr
497 static void yy_flex_strncpy(char *, yyconst char *, int);
498 #endif
499 
500 #ifdef YY_NEED_STRLEN
501 static int yy_flex_strlen(yyconst char *);
502 #endif
503 
504 #ifndef YY_NO_INPUT
505 
506 #endif
507 
508 /* Amount of stuff to slurp up with each read. */
509 #ifndef YY_READ_BUF_SIZE
510 #ifdef __ia64__
511 /* On IA-64, the buffer size is 16k, not 8k */
512 #define YY_READ_BUF_SIZE 16384
513 #else
514 #define YY_READ_BUF_SIZE 8192
515 #endif /* __ia64__ */
516 #endif
517 
518 /* Copy whatever the last rule matched to the standard output. */
519 #ifndef ECHO
520 #define ECHO LexerOutput(yytext, yyleng)
521 #endif
522 
523 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
524  * is returned in "result".
525  */
526 #ifndef YY_INPUT
527 #define YY_INPUT(buf,result,max_size) \
528  \
529  if ((result = LexerInput((char *) buf, max_size )) < 0 ) \
530  YY_FATAL_ERROR("input in flex scanner failed" );
531 
532 #endif
533 
534 /* No semi-colon after return; correct usage is to write "yyterminate();" -
535  * we don't want an extra ';' after the "return" because that will cause
536  * some compilers to complain about unreachable statements.
537  */
538 #ifndef yyterminate
539 #define yyterminate() return YY_NULL
540 #endif
541 
542 /* Number of entries by which start-condition stack grows. */
543 #ifndef YY_START_STACK_INCR
544 #define YY_START_STACK_INCR 25
545 #endif
546 
547 /* Report a fatal error. */
548 #ifndef YY_FATAL_ERROR
549 #define YY_FATAL_ERROR(msg) LexerError(msg)
550 #endif
551 
552 /* end tables serialization structures and prototypes */
553 
554 /* Default declaration of generated scanner - a define so the user can
555  * easily add parameters.
556  */
557 #ifndef YY_DECL
558 #define YY_DECL_IS_OURS 1
559 #define YY_DECL int yyFlexLexer::yylex()
560 #endif /* !YY_DECL */
561 
562 /* Code executed at the beginning of each rule, after yytext and yyleng
563  * have been set up.
564  */
565 #ifndef YY_USER_ACTION
566 #define YY_USER_ACTION
567 #endif
568 
569 /* Code executed at the end of each rule. */
570 #ifndef YY_BREAK
571 #define YY_BREAK break;
572 #endif
573 
574 #define YY_RULE_SETUP \
575  YY_USER_ACTION
576 
577 /** The main scanner function which does all the work.
578  */
580 {
581  register yy_state_type yy_current_state;
582  register char * yy_cp, *yy_bp;
583  register int yy_act;
584 
585 #line 36 "model/CChemEqParser.lpp"
586 
587 #line 570 "CChemEqParser_lex.cpp"
588 
589  if (!(yy_init))
590  {
591  (yy_init) = 1;
592 
593 #ifdef YY_USER_INIT
594  YY_USER_INIT;
595 #endif
596 
597  if (!(yy_start))
598  (yy_start) = 1; /* first start state */
599 
600  if (! yyin)
601  yyin = & std::cin;
602 
603  if (! yyout)
604  yyout = & std::cout;
605 
606  if (! YY_CURRENT_BUFFER)
607  {
608  yyensure_buffer_stack();
610  yy_create_buffer(yyin, YY_BUF_SIZE);
611  }
612 
613  yy_load_buffer_state();
614  }
615 
616  while (1) /* loops until end-of-file is reached */
617  {
618  yy_cp = (yy_c_buf_p);
619 
620  /* Support of yytext. */
621  *yy_cp = (yy_hold_char);
622 
623  /* yy_bp points to the position in yy_ch_buf of the start of
624  * the current run.
625  */
626  yy_bp = yy_cp;
627 
628  yy_current_state = (yy_start);
629 yy_match:
630 
631  do
632  {
633  register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
634 
635  if (yy_accept[yy_current_state])
636  {
637  (yy_last_accepting_state) = yy_current_state;
638  (yy_last_accepting_cpos) = yy_cp;
639  }
640 
641  while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state)
642  {
643  yy_current_state = (int) yy_def[yy_current_state];
644 
645  if (yy_current_state >= 32)
646  yy_c = yy_meta[(unsigned int) yy_c];
647  }
648 
649  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
650  ++yy_cp;
651  }
652  while (yy_current_state != 31);
653 
654  yy_cp = (yy_last_accepting_cpos);
655  yy_current_state = (yy_last_accepting_state);
656 
657 yy_find_action:
658  yy_act = yy_accept[yy_current_state];
659 
661 
662 do_action: /* This label is used only to access EOF actions. */
663 
664  switch (yy_act)
665  {
666  /* beginning of action switch */
667  case 0: /* must back up */
668  /* undo the effects of YY_DO_BEFORE_ACTION */
669  *yy_cp = (yy_hold_char);
670  yy_cp = (yy_last_accepting_cpos);
671  yy_current_state = (yy_last_accepting_state);
672  goto yy_find_action;
673 
674  case 1:
676 #line 37 "model/CChemEqParser.lpp"
677 
679  return TOKEN_NUMBER;
680 
681  YY_BREAK
682 
683  case 2:
685 #line 42 "model/CChemEqParser.lpp"
686 
688  return TOKEN_PLUS;
689 
690  YY_BREAK
691 
692  case 3:
694 #line 47 "model/CChemEqParser.lpp"
695 
697  return TOKEN_MULTIPLY;
698 
699  YY_BREAK
700 
701  case 4:
703 #line 52 "model/CChemEqParser.lpp"
704 
707 
708  YY_BREAK
709 
710  case 5:
712 #line 57 "model/CChemEqParser.lpp"
713 
715  return TOKEN_END_COMPARTMENT;
716 
717  YY_BREAK
718 
719  case 6:
721 #line 62 "model/CChemEqParser.lpp"
722 
724  return TOKEN_BEGIN_MODIFIERS;
725 
726  YY_BREAK
727 
728  case 7:
730 #line 67 "model/CChemEqParser.lpp"
731 
733  return TOKEN_BEGIN_PRODUCTS;
734 
735  YY_BREAK
736 
737  case 8:
738  /* rule 8 can match eol */
740 #line 72 "model/CChemEqParser.lpp"
741 
744  return TOKEN_NAME;
745 
746  YY_BREAK
747 
748  case 9:
749  /* rule 9 can match eol */
751 #line 78 "model/CChemEqParser.lpp"
752 
754  return TOKEN_NAME;
755 
756  YY_BREAK
757 
758  case 10:
759  /* rule 10 can match eol */
761 #line 83 "model/CChemEqParser.lpp"
762 
763  mPosition += yyleng;
764  //COMMON_ACTION;
765 
766  YY_BREAK
767 
768  case YY_STATE_EOF(INITIAL):
769 #line 87 "model/CChemEqParser.lpp"
770  return 0;
771  YY_BREAK
772 
773  case 11:
775 #line 89 "model/CChemEqParser.lpp"
776 
778  return YYERRCODE;
779 
780  YY_BREAK
781 
782  case 12:
784 #line 94 "model/CChemEqParser.lpp"
785  ECHO;
786  YY_BREAK
787 #line 749 "CChemEqParser_lex.cpp"
788 
789  case YY_END_OF_BUFFER:
790  {
791  /* Amount of text matched not including the EOB char. */
792  int yy_amount_of_matched_text = (int)(yy_cp - (yytext_ptr)) - 1;
793 
794  /* Undo the effects of YY_DO_BEFORE_ACTION. */
795  *yy_cp = (yy_hold_char);
797 
798  if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW)
799  {
800  /* We're scanning a new file or input source. It's
801  * possible that this happened because the user
802  * just pointed yyin at a new source and called
803  * yylex(). If so, then we have to assure
804  * consistency between YY_CURRENT_BUFFER and our
805  * globals. Here is the right place to do so, because
806  * this is the first action (other than possibly a
807  * back-up) that will match for the new input source.
808  */
809  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
810  YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
811  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
812  }
813 
814  /* Note that here we test for yy_c_buf_p "<=" to the position
815  * of the first EOB in the buffer, since yy_c_buf_p will
816  * already have been incremented past the NUL character
817  * (since all states make transitions on EOB to the
818  * end-of-buffer state). Contrast this with the test
819  * in input().
820  */
821  if ((yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)])
822  {
823  /* This was really a NUL. */
824  yy_state_type yy_next_state;
825 
826  (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
827 
828  yy_current_state = yy_get_previous_state();
829 
830  /* Okay, we're now positioned to make the NUL
831  * transition. We couldn't have
832  * yy_get_previous_state() go ahead and do it
833  * for us because it doesn't know how to deal
834  * with the possibility of jamming (and we don't
835  * want to build jamming into it because then it
836  * will run more slowly).
837  */
838 
839  yy_next_state = yy_try_NUL_trans(yy_current_state);
840 
841  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
842 
843  if (yy_next_state)
844  {
845  /* Consume the NUL. */
846  yy_cp = ++(yy_c_buf_p);
847  yy_current_state = yy_next_state;
848  goto yy_match;
849  }
850 
851  else
852  {
853  yy_cp = (yy_last_accepting_cpos);
854  yy_current_state = (yy_last_accepting_state);
855  goto yy_find_action;
856  }
857  }
858 
859  else switch (yy_get_next_buffer())
860  {
861  case EOB_ACT_END_OF_FILE:
862  {
863  (yy_did_buffer_switch_on_eof) = 0;
864 
865  if (yywrap())
866  {
867  /* Note: because we've taken care in
868  * yy_get_next_buffer() to have set up
869  * yytext, we can now set up
870  * yy_c_buf_p so that if some total
871  * hoser (like flex itself) wants to
872  * call the scanner after we return the
873  * YY_NULL, it'll still work - another
874  * YY_NULL will get returned.
875  */
876  (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
877 
878  yy_act = YY_STATE_EOF(YY_START);
879  goto do_action;
880  }
881 
882  else
883  {
884  if (!(yy_did_buffer_switch_on_eof))
885  YY_NEW_FILE;
886  }
887 
888  break;
889  }
890 
892  (yy_c_buf_p) =
893  (yytext_ptr) + yy_amount_of_matched_text;
894 
895  yy_current_state = yy_get_previous_state();
896 
897  yy_cp = (yy_c_buf_p);
898  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
899  goto yy_match;
900 
901  case EOB_ACT_LAST_MATCH:
902  (yy_c_buf_p) =
903  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
904 
905  yy_current_state = yy_get_previous_state();
906 
907  yy_cp = (yy_c_buf_p);
908  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
909  goto yy_find_action;
910  }
911 
912  break;
913  }
914 
915  default:
917  "fatal flex scanner internal error--no action found");
918  } /* end of action switch */
919  } /* end of scanning one token */
920 } /* end of yylex */
921 
922 /* The contents of this function are C++ specific, so the () macro is not used.
923  */
924 yyFlexLexer::yyFlexLexer(std::istream* arg_yyin, std::ostream* arg_yyout)
925 {
926  yyin = arg_yyin;
927  yyout = arg_yyout;
928  yy_c_buf_p = 0;
929  yy_init = 0;
930  yy_start = 0;
931  yy_flex_debug = 0;
932  yylineno = 1; // this will only get updated if %option yylineno
933 
935 
937  yy_more_flag = 0;
938  yy_more_len = 0;
940 
942  yy_start_stack = NULL;
943 
944  yy_buffer_stack = 0;
947 
948  yy_state_buf = 0;
949 }
950 
951 /* The contents of this function are C++ specific, so the () macro is not used.
952  */
954 {
955  delete [] yy_state_buf;
959 }
960 
961 /* The contents of this function are C++ specific, so the () macro is not used.
962  */
963 void yyFlexLexer::switch_streams(std::istream* new_in, std::ostream* new_out)
964 {
965  if (new_in)
966  {
969  }
970 
971  if (new_out)
972  yyout = new_out;
973 }
974 
975 #ifdef YY_INTERACTIVE
976 int yyFlexLexer::LexerInput(char* buf, int /* max_size */)
977 #else
978 int yyFlexLexer::LexerInput(char* buf, int max_size)
979 #endif
980 {
981  if (yyin->eof() || yyin->fail())
982  return 0;
983 
984 #ifdef YY_INTERACTIVE
985  yyin->get(buf[0]);
986 
987  if (yyin->eof())
988  return 0;
989 
990  if (yyin->bad())
991  return -1;
992 
993  return 1;
994 
995 #else
996  (void) yyin->read(buf, max_size);
997 
998  if (yyin->bad())
999  return -1;
1000  else
1001  return yyin->gcount();
1002 
1003 #endif
1004 }
1005 
1006 void yyFlexLexer::LexerOutput(const char* buf, int size)
1007 {
1008  (void) yyout->write(buf, size);
1009 }
1010 
1011 /* yy_get_next_buffer - try to read in a new buffer
1012  *
1013  * Returns a code representing an action:
1014  * EOB_ACT_LAST_MATCH -
1015  * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1016  * EOB_ACT_END_OF_FILE - end of file
1017  */
1019 {
1020  register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1021  register char *source = (yytext_ptr);
1022  register int number_to_move, i;
1023  int ret_val;
1024 
1025  if ((yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1])
1027  "fatal flex scanner internal error--end of buffer missed");
1028 
1029  if (YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0)
1030  {
1031  /* Don't try to fill the buffer, so this is an EOF. */
1032  if ((yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1)
1033  {
1034  /* We matched a single character, the EOB, so
1035  * treat this as a final EOF.
1036  */
1037  return EOB_ACT_END_OF_FILE;
1038  }
1039 
1040  else
1041  {
1042  /* We matched some text prior to the EOB, first
1043  * process it.
1044  */
1045  return EOB_ACT_LAST_MATCH;
1046  }
1047  }
1048 
1049  /* Try to read more data. */
1050 
1051  /* First move last chars to start of buffer. */
1052  number_to_move = (int)((yy_c_buf_p) - (yytext_ptr)) - 1;
1053 
1054  for (i = 0; i < number_to_move; ++i)
1055  *(dest++) = *(source++);
1056 
1057  if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING)
1058  /* don't do the read, it's not guaranteed to return an EOF,
1059  * just force an EOF
1060  */
1061  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1062 
1063  else
1064  {
1065  int num_to_read =
1066  YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1067 
1068  while (num_to_read <= 0)
1069  {
1070  /* Not enough room in the buffer - grow it. */
1071 
1072  /* just a shorter name for the current buffer */
1073  YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1074 
1075  int yy_c_buf_p_offset =
1076  (int)((yy_c_buf_p) - b->yy_ch_buf);
1077 
1078  if (b->yy_is_our_buffer)
1079  {
1080  int new_size = b->yy_buf_size * 2;
1081 
1082  if (new_size <= 0)
1083  b->yy_buf_size += b->yy_buf_size / 8;
1084  else
1085  b->yy_buf_size *= 2;
1086 
1087  b->yy_ch_buf = (char *)
1088  /* Include room in for 2 EOB chars. */
1089  CChemEqParserrealloc((void *) b->yy_ch_buf, b->yy_buf_size + 2);
1090  }
1091  else
1092  /* Can't grow it, we don't own it. */
1093  b->yy_ch_buf = 0;
1094 
1095  if (! b->yy_ch_buf)
1097  "fatal error - scanner input buffer overflow");
1098 
1099  (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1100 
1101  num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1102  number_to_move - 1;
1103  }
1104 
1105  if (num_to_read > YY_READ_BUF_SIZE)
1106  num_to_read = YY_READ_BUF_SIZE;
1107 
1108  /* Read in more data. */
1109  YY_INPUT((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1110  (yy_n_chars), (size_t) num_to_read);
1111 
1112  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1113  }
1114 
1115  if ((yy_n_chars) == 0)
1116  {
1117  if (number_to_move == YY_MORE_ADJ)
1118  {
1119  ret_val = EOB_ACT_END_OF_FILE;
1120  yyrestart(yyin);
1121  }
1122 
1123  else
1124  {
1125  ret_val = EOB_ACT_LAST_MATCH;
1126  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1128  }
1129  }
1130 
1131  else
1132  ret_val = EOB_ACT_CONTINUE_SCAN;
1133 
1134  if ((yy_size_t)((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size)
1135  {
1136  /* Extend the array by 50%, plus the number we really need. */
1137  yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1138  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) CChemEqParserrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, new_size);
1139 
1140  if (! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf)
1141  YY_FATAL_ERROR("out of dynamic memory in yy_get_next_buffer()");
1142  }
1143 
1144  (yy_n_chars) += number_to_move;
1147 
1148  (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1149 
1150  return ret_val;
1151 }
1152 
1153 /* yy_get_previous_state - get the state just before the EOB char was reached */
1154 
1156 {
1157  register yy_state_type yy_current_state;
1158  register char *yy_cp;
1159 
1160  yy_current_state = (yy_start);
1161 
1162  for (yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp)
1163  {
1164  register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1165 
1166  if (yy_accept[yy_current_state])
1167  {
1168  (yy_last_accepting_state) = yy_current_state;
1169  (yy_last_accepting_cpos) = yy_cp;
1170  }
1171 
1172  while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state)
1173  {
1174  yy_current_state = (int) yy_def[yy_current_state];
1175 
1176  if (yy_current_state >= 32)
1177  yy_c = yy_meta[(unsigned int) yy_c];
1178  }
1179 
1180  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1181  }
1182 
1183  return yy_current_state;
1184 }
1185 
1186 /* yy_try_NUL_trans - try to make a transition on the NUL character
1187  *
1188  * synopsis
1189  * next_state = yy_try_NUL_trans(current_state );
1190  */
1192 {
1193  register int yy_is_jam;
1194  register char *yy_cp = (yy_c_buf_p);
1195 
1196  register YY_CHAR yy_c = 1;
1197 
1198  if (yy_accept[yy_current_state])
1199  {
1200  (yy_last_accepting_state) = yy_current_state;
1201  (yy_last_accepting_cpos) = yy_cp;
1202  }
1203 
1204  while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state)
1205  {
1206  yy_current_state = (int) yy_def[yy_current_state];
1207 
1208  if (yy_current_state >= 32)
1209  yy_c = yy_meta[(unsigned int) yy_c];
1210  }
1211 
1212  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1213  yy_is_jam = (yy_current_state == 31);
1214 
1215  return yy_is_jam ? 0 : yy_current_state;
1216 }
1217 
1218 void yyFlexLexer::yyunput(int c, register char* yy_bp)
1219 {
1220  register char *yy_cp;
1221 
1222  yy_cp = (yy_c_buf_p);
1223 
1224  /* undo effects of setting up yytext */
1225  *yy_cp = (yy_hold_char);
1226 
1227  if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2)
1228  {
1229  /* need to shift things up to make room */
1230  /* +2 for EOB chars. */
1231  register int number_to_move = (yy_n_chars) + 2;
1232  register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1233  YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1234  register char *source =
1235  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1236 
1237  while (source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf)
1238  *--dest = *--source;
1239 
1240  yy_cp += (int)(dest - source);
1241  yy_bp += (int)(dest - source);
1242  YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1243  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1244 
1245  if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2)
1246  YY_FATAL_ERROR("flex scanner push-back overflow");
1247  }
1248 
1249  *--yy_cp = (char) c;
1250 
1251  (yytext_ptr) = yy_bp;
1252  (yy_hold_char) = *yy_cp;
1253  (yy_c_buf_p) = yy_cp;
1254 }
1255 
1257 {
1258  int c;
1259 
1260  *(yy_c_buf_p) = (yy_hold_char);
1261 
1263  {
1264  /* yy_c_buf_p now points to the character we want to return.
1265  * If this occurs *before* the EOB characters, then it's a
1266  * valid NUL; if not, then we've hit the end of the buffer.
1267  */
1268  if ((yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)])
1269  /* This was really a NUL. */
1270  *(yy_c_buf_p) = '\0';
1271 
1272  else
1273  {
1274  /* need more input */
1275  int offset = (yy_c_buf_p) - (yytext_ptr);
1276  ++(yy_c_buf_p);
1277 
1278  switch (yy_get_next_buffer())
1279  {
1280  case EOB_ACT_LAST_MATCH:
1281  /* This happens because yy_g_n_b()
1282  * sees that we've accumulated a
1283  * token and flags that we need to
1284  * try matching the token before
1285  * proceeding. But for input(),
1286  * there's no matching to consider.
1287  * So convert the EOB_ACT_LAST_MATCH
1288  * to EOB_ACT_END_OF_FILE.
1289  */
1290 
1291  /* Reset buffer status. */
1292  yyrestart(yyin);
1293 
1294  /*FALLTHROUGH*/
1295 
1296  case EOB_ACT_END_OF_FILE:
1297  {
1298  if (yywrap())
1299  return EOF;
1300 
1302  YY_NEW_FILE;
1303 
1304 #ifdef __cplusplus
1305  return yyinput();
1306 #else
1307  return input();
1308 #endif
1309  }
1310 
1311  case EOB_ACT_CONTINUE_SCAN:
1312  (yy_c_buf_p) = (yytext_ptr) + offset;
1313  break;
1314  }
1315  }
1316  }
1317 
1318  c = *(unsigned char *)(yy_c_buf_p); /* cast for 8-bit char's */
1319  *(yy_c_buf_p) = '\0'; /* preserve yytext */
1320  (yy_hold_char) = *++(yy_c_buf_p);
1321 
1322  return c;
1323 }
1324 
1325 /** Immediately switch to a different input stream.
1326  * @param input_file A readable stream.
1327  *
1328  * @note This function does not reset the start condition to @c INITIAL .
1329  */
1330 void yyFlexLexer::yyrestart(std::istream* input_file)
1331 {
1332 
1333  if (! YY_CURRENT_BUFFER)
1334  {
1338  }
1339 
1340  yy_init_buffer(YY_CURRENT_BUFFER, input_file);
1342 }
1343 
1344 /** Switch to a different input buffer.
1345  * @param new_buffer The new input buffer.
1346  *
1347  */
1348 void yyFlexLexer::yy_switch_to_buffer(YY_BUFFER_STATE new_buffer)
1349 {
1350 
1351  /* TODO. We should be able to replace this entire function body
1352  * with
1353  * yypop_buffer_state();
1354  * yypush_buffer_state(new_buffer);
1355  */
1357 
1358  if (YY_CURRENT_BUFFER == new_buffer)
1359  return;
1360 
1361  if (YY_CURRENT_BUFFER)
1362  {
1363  /* Flush out information for old buffer. */
1364  *(yy_c_buf_p) = (yy_hold_char);
1365  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1366  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1367  }
1368 
1369  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1371 
1372  /* We don't actually know whether we did this switch during
1373  * EOF (yywrap()) processing, but the only time this flag
1374  * is looked at is after yywrap() is called, so it's safe
1375  * to go ahead and always set it.
1376  */
1378 }
1379 
1381 {
1382  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1383  (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1384  yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1385  (yy_hold_char) = *(yy_c_buf_p);
1386 }
1387 
1388 /** Allocate and initialize an input buffer state.
1389  * @param file A readable stream.
1390  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1391  *
1392  * @return the allocated buffer state.
1393  */
1394 YY_BUFFER_STATE yyFlexLexer::yy_create_buffer(std::istream* file, int size)
1395 {
1396  YY_BUFFER_STATE b;
1397 
1398  b = (YY_BUFFER_STATE) CChemEqParseralloc(sizeof(struct yy_buffer_state));
1399 
1400  if (! b)
1401  YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()");
1402 
1403  b->yy_buf_size = size;
1404 
1405  /* yy_ch_buf has to be 2 characters longer than the size given because
1406  * we need to put in 2 end-of-buffer characters.
1407  */
1408  b->yy_ch_buf = (char *) CChemEqParseralloc(b->yy_buf_size + 2);
1409 
1410  if (! b->yy_ch_buf)
1411  YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()");
1412 
1413  b->yy_is_our_buffer = 1;
1414 
1415  yy_init_buffer(b, file);
1416 
1417  return b;
1418 }
1419 
1420 /** Destroy the buffer.
1421  * @param b a buffer created with yy_create_buffer()
1422  *
1423  */
1424 void yyFlexLexer::yy_delete_buffer(YY_BUFFER_STATE b)
1425 {
1426 
1427  if (! b)
1428  return;
1429 
1430  if (b == YY_CURRENT_BUFFER) /* Not sure if we should pop here. */
1432 
1433  if (b->yy_is_our_buffer)
1434  CChemEqParserfree((void *) b->yy_ch_buf);
1435 
1436  CChemEqParserfree((void *) b);
1437 }
1438 
1439 /* Initializes or reinitializes a buffer.
1440  * This function is sometimes called more than once on the same buffer,
1441  * such as during a yyrestart() or at EOF.
1442  */
1443 void yyFlexLexer::yy_init_buffer(YY_BUFFER_STATE b, std::istream* file)
1444 
1445 {
1446  int oerrno = errno;
1447 
1448  yy_flush_buffer(b);
1449 
1450  b->yy_input_file = file;
1451  b->yy_fill_buffer = 1;
1452 
1453  /* If b is the current buffer, then yy_init_buffer was _probably_
1454  * called from yyrestart() or through yy_get_next_buffer.
1455  * In that case, we don't want to reset the lineno or column.
1456  */
1457  if (b != YY_CURRENT_BUFFER)
1458  {
1459  b->yy_bs_lineno = 1;
1460  b->yy_bs_column = 0;
1461  }
1462 
1463  b->yy_is_interactive = 0;
1464  errno = oerrno;
1465 }
1466 
1467 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1468  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1469  *
1470  */
1471 void yyFlexLexer::yy_flush_buffer(YY_BUFFER_STATE b)
1472 {
1473  if (! b)
1474  return;
1475 
1476  b->yy_n_chars = 0;
1477 
1478  /* We always need two end-of-buffer characters. The first causes
1479  * a transition to the end-of-buffer state. The second causes
1480  * a jam in that state.
1481  */
1484 
1485  b->yy_buf_pos = &b->yy_ch_buf[0];
1486 
1487  b->yy_at_bol = 1;
1489 
1490  if (b == YY_CURRENT_BUFFER)
1492 }
1493 
1494 /** Pushes the new state onto the stack. The new state becomes
1495  * the current state. This function will allocate the stack
1496  * if necessary.
1497  * @param new_buffer The new state.
1498  *
1499  */
1500 void yyFlexLexer::yypush_buffer_state(YY_BUFFER_STATE new_buffer)
1501 {
1502  if (new_buffer == NULL)
1503  return;
1504 
1506 
1507  /* This block is copied from yy_switch_to_buffer. */
1508  if (YY_CURRENT_BUFFER)
1509  {
1510  /* Flush out information for old buffer. */
1511  *(yy_c_buf_p) = (yy_hold_char);
1512  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1513  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1514  }
1515 
1516  /* Only push if top exists. Otherwise, replace top. */
1517  if (YY_CURRENT_BUFFER)
1518  (yy_buffer_stack_top)++;
1519 
1520  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1521 
1522  /* copied from yy_switch_to_buffer. */
1525 }
1526 
1527 /** Removes and deletes the top of the stack, if present.
1528  * The next element becomes the new top.
1529  *
1530  */
1532 {
1533  if (!YY_CURRENT_BUFFER)
1534  return;
1535 
1537  YY_CURRENT_BUFFER_LVALUE = NULL;
1538 
1539  if ((yy_buffer_stack_top) > 0)
1540  --(yy_buffer_stack_top);
1541 
1542  if (YY_CURRENT_BUFFER)
1543  {
1546  }
1547 }
1548 
1549 /* Allocates the stack if it does not exist.
1550  * Guarantees space for at least one push.
1551  */
1553 {
1554  int num_to_alloc;
1555 
1556  if (!(yy_buffer_stack))
1557  {
1558 
1559  /* First allocation is just for 2 elements, since we don't know if this
1560  * scanner will even need a stack. We use 2 instead of 1 to avoid an
1561  * immediate realloc on the next call.
1562  */
1563  num_to_alloc = 1;
1565  (num_to_alloc * sizeof(struct yy_buffer_state*)
1566  );
1567 
1568  if (!(yy_buffer_stack))
1569  YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()");
1570 
1571  memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1572 
1573  (yy_buffer_stack_max) = num_to_alloc;
1574  (yy_buffer_stack_top) = 0;
1575  return;
1576  }
1577 
1578  if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1)
1579  {
1580 
1581  /* Increase the buffer to prepare for a possible push. */
1582  int grow_size = 8 /* arbitrary grow size */;
1583 
1584  num_to_alloc = (yy_buffer_stack_max) + grow_size;
1586  ((yy_buffer_stack),
1587  num_to_alloc * sizeof(struct yy_buffer_state*)
1588  );
1589 
1590  if (!(yy_buffer_stack))
1591  YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()");
1592 
1593  /* zero only the new slots.*/
1594  memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1595  (yy_buffer_stack_max) = num_to_alloc;
1596  }
1597 }
1598 
1599 void yyFlexLexer::yy_push_state(int new_state)
1600 {
1602  {
1603  yy_size_t new_size;
1604 
1606  new_size = (yy_start_stack_depth) * sizeof(int);
1607 
1608  if (!(yy_start_stack))
1609  (yy_start_stack) = (int *) CChemEqParseralloc(new_size);
1610 
1611  else
1612  (yy_start_stack) = (int *) CChemEqParserrealloc((void *)(yy_start_stack), new_size);
1613 
1614  if (!(yy_start_stack))
1615  YY_FATAL_ERROR("out of memory expanding start-condition stack");
1616  }
1617 
1619 
1620  BEGIN(new_state);
1621 }
1622 
1624 {
1625  if (--(yy_start_stack_ptr) < 0)
1626  YY_FATAL_ERROR("start-condition stack underflow");
1627 
1629 }
1630 
1632 {
1633  return (yy_start_stack)[(yy_start_stack_ptr) - 1];
1634 }
1635 
1636 #ifndef YY_EXIT_FAILURE
1637 #define YY_EXIT_FAILURE 2
1638 #endif
1639 
1641 {
1642  std::cerr << msg << std::endl;
1643  exit(YY_EXIT_FAILURE);
1644 }
1645 
1646 /* Redefine yyless() so it works in section 3 code. */
1647 
1648 #undef yyless
1649 #define yyless(n) \
1650  do \
1651  {\
1652  /* Undo effects of setting up yytext. */ \
1653  int yyless_macro_arg = (n); \
1654  YY_LESS_LINENO(yyless_macro_arg);\
1655  yytext[yyleng] = (yy_hold_char); \
1656  (yy_c_buf_p) = yytext + yyless_macro_arg; \
1657  (yy_hold_char) = *(yy_c_buf_p); \
1658  *(yy_c_buf_p) = '\0'; \
1659  yyleng = yyless_macro_arg; \
1660  } \
1661  while (0)
1662 
1663 /* Accessor methods (get/set functions) to struct members. */
1664 
1665 /*
1666  * Internal utility routines.
1667  */
1668 
1669 #ifndef yytext_ptr
1670 static void yy_flex_strncpy(char* s1, yyconst char * s2, int n)
1671 {
1672  register int i;
1673 
1674  for (i = 0; i < n; ++i)
1675  s1[i] = s2[i];
1676 }
1677 #endif
1678 
1679 #ifdef YY_NEED_STRLEN
1680 static int yy_flex_strlen(yyconst char * s)
1681 {
1682  register int n;
1683 
1684  for (n = 0; s[n]; ++n)
1685  ;
1686 
1687  return n;
1688 }
1689 #endif
1690 
1691 void *CChemEqParseralloc(yy_size_t size)
1692 {
1693  return (void *) malloc(size);
1694 }
1695 
1696 void *CChemEqParserrealloc(void * ptr, yy_size_t size)
1697 {
1698  /* The cast to (char *) in the following accommodates both
1699  * implementations that use char* generic pointers, and those
1700  * that use void* generic pointers. It works with the latter
1701  * because both ANSI C and C++ allow castless assignment from
1702  * any pointer type to void*, and deal with argument conversions
1703  * as though doing an assignment.
1704  */
1705  return (void *) realloc((char *) ptr, size);
1706 }
1707 
1708 void CChemEqParserfree(void * ptr)
1709 {
1710  free((char *) ptr); /* see CChemEqParserrealloc() for (char *) cast */
1711 }
1712 
1713 #define YYTABLES_NAME "yytables"
1714 
1715 #line 94 "model/CChemEqParser.lpp"
std::string unQuote(const std::string &name)
Definition: utility.cpp:120
void yy_switch_to_buffer(struct yy_buffer_state *new_buffer)
#define YY_BUFFER_NEW
int yy_flex_debug
Definition: FlexLexer.h:113
struct yy_buffer_state * YY_BUFFER_STATE
void yypush_buffer_state(struct yy_buffer_state *new_buffer)
#define EOB_ACT_LAST_MATCH
static flex_int32_t yy_ec[256]
void CChemEqParserfree(void *)
static flex_int16_t yy_accept[32]
#define YYERRCODE
#define YY_DO_BEFORE_ACTION
int yy_start_stack_ptr
Definition: FlexLexer.h:161
void * CChemEqParseralloc(yy_size_t)
#define YY_SC_TO_UI(c)
#define YY_USER_INIT
void yy_push_state(int new_state)
yy_state_type yy_try_NUL_trans(yy_state_type current_state)
#define MCFunction
size_t yy_buffer_stack_top
Definition: FlexLexer.h:193
#define EOB_ACT_CONTINUE_SCAN
int yy_prev_more_offset
Definition: FlexLexer.h:217
#define YY_RESTORE_YY_MORE_OFFSET
#define YY_CURRENT_BUFFER
int yyleng
unsigned int flex_uint32_t
#define YY_START_STACK_INCR
int * yy_start_stack
Definition: FlexLexer.h:163
yyFlexLexer(std::istream *arg_yyin=0, std::ostream *arg_yyout=0)
#define YY_EXIT_FAILURE
yy_state_type * yy_state_buf
Definition: FlexLexer.h:204
void yy_flush_buffer(struct yy_buffer_state *b)
virtual void switch_streams(std::istream *new_in, std::ostream *new_out=0)
#define YY_FATAL_ERROR(msg)
#define YY_END_OF_BUFFER
char yy_hold_char
Definition: FlexLexer.h:177
yy_state_type yy_last_accepting_state
Definition: FlexLexer.h:201
int yy_more_offset
Definition: FlexLexer.h:216
int yy_more_flag
Definition: FlexLexer.h:214
#define ECHO
virtual ~yyFlexLexer()
#define yytext_ptr
#define COMMON_ACTION
void yyunput(int c, char *buf_ptr)
#define YY_MORE_ADJ
static flex_int16_t yy_def[35]
unsigned char flex_uint8_t
void yypop_buffer_state()
static flex_int16_t yy_nxt[83]
virtual void LexerError(const char *msg)
char * yy_last_accepting_cpos
Definition: FlexLexer.h:202
void yy_load_buffer_state()
int yy_state_type
Definition: FlexLexer.h:72
int yylineno
Definition: FlexLexer.h:112
struct yy_buffer_state * yy_create_buffer(std::istream *s, int size)
void yyrestart(std::istream *s)
int yy_looking_for_trail_begin
Definition: FlexLexer.h:212
size_t yy_buffer_stack_max
Definition: FlexLexer.h:194
#define YY_END_OF_BUFFER_CHAR
int yy_did_buffer_switch_on_eof
Definition: FlexLexer.h:190
#define BEGIN
static flex_int16_t yy_base[35]
short int flex_int16_t
std::istream * yy_input_file
void yy_init_buffer(struct yy_buffer_state *b, std::istream *s)
struct yy_buffer_state ** yy_buffer_stack
Definition: FlexLexer.h:195
#define YY_NEW_FILE
unsigned short int flex_uint16_t
std::istream * yyin
Definition: FlexLexer.h:173
char * yy_c_buf_p
Definition: FlexLexer.h:183
int yy_get_next_buffer()
std::ostream * yyout
Definition: FlexLexer.h:174
void yyensure_buffer_stack(void)
int flex_int32_t
virtual void LexerOutput(const char *buf, int size)
#define EOB_ACT_END_OF_FILE
virtual int LexerInput(char *buf, int max_size)
#define TOKEN_NUMBER
int yy_start
Definition: FlexLexer.h:186
void yy_delete_buffer(struct yy_buffer_state *b)
#define YY_BREAK
int yy_n_chars
Definition: FlexLexer.h:180
void * CChemEqParserrealloc(void *, yy_size_t)
size_t yy_size_t
int yy_top_state()
#define YY_CURRENT_BUFFER_LVALUE
() void(yyvaluep))
int yy_start_stack_depth
Definition: FlexLexer.h:162
#define yyconst
void yy_pop_state()
#define YY_BUFFER_EOF_PENDING
signed char flex_int8_t
static flex_int32_t yy_meta[19]
#define INITIAL
if(!yymsg) yymsg
#define YY_RULE_SETUP
#define YY_STATE_EOF(state)
yy_state_type yy_get_previous_state()
virtual int yywrap()
#define YY_READ_BUF_SIZE
CChemEqParserBase::Data * mpData
#define YY_BUFFER_NORMAL
static flex_int16_t yy_chk[83]
#define YY_BUF_SIZE
int yy_more_len
Definition: FlexLexer.h:215
#define YY_INPUT(buf, result, max_size)
#define YY_START
unsigned char YY_CHAR
#define YY_DECL