source: palm/trunk/UTIL/chemistry/gasphase_preproc/kpp/src/lex.yy.c @ 3298

Last change on this file since 3298 was 3298, checked in by kanani, 6 years ago

Merge chemistry branch at r3297 to trunk

File size: 74.4 KB
Line 
1#line 2 "lex.yy.c"
2
3#line 4 "lex.yy.c"
4
5#define  YY_INT_ALIGNED short int
6
7/* A lexical scanner generated by flex */
8
9#define FLEX_SCANNER
10#define YY_FLEX_MAJOR_VERSION 2
11#define YY_FLEX_MINOR_VERSION 5
12#define YY_FLEX_SUBMINOR_VERSION 35
13#if YY_FLEX_SUBMINOR_VERSION > 0
14#define FLEX_BETA
15#endif
16
17/* First, we deal with  platform-specific or compiler-specific issues. */
18
19/* begin standard C headers. */
20#include <stdio.h>
21#include <string.h>
22#include <errno.h>
23#include <stdlib.h>
24
25/* end standard C headers. */
26
27/* flex integer type definitions */
28
29#ifndef FLEXINT_H
30#define FLEXINT_H
31
32/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33
34#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35
36/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37 * if you want the limit (max/min) macros for int types.
38 */
39#ifndef __STDC_LIMIT_MACROS
40#define __STDC_LIMIT_MACROS 1
41#endif
42
43#include <inttypes.h>
44typedef int8_t flex_int8_t;
45typedef uint8_t flex_uint8_t;
46typedef int16_t flex_int16_t;
47typedef uint16_t flex_uint16_t;
48typedef int32_t flex_int32_t;
49typedef uint32_t flex_uint32_t;
50#else
51typedef signed char flex_int8_t;
52typedef short int flex_int16_t;
53typedef int flex_int32_t;
54typedef unsigned char flex_uint8_t; 
55typedef unsigned short int flex_uint16_t;
56typedef unsigned int flex_uint32_t;
57
58/* Limits of integral types. */
59#ifndef INT8_MIN
60#define INT8_MIN               (-128)
61#endif
62#ifndef INT16_MIN
63#define INT16_MIN              (-32767-1)
64#endif
65#ifndef INT32_MIN
66#define INT32_MIN              (-2147483647-1)
67#endif
68#ifndef INT8_MAX
69#define INT8_MAX               (127)
70#endif
71#ifndef INT16_MAX
72#define INT16_MAX              (32767)
73#endif
74#ifndef INT32_MAX
75#define INT32_MAX              (2147483647)
76#endif
77#ifndef UINT8_MAX
78#define UINT8_MAX              (255U)
79#endif
80#ifndef UINT16_MAX
81#define UINT16_MAX             (65535U)
82#endif
83#ifndef UINT32_MAX
84#define UINT32_MAX             (4294967295U)
85#endif
86
87#endif /* ! C99 */
88
89#endif /* ! FLEXINT_H */
90
91#ifdef __cplusplus
92
93/* The "const" storage-class-modifier is valid. */
94#define YY_USE_CONST
95
96#else   /* ! __cplusplus */
97
98/* C99 requires __STDC__ to be defined as 1. */
99#if defined (__STDC__)
100
101#define YY_USE_CONST
102
103#endif  /* defined (__STDC__) */
104#endif  /* ! __cplusplus */
105
106#ifdef YY_USE_CONST
107#define yyconst const
108#else
109#define yyconst
110#endif
111
112/* Returned upon end-of-file. */
113#define YY_NULL 0
114
115/* Promotes a possibly negative, possibly signed char to an unsigned
116 * integer for use as an array index.  If the signed char is negative,
117 * we want to instead treat it as an 8-bit unsigned char, hence the
118 * double cast.
119 */
120#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
121
122/* Enter a start condition.  This macro really ought to take a parameter,
123 * but we do it the disgusting crufty way forced on us by the ()-less
124 * definition of BEGIN.
125 */
126#define BEGIN (yy_start) = 1 + 2 *
127
128/* Translate the current start state into a value that can be later handed
129 * to BEGIN to return to the state.  The YYSTATE alias is for lex
130 * compatibility.
131 */
132#define YY_START (((yy_start) - 1) / 2)
133#define YYSTATE YY_START
134
135/* Action number for EOF rule of a given start state. */
136#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
137
138/* Special action meaning "start processing a new file". */
139#define YY_NEW_FILE yyrestart(yyin  )
140
141#define YY_END_OF_BUFFER_CHAR 0
142
143/* Size of default input buffer. */
144#ifndef YY_BUF_SIZE
145#ifdef __ia64__
146/* On IA-64, the buffer size is 16k, not 8k.
147 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
148 * Ditto for the __ia64__ case accordingly.
149 */
150#define YY_BUF_SIZE 32768
151#else
152#define YY_BUF_SIZE 16384
153#endif /* __ia64__ */
154#endif
155
156/* The state buf must be large enough to hold one state per character in the main buffer.
157 */
158#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
159
160#ifndef YY_TYPEDEF_YY_BUFFER_STATE
161#define YY_TYPEDEF_YY_BUFFER_STATE
162typedef struct yy_buffer_state *YY_BUFFER_STATE;
163#endif
164
165extern int yyleng;
166
167extern FILE *yyin, *yyout;
168
169#define EOB_ACT_CONTINUE_SCAN 0
170#define EOB_ACT_END_OF_FILE 1
171#define EOB_ACT_LAST_MATCH 2
172
173    #define YY_LESS_LINENO(n)
174   
175/* Return all but the first "n" matched characters back to the input stream. */
176#define yyless(n) \
177        do \
178                { \
179                /* Undo effects of setting up yytext. */ \
180        int yyless_macro_arg = (n); \
181        YY_LESS_LINENO(yyless_macro_arg);\
182                *yy_cp = (yy_hold_char); \
183                YY_RESTORE_YY_MORE_OFFSET \
184                (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
185                YY_DO_BEFORE_ACTION; /* set up yytext again */ \
186                } \
187        while ( 0 )
188
189#define unput(c) yyunput( c, (yytext_ptr)  )
190
191#ifndef YY_TYPEDEF_YY_SIZE_T
192#define YY_TYPEDEF_YY_SIZE_T
193typedef size_t yy_size_t;
194#endif
195
196#ifndef YY_STRUCT_YY_BUFFER_STATE
197#define YY_STRUCT_YY_BUFFER_STATE
198struct yy_buffer_state
199        {
200        FILE *yy_input_file;
201
202        char *yy_ch_buf;                /* input buffer */
203        char *yy_buf_pos;               /* current position in input buffer */
204
205        /* Size of input buffer in bytes, not including room for EOB
206         * characters.
207         */
208        yy_size_t yy_buf_size;
209
210        /* Number of characters read into yy_ch_buf, not including EOB
211         * characters.
212         */
213        int yy_n_chars;
214
215        /* Whether we "own" the buffer - i.e., we know we created it,
216         * and can realloc() it to grow it, and should free() it to
217         * delete it.
218         */
219        int yy_is_our_buffer;
220
221        /* Whether this is an "interactive" input source; if so, and
222         * if we're using stdio for input, then we want to use getc()
223         * instead of fread(), to make sure we stop fetching input after
224         * each newline.
225         */
226        int yy_is_interactive;
227
228        /* Whether we're considered to be at the beginning of a line.
229         * If so, '^' rules will be active on the next match, otherwise
230         * not.
231         */
232        int yy_at_bol;
233
234    int yy_bs_lineno; /**< The line count. */
235    int yy_bs_column; /**< The column count. */
236   
237        /* Whether to try to fill the input buffer when we reach the
238         * end of it.
239         */
240        int yy_fill_buffer;
241
242        int yy_buffer_status;
243
244#define YY_BUFFER_NEW 0
245#define YY_BUFFER_NORMAL 1
246        /* When an EOF's been seen but there's still some text to process
247         * then we mark the buffer as YY_EOF_PENDING, to indicate that we
248         * shouldn't try reading from the input source any more.  We might
249         * still have a bunch of tokens to match, though, because of
250         * possible backing-up.
251         *
252         * When we actually see the EOF, we change the status to "new"
253         * (via yyrestart()), so that the user can continue scanning by
254         * just pointing yyin at a new input file.
255         */
256#define YY_BUFFER_EOF_PENDING 2
257
258        };
259#endif /* !YY_STRUCT_YY_BUFFER_STATE */
260
261/* Stack of input buffers. */
262static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
263static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
264static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
265
266/* We provide macros for accessing buffer states in case in the
267 * future we want to put the buffer states in a more general
268 * "scanner state".
269 *
270 * Returns the top of the stack, or NULL.
271 */
272#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
273                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
274                          : NULL)
275
276/* Same as previous macro, but useful when we know that the buffer stack is not
277 * NULL or when we need an lvalue. For internal use only.
278 */
279#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
280
281/* yy_hold_char holds the character lost when yytext is formed. */
282static char yy_hold_char;
283static int yy_n_chars;          /* number of characters read into yy_ch_buf */
284int yyleng;
285
286/* Points to current character in buffer. */
287static char *yy_c_buf_p = (char *) 0;
288static int yy_init = 0;         /* whether we need to initialize */
289static int yy_start = 0;        /* start state number */
290
291/* Flag which is used to allow yywrap()'s to do buffer switches
292 * instead of setting up a fresh yyin.  A bit of a hack ...
293 */
294static int yy_did_buffer_switch_on_eof;
295
296void yyrestart (FILE *input_file  );
297void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
298YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
299void yy_delete_buffer (YY_BUFFER_STATE b  );
300void yy_flush_buffer (YY_BUFFER_STATE b  );
301void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
302void yypop_buffer_state (void );
303
304static void yyensure_buffer_stack (void );
305static void yy_load_buffer_state (void );
306static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
307
308#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
309
310YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
311YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
312YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len  );
313
314void *yyalloc (yy_size_t  );
315void *yyrealloc (void *,yy_size_t  );
316void yyfree (void *  );
317
318#define yy_new_buffer yy_create_buffer
319
320#define yy_set_interactive(is_interactive) \
321        { \
322        if ( ! YY_CURRENT_BUFFER ){ \
323        yyensure_buffer_stack (); \
324                YY_CURRENT_BUFFER_LVALUE =    \
325            yy_create_buffer(yyin,YY_BUF_SIZE ); \
326        } \
327        YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
328        }
329
330#define yy_set_bol(at_bol) \
331        { \
332        if ( ! YY_CURRENT_BUFFER ){\
333        yyensure_buffer_stack (); \
334                YY_CURRENT_BUFFER_LVALUE =    \
335            yy_create_buffer(yyin,YY_BUF_SIZE ); \
336        } \
337        YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
338        }
339
340#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
341
342/* Begin user sect3 */
343
344typedef unsigned char YY_CHAR;
345
346FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
347
348typedef int yy_state_type;
349
350extern int yylineno;
351
352int yylineno = 1;
353
354extern char *yytext;
355#define yytext_ptr yytext
356
357static yy_state_type yy_get_previous_state (void );
358static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
359static int yy_get_next_buffer (void );
360static void yy_fatal_error (yyconst char msg[]  );
361
362/* Done after the current pattern has been matched and before the
363 * corresponding action - sets up yytext.
364 */
365#define YY_DO_BEFORE_ACTION \
366        (yytext_ptr) = yy_bp; \
367        yyleng = (size_t) (yy_cp - yy_bp); \
368        (yy_hold_char) = *yy_cp; \
369        *yy_cp = '\0'; \
370        (yy_c_buf_p) = yy_cp;
371
372#define YY_NUM_RULES 58
373#define YY_END_OF_BUFFER 59
374/* This struct is not used in this scanner,
375   but its presence is necessary. */
376struct yy_trans_info
377        {
378        flex_int32_t yy_verify;
379        flex_int32_t yy_nxt;
380        };
381static yyconst flex_int16_t yy_accept[199] =
382    {   0,
383        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
384        0,    0,   19,   19,    0,    0,   29,   29,   33,   33,
385        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
386        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
387        0,    0,    5,    5,    7,    7,    0,    0,   57,   57,
388       59,   58,    1,    9,    2,   58,    3,   10,   10,   11,
389       11,   12,   12,   13,   13,   14,   14,   23,    1,    9,
390       21,   23,   19,   22,   20,   18,    3,   25,   24,   30,
391        1,    9,   30,   29,   30,   29,   28,   27,   26,   26,
392        3,   35,   33,   33,   34,   36,   32,   31,   31,   37,
393
394       38,   39,   39,   40,   45,    1,    9,   42,   45,   43,
395       44,   41,    3,   15,   15,   17,   16,   47,   46,   54,
396       54,   53,   52,   49,   48,   50,   50,   51,    5,    1,
397        2,    5,    3,    6,    7,    1,    8,    2,    7,    3,
398       57,   56,   55,    1,    4,   10,    4,   11,    4,   12,
399        4,   13,    4,   14,    4,   19,   18,   24,   29,   29,
400        0,   29,   29,   26,    0,   26,   33,    0,   33,   33,
401       31,    0,   31,   37,   39,    4,   41,   15,    4,   16,
402       46,   54,    4,   52,   48,   50,    4,    5,    1,    4,
403        7,    1,    4,   57,   55,   29,   33,    0
404
405    } ;
406
407static yyconst flex_int32_t yy_ec[256] =
408    {   0,
409        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
410        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
411        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
412        1,    2,    1,    1,    4,    1,    1,    1,    1,    1,
413        1,    1,    5,    1,    6,    7,    8,    9,    9,    9,
414        9,    9,    9,    9,    9,    9,    9,   10,   11,   12,
415       13,   14,    1,    1,   15,   15,   15,   15,   16,   15,
416       15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
417       15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
418        1,    1,    1,    1,   15,    1,   15,   15,   15,   15,
419
420       16,   15,   15,   15,   15,   15,   15,   15,   15,   15,
421       15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
422       15,   15,   17,    1,   18,    1,    1,    1,    1,    1,
423        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
424        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
425        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
426        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
427        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
428        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
429        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
430
431        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
432        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
433        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
434        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
435        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
436        1,    1,    1,    1,    1
437    } ;
438
439static yyconst flex_int32_t yy_meta[19] =
440    {   0,
441        1,    2,    3,    4,    5,    5,    1,    1,    6,    1,
442        7,    1,    1,    1,    8,    8,    7,    9
443    } ;
444
445static yyconst flex_int16_t yy_base[237] =
446    {   0,
447        0,   16,   32,   49,   66,   83,  100,  117,  134,  151,
448      168,  185,  203,    0,  211,  217,  233,    0,  247,    0,
449      255,    0,  270,  287,  305,    0,  322,  339,    0,    0,
450      347,  353,  359,  365,  380,  397,  405,  411,  417,  423,
451      438,  455,  472,  489,  506,  522,    0,    0,    2,    6,
452       88,  842,   80,  842,  842,   73,  842,    0,   72,    0,
453       71,    0,   70,    0,   68,    0,   67,  842,   71,  842,
454      842,   64,   62,  842,  842,    0,  842,  842,    0,  842,
455       63,  842,   55,    5,   55,  533,  842,  842,    0,  545,
456      842,  842,    6,  555,  842,  842,  842,    0,  567,    0,
457
458      842,    0,   54,  842,  842,   59,  842,  842,   51,  842,
459      842,    0,  842,    0,   50,  842,    0,  842,    0,    0,
460       48,  842,    0,  842,    0,    0,   47,  842,    0,   52,
461        0,   40,    0,  842,    0,   45,  842,    0,   38,    0,
462        0,  842,    0,   43,  842,    0,    0,    0,    0,    0,
463        0,    0,    0,    0,    0,   35,    0,    0,    0,    7,
464       33,   16,    0,    0,   32,   30,   21,   20,   22,    0,
465        0,   19,   18,    0,    0,    0,    0,    0,    0,    0,
466        0,    0,    0,    0,    0,    0,    0,    0,   24,    0,
467        0,   11,    0,    0,    0,    3,    2,  842,  583,  592,
468
469      601,  610,  619,  628,  637,  646,  655,  664,  673,  682,
470      691,  700,  708,  716,  724,  732,  735,  738,  741,  744,
471      747,  755,  758,  766,  769,  772,  780,  783,  786,  794,
472      802,  810,  819,  828,  833,  835
473    } ;
474
475static yyconst flex_int16_t yy_def[237] =
476    {   0,
477      199,  199,  200,  200,  201,  201,  202,  202,  203,  203,
478      204,  204,  198,   13,    2,    2,  198,   17,    2,   19,
479        2,   21,  205,  205,  198,   25,  206,  206,    2,    2,
480        2,    2,    2,    2,  207,  207,    2,    2,    2,    2,
481      208,  208,  209,  209,  210,  210,    2,    2,  211,  211,
482      198,  198,  198,  198,  198,  198,  198,  212,  212,  213,
483      213,  214,  214,  215,  215,  216,  216,  198,  198,  198,
484      198,  198,  198,  198,  198,  217,  198,  198,  218,  198,
485      198,  198,  198,  198,  198,  198,  198,  198,  219,  198,
486      198,  198,  198,  198,  198,  198,  198,  220,  198,  221,
487
488      198,  222,  222,  198,  198,  198,  198,  198,  198,  198,
489      198,  223,  198,  224,  224,  198,  225,  198,  226,  227,
490      227,  198,  228,  198,  229,  230,  230,  198,  231,  231,
491      231,  231,  231,  198,  232,  232,  198,  232,  232,  232,
492      233,  198,  234,  198,  198,  212,  212,  213,  213,  214,
493      214,  215,  215,  216,  216,  198,  217,  218,   86,  198,
494      235,  198,   86,  219,  198,  219,  198,  236,  198,   94,
495      220,  198,  220,  221,  222,  222,  223,  224,  224,  225,
496      226,  227,  227,  228,  229,  230,  230,  231,  231,  231,
497      232,  232,  232,  233,  234,  198,  198,    0,  198,  198,
498
499      198,  198,  198,  198,  198,  198,  198,  198,  198,  198,
500      198,  198,  198,  198,  198,  198,  198,  198,  198,  198,
501      198,  198,  198,  198,  198,  198,  198,  198,  198,  198,
502      198,  198,  198,  198,  198,  198
503    } ;
504
505static yyconst flex_int16_t yy_nxt[861] =
506    {   0,
507      198,   53,   54,   55,  142,  143,  198,   56,  142,  143,
508      197,  196,  192,  160,  167,  160,   57,   53,   54,   55,
509      161,  168,  161,   56,  160,  189,  173,  197,  197,  167,
510      167,  161,   57,   53,   54,   55,  168,  168,  166,   59,
511      196,  196,   52,  156,  144,  193,  192,  190,   57,   52,
512       53,   54,   55,  189,  187,  183,   59,  179,  145,   52,
513      144,  176,  145,  159,  144,   57,   52,   53,   54,   55,
514      156,  145,  144,   61,  155,  153,   52,  151,  149,  147,
515      145,  144,   57,   52,   53,   54,   55,  198,  198,  198,
516       61,  198,  198,   52,  198,  198,  198,  198,  198,   57,
517
518       52,   53,   54,   55,  198,  198,  198,   63,  198,  198,
519       52,  198,  198,  198,  198,  198,   57,   52,   53,   54,
520       55,  198,  198,  198,   63,  198,  198,   52,  198,  198,
521      198,  198,  198,   57,   52,   53,   54,   55,  198,  198,
522      198,   65,  198,  198,   52,  198,  198,  198,  198,  198,
523       57,   52,   53,   54,   55,  198,  198,  198,   65,  198,
524      198,   52,  198,  198,  198,  198,  198,   57,   52,   53,
525       54,   55,  198,  198,  198,   67,  198,  198,   52,  198,
526      198,  198,  198,  198,   57,   52,   53,   54,   55,  198,
527      198,  198,   67,  198,  198,   52,  198,  198,  198,  198,
528
529      198,   57,   52,   68,   69,   70,   55,   71,   68,   68,
530       72,   73,   68,   74,   68,   75,   68,   76,   76,   77,
531       68,   78,  198,  198,  198,   79,   79,   78,  198,  198,
532      198,   79,   79,   80,   81,   82,   55,   83,   83,   84,
533       85,   86,   80,   87,   80,   88,   80,   89,   90,   91,
534       80,   92,   92,   93,  198,   94,   95,  198,   96,   97,
535      198,   98,   99,  100,  198,  198,  198,  198,  101,  100,
536      100,   53,   54,   55,  198,  198,  198,  103,  198,  198,
537      104,  198,  198,  198,  198,  198,   57,   52,   53,   54,
538       55,  198,  198,  198,  103,  198,  198,  104,  198,  198,
539
540      198,  198,  198,   57,   52,  105,  106,  107,   55,  108,
541      105,  105,  109,  105,  110,  111,  105,  105,  105,  112,
542      112,  113,  105,   53,   54,   55,  198,  198,  198,  115,
543      198,  198,   52,  198,  198,  198,  198,  198,   57,   52,
544       53,   54,   55,  198,  198,  198,  115,  198,  198,   52,
545      198,  198,  198,  198,  198,   57,   52,  116,  198,  198,
546      198,  117,  117,  116,  198,  198,  198,  117,  117,  118,
547      198,  198,  198,  119,  119,  118,  198,  198,  198,  119,
548      119,   53,   54,   55,  198,  198,  198,  121,  198,  198,
549       52,  198,  198,  198,  198,  198,   57,   52,   53,   54,
550
551       55,  198,  198,  198,  121,  198,  198,   52,  198,  198,
552      198,  198,  198,   57,   52,  122,  198,  198,  198,  123,
553      123,  122,  198,  198,  198,  123,  123,  124,  198,  198,
554      198,  125,  125,  124,  198,  198,  198,  125,  125,   53,
555       54,   55,  198,  198,  198,  127,  198,  198,  128,  198,
556      198,  198,  198,  198,   57,   52,   53,   54,   55,  198,
557      198,  198,  127,  198,  198,  128,  198,  198,  198,  198,
558      198,   57,   52,  130,   54,  131,  198,  198,  198,  132,
559      198,  198,  198,  198,  198,  198,  198,  198,  133,  134,
560      130,   54,  131,  198,  198,  198,  132,  198,  198,  198,
561
562      198,  198,  198,  198,  198,  133,  134,  136,  137,  138,
563      198,  198,  198,  139,  198,  198,  198,  198,  198,  198,
564      198,  198,  140,  136,  137,  138,  198,  198,  198,  139,
565      198,  198,  198,  198,  198,  198,  198,  198,  140,  162,
566      198,  163,  198,  198,  198,  198,  198,  198,  161,  165,
567      165,  198,  198,  166,  198,  198,  198,  198,  198,  164,
568      164,  169,  198,  170,  198,  198,  198,  198,  198,  198,
569      168,  172,  172,  198,  198,  173,  198,  198,  198,  198,
570      198,  171,  171,   52,   52,   52,   52,   52,   52,   52,
571       52,   52,   58,   58,   58,   58,   58,   58,   58,   58,
572
573       58,   60,   60,   60,   60,   60,   60,   60,   60,   60,
574       62,   62,   62,   62,   62,   62,   62,   62,   62,   64,
575       64,   64,   64,   64,   64,   64,   64,   64,   66,   66,
576       66,   66,   66,   66,   66,   66,   66,  102,  102,  102,
577      102,  102,  102,  102,  102,  102,  114,  114,  114,  114,
578      114,  114,  114,  114,  114,  120,  120,  120,  120,  120,
579      120,  120,  120,  120,  126,  126,  126,  126,  126,  126,
580      126,  126,  126,  129,  129,  129,  129,  129,  129,  129,
581      129,  129,  135,  135,  135,  135,  135,  135,  135,  135,
582      135,  141,  141,  141,  141,  141,  141,  141,  141,  141,
583
584      146,  198,  198,  198,  146,  146,  198,  146,  148,  198,
585      198,  198,  148,  148,  198,  148,  150,  198,  198,  198,
586      150,  150,  198,  150,  152,  198,  198,  198,  152,  152,
587      198,  152,  154,  198,  198,  198,  154,  154,  198,  154,
588      157,  198,  157,  158,  198,  158,  164,  198,  164,  171,
589      198,  171,  174,  198,  174,  175,  198,  198,  198,  175,
590      175,  198,  175,  177,  198,  177,  178,  198,  198,  198,
591      178,  178,  198,  178,  180,  198,  180,  181,  198,  181,
592      182,  198,  198,  198,  182,  182,  198,  182,  184,  198,
593      184,  185,  198,  185,  186,  198,  198,  198,  186,  186,
594
595      198,  186,  188,  188,  198,  188,  188,  188,  188,  188,
596      191,  191,  198,  191,  191,  191,  191,  191,  191,  194,
597      194,  198,  198,  194,  194,  194,  194,  194,  195,  198,
598      198,  195,  195,  195,  195,  195,  195,  165,  165,  172,
599      172,   51,  198,  198,  198,  198,  198,  198,  198,  198,
600      198,  198,  198,  198,  198,  198,  198,  198,  198,  198
601    } ;
602
603static yyconst flex_int16_t yy_chk[861] =
604    {   0,
605        0,    1,    1,    1,   49,   49,    0,    1,   50,   50,
606      197,  196,  192,   84,   93,  160,    1,    2,    2,    2,
607       84,   93,  160,    2,  162,  189,  173,  172,  168,  167,
608      169,  162,    2,    3,    3,    3,  167,  169,  166,    3,
609      165,  161,    3,  156,  144,  139,  136,  132,    3,    3,
610        4,    4,    4,  130,  127,  121,    4,  115,  109,    4,
611      106,  103,   85,   83,   81,    4,    4,    5,    5,    5,
612       73,   72,   69,    5,   67,   65,    5,   63,   61,   59,
613       56,   53,    5,    5,    6,    6,    6,   51,    0,    0,
614        6,    0,    0,    6,    0,    0,    0,    0,    0,    6,
615
616        6,    7,    7,    7,    0,    0,    0,    7,    0,    0,
617        7,    0,    0,    0,    0,    0,    7,    7,    8,    8,
618        8,    0,    0,    0,    8,    0,    0,    8,    0,    0,
619        0,    0,    0,    8,    8,    9,    9,    9,    0,    0,
620        0,    9,    0,    0,    9,    0,    0,    0,    0,    0,
621        9,    9,   10,   10,   10,    0,    0,    0,   10,    0,
622        0,   10,    0,    0,    0,    0,    0,   10,   10,   11,
623       11,   11,    0,    0,    0,   11,    0,    0,   11,    0,
624        0,    0,    0,    0,   11,   11,   12,   12,   12,    0,
625        0,    0,   12,    0,    0,   12,    0,    0,    0,    0,
626
627        0,   12,   12,   13,   13,   13,   13,   13,   13,   13,
628       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
629       13,   15,    0,    0,    0,   15,   15,   16,    0,    0,
630        0,   16,   16,   17,   17,   17,   17,   17,   17,   17,
631       17,   17,   17,   17,   17,   17,   17,   17,   17,   17,
632       17,   19,   19,   19,    0,   19,   19,    0,   19,   19,
633        0,   19,   19,   21,    0,    0,    0,    0,   21,   21,
634       21,   23,   23,   23,    0,    0,    0,   23,    0,    0,
635       23,    0,    0,    0,    0,    0,   23,   23,   24,   24,
636       24,    0,    0,    0,   24,    0,    0,   24,    0,    0,
637
638        0,    0,    0,   24,   24,   25,   25,   25,   25,   25,
639       25,   25,   25,   25,   25,   25,   25,   25,   25,   25,
640       25,   25,   25,   27,   27,   27,    0,    0,    0,   27,
641        0,    0,   27,    0,    0,    0,    0,    0,   27,   27,
642       28,   28,   28,    0,    0,    0,   28,    0,    0,   28,
643        0,    0,    0,    0,    0,   28,   28,   31,    0,    0,
644        0,   31,   31,   32,    0,    0,    0,   32,   32,   33,
645        0,    0,    0,   33,   33,   34,    0,    0,    0,   34,
646       34,   35,   35,   35,    0,    0,    0,   35,    0,    0,
647       35,    0,    0,    0,    0,    0,   35,   35,   36,   36,
648
649       36,    0,    0,    0,   36,    0,    0,   36,    0,    0,
650        0,    0,    0,   36,   36,   37,    0,    0,    0,   37,
651       37,   38,    0,    0,    0,   38,   38,   39,    0,    0,
652        0,   39,   39,   40,    0,    0,    0,   40,   40,   41,
653       41,   41,    0,    0,    0,   41,    0,    0,   41,    0,
654        0,    0,    0,    0,   41,   41,   42,   42,   42,    0,
655        0,    0,   42,    0,    0,   42,    0,    0,    0,    0,
656        0,   42,   42,   43,   43,   43,    0,    0,    0,   43,
657        0,    0,    0,    0,    0,    0,    0,    0,   43,   43,
658       44,   44,   44,    0,    0,    0,   44,    0,    0,    0,
659
660        0,    0,    0,    0,    0,   44,   44,   45,   45,   45,
661        0,    0,    0,   45,    0,    0,    0,    0,    0,    0,
662        0,    0,   45,   46,   46,   46,    0,    0,    0,   46,
663        0,    0,    0,    0,    0,    0,    0,    0,   46,   86,
664        0,   86,    0,    0,    0,    0,    0,    0,   86,   90,
665       90,    0,    0,   90,    0,    0,    0,    0,    0,   90,
666       90,   94,    0,   94,    0,    0,    0,    0,    0,    0,
667       94,   99,   99,    0,    0,   99,    0,    0,    0,    0,
668        0,   99,   99,  199,  199,  199,  199,  199,  199,  199,
669      199,  199,  200,  200,  200,  200,  200,  200,  200,  200,
670
671      200,  201,  201,  201,  201,  201,  201,  201,  201,  201,
672      202,  202,  202,  202,  202,  202,  202,  202,  202,  203,
673      203,  203,  203,  203,  203,  203,  203,  203,  204,  204,
674      204,  204,  204,  204,  204,  204,  204,  205,  205,  205,
675      205,  205,  205,  205,  205,  205,  206,  206,  206,  206,
676      206,  206,  206,  206,  206,  207,  207,  207,  207,  207,
677      207,  207,  207,  207,  208,  208,  208,  208,  208,  208,
678      208,  208,  208,  209,  209,  209,  209,  209,  209,  209,
679      209,  209,  210,  210,  210,  210,  210,  210,  210,  210,
680      210,  211,  211,  211,  211,  211,  211,  211,  211,  211,
681
682      212,    0,    0,    0,  212,  212,    0,  212,  213,    0,
683        0,    0,  213,  213,    0,  213,  214,    0,    0,    0,
684      214,  214,    0,  214,  215,    0,    0,    0,  215,  215,
685        0,  215,  216,    0,    0,    0,  216,  216,    0,  216,
686      217,    0,  217,  218,    0,  218,  219,    0,  219,  220,
687        0,  220,  221,    0,  221,  222,    0,    0,    0,  222,
688      222,    0,  222,  223,    0,  223,  224,    0,    0,    0,
689      224,  224,    0,  224,  225,    0,  225,  226,    0,  226,
690      227,    0,    0,    0,  227,  227,    0,  227,  228,    0,
691      228,  229,    0,  229,  230,    0,    0,    0,  230,  230,
692
693        0,  230,  231,  231,    0,  231,  231,  231,  231,  231,
694      232,  232,    0,  232,  232,  232,  232,  232,  232,  233,
695      233,    0,    0,  233,  233,  233,  233,  233,  234,    0,
696        0,  234,  234,  234,  234,  234,  234,  235,  235,  236,
697      236,  198,  198,  198,  198,  198,  198,  198,  198,  198,
698      198,  198,  198,  198,  198,  198,  198,  198,  198,  198
699    } ;
700
701static yy_state_type yy_last_accepting_state;
702static char *yy_last_accepting_cpos;
703
704extern int yy_flex_debug;
705int yy_flex_debug = 0;
706
707/* The intent behind this definition is that it'll catch
708 * any uses of REJECT which flex missed.
709 */
710#define REJECT reject_used_but_not_detected
711#define yymore() yymore_used_but_not_detected
712#define YY_MORE_ADJ 0
713#define YY_RESTORE_YY_MORE_OFFSET
714char *yytext;
715#line 1 "scan.l"
716/******************************************************************************
717
718  KPP - The Kinetic PreProcessor
719        Builds simulation code for chemical kinetic systems
720
721  Copyright (C) 1995-1996 Valeriu Damian and Adrian Sandu
722  Copyright (C) 1997-2005 Adrian Sandu
723
724  KPP is free software; you can redistribute it and/or modify it under the
725  terms of the GNU General Public License as published by the Free Software
726  Foundation (http://www.gnu.org/copyleft/gpl.html); either version 2 of the
727  License, or (at your option) any later version.
728
729  KPP is distributed in the hope that it will be useful, but WITHOUT ANY
730  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
731  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
732  details.
733
734  You should have received a copy of the GNU General Public License along
735  with this program; if not, consult http://www.gnu.org/copyleft/gpl.html or
736  write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
737  Boston, MA  02111-1307,  USA.
738
739  Adrian Sandu
740  Computer Science Department
741  Virginia Polytechnic Institute and State University
742  Blacksburg, VA 24060
743  E-mail: sandu@cs.vt.edu
744
745******************************************************************************/
746/******************************************************************************
747  bug fixes for upgrading from yacc to bison implemented by Rolf Sander,
748  following suggestions from Jason Lander <jason@env.leeds.ac.uk>
749******************************************************************************/
750 
751 
752 
753
754
755
756#line 45 "scan.l"
757  #include <string.h> /* strcpy, strlen */
758  #include "gdata.h"
759  #include "scan.h"
760  #include "y.tab.h"
761
762  void Include ( char * filename );
763  int EndInclude();
764
765  int crt_line_no = 1;
766  char *crt_filename;
767
768  #define MAX_INCLUDE 10
769 
770  YY_BUFFER_STATE yy_buffers[ MAX_INCLUDE ];
771  int yy_line_no[ MAX_INCLUDE ];
772  char *yy_filename[ MAX_INCLUDE ];
773  int yy_buf_level = 0;
774 
775  char crtToken[100];
776  char nextToken[100];
777  int crtTokType;
778  int nextTokType;
779  int crtLine;
780  char crtFile[100];
781  char crt_rate[100];
782
783  int oldnErr = 0;
784
785  int idx;
786  int oldstate;
787  extern int yyerrflag;
788
789  typedef struct {
790                   char *name;
791                   int next;
792                   int cmd; 
793                 } KEYWORD;
794
795  KEYWORD keywords[];
796
797  int CheckKeyword( char *cmd );
798
799#define RETURN( x ) \
800        if(1) { \
801          if ( yyerrflag == 0) { \
802            strcpy( crtToken, nextToken ); \
803            crtTokType = nextTokType; \
804            crtLine = crt_line_no; \
805            strcpy( crtFile, crt_filename ); \
806          } \
807          strcpy( nextToken, yytext); \
808          nextTokType = x; \
809          return (x); \
810        }
811#line 812 "lex.yy.c"
812
813#define INITIAL 0
814#define CMD_STATE 1
815#define INC_STATE 2
816#define MOD_STATE 3
817#define INT_STATE 4
818#define PRM_STATE 5
819#define DSP_STATE 6
820#define SSP_STATE 7
821#define INI_STATE 8
822#define EQN_STATE 9
823#define EQNTAG_STATE 10
824#define RATE_STATE 11
825#define LMP_STATE 12
826#define CR_IGNORE 13
827#define SC_IGNORE 14
828#define ATM_STATE 15
829#define LKT_STATE 16
830#define INL_STATE 17
831#define MNI_STATE 18
832#define TPT_STATE 19
833#define USE_STATE 20
834#define COMMENT 21
835#define COMMENT2 22
836#define EQN_ID 23
837#define INL_CODE 24
838
839#ifndef YY_NO_UNISTD_H
840/* Special case for "unistd.h", since it is non-ANSI. We include it way
841 * down here because we want the user's section 1 to have been scanned first.
842 * The user has a chance to override it with an option.
843 */
844#include <unistd.h>
845#endif
846
847#ifndef YY_EXTRA_TYPE
848#define YY_EXTRA_TYPE void *
849#endif
850
851static int yy_init_globals (void );
852
853/* Accessor methods to globals.
854   These are made visible to non-reentrant scanners for convenience. */
855
856int yylex_destroy (void );
857
858int yyget_debug (void );
859
860void yyset_debug (int debug_flag  );
861
862YY_EXTRA_TYPE yyget_extra (void );
863
864void yyset_extra (YY_EXTRA_TYPE user_defined  );
865
866FILE *yyget_in (void );
867
868void yyset_in  (FILE * in_str  );
869
870FILE *yyget_out (void );
871
872void yyset_out  (FILE * out_str  );
873
874int yyget_leng (void );
875
876char *yyget_text (void );
877
878int yyget_lineno (void );
879
880void yyset_lineno (int line_number  );
881
882/* Macros after this point can all be overridden by user definitions in
883 * section 1.
884 */
885
886#ifndef YY_SKIP_YYWRAP
887#ifdef __cplusplus
888extern "C" int yywrap (void );
889#else
890extern int yywrap (void );
891#endif
892#endif
893
894    static void yyunput (int c,char *buf_ptr  );
895   
896#ifndef yytext_ptr
897static void yy_flex_strncpy (char *,yyconst char *,int );
898#endif
899
900#ifdef YY_NEED_STRLEN
901static int yy_flex_strlen (yyconst char * );
902#endif
903
904#ifndef YY_NO_INPUT
905
906#ifdef __cplusplus
907static int yyinput (void );
908#else
909static int input (void );
910#endif
911
912#endif
913
914/* Amount of stuff to slurp up with each read. */
915#ifndef YY_READ_BUF_SIZE
916#ifdef __ia64__
917/* On IA-64, the buffer size is 16k, not 8k */
918#define YY_READ_BUF_SIZE 16384
919#else
920#define YY_READ_BUF_SIZE 8192
921#endif /* __ia64__ */
922#endif
923
924/* Copy whatever the last rule matched to the standard output. */
925#ifndef ECHO
926/* This used to be an fputs(), but since the string might contain NUL's,
927 * we now use fwrite().
928 */
929#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
930#endif
931
932/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
933 * is returned in "result".
934 */
935#ifndef YY_INPUT
936#define YY_INPUT(buf,result,max_size) \
937        if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
938                { \
939                int c = '*'; \
940                size_t n; \
941                for ( n = 0; n < max_size && \
942                             (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
943                        buf[n] = (char) c; \
944                if ( c == '\n' ) \
945                        buf[n++] = (char) c; \
946                if ( c == EOF && ferror( yyin ) ) \
947                        YY_FATAL_ERROR( "input in flex scanner failed" ); \
948                result = n; \
949                } \
950        else \
951                { \
952                errno=0; \
953                while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
954                        { \
955                        if( errno != EINTR) \
956                                { \
957                                YY_FATAL_ERROR( "input in flex scanner failed" ); \
958                                break; \
959                                } \
960                        errno=0; \
961                        clearerr(yyin); \
962                        } \
963                }\
964\
965
966#endif
967
968/* No semi-colon after return; correct usage is to write "yyterminate();" -
969 * we don't want an extra ';' after the "return" because that will cause
970 * some compilers to complain about unreachable statements.
971 */
972#ifndef yyterminate
973#define yyterminate() return YY_NULL
974#endif
975
976/* Number of entries by which start-condition stack grows. */
977#ifndef YY_START_STACK_INCR
978#define YY_START_STACK_INCR 25
979#endif
980
981/* Report a fatal error. */
982#ifndef YY_FATAL_ERROR
983#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
984#endif
985
986/* end tables serialization structures and prototypes */
987
988/* Default declaration of generated scanner - a define so the user can
989 * easily add parameters.
990 */
991#ifndef YY_DECL
992#define YY_DECL_IS_OURS 1
993
994extern int yylex (void);
995
996#define YY_DECL int yylex (void)
997#endif /* !YY_DECL */
998
999/* Code executed at the beginning of each rule, after yytext and yyleng
1000 * have been set up.
1001 */
1002#ifndef YY_USER_ACTION
1003#define YY_USER_ACTION
1004#endif
1005
1006/* Code executed at the end of each rule. */
1007#ifndef YY_BREAK
1008#define YY_BREAK break;
1009#endif
1010
1011#define YY_RULE_SETUP \
1012        YY_USER_ACTION
1013
1014/** The main scanner function which does all the work.
1015 */
1016YY_DECL
1017{
1018        register yy_state_type yy_current_state;
1019        register char *yy_cp, *yy_bp;
1020        register int yy_act;
1021   
1022#line 120 "scan.l"
1023
1024#line 1025 "lex.yy.c"
1025
1026        if ( !(yy_init) )
1027                {
1028                (yy_init) = 1;
1029
1030#ifdef YY_USER_INIT
1031                YY_USER_INIT;
1032#endif
1033
1034                if ( ! (yy_start) )
1035                        (yy_start) = 1; /* first start state */
1036
1037                if ( ! yyin )
1038                        yyin = stdin;
1039
1040                if ( ! yyout )
1041                        yyout = stdout;
1042
1043                if ( ! YY_CURRENT_BUFFER ) {
1044                        yyensure_buffer_stack ();
1045                        YY_CURRENT_BUFFER_LVALUE =
1046                                yy_create_buffer(yyin,YY_BUF_SIZE );
1047                }
1048
1049                yy_load_buffer_state( );
1050                }
1051
1052        while ( 1 )             /* loops until end-of-file is reached */
1053                {
1054                yy_cp = (yy_c_buf_p);
1055
1056                /* Support of yytext. */
1057                *yy_cp = (yy_hold_char);
1058
1059                /* yy_bp points to the position in yy_ch_buf of the start of
1060                 * the current run.
1061                 */
1062                yy_bp = yy_cp;
1063
1064                yy_current_state = (yy_start);
1065yy_match:
1066                do
1067                        {
1068                        register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1069                        if ( yy_accept[yy_current_state] )
1070                                {
1071                                (yy_last_accepting_state) = yy_current_state;
1072                                (yy_last_accepting_cpos) = yy_cp;
1073                                }
1074                        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1075                                {
1076                                yy_current_state = (int) yy_def[yy_current_state];
1077                                if ( yy_current_state >= 199 )
1078                                        yy_c = yy_meta[(unsigned int) yy_c];
1079                                }
1080                        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1081                        ++yy_cp;
1082                        }
1083                while ( yy_base[yy_current_state] != 842 );
1084
1085yy_find_action:
1086                yy_act = yy_accept[yy_current_state];
1087                if ( yy_act == 0 )
1088                        { /* have to back up */
1089                        yy_cp = (yy_last_accepting_cpos);
1090                        yy_current_state = (yy_last_accepting_state);
1091                        yy_act = yy_accept[yy_current_state];
1092                        }
1093
1094                YY_DO_BEFORE_ACTION;
1095
1096do_action:      /* This label is used only to access EOF actions. */
1097
1098                switch ( yy_act )
1099        { /* beginning of action switch */
1100                        case 0: /* must back up */
1101                        /* undo the effects of YY_DO_BEFORE_ACTION */
1102                        *yy_cp = (yy_hold_char);
1103                        yy_cp = (yy_last_accepting_cpos);
1104                        yy_current_state = (yy_last_accepting_state);
1105                        goto yy_find_action;
1106
1107case 1:
1108YY_RULE_SETUP
1109#line 121 "scan.l"
1110{
1111                        } 
1112        YY_BREAK
1113case 2:
1114YY_RULE_SETUP
1115#line 123 "scan.l"
1116{ BEGIN CMD_STATE; 
1117                        }
1118        YY_BREAK
1119case 3:
1120YY_RULE_SETUP
1121#line 125 "scan.l"
1122{ oldstate = (yy_start - 1) / 2;
1123                          BEGIN COMMENT;
1124                        }
1125        YY_BREAK
1126case 4:
1127YY_RULE_SETUP
1128#line 128 "scan.l"
1129{ oldstate = (yy_start - 1) / 2;
1130                          BEGIN COMMENT2;
1131                        }
1132        YY_BREAK
1133case 5:
1134YY_RULE_SETUP
1135#line 131 "scan.l"
1136{
1137                        } 
1138        YY_BREAK
1139case 6:
1140YY_RULE_SETUP
1141#line 133 "scan.l"
1142{ BEGIN oldstate;
1143                        }   
1144        YY_BREAK
1145case 7:
1146YY_RULE_SETUP
1147#line 135 "scan.l"
1148{
1149                        } 
1150        YY_BREAK
1151case 8:
1152/* rule 8 can match eol */
1153YY_RULE_SETUP
1154#line 137 "scan.l"
1155{ crt_line_no++; 
1156                          BEGIN oldstate;
1157                        }   
1158        YY_BREAK
1159case 9:
1160/* rule 9 can match eol */
1161YY_RULE_SETUP
1162#line 140 "scan.l"
1163{ crt_line_no++; 
1164                        }
1165        YY_BREAK
1166case 10:
1167YY_RULE_SETUP
1168#line 142 "scan.l"
1169{ idx = CheckKeyword( yytext );
1170                          if ( idx < 0 ) { 
1171                            BEGIN CR_IGNORE;
1172                            break; 
1173                          } 
1174                          BEGIN keywords[idx].next;
1175                          if ( keywords[idx].cmd ) {
1176                            crt_section = keywords[idx].cmd;
1177                            RETURN( keywords[idx].cmd );
1178                          }
1179                        } 
1180        YY_BREAK
1181case 11:
1182YY_RULE_SETUP
1183#line 153 "scan.l"
1184{ Include( IncName(yytext) );
1185                          BEGIN CR_IGNORE;
1186                        } 
1187        YY_BREAK
1188case 12:
1189YY_RULE_SETUP
1190#line 156 "scan.l"
1191{ Include( ModelName(yytext) );
1192                          BEGIN CR_IGNORE;
1193                        } 
1194        YY_BREAK
1195case 13:
1196YY_RULE_SETUP
1197#line 159 "scan.l"
1198{ Include( IntegName(yytext) );
1199                          BEGIN CR_IGNORE;
1200                        } 
1201        YY_BREAK
1202case 14:
1203YY_RULE_SETUP
1204#line 162 "scan.l"
1205{ strcpy( yylval.str, yytext );
1206                          BEGIN CR_IGNORE;                         
1207                          RETURN( PARAMETER ); 
1208                        }
1209        YY_BREAK
1210case 15:
1211YY_RULE_SETUP
1212#line 166 "scan.l"
1213{ ScanError("Extra parameter on command line '%s'", yytext);
1214                        }
1215        YY_BREAK
1216case 16:
1217YY_RULE_SETUP
1218#line 168 "scan.l"
1219{ strcpy( yylval.str, yytext );
1220                          RETURN( ATOMID );
1221                        }
1222        YY_BREAK
1223case 17:
1224YY_RULE_SETUP
1225#line 171 "scan.l"
1226{ RETURN( yytext[0] );
1227                        } 
1228        YY_BREAK
1229case 18:
1230YY_RULE_SETUP
1231#line 173 "scan.l"
1232{ strcpy( yylval.str, yytext );
1233                          RETURN( SPCSPC );
1234                        }
1235        YY_BREAK
1236case 19:
1237YY_RULE_SETUP
1238#line 176 "scan.l"
1239{ strcpy( yylval.str, yytext );
1240                          RETURN( SPCNR );
1241                        }
1242        YY_BREAK
1243case 20:
1244YY_RULE_SETUP
1245#line 179 "scan.l"
1246{ RETURN( SPCEQUAL );
1247                        } 
1248        YY_BREAK
1249case 21:
1250YY_RULE_SETUP
1251#line 181 "scan.l"
1252{ RETURN( SPCPLUS );
1253                        } 
1254        YY_BREAK
1255case 22:
1256YY_RULE_SETUP
1257#line 183 "scan.l"
1258{ RETURN( yytext[0] );
1259                        } 
1260        YY_BREAK
1261case 23:
1262/* rule 23 can match eol */
1263YY_RULE_SETUP
1264#line 185 "scan.l"
1265{ ScanError("Invalid character '%c' in species definition", yytext[0] );
1266                        }
1267        YY_BREAK
1268case 24:
1269YY_RULE_SETUP
1270#line 187 "scan.l"
1271{ strcpy( yylval.str, yytext );
1272                          RETURN( SSPID );
1273                        }
1274        YY_BREAK
1275case 25:
1276YY_RULE_SETUP
1277#line 190 "scan.l"
1278{ RETURN( yytext[0] );
1279                        } 
1280        YY_BREAK
1281case 26:
1282YY_RULE_SETUP
1283#line 192 "scan.l"
1284{ strcpy( yylval.str, yytext );
1285                          RETURN( INISPC ); 
1286                        } 
1287        YY_BREAK
1288case 27:
1289YY_RULE_SETUP
1290#line 195 "scan.l"
1291{ RETURN( INIEQUAL );
1292                        } 
1293        YY_BREAK
1294case 28:
1295YY_RULE_SETUP
1296#line 197 "scan.l"
1297{ RETURN( yytext[0] );
1298                        } 
1299        YY_BREAK
1300case 29:
1301YY_RULE_SETUP
1302#line 199 "scan.l"
1303{ strcpy( yylval.str, yytext );
1304                          RETURN( INIVALUE ); 
1305                        } 
1306        YY_BREAK
1307case 30:
1308/* rule 30 can match eol */
1309YY_RULE_SETUP
1310#line 202 "scan.l"
1311{ ScanError("Invalid character '%c' in initial values", yytext[0] );
1312                        }
1313        YY_BREAK
1314case 31:
1315YY_RULE_SETUP
1316#line 204 "scan.l"
1317{ strcpy( yylval.str, yytext );
1318                          RETURN( EQNSPC );
1319                        } 
1320        YY_BREAK
1321case 32:
1322YY_RULE_SETUP
1323#line 207 "scan.l"
1324{ RETURN( EQNEQUAL );
1325                        } 
1326        YY_BREAK
1327case 33:
1328YY_RULE_SETUP
1329#line 209 "scan.l"
1330{ strcpy( yylval.str, yytext );
1331                          RETURN( EQNCOEF ); 
1332                        } 
1333        YY_BREAK
1334case 34:
1335YY_RULE_SETUP
1336#line 212 "scan.l"
1337{ BEGIN RATE_STATE;
1338                          *crt_rate = 0;
1339                          RETURN( EQNCOLON );
1340                        } 
1341        YY_BREAK
1342case 35:
1343YY_RULE_SETUP
1344#line 216 "scan.l"
1345{ strcpy( yylval.str, yytext );
1346                          RETURN( EQNSIGN );
1347                        } 
1348        YY_BREAK
1349case 36:
1350YY_RULE_SETUP
1351#line 219 "scan.l"
1352{ BEGIN EQNTAG_STATE;
1353                          RETURN( EQNLESS );
1354                        }
1355        YY_BREAK
1356case 37:
1357YY_RULE_SETUP
1358#line 222 "scan.l"
1359{ strcpy( yylval.str, yytext );
1360                          RETURN( EQNTAG );
1361                        } 
1362        YY_BREAK
1363case 38:
1364YY_RULE_SETUP
1365#line 225 "scan.l"
1366{ BEGIN EQN_STATE;
1367                          RETURN( EQNGREATER );
1368                        }   
1369        YY_BREAK
1370case 39:
1371YY_RULE_SETUP
1372#line 228 "scan.l"
1373{ strcpy( yylval.str, yytext );
1374                          RETURN( RATE );
1375                        } 
1376        YY_BREAK
1377case 40:
1378YY_RULE_SETUP
1379#line 231 "scan.l"
1380{ BEGIN EQN_STATE;
1381                          RETURN( yytext[0] );
1382                        } 
1383        YY_BREAK
1384case 41:
1385YY_RULE_SETUP
1386#line 234 "scan.l"
1387{ strcpy( yylval.str, yytext );
1388                          RETURN( LMPSPC );
1389                        }
1390        YY_BREAK
1391case 42:
1392YY_RULE_SETUP
1393#line 237 "scan.l"
1394{ RETURN( LMPPLUS );
1395                        } 
1396        YY_BREAK
1397case 43:
1398YY_RULE_SETUP
1399#line 239 "scan.l"
1400{ RETURN( LMPCOLON );
1401                        } 
1402        YY_BREAK
1403case 44:
1404YY_RULE_SETUP
1405#line 241 "scan.l"
1406{ RETURN( yytext[0] );
1407                        } 
1408        YY_BREAK
1409case 45:
1410/* rule 45 can match eol */
1411YY_RULE_SETUP
1412#line 243 "scan.l"
1413{ ScanError("Invalid character '%c' in species definition", yytext[0] );
1414                        }
1415        YY_BREAK
1416case 46:
1417YY_RULE_SETUP
1418#line 245 "scan.l"
1419{ strcpy( yylval.str, yytext );
1420                          RETURN( LKTID );
1421                        }
1422        YY_BREAK
1423case 47:
1424YY_RULE_SETUP
1425#line 248 "scan.l"
1426{ RETURN( yytext[0] );
1427                        } 
1428        YY_BREAK
1429case 48:
1430YY_RULE_SETUP
1431#line 250 "scan.l"
1432{ strcpy( yylval.str, yytext );
1433                          RETURN( TPTID );
1434                        }
1435        YY_BREAK
1436case 49:
1437YY_RULE_SETUP
1438#line 253 "scan.l"
1439{ RETURN( yytext[0] );
1440                        } 
1441        YY_BREAK
1442case 50:
1443YY_RULE_SETUP
1444#line 255 "scan.l"
1445{ strcpy( yylval.str, yytext );
1446                          RETURN( USEID );
1447                        }
1448        YY_BREAK
1449case 51:
1450YY_RULE_SETUP
1451#line 258 "scan.l"
1452{ RETURN( yytext[0] );
1453                        } 
1454        YY_BREAK
1455case 52:
1456YY_RULE_SETUP
1457#line 260 "scan.l"
1458{ strcpy( yylval.str, yytext );
1459                          RETURN( MNIID );
1460                        }
1461        YY_BREAK
1462case 53:
1463YY_RULE_SETUP
1464#line 263 "scan.l"
1465{ RETURN( yytext[0] );
1466                        } 
1467        YY_BREAK
1468case 54:
1469YY_RULE_SETUP
1470#line 265 "scan.l"
1471{ strcpy( yylval.str, yytext );
1472                          BEGIN INL_CODE;
1473                          RETURN( INLCTX );
1474                        }
1475        YY_BREAK
1476case 55:
1477YY_RULE_SETUP
1478#line 269 "scan.l"
1479{ if ( EqNoCase( yytext+1, "ENDINLINE" ) ){
1480                            BEGIN INITIAL;
1481                            RETURN( ENDINLINE );
1482                          }
1483                          else {
1484                            strcpy( yylval.str, yytext );
1485                            RETURN( INCODE );
1486                          }
1487                        }
1488        YY_BREAK
1489case 56:
1490/* rule 56 can match eol */
1491YY_RULE_SETUP
1492#line 278 "scan.l"
1493{ crt_line_no++;
1494                          strcpy( yylval.str,yytext );
1495                          RETURN( INCODE );
1496                        }
1497        YY_BREAK
1498case 57:
1499YY_RULE_SETUP
1500#line 282 "scan.l"
1501{ strcpy( yylval.str,yytext );
1502                          RETURN( INCODE );
1503                        }
1504        YY_BREAK
1505case YY_STATE_EOF(INITIAL):
1506case YY_STATE_EOF(CMD_STATE):
1507case YY_STATE_EOF(INC_STATE):
1508case YY_STATE_EOF(MOD_STATE):
1509case YY_STATE_EOF(INT_STATE):
1510case YY_STATE_EOF(PRM_STATE):
1511case YY_STATE_EOF(DSP_STATE):
1512case YY_STATE_EOF(SSP_STATE):
1513case YY_STATE_EOF(INI_STATE):
1514case YY_STATE_EOF(EQN_STATE):
1515case YY_STATE_EOF(EQNTAG_STATE):
1516case YY_STATE_EOF(RATE_STATE):
1517case YY_STATE_EOF(LMP_STATE):
1518case YY_STATE_EOF(CR_IGNORE):
1519case YY_STATE_EOF(SC_IGNORE):
1520case YY_STATE_EOF(ATM_STATE):
1521case YY_STATE_EOF(LKT_STATE):
1522case YY_STATE_EOF(INL_STATE):
1523case YY_STATE_EOF(MNI_STATE):
1524case YY_STATE_EOF(TPT_STATE):
1525case YY_STATE_EOF(USE_STATE):
1526case YY_STATE_EOF(COMMENT):
1527case YY_STATE_EOF(COMMENT2):
1528case YY_STATE_EOF(EQN_ID):
1529case YY_STATE_EOF(INL_CODE):
1530#line 285 "scan.l"
1531{ if ( ! EndInclude() ) {
1532                            RETURN( INITIAL );
1533                          }
1534                        } 
1535        YY_BREAK
1536case 58:
1537YY_RULE_SETUP
1538#line 289 "scan.l"
1539ECHO;
1540        YY_BREAK
1541#line 1542 "lex.yy.c"
1542
1543        case YY_END_OF_BUFFER:
1544                {
1545                /* Amount of text matched not including the EOB char. */
1546                int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1547
1548                /* Undo the effects of YY_DO_BEFORE_ACTION. */
1549                *yy_cp = (yy_hold_char);
1550                YY_RESTORE_YY_MORE_OFFSET
1551
1552                if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1553                        {
1554                        /* We're scanning a new file or input source.  It's
1555                         * possible that this happened because the user
1556                         * just pointed yyin at a new source and called
1557                         * yylex().  If so, then we have to assure
1558                         * consistency between YY_CURRENT_BUFFER and our
1559                         * globals.  Here is the right place to do so, because
1560                         * this is the first action (other than possibly a
1561                         * back-up) that will match for the new input source.
1562                         */
1563                        (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1564                        YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1565                        YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1566                        }
1567
1568                /* Note that here we test for yy_c_buf_p "<=" to the position
1569                 * of the first EOB in the buffer, since yy_c_buf_p will
1570                 * already have been incremented past the NUL character
1571                 * (since all states make transitions on EOB to the
1572                 * end-of-buffer state).  Contrast this with the test
1573                 * in input().
1574                 */
1575                if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1576                        { /* This was really a NUL. */
1577                        yy_state_type yy_next_state;
1578
1579                        (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1580
1581                        yy_current_state = yy_get_previous_state(  );
1582
1583                        /* Okay, we're now positioned to make the NUL
1584                         * transition.  We couldn't have
1585                         * yy_get_previous_state() go ahead and do it
1586                         * for us because it doesn't know how to deal
1587                         * with the possibility of jamming (and we don't
1588                         * want to build jamming into it because then it
1589                         * will run more slowly).
1590                         */
1591
1592                        yy_next_state = yy_try_NUL_trans( yy_current_state );
1593
1594                        yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1595
1596                        if ( yy_next_state )
1597                                {
1598                                /* Consume the NUL. */
1599                                yy_cp = ++(yy_c_buf_p);
1600                                yy_current_state = yy_next_state;
1601                                goto yy_match;
1602                                }
1603
1604                        else
1605                                {
1606                                yy_cp = (yy_c_buf_p);
1607                                goto yy_find_action;
1608                                }
1609                        }
1610
1611                else switch ( yy_get_next_buffer(  ) )
1612                        {
1613                        case EOB_ACT_END_OF_FILE:
1614                                {
1615                                (yy_did_buffer_switch_on_eof) = 0;
1616
1617                                if ( yywrap( ) )
1618                                        {
1619                                        /* Note: because we've taken care in
1620                                         * yy_get_next_buffer() to have set up
1621                                         * yytext, we can now set up
1622                                         * yy_c_buf_p so that if some total
1623                                         * hoser (like flex itself) wants to
1624                                         * call the scanner after we return the
1625                                         * YY_NULL, it'll still work - another
1626                                         * YY_NULL will get returned.
1627                                         */
1628                                        (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1629
1630                                        yy_act = YY_STATE_EOF(YY_START);
1631                                        goto do_action;
1632                                        }
1633
1634                                else
1635                                        {
1636                                        if ( ! (yy_did_buffer_switch_on_eof) )
1637                                                YY_NEW_FILE;
1638                                        }
1639                                break;
1640                                }
1641
1642                        case EOB_ACT_CONTINUE_SCAN:
1643                                (yy_c_buf_p) =
1644                                        (yytext_ptr) + yy_amount_of_matched_text;
1645
1646                                yy_current_state = yy_get_previous_state(  );
1647
1648                                yy_cp = (yy_c_buf_p);
1649                                yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1650                                goto yy_match;
1651
1652                        case EOB_ACT_LAST_MATCH:
1653                                (yy_c_buf_p) =
1654                                &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1655
1656                                yy_current_state = yy_get_previous_state(  );
1657
1658                                yy_cp = (yy_c_buf_p);
1659                                yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1660                                goto yy_find_action;
1661                        }
1662                break;
1663                }
1664
1665        default:
1666                YY_FATAL_ERROR(
1667                        "fatal flex scanner internal error--no action found" );
1668        } /* end of action switch */
1669                } /* end of scanning one token */
1670} /* end of yylex */
1671
1672/* yy_get_next_buffer - try to read in a new buffer
1673 *
1674 * Returns a code representing an action:
1675 *      EOB_ACT_LAST_MATCH -
1676 *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1677 *      EOB_ACT_END_OF_FILE - end of file
1678 */
1679static int yy_get_next_buffer (void)
1680{
1681        register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1682        register char *source = (yytext_ptr);
1683        register int number_to_move, i;
1684        int ret_val;
1685
1686        if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1687                YY_FATAL_ERROR(
1688                "fatal flex scanner internal error--end of buffer missed" );
1689
1690        if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1691                { /* Don't try to fill the buffer, so this is an EOF. */
1692                if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1693                        {
1694                        /* We matched a single character, the EOB, so
1695                         * treat this as a final EOF.
1696                         */
1697                        return EOB_ACT_END_OF_FILE;
1698                        }
1699
1700                else
1701                        {
1702                        /* We matched some text prior to the EOB, first
1703                         * process it.
1704                         */
1705                        return EOB_ACT_LAST_MATCH;
1706                        }
1707                }
1708
1709        /* Try to read more data. */
1710
1711        /* First move last chars to start of buffer. */
1712        number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1713
1714        for ( i = 0; i < number_to_move; ++i )
1715                *(dest++) = *(source++);
1716
1717        if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1718                /* don't do the read, it's not guaranteed to return an EOF,
1719                 * just force an EOF
1720                 */
1721                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1722
1723        else
1724                {
1725                        int num_to_read =
1726                        YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1727
1728                while ( num_to_read <= 0 )
1729                        { /* Not enough room in the buffer - grow it. */
1730
1731                        /* just a shorter name for the current buffer */
1732                        YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1733
1734                        int yy_c_buf_p_offset =
1735                                (int) ((yy_c_buf_p) - b->yy_ch_buf);
1736
1737                        if ( b->yy_is_our_buffer )
1738                                {
1739                                int new_size = b->yy_buf_size * 2;
1740
1741                                if ( new_size <= 0 )
1742                                        b->yy_buf_size += b->yy_buf_size / 8;
1743                                else
1744                                        b->yy_buf_size *= 2;
1745
1746                                b->yy_ch_buf = (char *)
1747                                        /* Include room in for 2 EOB chars. */
1748                                        yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
1749                                }
1750                        else
1751                                /* Can't grow it, we don't own it. */
1752                                b->yy_ch_buf = 0;
1753
1754                        if ( ! b->yy_ch_buf )
1755                                YY_FATAL_ERROR(
1756                                "fatal error - scanner input buffer overflow" );
1757
1758                        (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1759
1760                        num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1761                                                number_to_move - 1;
1762
1763                        }
1764
1765                if ( num_to_read > YY_READ_BUF_SIZE )
1766                        num_to_read = YY_READ_BUF_SIZE;
1767
1768                /* Read in more data. */
1769                YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1770                        (yy_n_chars), (size_t) num_to_read );
1771
1772                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1773                }
1774
1775        if ( (yy_n_chars) == 0 )
1776                {
1777                if ( number_to_move == YY_MORE_ADJ )
1778                        {
1779                        ret_val = EOB_ACT_END_OF_FILE;
1780                        yyrestart(yyin  );
1781                        }
1782
1783                else
1784                        {
1785                        ret_val = EOB_ACT_LAST_MATCH;
1786                        YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1787                                YY_BUFFER_EOF_PENDING;
1788                        }
1789                }
1790
1791        else
1792                ret_val = EOB_ACT_CONTINUE_SCAN;
1793
1794        if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1795                /* Extend the array by 50%, plus the number we really need. */
1796                yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1797                YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
1798                if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1799                        YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1800        }
1801
1802        (yy_n_chars) += number_to_move;
1803        YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1804        YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1805
1806        (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1807
1808        return ret_val;
1809}
1810
1811/* yy_get_previous_state - get the state just before the EOB char was reached */
1812
1813    static yy_state_type yy_get_previous_state (void)
1814{
1815        register yy_state_type yy_current_state;
1816        register char *yy_cp;
1817   
1818        yy_current_state = (yy_start);
1819
1820        for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1821                {
1822                register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1823                if ( yy_accept[yy_current_state] )
1824                        {
1825                        (yy_last_accepting_state) = yy_current_state;
1826                        (yy_last_accepting_cpos) = yy_cp;
1827                        }
1828                while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1829                        {
1830                        yy_current_state = (int) yy_def[yy_current_state];
1831                        if ( yy_current_state >= 199 )
1832                                yy_c = yy_meta[(unsigned int) yy_c];
1833                        }
1834                yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1835                }
1836
1837        return yy_current_state;
1838}
1839
1840/* yy_try_NUL_trans - try to make a transition on the NUL character
1841 *
1842 * synopsis
1843 *      next_state = yy_try_NUL_trans( current_state );
1844 */
1845    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
1846{
1847        register int yy_is_jam;
1848        register char *yy_cp = (yy_c_buf_p);
1849
1850        register YY_CHAR yy_c = 1;
1851        if ( yy_accept[yy_current_state] )
1852                {
1853                (yy_last_accepting_state) = yy_current_state;
1854                (yy_last_accepting_cpos) = yy_cp;
1855                }
1856        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1857                {
1858                yy_current_state = (int) yy_def[yy_current_state];
1859                if ( yy_current_state >= 199 )
1860                        yy_c = yy_meta[(unsigned int) yy_c];
1861                }
1862        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1863        yy_is_jam = (yy_current_state == 198);
1864
1865        return yy_is_jam ? 0 : yy_current_state;
1866}
1867
1868    static void yyunput (int c, register char * yy_bp )
1869{
1870        register char *yy_cp;
1871   
1872    yy_cp = (yy_c_buf_p);
1873
1874        /* undo effects of setting up yytext */
1875        *yy_cp = (yy_hold_char);
1876
1877        if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1878                { /* need to shift things up to make room */
1879                /* +2 for EOB chars. */
1880                register int number_to_move = (yy_n_chars) + 2;
1881                register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1882                                        YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1883                register char *source =
1884                                &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1885
1886                while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1887                        *--dest = *--source;
1888
1889                yy_cp += (int) (dest - source);
1890                yy_bp += (int) (dest - source);
1891                YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1892                        (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1893
1894                if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1895                        YY_FATAL_ERROR( "flex scanner push-back overflow" );
1896                }
1897
1898        *--yy_cp = (char) c;
1899
1900        (yytext_ptr) = yy_bp;
1901        (yy_hold_char) = *yy_cp;
1902        (yy_c_buf_p) = yy_cp;
1903}
1904
1905#ifndef YY_NO_INPUT
1906#ifdef __cplusplus
1907    static int yyinput (void)
1908#else
1909    static int input  (void)
1910#endif
1911
1912{
1913        int c;
1914   
1915        *(yy_c_buf_p) = (yy_hold_char);
1916
1917        if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1918                {
1919                /* yy_c_buf_p now points to the character we want to return.
1920                 * If this occurs *before* the EOB characters, then it's a
1921                 * valid NUL; if not, then we've hit the end of the buffer.
1922                 */
1923                if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1924                        /* This was really a NUL. */
1925                        *(yy_c_buf_p) = '\0';
1926
1927                else
1928                        { /* need more input */
1929                        int offset = (yy_c_buf_p) - (yytext_ptr);
1930                        ++(yy_c_buf_p);
1931
1932                        switch ( yy_get_next_buffer(  ) )
1933                                {
1934                                case EOB_ACT_LAST_MATCH:
1935                                        /* This happens because yy_g_n_b()
1936                                         * sees that we've accumulated a
1937                                         * token and flags that we need to
1938                                         * try matching the token before
1939                                         * proceeding.  But for input(),
1940                                         * there's no matching to consider.
1941                                         * So convert the EOB_ACT_LAST_MATCH
1942                                         * to EOB_ACT_END_OF_FILE.
1943                                         */
1944
1945                                        /* Reset buffer status. */
1946                                        yyrestart(yyin );
1947
1948                                        /*FALLTHROUGH*/
1949
1950                                case EOB_ACT_END_OF_FILE:
1951                                        {
1952                                        if ( yywrap( ) )
1953                                                return EOF;
1954
1955                                        if ( ! (yy_did_buffer_switch_on_eof) )
1956                                                YY_NEW_FILE;
1957#ifdef __cplusplus
1958                                        return yyinput();
1959#else
1960                                        return input();
1961#endif
1962                                        }
1963
1964                                case EOB_ACT_CONTINUE_SCAN:
1965                                        (yy_c_buf_p) = (yytext_ptr) + offset;
1966                                        break;
1967                                }
1968                        }
1969                }
1970
1971        c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
1972        *(yy_c_buf_p) = '\0';   /* preserve yytext */
1973        (yy_hold_char) = *++(yy_c_buf_p);
1974
1975        return c;
1976}
1977#endif  /* ifndef YY_NO_INPUT */
1978
1979/** Immediately switch to a different input stream.
1980 * @param input_file A readable stream.
1981 *
1982 * @note This function does not reset the start condition to @c INITIAL .
1983 */
1984    void yyrestart  (FILE * input_file )
1985{
1986   
1987        if ( ! YY_CURRENT_BUFFER ){
1988        yyensure_buffer_stack ();
1989                YY_CURRENT_BUFFER_LVALUE =
1990            yy_create_buffer(yyin,YY_BUF_SIZE );
1991        }
1992
1993        yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1994        yy_load_buffer_state( );
1995}
1996
1997/** Switch to a different input buffer.
1998 * @param new_buffer The new input buffer.
1999 *
2000 */
2001    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
2002{
2003   
2004        /* TODO. We should be able to replace this entire function body
2005         * with
2006         *              yypop_buffer_state();
2007         *              yypush_buffer_state(new_buffer);
2008     */
2009        yyensure_buffer_stack ();
2010        if ( YY_CURRENT_BUFFER == new_buffer )
2011                return;
2012
2013        if ( YY_CURRENT_BUFFER )
2014                {
2015                /* Flush out information for old buffer. */
2016                *(yy_c_buf_p) = (yy_hold_char);
2017                YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2018                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2019                }
2020
2021        YY_CURRENT_BUFFER_LVALUE = new_buffer;
2022        yy_load_buffer_state( );
2023
2024        /* We don't actually know whether we did this switch during
2025         * EOF (yywrap()) processing, but the only time this flag
2026         * is looked at is after yywrap() is called, so it's safe
2027         * to go ahead and always set it.
2028         */
2029        (yy_did_buffer_switch_on_eof) = 1;
2030}
2031
2032static void yy_load_buffer_state  (void)
2033{
2034        (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2035        (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2036        yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2037        (yy_hold_char) = *(yy_c_buf_p);
2038}
2039
2040/** Allocate and initialize an input buffer state.
2041 * @param file A readable stream.
2042 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2043 *
2044 * @return the allocated buffer state.
2045 */
2046    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
2047{
2048        YY_BUFFER_STATE b;
2049   
2050        b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
2051        if ( ! b )
2052                YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2053
2054        b->yy_buf_size = size;
2055
2056        /* yy_ch_buf has to be 2 characters longer than the size given because
2057         * we need to put in 2 end-of-buffer characters.
2058         */
2059        b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
2060        if ( ! b->yy_ch_buf )
2061                YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2062
2063        b->yy_is_our_buffer = 1;
2064
2065        yy_init_buffer(b,file );
2066
2067        return b;
2068}
2069
2070/** Destroy the buffer.
2071 * @param b a buffer created with yy_create_buffer()
2072 *
2073 */
2074    void yy_delete_buffer (YY_BUFFER_STATE  b )
2075{
2076   
2077        if ( ! b )
2078                return;
2079
2080        if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2081                YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2082
2083        if ( b->yy_is_our_buffer )
2084                yyfree((void *) b->yy_ch_buf  );
2085
2086        yyfree((void *) b  );
2087}
2088
2089#ifndef __cplusplus
2090extern int isatty (int );
2091#endif /* __cplusplus */
2092   
2093/* Initializes or reinitializes a buffer.
2094 * This function is sometimes called more than once on the same buffer,
2095 * such as during a yyrestart() or at EOF.
2096 */
2097    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
2098
2099{
2100        int oerrno = errno;
2101   
2102        yy_flush_buffer(b );
2103
2104        b->yy_input_file = file;
2105        b->yy_fill_buffer = 1;
2106
2107    /* If b is the current buffer, then yy_init_buffer was _probably_
2108     * called from yyrestart() or through yy_get_next_buffer.
2109     * In that case, we don't want to reset the lineno or column.
2110     */
2111    if (b != YY_CURRENT_BUFFER){
2112        b->yy_bs_lineno = 1;
2113        b->yy_bs_column = 0;
2114    }
2115
2116        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2117   
2118        errno = oerrno;
2119}
2120
2121/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2122 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2123 *
2124 */
2125    void yy_flush_buffer (YY_BUFFER_STATE  b )
2126{
2127        if ( ! b )
2128                return;
2129
2130        b->yy_n_chars = 0;
2131
2132        /* We always need two end-of-buffer characters.  The first causes
2133         * a transition to the end-of-buffer state.  The second causes
2134         * a jam in that state.
2135         */
2136        b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2137        b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2138
2139        b->yy_buf_pos = &b->yy_ch_buf[0];
2140
2141        b->yy_at_bol = 1;
2142        b->yy_buffer_status = YY_BUFFER_NEW;
2143
2144        if ( b == YY_CURRENT_BUFFER )
2145                yy_load_buffer_state( );
2146}
2147
2148/** Pushes the new state onto the stack. The new state becomes
2149 *  the current state. This function will allocate the stack
2150 *  if necessary.
2151 *  @param new_buffer The new state.
2152 * 
2153 */
2154void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
2155{
2156        if (new_buffer == NULL)
2157                return;
2158
2159        yyensure_buffer_stack();
2160
2161        /* This block is copied from yy_switch_to_buffer. */
2162        if ( YY_CURRENT_BUFFER )
2163                {
2164                /* Flush out information for old buffer. */
2165                *(yy_c_buf_p) = (yy_hold_char);
2166                YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2167                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2168                }
2169
2170        /* Only push if top exists. Otherwise, replace top. */
2171        if (YY_CURRENT_BUFFER)
2172                (yy_buffer_stack_top)++;
2173        YY_CURRENT_BUFFER_LVALUE = new_buffer;
2174
2175        /* copied from yy_switch_to_buffer. */
2176        yy_load_buffer_state( );
2177        (yy_did_buffer_switch_on_eof) = 1;
2178}
2179
2180/** Removes and deletes the top of the stack, if present.
2181 *  The next element becomes the new top.
2182 * 
2183 */
2184void yypop_buffer_state (void)
2185{
2186        if (!YY_CURRENT_BUFFER)
2187                return;
2188
2189        yy_delete_buffer(YY_CURRENT_BUFFER );
2190        YY_CURRENT_BUFFER_LVALUE = NULL;
2191        if ((yy_buffer_stack_top) > 0)
2192                --(yy_buffer_stack_top);
2193
2194        if (YY_CURRENT_BUFFER) {
2195                yy_load_buffer_state( );
2196                (yy_did_buffer_switch_on_eof) = 1;
2197        }
2198}
2199
2200/* Allocates the stack if it does not exist.
2201 *  Guarantees space for at least one push.
2202 */
2203static void yyensure_buffer_stack (void)
2204{
2205        int num_to_alloc;
2206   
2207        if (!(yy_buffer_stack)) {
2208
2209                /* First allocation is just for 2 elements, since we don't know if this
2210                 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2211                 * immediate realloc on the next call.
2212         */
2213                num_to_alloc = 1;
2214                (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
2215                                                                (num_to_alloc * sizeof(struct yy_buffer_state*)
2216                                                                );
2217                if ( ! (yy_buffer_stack) )
2218                        YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2219                                                                 
2220                memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2221                               
2222                (yy_buffer_stack_max) = num_to_alloc;
2223                (yy_buffer_stack_top) = 0;
2224                return;
2225        }
2226
2227        if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2228
2229                /* Increase the buffer to prepare for a possible push. */
2230                int grow_size = 8 /* arbitrary grow size */;
2231
2232                num_to_alloc = (yy_buffer_stack_max) + grow_size;
2233                (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
2234                                                                ((yy_buffer_stack),
2235                                                                num_to_alloc * sizeof(struct yy_buffer_state*)
2236                                                                );
2237                if ( ! (yy_buffer_stack) )
2238                        YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2239
2240                /* zero only the new slots.*/
2241                memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2242                (yy_buffer_stack_max) = num_to_alloc;
2243        }
2244}
2245
2246/** Setup the input buffer state to scan directly from a user-specified character buffer.
2247 * @param base the character buffer
2248 * @param size the size in bytes of the character buffer
2249 *
2250 * @return the newly allocated buffer state object.
2251 */
2252YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
2253{
2254        YY_BUFFER_STATE b;
2255   
2256        if ( size < 2 ||
2257             base[size-2] != YY_END_OF_BUFFER_CHAR ||
2258             base[size-1] != YY_END_OF_BUFFER_CHAR )
2259                /* They forgot to leave room for the EOB's. */
2260                return 0;
2261
2262        b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
2263        if ( ! b )
2264                YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2265
2266        b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
2267        b->yy_buf_pos = b->yy_ch_buf = base;
2268        b->yy_is_our_buffer = 0;
2269        b->yy_input_file = 0;
2270        b->yy_n_chars = b->yy_buf_size;
2271        b->yy_is_interactive = 0;
2272        b->yy_at_bol = 1;
2273        b->yy_fill_buffer = 0;
2274        b->yy_buffer_status = YY_BUFFER_NEW;
2275
2276        yy_switch_to_buffer();
2277
2278        return b;
2279}
2280
2281/** Setup the input buffer state to scan a string. The next call to yylex() will
2282 * scan from a @e copy of @a str.
2283 * @param yystr a NUL-terminated string to scan
2284 *
2285 * @return the newly allocated buffer state object.
2286 * @note If you want to scan bytes that may contain NUL values, then use
2287 *       yy_scan_bytes() instead.
2288 */
2289YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
2290{
2291   
2292        return yy_scan_bytes(yystr,strlen(yystr) );
2293}
2294
2295/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2296 * scan from a @e copy of @a bytes.
2297 * @param yybytes the byte buffer to scan
2298 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2299 *
2300 * @return the newly allocated buffer state object.
2301 */
2302YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
2303{
2304        YY_BUFFER_STATE b;
2305        char *buf;
2306        yy_size_t n;
2307        int i;
2308   
2309        /* Get memory for full buffer, including space for trailing EOB's. */
2310        n = _yybytes_len + 2;
2311        buf = (char *) yyalloc();
2312        if ( ! buf )
2313                YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2314
2315        for ( i = 0; i < _yybytes_len; ++i )
2316                buf[i] = yybytes[i];
2317
2318        buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2319
2320        b = yy_scan_buffer(buf,n );
2321        if ( ! b )
2322                YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2323
2324        /* It's okay to grow etc. this buffer, and we should throw it
2325         * away when we're done.
2326         */
2327        b->yy_is_our_buffer = 1;
2328
2329        return b;
2330}
2331
2332#ifndef YY_EXIT_FAILURE
2333#define YY_EXIT_FAILURE 2
2334#endif
2335
2336static void yy_fatal_error (yyconst char* msg )
2337{
2338        (void) fprintf( stderr, "%s\n", msg );
2339        exit( YY_EXIT_FAILURE );
2340}
2341
2342/* Redefine yyless() so it works in section 3 code. */
2343
2344#undef yyless
2345#define yyless(n) \
2346        do \
2347                { \
2348                /* Undo effects of setting up yytext. */ \
2349        int yyless_macro_arg = (n); \
2350        YY_LESS_LINENO(yyless_macro_arg);\
2351                yytext[yyleng] = (yy_hold_char); \
2352                (yy_c_buf_p) = yytext + yyless_macro_arg; \
2353                (yy_hold_char) = *(yy_c_buf_p); \
2354                *(yy_c_buf_p) = '\0'; \
2355                yyleng = yyless_macro_arg; \
2356                } \
2357        while ( 0 )
2358
2359/* Accessor  methods (get/set functions) to struct members. */
2360
2361/** Get the current line number.
2362 *
2363 */
2364int yyget_lineno  (void)
2365{
2366       
2367    return yylineno;
2368}
2369
2370/** Get the input stream.
2371 *
2372 */
2373FILE *yyget_in  (void)
2374{
2375        return yyin;
2376}
2377
2378/** Get the output stream.
2379 *
2380 */
2381FILE *yyget_out  (void)
2382{
2383        return yyout;
2384}
2385
2386/** Get the length of the current token.
2387 *
2388 */
2389int yyget_leng  (void)
2390{
2391        return yyleng;
2392}
2393
2394/** Get the current token.
2395 *
2396 */
2397
2398char *yyget_text  (void)
2399{
2400        return yytext;
2401}
2402
2403/** Set the current line number.
2404 * @param line_number
2405 *
2406 */
2407void yyset_lineno (int  line_number )
2408{
2409   
2410    yylineno = line_number;
2411}
2412
2413/** Set the input stream. This does not discard the current
2414 * input buffer.
2415 * @param in_str A readable stream.
2416 *
2417 * @see yy_switch_to_buffer
2418 */
2419void yyset_in (FILE *  in_str )
2420{
2421        yyin = in_str ;
2422}
2423
2424void yyset_out (FILE *  out_str )
2425{
2426        yyout = out_str ;
2427}
2428
2429int yyget_debug  (void)
2430{
2431        return yy_flex_debug;
2432}
2433
2434void yyset_debug (int  bdebug )
2435{
2436        yy_flex_debug = bdebug ;
2437}
2438
2439static int yy_init_globals (void)
2440{
2441        /* Initialization is the same as for the non-reentrant scanner.
2442     * This function is called from yylex_destroy(), so don't allocate here.
2443     */
2444
2445    (yy_buffer_stack) = 0;
2446    (yy_buffer_stack_top) = 0;
2447    (yy_buffer_stack_max) = 0;
2448    (yy_c_buf_p) = (char *) 0;
2449    (yy_init) = 0;
2450    (yy_start) = 0;
2451
2452/* Defined in main.c */
2453#ifdef YY_STDINIT
2454    yyin = stdin;
2455    yyout = stdout;
2456#else
2457    yyin = (FILE *) 0;
2458    yyout = (FILE *) 0;
2459#endif
2460
2461    /* For future reference: Set errno on error, since we are called by
2462     * yylex_init()
2463     */
2464    return 0;
2465}
2466
2467/* yylex_destroy is for both reentrant and non-reentrant scanners. */
2468int yylex_destroy  (void)
2469{
2470   
2471    /* Pop the buffer stack, destroying each element. */
2472        while(YY_CURRENT_BUFFER){
2473                yy_delete_buffer(YY_CURRENT_BUFFER  );
2474                YY_CURRENT_BUFFER_LVALUE = NULL;
2475                yypop_buffer_state();
2476        }
2477
2478        /* Destroy the stack itself. */
2479        yyfree((yy_buffer_stack) );
2480        (yy_buffer_stack) = NULL;
2481
2482    /* Reset the globals. This is important in a non-reentrant scanner so the next time
2483     * yylex() is called, initialization will occur. */
2484    yy_init_globals( );
2485
2486    return 0;
2487}
2488
2489/*
2490 * Internal utility routines.
2491 */
2492
2493#ifndef yytext_ptr
2494static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2495{
2496        register int i;
2497        for ( i = 0; i < n; ++i )
2498                s1[i] = s2[i];
2499}
2500#endif
2501
2502#ifdef YY_NEED_STRLEN
2503static int yy_flex_strlen (yyconst char * s )
2504{
2505        register int n;
2506        for ( n = 0; s[n]; ++n )
2507                ;
2508
2509        return n;
2510}
2511#endif
2512
2513void *yyalloc (yy_size_t  size )
2514{
2515        return (void *) malloc( size );
2516}
2517
2518void *yyrealloc  (void * ptr, yy_size_t  size )
2519{
2520        /* The cast to (char *) in the following accommodates both
2521         * implementations that use char* generic pointers, and those
2522         * that use void* generic pointers.  It works with the latter
2523         * because both ANSI C and C++ allow castless assignment from
2524         * any pointer type to void*, and deal with argument conversions
2525         * as though doing an assignment.
2526         */
2527        return (void *) realloc( (char *) ptr, size );
2528}
2529
2530void yyfree (void * ptr )
2531{
2532        free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
2533}
2534
2535#define YYTABLES_NAME "yytables"
2536
2537#line 289 "scan.l"
2538
2539
2540
2541  KEYWORD keywords[] = { { "INCLUDE",    INC_STATE, 0 },
2542                         { "MODEL",      MOD_STATE, 0 },
2543                         { "INTEGRATOR", INT_STATE, 0 },
2544                         { "JACOBIAN",   PRM_STATE, JACOBIAN }, 
2545                         { "HESSIAN",    PRM_STATE, HESSIAN }, 
2546                         { "DECLARE",    PRM_STATE, DECLARE }, 
2547                         { "STOICMAT",   PRM_STATE, STOICMAT }, 
2548                         { "STOCHASTIC", PRM_STATE, STOCHASTIC }, 
2549                         { "DOUBLE",     PRM_STATE, DOUBLE }, 
2550                         { "REORDER",    PRM_STATE, REORDER }, 
2551                         { "MEX",        PRM_STATE, MEX }, 
2552                         { "DUMMYINDEX", PRM_STATE, DUMMYINDEX}, 
2553                         { "EQNTAGS",    PRM_STATE, EQNTAGS}, 
2554                         { "FUNCTION",   PRM_STATE, FUNCTION }, 
2555                         { "ATOMS",      ATM_STATE, ATOMDECL },   
2556                         { "CHECK",      ATM_STATE, CHECK },
2557                         { "CHECKALL",   INITIAL,   CHECKALL },
2558                         { "DEFVAR",     DSP_STATE, DEFVAR }, 
2559                         { "DEFRAD",     DSP_STATE, DEFVAR }, 
2560                         { "DEFFIX",     DSP_STATE, DEFFIX }, 
2561                         { "SETVAR",     SSP_STATE, SETVAR }, 
2562                         { "SETRAD",     SSP_STATE, SETVAR }, 
2563                         { "SETFIX",     SSP_STATE, SETFIX }, 
2564                         { "INITVALUES", INI_STATE, INITVALUES }, 
2565                         { "EQUATIONS",  EQN_STATE, EQUATIONS }, 
2566                         { "LUMP",       LMP_STATE, LUMP }, 
2567                         { "LOOKAT",     LKT_STATE, LOOKAT },
2568                         { "LOOKATALL",  INITIAL,   LOOKATALL },
2569                         { "TRANSPORT",  TPT_STATE, TRANSPORT },
2570                         { "TRANSPORTALL", INITIAL,   TRANSPORTALL },
2571                         { "INITIALIZE", PRM_STATE, INITIALIZE },
2572                         { "XGRID",      PRM_STATE, XGRID },
2573                         { "YGRID",      PRM_STATE, YGRID },
2574                         { "ZGRID",      PRM_STATE, ZGRID },
2575                         { "MONITOR",    MNI_STATE, MONITOR },
2576                         { "WRITE_ATM",  INITIAL,   WRITE_ATM },
2577                         { "WRITE_SPC",  INITIAL,   WRITE_SPC },
2578                         { "WRITE_MAT",  INITIAL,   WRITE_MAT },
2579                         { "WRITE_OPT",  INITIAL,   WRITE_OPT },
2580                         { "USE",        PRM_STATE, USE },
2581                         { "LANGUAGE",   PRM_STATE, LANGUAGE },
2582                         { "INLINE",     INL_STATE, INLINE },
2583                         { "ENDINLINE",  INITIAL,   ENDINLINE },
2584                         { "INTFILE",    PRM_STATE, INTFILE },
2585                         { "DRIVER",     PRM_STATE, DRIVER },
2586                         { "RUN",        PRM_STATE, RUN },
2587                         { "USES",       USE_STATE, USES },
2588                         { "SPARSEDATA", PRM_STATE, SPARSEDATA },
2589                         { 0, 0, 0 } 
2590                       };
2591
2592void Include ( char * name )
2593{
2594FILE *f;
2595YY_BUFFER_STATE newb;
2596
2597  if ( yy_buf_level == MAX_INCLUDE ) {
2598    printf("\nInclude nested too deep. Include %s ignored", name);
2599    return;
2600  }
2601
2602  yy_buffers[ yy_buf_level ]  = YY_CURRENT_BUFFER;
2603  yy_line_no[ yy_buf_level ]  = crt_line_no;
2604  yy_filename[ yy_buf_level ] = crt_filename;
2605  yy_buf_level++;
2606 
2607  crt_line_no = 1; 
2608
2609  crt_filename = malloc( 1 + strlen( name ) );
2610  strcpy( crt_filename, name ); 
2611
2612 
2613  f = fopen( name, "r" );
2614  if( f == 0 )
2615    FatalError(3,"%s: Can't read file", name );
2616
2617  newb = yy_create_buffer(f,YY_BUF_SIZE);
2618  yy_switch_to_buffer(newb );
2619}
2620
2621int EndInclude()
2622{
2623YY_BUFFER_STATE oldb;
2624char * oldn;
2625
2626  if ( yy_buf_level > 0 ) {
2627    oldb = YY_CURRENT_BUFFER;
2628    oldn = crt_filename; 
2629    yy_buf_level--;
2630    yy_switch_to_buffer(yy_buffers[yy_buf_level] );
2631    crt_line_no = yy_line_no[ yy_buf_level ];
2632    crt_filename = yy_filename[ yy_buf_level ]; 
2633    yy_delete_buffer(oldb ); 
2634    free( oldn );
2635    return 1;
2636  } 
2637  return 0;
2638}
2639
2640int EqNoCase( char *s1, char *s2 )
2641{
2642  while( *s1 ) {
2643    if ( toupper(*s1++) != toupper(*s2++) ) return 0;
2644  }
2645  return *s1 == *s2;
2646}
2647
2648int CheckKeyword( char *cmd )
2649{
2650int i;
2651
2652  i = 0;
2653  while( 1 ) {
2654    if( keywords[i].name == 0 ) {
2655      ScanError( "'%s': Unknown command (ignored)", cmd);
2656      return -1;
2657    }
2658    if( EqNoCase( cmd, keywords[i].name ) ) {
2659      return i;
2660    }
2661    i++;
2662  }
2663}
2664
2665
Note: See TracBrowser for help on using the repository browser.