Original WRF subgrid support version from John Michalakes without fire
[wrffire.git] / wrfv2_fire / chem / KPP / kpp / kpp-2.1 / src.org / lex.yy.c
blobc33b607325385bdbc83d6c76a2f83d52c5509cbc
1 /* A lexical scanner generated by flex */
3 /* Scanner skeleton version:
4 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
5 */
7 #define FLEX_SCANNER
8 #define YY_FLEX_MAJOR_VERSION 2
9 #define YY_FLEX_MINOR_VERSION 5
11 #include <stdio.h>
14 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
15 #ifdef c_plusplus
16 #ifndef __cplusplus
17 #define __cplusplus
18 #endif
19 #endif
22 #ifdef __cplusplus
24 #include <stdlib.h>
25 #include <unistd.h>
27 /* Use prototypes in function declarations. */
28 #define YY_USE_PROTOS
30 /* The "const" storage-class-modifier is valid. */
31 #define YY_USE_CONST
33 #else /* ! __cplusplus */
35 #if __STDC__
37 #define YY_USE_PROTOS
38 #define YY_USE_CONST
40 #endif /* __STDC__ */
41 #endif /* ! __cplusplus */
43 #ifdef __TURBOC__
44 #pragma warn -rch
45 #pragma warn -use
46 #include <io.h>
47 #include <stdlib.h>
48 #define YY_USE_CONST
49 #define YY_USE_PROTOS
50 #endif
52 #ifdef YY_USE_CONST
53 #define yyconst const
54 #else
55 #define yyconst
56 #endif
59 #ifdef YY_USE_PROTOS
60 #define YY_PROTO(proto) proto
61 #else
62 #define YY_PROTO(proto) ()
63 #endif
65 /* Returned upon end-of-file. */
66 #define YY_NULL 0
68 /* Promotes a possibly negative, possibly signed char to an unsigned
69 * integer for use as an array index. If the signed char is negative,
70 * we want to instead treat it as an 8-bit unsigned char, hence the
71 * double cast.
73 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
75 /* Enter a start condition. This macro really ought to take a parameter,
76 * but we do it the disgusting crufty way forced on us by the ()-less
77 * definition of BEGIN.
79 #define BEGIN yy_start = 1 + 2 *
81 /* Translate the current start state into a value that can be later handed
82 * to BEGIN to return to the state. The YYSTATE alias is for lex
83 * compatibility.
85 #define YY_START ((yy_start - 1) / 2)
86 #define YYSTATE YY_START
88 /* Action number for EOF rule of a given start state. */
89 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
91 /* Special action meaning "start processing a new file". */
92 #define YY_NEW_FILE yyrestart( yyin )
94 #define YY_END_OF_BUFFER_CHAR 0
96 /* Size of default input buffer. */
97 #define YY_BUF_SIZE 16384
99 typedef struct yy_buffer_state *YY_BUFFER_STATE;
101 extern int yyleng;
102 extern FILE *yyin, *yyout;
104 #define EOB_ACT_CONTINUE_SCAN 0
105 #define EOB_ACT_END_OF_FILE 1
106 #define EOB_ACT_LAST_MATCH 2
108 /* The funky do-while in the following #define is used to turn the definition
109 * int a single C statement (which needs a semi-colon terminator). This
110 * avoids problems with code like:
112 * if ( condition_holds )
113 * yyless( 5 );
114 * else
115 * do_something_else();
117 * Prior to using the do-while the compiler would get upset at the
118 * "else" because it interpreted the "if" statement as being all
119 * done when it reached the ';' after the yyless() call.
122 /* Return all but the first 'n' matched characters back to the input stream. */
124 #define yyless(n) \
125 do \
127 /* Undo effects of setting up yytext. */ \
128 *yy_cp = yy_hold_char; \
129 YY_RESTORE_YY_MORE_OFFSET \
130 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
131 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
133 while ( 0 )
135 #define unput(c) yyunput( c, yytext_ptr )
137 /* The following is because we cannot portably get our hands on size_t
138 * (without autoconf's help, which isn't available because we want
139 * flex-generated scanners to compile on their own).
141 typedef unsigned int yy_size_t;
144 struct yy_buffer_state
146 FILE *yy_input_file;
148 char *yy_ch_buf; /* input buffer */
149 char *yy_buf_pos; /* current position in input buffer */
151 /* Size of input buffer in bytes, not including room for EOB
152 * characters.
154 yy_size_t yy_buf_size;
156 /* Number of characters read into yy_ch_buf, not including EOB
157 * characters.
159 int yy_n_chars;
161 /* Whether we "own" the buffer - i.e., we know we created it,
162 * and can realloc() it to grow it, and should free() it to
163 * delete it.
165 int yy_is_our_buffer;
167 /* Whether this is an "interactive" input source; if so, and
168 * if we're using stdio for input, then we want to use getc()
169 * instead of fread(), to make sure we stop fetching input after
170 * each newline.
172 int yy_is_interactive;
174 /* Whether we're considered to be at the beginning of a line.
175 * If so, '^' rules will be active on the next match, otherwise
176 * not.
178 int yy_at_bol;
180 /* Whether to try to fill the input buffer when we reach the
181 * end of it.
183 int yy_fill_buffer;
185 int yy_buffer_status;
186 #define YY_BUFFER_NEW 0
187 #define YY_BUFFER_NORMAL 1
188 /* When an EOF's been seen but there's still some text to process
189 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
190 * shouldn't try reading from the input source any more. We might
191 * still have a bunch of tokens to match, though, because of
192 * possible backing-up.
194 * When we actually see the EOF, we change the status to "new"
195 * (via yyrestart()), so that the user can continue scanning by
196 * just pointing yyin at a new input file.
198 #define YY_BUFFER_EOF_PENDING 2
201 static YY_BUFFER_STATE yy_current_buffer = 0;
203 /* We provide macros for accessing buffer states in case in the
204 * future we want to put the buffer states in a more general
205 * "scanner state".
207 #define YY_CURRENT_BUFFER yy_current_buffer
210 /* yy_hold_char holds the character lost when yytext is formed. */
211 static char yy_hold_char;
213 static int yy_n_chars; /* number of characters read into yy_ch_buf */
216 int yyleng;
218 /* Points to current character in buffer. */
219 static char *yy_c_buf_p = (char *) 0;
220 static int yy_init = 1; /* whether we need to initialize */
221 static int yy_start = 0; /* start state number */
223 /* Flag which is used to allow yywrap()'s to do buffer switches
224 * instead of setting up a fresh yyin. A bit of a hack ...
226 static int yy_did_buffer_switch_on_eof;
228 void yyrestart YY_PROTO(( FILE *input_file ));
230 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
231 void yy_load_buffer_state YY_PROTO(( void ));
232 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
233 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
234 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
235 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
236 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
238 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
239 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
240 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
242 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
243 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
244 static void yy_flex_free YY_PROTO(( void * ));
246 #define yy_new_buffer yy_create_buffer
248 #define yy_set_interactive(is_interactive) \
250 if ( ! yy_current_buffer ) \
251 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
252 yy_current_buffer->yy_is_interactive = is_interactive; \
255 #define yy_set_bol(at_bol) \
257 if ( ! yy_current_buffer ) \
258 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
259 yy_current_buffer->yy_at_bol = at_bol; \
262 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
264 typedef unsigned char YY_CHAR;
265 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
266 typedef int yy_state_type;
267 extern char *yytext;
268 #define yytext_ptr yytext
270 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
271 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
272 static int yy_get_next_buffer YY_PROTO(( void ));
273 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
275 /* Done after the current pattern has been matched and before the
276 * corresponding action - sets up yytext.
278 #define YY_DO_BEFORE_ACTION \
279 yytext_ptr = yy_bp; \
280 yyleng = (int) (yy_cp - yy_bp); \
281 yy_hold_char = *yy_cp; \
282 *yy_cp = '\0'; \
283 yy_c_buf_p = yy_cp;
285 #define YY_NUM_RULES 58
286 #define YY_END_OF_BUFFER 59
287 static yyconst short int yy_accept[199] =
288 { 0,
289 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
290 0, 0, 19, 19, 0, 0, 29, 29, 33, 33,
291 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
292 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
293 0, 0, 5, 5, 7, 7, 0, 0, 57, 57,
294 59, 58, 1, 9, 2, 58, 3, 10, 10, 11,
295 11, 12, 12, 13, 13, 14, 14, 23, 1, 9,
296 21, 23, 19, 22, 20, 18, 3, 25, 24, 30,
297 1, 9, 30, 29, 30, 29, 28, 27, 26, 26,
298 3, 35, 33, 33, 34, 36, 32, 31, 31, 37,
300 38, 39, 39, 40, 45, 1, 9, 42, 45, 43,
301 44, 41, 3, 15, 15, 17, 16, 47, 46, 54,
302 54, 53, 52, 49, 48, 50, 50, 51, 5, 1,
303 2, 5, 3, 6, 7, 1, 8, 2, 7, 3,
304 57, 56, 55, 1, 4, 10, 4, 11, 4, 12,
305 4, 13, 4, 14, 4, 19, 18, 24, 29, 29,
306 0, 29, 29, 26, 0, 26, 33, 0, 33, 33,
307 31, 0, 31, 37, 39, 4, 41, 15, 4, 16,
308 46, 54, 4, 52, 48, 50, 4, 5, 1, 4,
309 7, 1, 4, 57, 55, 29, 33, 0
313 static yyconst int yy_ec[256] =
314 { 0,
315 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
316 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
317 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
318 1, 2, 1, 1, 4, 1, 1, 1, 1, 1,
319 1, 1, 5, 1, 6, 7, 8, 9, 9, 9,
320 9, 9, 9, 9, 9, 9, 9, 10, 11, 12,
321 13, 14, 1, 1, 15, 15, 15, 15, 16, 15,
322 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
323 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
324 1, 1, 1, 1, 15, 1, 15, 15, 15, 15,
326 16, 15, 15, 15, 15, 15, 15, 15, 15, 15,
327 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
328 15, 15, 17, 1, 18, 1, 1, 1, 1, 1,
329 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
330 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
331 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
332 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
333 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
334 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
335 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
337 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
338 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
339 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
340 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
341 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
342 1, 1, 1, 1, 1
345 static yyconst int yy_meta[19] =
346 { 0,
347 1, 2, 3, 4, 5, 5, 1, 1, 6, 1,
348 7, 1, 1, 1, 8, 8, 7, 9
351 static yyconst short int yy_base[237] =
352 { 0,
353 0, 16, 32, 49, 66, 83, 100, 117, 134, 151,
354 168, 185, 203, 0, 211, 217, 233, 0, 247, 0,
355 255, 0, 270, 287, 305, 0, 322, 339, 0, 0,
356 347, 353, 359, 365, 380, 397, 405, 411, 417, 423,
357 438, 455, 472, 489, 506, 522, 0, 0, 2, 6,
358 88, 842, 80, 842, 842, 73, 842, 0, 72, 0,
359 71, 0, 70, 0, 68, 0, 67, 842, 71, 842,
360 842, 64, 62, 842, 842, 0, 842, 842, 0, 842,
361 63, 842, 55, 5, 55, 533, 842, 842, 0, 545,
362 842, 842, 6, 555, 842, 842, 842, 0, 567, 0,
364 842, 0, 54, 842, 842, 59, 842, 842, 51, 842,
365 842, 0, 842, 0, 50, 842, 0, 842, 0, 0,
366 48, 842, 0, 842, 0, 0, 47, 842, 0, 52,
367 0, 40, 0, 842, 0, 45, 842, 0, 38, 0,
368 0, 842, 0, 43, 842, 0, 0, 0, 0, 0,
369 0, 0, 0, 0, 0, 35, 0, 0, 0, 7,
370 33, 16, 0, 0, 32, 30, 21, 20, 22, 0,
371 0, 19, 18, 0, 0, 0, 0, 0, 0, 0,
372 0, 0, 0, 0, 0, 0, 0, 0, 24, 0,
373 0, 11, 0, 0, 0, 3, 2, 842, 583, 592,
375 601, 610, 619, 628, 637, 646, 655, 664, 673, 682,
376 691, 700, 708, 716, 724, 732, 735, 738, 741, 744,
377 747, 755, 758, 766, 769, 772, 780, 783, 786, 794,
378 802, 810, 819, 828, 833, 835
381 static yyconst short int yy_def[237] =
382 { 0,
383 199, 199, 200, 200, 201, 201, 202, 202, 203, 203,
384 204, 204, 198, 13, 2, 2, 198, 17, 2, 19,
385 2, 21, 205, 205, 198, 25, 206, 206, 2, 2,
386 2, 2, 2, 2, 207, 207, 2, 2, 2, 2,
387 208, 208, 209, 209, 210, 210, 2, 2, 211, 211,
388 198, 198, 198, 198, 198, 198, 198, 212, 212, 213,
389 213, 214, 214, 215, 215, 216, 216, 198, 198, 198,
390 198, 198, 198, 198, 198, 217, 198, 198, 218, 198,
391 198, 198, 198, 198, 198, 198, 198, 198, 219, 198,
392 198, 198, 198, 198, 198, 198, 198, 220, 198, 221,
394 198, 222, 222, 198, 198, 198, 198, 198, 198, 198,
395 198, 223, 198, 224, 224, 198, 225, 198, 226, 227,
396 227, 198, 228, 198, 229, 230, 230, 198, 231, 231,
397 231, 231, 231, 198, 232, 232, 198, 232, 232, 232,
398 233, 198, 234, 198, 198, 212, 212, 213, 213, 214,
399 214, 215, 215, 216, 216, 198, 217, 218, 86, 198,
400 235, 198, 86, 219, 198, 219, 198, 236, 198, 94,
401 220, 198, 220, 221, 222, 222, 223, 224, 224, 225,
402 226, 227, 227, 228, 229, 230, 230, 231, 231, 231,
403 232, 232, 232, 233, 234, 198, 198, 0, 198, 198,
405 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
406 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
407 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
408 198, 198, 198, 198, 198, 198
411 static yyconst short int yy_nxt[861] =
412 { 0,
413 198, 53, 54, 55, 142, 143, 198, 56, 142, 143,
414 197, 196, 192, 160, 167, 160, 57, 53, 54, 55,
415 161, 168, 161, 56, 160, 189, 173, 197, 197, 167,
416 167, 161, 57, 53, 54, 55, 168, 168, 166, 59,
417 196, 196, 52, 156, 144, 193, 192, 190, 57, 52,
418 53, 54, 55, 189, 187, 183, 59, 179, 145, 52,
419 144, 176, 145, 159, 144, 57, 52, 53, 54, 55,
420 156, 145, 144, 61, 155, 153, 52, 151, 149, 147,
421 145, 144, 57, 52, 53, 54, 55, 198, 198, 198,
422 61, 198, 198, 52, 198, 198, 198, 198, 198, 57,
424 52, 53, 54, 55, 198, 198, 198, 63, 198, 198,
425 52, 198, 198, 198, 198, 198, 57, 52, 53, 54,
426 55, 198, 198, 198, 63, 198, 198, 52, 198, 198,
427 198, 198, 198, 57, 52, 53, 54, 55, 198, 198,
428 198, 65, 198, 198, 52, 198, 198, 198, 198, 198,
429 57, 52, 53, 54, 55, 198, 198, 198, 65, 198,
430 198, 52, 198, 198, 198, 198, 198, 57, 52, 53,
431 54, 55, 198, 198, 198, 67, 198, 198, 52, 198,
432 198, 198, 198, 198, 57, 52, 53, 54, 55, 198,
433 198, 198, 67, 198, 198, 52, 198, 198, 198, 198,
435 198, 57, 52, 68, 69, 70, 55, 71, 68, 68,
436 72, 73, 68, 74, 68, 75, 68, 76, 76, 77,
437 68, 78, 198, 198, 198, 79, 79, 78, 198, 198,
438 198, 79, 79, 80, 81, 82, 55, 83, 83, 84,
439 85, 86, 80, 87, 80, 88, 80, 89, 90, 91,
440 80, 92, 92, 93, 198, 94, 95, 198, 96, 97,
441 198, 98, 99, 100, 198, 198, 198, 198, 101, 100,
442 100, 53, 54, 55, 198, 198, 198, 103, 198, 198,
443 104, 198, 198, 198, 198, 198, 57, 52, 53, 54,
444 55, 198, 198, 198, 103, 198, 198, 104, 198, 198,
446 198, 198, 198, 57, 52, 105, 106, 107, 55, 108,
447 105, 105, 109, 105, 110, 111, 105, 105, 105, 112,
448 112, 113, 105, 53, 54, 55, 198, 198, 198, 115,
449 198, 198, 52, 198, 198, 198, 198, 198, 57, 52,
450 53, 54, 55, 198, 198, 198, 115, 198, 198, 52,
451 198, 198, 198, 198, 198, 57, 52, 116, 198, 198,
452 198, 117, 117, 116, 198, 198, 198, 117, 117, 118,
453 198, 198, 198, 119, 119, 118, 198, 198, 198, 119,
454 119, 53, 54, 55, 198, 198, 198, 121, 198, 198,
455 52, 198, 198, 198, 198, 198, 57, 52, 53, 54,
457 55, 198, 198, 198, 121, 198, 198, 52, 198, 198,
458 198, 198, 198, 57, 52, 122, 198, 198, 198, 123,
459 123, 122, 198, 198, 198, 123, 123, 124, 198, 198,
460 198, 125, 125, 124, 198, 198, 198, 125, 125, 53,
461 54, 55, 198, 198, 198, 127, 198, 198, 128, 198,
462 198, 198, 198, 198, 57, 52, 53, 54, 55, 198,
463 198, 198, 127, 198, 198, 128, 198, 198, 198, 198,
464 198, 57, 52, 130, 54, 131, 198, 198, 198, 132,
465 198, 198, 198, 198, 198, 198, 198, 198, 133, 134,
466 130, 54, 131, 198, 198, 198, 132, 198, 198, 198,
468 198, 198, 198, 198, 198, 133, 134, 136, 137, 138,
469 198, 198, 198, 139, 198, 198, 198, 198, 198, 198,
470 198, 198, 140, 136, 137, 138, 198, 198, 198, 139,
471 198, 198, 198, 198, 198, 198, 198, 198, 140, 162,
472 198, 163, 198, 198, 198, 198, 198, 198, 161, 165,
473 165, 198, 198, 166, 198, 198, 198, 198, 198, 164,
474 164, 169, 198, 170, 198, 198, 198, 198, 198, 198,
475 168, 172, 172, 198, 198, 173, 198, 198, 198, 198,
476 198, 171, 171, 52, 52, 52, 52, 52, 52, 52,
477 52, 52, 58, 58, 58, 58, 58, 58, 58, 58,
479 58, 60, 60, 60, 60, 60, 60, 60, 60, 60,
480 62, 62, 62, 62, 62, 62, 62, 62, 62, 64,
481 64, 64, 64, 64, 64, 64, 64, 64, 66, 66,
482 66, 66, 66, 66, 66, 66, 66, 102, 102, 102,
483 102, 102, 102, 102, 102, 102, 114, 114, 114, 114,
484 114, 114, 114, 114, 114, 120, 120, 120, 120, 120,
485 120, 120, 120, 120, 126, 126, 126, 126, 126, 126,
486 126, 126, 126, 129, 129, 129, 129, 129, 129, 129,
487 129, 129, 135, 135, 135, 135, 135, 135, 135, 135,
488 135, 141, 141, 141, 141, 141, 141, 141, 141, 141,
490 146, 198, 198, 198, 146, 146, 198, 146, 148, 198,
491 198, 198, 148, 148, 198, 148, 150, 198, 198, 198,
492 150, 150, 198, 150, 152, 198, 198, 198, 152, 152,
493 198, 152, 154, 198, 198, 198, 154, 154, 198, 154,
494 157, 198, 157, 158, 198, 158, 164, 198, 164, 171,
495 198, 171, 174, 198, 174, 175, 198, 198, 198, 175,
496 175, 198, 175, 177, 198, 177, 178, 198, 198, 198,
497 178, 178, 198, 178, 180, 198, 180, 181, 198, 181,
498 182, 198, 198, 198, 182, 182, 198, 182, 184, 198,
499 184, 185, 198, 185, 186, 198, 198, 198, 186, 186,
501 198, 186, 188, 188, 198, 188, 188, 188, 188, 188,
502 191, 191, 198, 191, 191, 191, 191, 191, 191, 194,
503 194, 198, 198, 194, 194, 194, 194, 194, 195, 198,
504 198, 195, 195, 195, 195, 195, 195, 165, 165, 172,
505 172, 51, 198, 198, 198, 198, 198, 198, 198, 198,
506 198, 198, 198, 198, 198, 198, 198, 198, 198, 198
509 static yyconst short int yy_chk[861] =
510 { 0,
511 0, 1, 1, 1, 49, 49, 0, 1, 50, 50,
512 197, 196, 192, 84, 93, 160, 1, 2, 2, 2,
513 84, 93, 160, 2, 162, 189, 173, 172, 168, 167,
514 169, 162, 2, 3, 3, 3, 167, 169, 166, 3,
515 165, 161, 3, 156, 144, 139, 136, 132, 3, 3,
516 4, 4, 4, 130, 127, 121, 4, 115, 109, 4,
517 106, 103, 85, 83, 81, 4, 4, 5, 5, 5,
518 73, 72, 69, 5, 67, 65, 5, 63, 61, 59,
519 56, 53, 5, 5, 6, 6, 6, 51, 0, 0,
520 6, 0, 0, 6, 0, 0, 0, 0, 0, 6,
522 6, 7, 7, 7, 0, 0, 0, 7, 0, 0,
523 7, 0, 0, 0, 0, 0, 7, 7, 8, 8,
524 8, 0, 0, 0, 8, 0, 0, 8, 0, 0,
525 0, 0, 0, 8, 8, 9, 9, 9, 0, 0,
526 0, 9, 0, 0, 9, 0, 0, 0, 0, 0,
527 9, 9, 10, 10, 10, 0, 0, 0, 10, 0,
528 0, 10, 0, 0, 0, 0, 0, 10, 10, 11,
529 11, 11, 0, 0, 0, 11, 0, 0, 11, 0,
530 0, 0, 0, 0, 11, 11, 12, 12, 12, 0,
531 0, 0, 12, 0, 0, 12, 0, 0, 0, 0,
533 0, 12, 12, 13, 13, 13, 13, 13, 13, 13,
534 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
535 13, 15, 0, 0, 0, 15, 15, 16, 0, 0,
536 0, 16, 16, 17, 17, 17, 17, 17, 17, 17,
537 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
538 17, 19, 19, 19, 0, 19, 19, 0, 19, 19,
539 0, 19, 19, 21, 0, 0, 0, 0, 21, 21,
540 21, 23, 23, 23, 0, 0, 0, 23, 0, 0,
541 23, 0, 0, 0, 0, 0, 23, 23, 24, 24,
542 24, 0, 0, 0, 24, 0, 0, 24, 0, 0,
544 0, 0, 0, 24, 24, 25, 25, 25, 25, 25,
545 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
546 25, 25, 25, 27, 27, 27, 0, 0, 0, 27,
547 0, 0, 27, 0, 0, 0, 0, 0, 27, 27,
548 28, 28, 28, 0, 0, 0, 28, 0, 0, 28,
549 0, 0, 0, 0, 0, 28, 28, 31, 0, 0,
550 0, 31, 31, 32, 0, 0, 0, 32, 32, 33,
551 0, 0, 0, 33, 33, 34, 0, 0, 0, 34,
552 34, 35, 35, 35, 0, 0, 0, 35, 0, 0,
553 35, 0, 0, 0, 0, 0, 35, 35, 36, 36,
555 36, 0, 0, 0, 36, 0, 0, 36, 0, 0,
556 0, 0, 0, 36, 36, 37, 0, 0, 0, 37,
557 37, 38, 0, 0, 0, 38, 38, 39, 0, 0,
558 0, 39, 39, 40, 0, 0, 0, 40, 40, 41,
559 41, 41, 0, 0, 0, 41, 0, 0, 41, 0,
560 0, 0, 0, 0, 41, 41, 42, 42, 42, 0,
561 0, 0, 42, 0, 0, 42, 0, 0, 0, 0,
562 0, 42, 42, 43, 43, 43, 0, 0, 0, 43,
563 0, 0, 0, 0, 0, 0, 0, 0, 43, 43,
564 44, 44, 44, 0, 0, 0, 44, 0, 0, 0,
566 0, 0, 0, 0, 0, 44, 44, 45, 45, 45,
567 0, 0, 0, 45, 0, 0, 0, 0, 0, 0,
568 0, 0, 45, 46, 46, 46, 0, 0, 0, 46,
569 0, 0, 0, 0, 0, 0, 0, 0, 46, 86,
570 0, 86, 0, 0, 0, 0, 0, 0, 86, 90,
571 90, 0, 0, 90, 0, 0, 0, 0, 0, 90,
572 90, 94, 0, 94, 0, 0, 0, 0, 0, 0,
573 94, 99, 99, 0, 0, 99, 0, 0, 0, 0,
574 0, 99, 99, 199, 199, 199, 199, 199, 199, 199,
575 199, 199, 200, 200, 200, 200, 200, 200, 200, 200,
577 200, 201, 201, 201, 201, 201, 201, 201, 201, 201,
578 202, 202, 202, 202, 202, 202, 202, 202, 202, 203,
579 203, 203, 203, 203, 203, 203, 203, 203, 204, 204,
580 204, 204, 204, 204, 204, 204, 204, 205, 205, 205,
581 205, 205, 205, 205, 205, 205, 206, 206, 206, 206,
582 206, 206, 206, 206, 206, 207, 207, 207, 207, 207,
583 207, 207, 207, 207, 208, 208, 208, 208, 208, 208,
584 208, 208, 208, 209, 209, 209, 209, 209, 209, 209,
585 209, 209, 210, 210, 210, 210, 210, 210, 210, 210,
586 210, 211, 211, 211, 211, 211, 211, 211, 211, 211,
588 212, 0, 0, 0, 212, 212, 0, 212, 213, 0,
589 0, 0, 213, 213, 0, 213, 214, 0, 0, 0,
590 214, 214, 0, 214, 215, 0, 0, 0, 215, 215,
591 0, 215, 216, 0, 0, 0, 216, 216, 0, 216,
592 217, 0, 217, 218, 0, 218, 219, 0, 219, 220,
593 0, 220, 221, 0, 221, 222, 0, 0, 0, 222,
594 222, 0, 222, 223, 0, 223, 224, 0, 0, 0,
595 224, 224, 0, 224, 225, 0, 225, 226, 0, 226,
596 227, 0, 0, 0, 227, 227, 0, 227, 228, 0,
597 228, 229, 0, 229, 230, 0, 0, 0, 230, 230,
599 0, 230, 231, 231, 0, 231, 231, 231, 231, 231,
600 232, 232, 0, 232, 232, 232, 232, 232, 232, 233,
601 233, 0, 0, 233, 233, 233, 233, 233, 234, 0,
602 0, 234, 234, 234, 234, 234, 234, 235, 235, 236,
603 236, 198, 198, 198, 198, 198, 198, 198, 198, 198,
604 198, 198, 198, 198, 198, 198, 198, 198, 198, 198
607 static yy_state_type yy_last_accepting_state;
608 static char *yy_last_accepting_cpos;
610 /* The intent behind this definition is that it'll catch
611 * any uses of REJECT which flex missed.
613 #define REJECT reject_used_but_not_detected
614 #define yymore() yymore_used_but_not_detected
615 #define YY_MORE_ADJ 0
616 #define YY_RESTORE_YY_MORE_OFFSET
617 char *yytext;
618 #line 1 "scan.l"
619 #define INITIAL 0
620 /******************************************************************************
622 KPP - The Kinetic PreProcessor
623 Builds simulation code for chemical kinetic systems
625 Copyright (C) 1995-1996 Valeriu Damian and Adrian Sandu
626 Copyright (C) 1997-2005 Adrian Sandu
628 KPP is free software; you can redistribute it and/or modify it under the
629 terms of the GNU General Public License as published by the Free Software
630 Foundation (http://www.gnu.org/copyleft/gpl.html); either version 2 of the
631 License, or (at your option) any later version.
633 KPP is distributed in the hope that it will be useful, but WITHOUT ANY
634 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
635 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
636 details.
638 You should have received a copy of the GNU General Public License along
639 with this program; if not, consult http://www.gnu.org/copyleft/gpl.html or
640 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
641 Boston, MA 02111-1307, USA.
643 Adrian Sandu
644 Computer Science Department
645 Virginia Polytechnic Institute and State University
646 Blacksburg, VA 24060
647 E-mail: sandu@cs.vt.edu
649 ******************************************************************************/
650 #define CMD_STATE 1
651 #define INC_STATE 2
652 #define MOD_STATE 3
653 #define INT_STATE 4
655 #define PRM_STATE 5
656 #define DSP_STATE 6
657 #define SSP_STATE 7
658 #define INI_STATE 8
659 #define EQN_STATE 9
660 #define EQNTAG_STATE 10
662 #define RATE_STATE 11
663 #define LMP_STATE 12
664 #define CR_IGNORE 13
665 #define SC_IGNORE 14
666 #define ATM_STATE 15
667 #define LKT_STATE 16
668 #define INL_STATE 17
670 #define MNI_STATE 18
671 #define TPT_STATE 19
672 #define USE_STATE 20
674 #define COMMENT 21
675 #define COMMENT2 22
676 #define EQN_ID 23
678 #define INL_CODE 24
680 #line 42 "scan.l"
681 #include "gdata.h"
682 #include "scan.h"
683 #include "y.tab.h"
685 void Include ( char * filename );
686 int EndInclude();
688 int crt_line_no = 1;
689 char *crt_filename;
691 #define MAX_INCLUDE 10
693 YY_BUFFER_STATE yy_buffers[ MAX_INCLUDE ];
694 int yy_line_no[ MAX_INCLUDE ];
695 char *yy_filename[ MAX_INCLUDE ];
696 int yy_buf_level = 0;
698 char crtToken[100];
699 char nextToken[100];
700 int crtTokType;
701 int nextTokType;
702 int crtLine;
703 char crtFile[100];
704 char crt_rate[100];
706 int oldnErr = 0;
708 int idx;
709 int oldstate;
710 extern int yyerrflag;
712 typedef struct {
713 char *name;
714 int next;
715 int cmd;
716 } KEYWORD;
718 KEYWORD keywords[] = { { "INCLUDE", INC_STATE, 0 },
719 { "MODEL", MOD_STATE, 0 },
720 { "INTEGRATOR", INT_STATE, 0 },
721 { "JACOBIAN", PRM_STATE, JACOBIAN },
722 { "HESSIAN", PRM_STATE, HESSIAN },
723 { "STOICMAT", PRM_STATE, STOICMAT },
724 { "STOCHASTIC", PRM_STATE, STOCHASTIC },
725 { "DOUBLE", PRM_STATE, DOUBLE },
726 { "REORDER", PRM_STATE, REORDER },
727 { "MEX", PRM_STATE, MEX },
728 { "DUMMYINDEX", PRM_STATE, DUMMYINDEX},
729 { "EQNTAGS", PRM_STATE, EQNTAGS},
730 { "FUNCTION", PRM_STATE, FUNCTION },
731 { "ATOMS", ATM_STATE, ATOMDECL },
732 { "CHECK", ATM_STATE, CHECK },
733 { "CHECKALL", INITIAL, CHECKALL },
734 { "DEFVAR", DSP_STATE, DEFVAR },
735 { "DEFRAD", DSP_STATE, DEFRAD },
736 { "DEFFIX", DSP_STATE, DEFFIX },
737 { "SETVAR", SSP_STATE, SETVAR },
738 { "SETRAD", SSP_STATE, SETRAD },
739 { "SETFIX", SSP_STATE, SETFIX },
740 { "INITVALUES", INI_STATE, INITVALUES },
741 { "EQUATIONS", EQN_STATE, EQUATIONS },
742 { "LUMP", LMP_STATE, LUMP },
743 { "LOOKAT", LKT_STATE, LOOKAT },
744 { "LOOKATALL", INITIAL, LOOKATALL },
745 { "TRANSPORT", TPT_STATE, TRANSPORT },
746 { "TRANSPORTALL", INITIAL, TRANSPORTALL },
747 { "INITIALIZE", PRM_STATE, INITIALIZE },
748 { "XGRID", PRM_STATE, XGRID },
749 { "YGRID", PRM_STATE, YGRID },
750 { "ZGRID", PRM_STATE, ZGRID },
751 { "MONITOR", MNI_STATE, MONITOR },
752 { "WRITE_ATM", INITIAL, WRITE_ATM },
753 { "WRITE_SPC", INITIAL, WRITE_SPC },
754 { "WRITE_MAT", INITIAL, WRITE_MAT },
755 { "WRITE_OPT", INITIAL, WRITE_OPT },
756 { "USE", PRM_STATE, USE },
757 { "LANGUAGE", PRM_STATE, LANGUAGE },
758 { "INLINE", INL_STATE, INLINE },
759 { "ENDINLINE", INITIAL, ENDINLINE },
760 { "INTFILE", PRM_STATE, INTFILE },
761 { "DRIVER", PRM_STATE, DRIVER },
762 { "RUN", PRM_STATE, RUN },
763 { "USES", USE_STATE, USES },
764 { "SPARSEDATA", PRM_STATE, SPARSEDATA },
765 { 0, 0, 0 }
768 int CheckKeyword( char *cmd );
770 #define RETURN( x ) \
771 if(1) { \
772 if ( yyerrflag == 0) { \
773 strcpy( crtToken, nextToken ); \
774 crtTokType = nextTokType; \
775 crtLine = crt_line_no; \
776 strcpy( crtFile, crt_filename ); \
778 strcpy( nextToken, yytext); \
779 nextTokType = x; \
780 return (x); \
782 #line 783 "lex.yy.c"
784 /* Macros after this point can all be overridden by user definitions in
785 * section 1.
788 #ifndef YY_SKIP_YYWRAP
789 #ifdef __cplusplus
790 extern "C" int yywrap YY_PROTO(( void ));
791 #else
792 extern int yywrap YY_PROTO(( void ));
793 #endif
794 #endif
796 #ifndef YY_NO_UNPUT
797 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
798 #endif
800 #ifndef yytext_ptr
801 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
802 #endif
804 #ifdef YY_NEED_STRLEN
805 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
806 #endif
808 #ifndef YY_NO_INPUT
809 #ifdef __cplusplus
810 static int yyinput YY_PROTO(( void ));
811 #else
812 static int input YY_PROTO(( void ));
813 #endif
814 #endif
816 #if YY_STACK_USED
817 static int yy_start_stack_ptr = 0;
818 static int yy_start_stack_depth = 0;
819 static int *yy_start_stack = 0;
820 #ifndef YY_NO_PUSH_STATE
821 static void yy_push_state YY_PROTO(( int new_state ));
822 #endif
823 #ifndef YY_NO_POP_STATE
824 static void yy_pop_state YY_PROTO(( void ));
825 #endif
826 #ifndef YY_NO_TOP_STATE
827 static int yy_top_state YY_PROTO(( void ));
828 #endif
830 #else
831 #define YY_NO_PUSH_STATE 1
832 #define YY_NO_POP_STATE 1
833 #define YY_NO_TOP_STATE 1
834 #endif
836 #ifdef YY_MALLOC_DECL
837 YY_MALLOC_DECL
838 #else
839 #if __STDC__
840 #ifndef __cplusplus
841 #include <stdlib.h>
842 #endif
843 #else
844 /* Just try to get by without declaring the routines. This will fail
845 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
846 * or sizeof(void*) != sizeof(int).
848 #endif
849 #endif
851 /* Amount of stuff to slurp up with each read. */
852 #ifndef YY_READ_BUF_SIZE
853 #define YY_READ_BUF_SIZE 8192
854 #endif
856 /* Copy whatever the last rule matched to the standard output. */
858 #ifndef ECHO
859 /* This used to be an fputs(), but since the string might contain NUL's,
860 * we now use fwrite().
862 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
863 #endif
865 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
866 * is returned in "result".
868 #ifndef YY_INPUT
869 #define YY_INPUT(buf,result,max_size) \
870 if ( yy_current_buffer->yy_is_interactive ) \
872 int c = '*', n; \
873 for ( n = 0; n < max_size && \
874 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
875 buf[n] = (char) c; \
876 if ( c == '\n' ) \
877 buf[n++] = (char) c; \
878 if ( c == EOF && ferror( yyin ) ) \
879 YY_FATAL_ERROR( "input in flex scanner failed" ); \
880 result = n; \
882 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
883 && ferror( yyin ) ) \
884 YY_FATAL_ERROR( "input in flex scanner failed" );
885 #endif
887 /* No semi-colon after return; correct usage is to write "yyterminate();" -
888 * we don't want an extra ';' after the "return" because that will cause
889 * some compilers to complain about unreachable statements.
891 #ifndef yyterminate
892 #define yyterminate() return YY_NULL
893 #endif
895 /* Number of entries by which start-condition stack grows. */
896 #ifndef YY_START_STACK_INCR
897 #define YY_START_STACK_INCR 25
898 #endif
900 /* Report a fatal error. */
901 #ifndef YY_FATAL_ERROR
902 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
903 #endif
905 /* Default declaration of generated scanner - a define so the user can
906 * easily add parameters.
908 #ifndef YY_DECL
909 #define YY_DECL int yylex YY_PROTO(( void ))
910 #endif
912 /* Code executed at the beginning of each rule, after yytext and yyleng
913 * have been set up.
915 #ifndef YY_USER_ACTION
916 #define YY_USER_ACTION
917 #endif
919 /* Code executed at the end of each rule. */
920 #ifndef YY_BREAK
921 #define YY_BREAK break;
922 #endif
924 #define YY_RULE_SETUP \
925 YY_USER_ACTION
927 YY_DECL
929 register yy_state_type yy_current_state;
930 register char *yy_cp, *yy_bp;
931 register int yy_act;
933 #line 164 "scan.l"
935 #line 936 "lex.yy.c"
937 if ( yy_init )
939 yy_init = 0;
941 #ifdef YY_USER_INIT
942 YY_USER_INIT;
943 #endif
945 if ( ! yy_start )
946 yy_start = 1; /* first start state */
948 if ( ! yyin )
949 yyin = stdin;
951 if ( ! yyout )
952 yyout = stdout;
954 if ( ! yy_current_buffer )
955 yy_current_buffer =
956 yy_create_buffer( yyin, YY_BUF_SIZE );
958 yy_load_buffer_state();
961 while ( 1 ) /* loops until end-of-file is reached */
963 yy_cp = yy_c_buf_p;
965 /* Support of yytext. */
966 *yy_cp = yy_hold_char;
968 /* yy_bp points to the position in yy_ch_buf of the start of
969 * the current run.
971 yy_bp = yy_cp;
973 yy_current_state = yy_start;
974 yy_match:
977 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
978 if ( yy_accept[yy_current_state] )
980 yy_last_accepting_state = yy_current_state;
981 yy_last_accepting_cpos = yy_cp;
983 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
985 yy_current_state = (int) yy_def[yy_current_state];
986 if ( yy_current_state >= 199 )
987 yy_c = yy_meta[(unsigned int) yy_c];
989 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
990 ++yy_cp;
992 while ( yy_base[yy_current_state] != 842 );
994 yy_find_action:
995 yy_act = yy_accept[yy_current_state];
996 if ( yy_act == 0 )
997 { /* have to back up */
998 yy_cp = yy_last_accepting_cpos;
999 yy_current_state = yy_last_accepting_state;
1000 yy_act = yy_accept[yy_current_state];
1003 YY_DO_BEFORE_ACTION;
1006 do_action: /* This label is used only to access EOF actions. */
1009 switch ( yy_act )
1010 { /* beginning of action switch */
1011 case 0: /* must back up */
1012 /* undo the effects of YY_DO_BEFORE_ACTION */
1013 *yy_cp = yy_hold_char;
1014 yy_cp = yy_last_accepting_cpos;
1015 yy_current_state = yy_last_accepting_state;
1016 goto yy_find_action;
1018 case 1:
1019 YY_RULE_SETUP
1020 #line 165 "scan.l"
1023 YY_BREAK
1024 case 2:
1025 YY_RULE_SETUP
1026 #line 167 "scan.l"
1027 { BEGIN CMD_STATE;
1029 YY_BREAK
1030 case 3:
1031 YY_RULE_SETUP
1032 #line 169 "scan.l"
1033 { oldstate = (yy_start - 1) / 2;
1034 BEGIN COMMENT;
1036 YY_BREAK
1037 case 4:
1038 YY_RULE_SETUP
1039 #line 172 "scan.l"
1040 { oldstate = (yy_start - 1) / 2;
1041 BEGIN COMMENT2;
1043 YY_BREAK
1044 case 5:
1045 YY_RULE_SETUP
1046 #line 175 "scan.l"
1049 YY_BREAK
1050 case 6:
1051 YY_RULE_SETUP
1052 #line 177 "scan.l"
1053 { BEGIN oldstate;
1055 YY_BREAK
1056 case 7:
1057 YY_RULE_SETUP
1058 #line 179 "scan.l"
1061 YY_BREAK
1062 case 8:
1063 YY_RULE_SETUP
1064 #line 181 "scan.l"
1065 { crt_line_no++;
1066 BEGIN oldstate;
1068 YY_BREAK
1069 case 9:
1070 YY_RULE_SETUP
1071 #line 184 "scan.l"
1072 { crt_line_no++;
1074 YY_BREAK
1075 case 10:
1076 YY_RULE_SETUP
1077 #line 186 "scan.l"
1078 { idx = CheckKeyword( yytext );
1079 if ( idx < 0 ) {
1080 BEGIN CR_IGNORE;
1081 break;
1083 BEGIN keywords[idx].next;
1084 if ( keywords[idx].cmd ) {
1085 crt_section = keywords[idx].cmd;
1086 RETURN( keywords[idx].cmd );
1089 YY_BREAK
1090 case 11:
1091 YY_RULE_SETUP
1092 #line 197 "scan.l"
1093 { Include( IncName(yytext) );
1094 BEGIN CR_IGNORE;
1096 YY_BREAK
1097 case 12:
1098 YY_RULE_SETUP
1099 #line 200 "scan.l"
1100 { Include( ModelName(yytext) );
1101 BEGIN CR_IGNORE;
1103 YY_BREAK
1104 case 13:
1105 YY_RULE_SETUP
1106 #line 203 "scan.l"
1107 { Include( IntegName(yytext) );
1108 BEGIN CR_IGNORE;
1110 YY_BREAK
1111 case 14:
1112 YY_RULE_SETUP
1113 #line 206 "scan.l"
1114 { strcpy( yylval.str, yytext );
1115 BEGIN CR_IGNORE;
1116 RETURN( PARAMETER );
1118 YY_BREAK
1119 case 15:
1120 YY_RULE_SETUP
1121 #line 210 "scan.l"
1122 { ScanError("Extra parameter on command line '%s'", yytext);
1124 YY_BREAK
1125 case 16:
1126 YY_RULE_SETUP
1127 #line 212 "scan.l"
1128 { strcpy( yylval.str, yytext );
1129 RETURN( ATOMID );
1131 YY_BREAK
1132 case 17:
1133 YY_RULE_SETUP
1134 #line 215 "scan.l"
1135 { RETURN( yytext[0] );
1137 YY_BREAK
1138 case 18:
1139 YY_RULE_SETUP
1140 #line 217 "scan.l"
1141 { strcpy( yylval.str, yytext );
1142 RETURN( SPCSPC );
1144 YY_BREAK
1145 case 19:
1146 YY_RULE_SETUP
1147 #line 220 "scan.l"
1148 { strcpy( yylval.str, yytext );
1149 RETURN( SPCNR );
1151 YY_BREAK
1152 case 20:
1153 YY_RULE_SETUP
1154 #line 223 "scan.l"
1155 { RETURN( SPCEQUAL );
1157 YY_BREAK
1158 case 21:
1159 YY_RULE_SETUP
1160 #line 225 "scan.l"
1161 { RETURN( SPCPLUS );
1163 YY_BREAK
1164 case 22:
1165 YY_RULE_SETUP
1166 #line 227 "scan.l"
1167 { RETURN( yytext[0] );
1169 YY_BREAK
1170 case 23:
1171 YY_RULE_SETUP
1172 #line 229 "scan.l"
1173 { ScanError("Invalid character '%c' in species definition", yytext[0] );
1175 YY_BREAK
1176 case 24:
1177 YY_RULE_SETUP
1178 #line 231 "scan.l"
1179 { strcpy( yylval.str, yytext );
1180 RETURN( SSPID );
1182 YY_BREAK
1183 case 25:
1184 YY_RULE_SETUP
1185 #line 234 "scan.l"
1186 { RETURN( yytext[0] );
1188 YY_BREAK
1189 case 26:
1190 YY_RULE_SETUP
1191 #line 236 "scan.l"
1192 { strcpy( yylval.str, yytext );
1193 RETURN( INISPC );
1195 YY_BREAK
1196 case 27:
1197 YY_RULE_SETUP
1198 #line 239 "scan.l"
1199 { RETURN( INIEQUAL );
1201 YY_BREAK
1202 case 28:
1203 YY_RULE_SETUP
1204 #line 241 "scan.l"
1205 { RETURN( yytext[0] );
1207 YY_BREAK
1208 case 29:
1209 YY_RULE_SETUP
1210 #line 243 "scan.l"
1211 { strcpy( yylval.str, yytext );
1212 RETURN( INIVALUE );
1214 YY_BREAK
1215 case 30:
1216 YY_RULE_SETUP
1217 #line 246 "scan.l"
1218 { ScanError("Invalid character '%c' in initial values", yytext[0] );
1220 YY_BREAK
1221 case 31:
1222 YY_RULE_SETUP
1223 #line 248 "scan.l"
1224 { strcpy( yylval.str, yytext );
1225 RETURN( EQNSPC );
1227 YY_BREAK
1228 case 32:
1229 YY_RULE_SETUP
1230 #line 251 "scan.l"
1231 { RETURN( EQNEQUAL );
1233 YY_BREAK
1234 case 33:
1235 YY_RULE_SETUP
1236 #line 253 "scan.l"
1237 { strcpy( yylval.str, yytext );
1238 RETURN( EQNCOEF );
1240 YY_BREAK
1241 case 34:
1242 YY_RULE_SETUP
1243 #line 256 "scan.l"
1244 { BEGIN RATE_STATE;
1245 *crt_rate = 0;
1246 RETURN( EQNCOLON );
1248 YY_BREAK
1249 case 35:
1250 YY_RULE_SETUP
1251 #line 260 "scan.l"
1252 { strcpy( yylval.str, yytext );
1253 RETURN( EQNSIGN );
1255 YY_BREAK
1256 case 36:
1257 YY_RULE_SETUP
1258 #line 263 "scan.l"
1259 { BEGIN EQNTAG_STATE;
1260 RETURN( EQNLESS );
1262 YY_BREAK
1263 case 37:
1264 YY_RULE_SETUP
1265 #line 266 "scan.l"
1266 { strcpy( yylval.str, yytext );
1267 RETURN( EQNTAG );
1269 YY_BREAK
1270 case 38:
1271 YY_RULE_SETUP
1272 #line 269 "scan.l"
1273 { BEGIN EQN_STATE;
1274 RETURN( EQNGREATER );
1276 YY_BREAK
1277 case 39:
1278 YY_RULE_SETUP
1279 #line 272 "scan.l"
1280 { strcpy( yylval.str, yytext );
1281 RETURN( RATE );
1283 YY_BREAK
1284 case 40:
1285 YY_RULE_SETUP
1286 #line 275 "scan.l"
1287 { BEGIN EQN_STATE;
1288 RETURN( yytext[0] );
1290 YY_BREAK
1291 case 41:
1292 YY_RULE_SETUP
1293 #line 278 "scan.l"
1294 { strcpy( yylval.str, yytext );
1295 RETURN( LMPSPC );
1297 YY_BREAK
1298 case 42:
1299 YY_RULE_SETUP
1300 #line 281 "scan.l"
1301 { RETURN( LMPPLUS );
1303 YY_BREAK
1304 case 43:
1305 YY_RULE_SETUP
1306 #line 283 "scan.l"
1307 { RETURN( LMPCOLON );
1309 YY_BREAK
1310 case 44:
1311 YY_RULE_SETUP
1312 #line 285 "scan.l"
1313 { RETURN( yytext[0] );
1315 YY_BREAK
1316 case 45:
1317 YY_RULE_SETUP
1318 #line 287 "scan.l"
1319 { ScanError("Invalid character '%c' in species definition", yytext[0] );
1321 YY_BREAK
1322 case 46:
1323 YY_RULE_SETUP
1324 #line 289 "scan.l"
1325 { strcpy( yylval.str, yytext );
1326 RETURN( LKTID );
1328 YY_BREAK
1329 case 47:
1330 YY_RULE_SETUP
1331 #line 292 "scan.l"
1332 { RETURN( yytext[0] );
1334 YY_BREAK
1335 case 48:
1336 YY_RULE_SETUP
1337 #line 294 "scan.l"
1338 { strcpy( yylval.str, yytext );
1339 RETURN( TPTID );
1341 YY_BREAK
1342 case 49:
1343 YY_RULE_SETUP
1344 #line 297 "scan.l"
1345 { RETURN( yytext[0] );
1347 YY_BREAK
1348 case 50:
1349 YY_RULE_SETUP
1350 #line 299 "scan.l"
1351 { strcpy( yylval.str, yytext );
1352 RETURN( USEID );
1354 YY_BREAK
1355 case 51:
1356 YY_RULE_SETUP
1357 #line 302 "scan.l"
1358 { RETURN( yytext[0] );
1360 YY_BREAK
1361 case 52:
1362 YY_RULE_SETUP
1363 #line 304 "scan.l"
1364 { strcpy( yylval.str, yytext );
1365 RETURN( MNIID );
1367 YY_BREAK
1368 case 53:
1369 YY_RULE_SETUP
1370 #line 307 "scan.l"
1371 { RETURN( yytext[0] );
1373 YY_BREAK
1374 case 54:
1375 YY_RULE_SETUP
1376 #line 309 "scan.l"
1377 { strcpy( yylval.str, yytext );
1378 BEGIN INL_CODE;
1379 RETURN( INLCTX );
1381 YY_BREAK
1382 case 55:
1383 YY_RULE_SETUP
1384 #line 313 "scan.l"
1385 { if ( EqNoCase( yytext+1, "ENDINLINE" ) ){
1386 BEGIN INITIAL;
1387 RETURN( ENDINLINE );
1389 else {
1390 strcpy( yylval.str, yytext );
1391 RETURN( INCODE );
1394 YY_BREAK
1395 case 56:
1396 YY_RULE_SETUP
1397 #line 322 "scan.l"
1398 { crt_line_no++;
1399 strcpy( yylval.str,yytext );
1400 RETURN( INCODE );
1402 YY_BREAK
1403 case 57:
1404 YY_RULE_SETUP
1405 #line 326 "scan.l"
1406 { strcpy( yylval.str,yytext );
1407 RETURN( INCODE );
1409 YY_BREAK
1410 case YY_STATE_EOF(INITIAL):
1411 case YY_STATE_EOF(CMD_STATE):
1412 case YY_STATE_EOF(INC_STATE):
1413 case YY_STATE_EOF(MOD_STATE):
1414 case YY_STATE_EOF(INT_STATE):
1415 case YY_STATE_EOF(PRM_STATE):
1416 case YY_STATE_EOF(DSP_STATE):
1417 case YY_STATE_EOF(SSP_STATE):
1418 case YY_STATE_EOF(INI_STATE):
1419 case YY_STATE_EOF(EQN_STATE):
1420 case YY_STATE_EOF(EQNTAG_STATE):
1421 case YY_STATE_EOF(RATE_STATE):
1422 case YY_STATE_EOF(LMP_STATE):
1423 case YY_STATE_EOF(CR_IGNORE):
1424 case YY_STATE_EOF(SC_IGNORE):
1425 case YY_STATE_EOF(ATM_STATE):
1426 case YY_STATE_EOF(LKT_STATE):
1427 case YY_STATE_EOF(INL_STATE):
1428 case YY_STATE_EOF(MNI_STATE):
1429 case YY_STATE_EOF(TPT_STATE):
1430 case YY_STATE_EOF(USE_STATE):
1431 case YY_STATE_EOF(COMMENT):
1432 case YY_STATE_EOF(COMMENT2):
1433 case YY_STATE_EOF(EQN_ID):
1434 case YY_STATE_EOF(INL_CODE):
1435 #line 329 "scan.l"
1436 { if ( ! EndInclude() ) {
1437 RETURN( INITIAL );
1440 YY_BREAK
1441 case 58:
1442 YY_RULE_SETUP
1443 #line 333 "scan.l"
1444 ECHO;
1445 YY_BREAK
1446 #line 1447 "lex.yy.c"
1448 case YY_END_OF_BUFFER:
1450 /* Amount of text matched not including the EOB char. */
1451 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1453 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1454 *yy_cp = yy_hold_char;
1455 YY_RESTORE_YY_MORE_OFFSET
1457 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1459 /* We're scanning a new file or input source. It's
1460 * possible that this happened because the user
1461 * just pointed yyin at a new source and called
1462 * yylex(). If so, then we have to assure
1463 * consistency between yy_current_buffer and our
1464 * globals. Here is the right place to do so, because
1465 * this is the first action (other than possibly a
1466 * back-up) that will match for the new input source.
1468 yy_n_chars = yy_current_buffer->yy_n_chars;
1469 yy_current_buffer->yy_input_file = yyin;
1470 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1473 /* Note that here we test for yy_c_buf_p "<=" to the position
1474 * of the first EOB in the buffer, since yy_c_buf_p will
1475 * already have been incremented past the NUL character
1476 * (since all states make transitions on EOB to the
1477 * end-of-buffer state). Contrast this with the test
1478 * in input().
1480 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1481 { /* This was really a NUL. */
1482 yy_state_type yy_next_state;
1484 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1486 yy_current_state = yy_get_previous_state();
1488 /* Okay, we're now positioned to make the NUL
1489 * transition. We couldn't have
1490 * yy_get_previous_state() go ahead and do it
1491 * for us because it doesn't know how to deal
1492 * with the possibility of jamming (and we don't
1493 * want to build jamming into it because then it
1494 * will run more slowly).
1497 yy_next_state = yy_try_NUL_trans( yy_current_state );
1499 yy_bp = yytext_ptr + YY_MORE_ADJ;
1501 if ( yy_next_state )
1503 /* Consume the NUL. */
1504 yy_cp = ++yy_c_buf_p;
1505 yy_current_state = yy_next_state;
1506 goto yy_match;
1509 else
1511 yy_cp = yy_c_buf_p;
1512 goto yy_find_action;
1516 else switch ( yy_get_next_buffer() )
1518 case EOB_ACT_END_OF_FILE:
1520 yy_did_buffer_switch_on_eof = 0;
1522 if ( yywrap() )
1524 /* Note: because we've taken care in
1525 * yy_get_next_buffer() to have set up
1526 * yytext, we can now set up
1527 * yy_c_buf_p so that if some total
1528 * hoser (like flex itself) wants to
1529 * call the scanner after we return the
1530 * YY_NULL, it'll still work - another
1531 * YY_NULL will get returned.
1533 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1535 yy_act = YY_STATE_EOF(YY_START);
1536 goto do_action;
1539 else
1541 if ( ! yy_did_buffer_switch_on_eof )
1542 YY_NEW_FILE;
1544 break;
1547 case EOB_ACT_CONTINUE_SCAN:
1548 yy_c_buf_p =
1549 yytext_ptr + yy_amount_of_matched_text;
1551 yy_current_state = yy_get_previous_state();
1553 yy_cp = yy_c_buf_p;
1554 yy_bp = yytext_ptr + YY_MORE_ADJ;
1555 goto yy_match;
1557 case EOB_ACT_LAST_MATCH:
1558 yy_c_buf_p =
1559 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1561 yy_current_state = yy_get_previous_state();
1563 yy_cp = yy_c_buf_p;
1564 yy_bp = yytext_ptr + YY_MORE_ADJ;
1565 goto yy_find_action;
1567 break;
1570 default:
1571 YY_FATAL_ERROR(
1572 "fatal flex scanner internal error--no action found" );
1573 } /* end of action switch */
1574 } /* end of scanning one token */
1575 } /* end of yylex */
1578 /* yy_get_next_buffer - try to read in a new buffer
1580 * Returns a code representing an action:
1581 * EOB_ACT_LAST_MATCH -
1582 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1583 * EOB_ACT_END_OF_FILE - end of file
1586 static int yy_get_next_buffer()
1588 register char *dest = yy_current_buffer->yy_ch_buf;
1589 register char *source = yytext_ptr;
1590 register int number_to_move, i;
1591 int ret_val;
1593 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1594 YY_FATAL_ERROR(
1595 "fatal flex scanner internal error--end of buffer missed" );
1597 if ( yy_current_buffer->yy_fill_buffer == 0 )
1598 { /* Don't try to fill the buffer, so this is an EOF. */
1599 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1601 /* We matched a single character, the EOB, so
1602 * treat this as a final EOF.
1604 return EOB_ACT_END_OF_FILE;
1607 else
1609 /* We matched some text prior to the EOB, first
1610 * process it.
1612 return EOB_ACT_LAST_MATCH;
1616 /* Try to read more data. */
1618 /* First move last chars to start of buffer. */
1619 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1621 for ( i = 0; i < number_to_move; ++i )
1622 *(dest++) = *(source++);
1624 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1625 /* don't do the read, it's not guaranteed to return an EOF,
1626 * just force an EOF
1628 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1630 else
1632 int num_to_read =
1633 yy_current_buffer->yy_buf_size - number_to_move - 1;
1635 while ( num_to_read <= 0 )
1636 { /* Not enough room in the buffer - grow it. */
1637 #ifdef YY_USES_REJECT
1638 YY_FATAL_ERROR(
1639 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1640 #else
1642 /* just a shorter name for the current buffer */
1643 YY_BUFFER_STATE b = yy_current_buffer;
1645 int yy_c_buf_p_offset =
1646 (int) (yy_c_buf_p - b->yy_ch_buf);
1648 if ( b->yy_is_our_buffer )
1650 int new_size = b->yy_buf_size * 2;
1652 if ( new_size <= 0 )
1653 b->yy_buf_size += b->yy_buf_size / 8;
1654 else
1655 b->yy_buf_size *= 2;
1657 b->yy_ch_buf = (char *)
1658 /* Include room in for 2 EOB chars. */
1659 yy_flex_realloc( (void *) b->yy_ch_buf,
1660 b->yy_buf_size + 2 );
1662 else
1663 /* Can't grow it, we don't own it. */
1664 b->yy_ch_buf = 0;
1666 if ( ! b->yy_ch_buf )
1667 YY_FATAL_ERROR(
1668 "fatal error - scanner input buffer overflow" );
1670 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1672 num_to_read = yy_current_buffer->yy_buf_size -
1673 number_to_move - 1;
1674 #endif
1677 if ( num_to_read > YY_READ_BUF_SIZE )
1678 num_to_read = YY_READ_BUF_SIZE;
1680 /* Read in more data. */
1681 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1682 yy_n_chars, num_to_read );
1684 yy_current_buffer->yy_n_chars = yy_n_chars;
1687 if ( yy_n_chars == 0 )
1689 if ( number_to_move == YY_MORE_ADJ )
1691 ret_val = EOB_ACT_END_OF_FILE;
1692 yyrestart( yyin );
1695 else
1697 ret_val = EOB_ACT_LAST_MATCH;
1698 yy_current_buffer->yy_buffer_status =
1699 YY_BUFFER_EOF_PENDING;
1703 else
1704 ret_val = EOB_ACT_CONTINUE_SCAN;
1706 yy_n_chars += number_to_move;
1707 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1708 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1710 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1712 return ret_val;
1716 /* yy_get_previous_state - get the state just before the EOB char was reached */
1718 static yy_state_type yy_get_previous_state()
1720 register yy_state_type yy_current_state;
1721 register char *yy_cp;
1723 yy_current_state = yy_start;
1725 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1727 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1728 if ( yy_accept[yy_current_state] )
1730 yy_last_accepting_state = yy_current_state;
1731 yy_last_accepting_cpos = yy_cp;
1733 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1735 yy_current_state = (int) yy_def[yy_current_state];
1736 if ( yy_current_state >= 199 )
1737 yy_c = yy_meta[(unsigned int) yy_c];
1739 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1742 return yy_current_state;
1746 /* yy_try_NUL_trans - try to make a transition on the NUL character
1748 * synopsis
1749 * next_state = yy_try_NUL_trans( current_state );
1752 #ifdef YY_USE_PROTOS
1753 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1754 #else
1755 static yy_state_type yy_try_NUL_trans( yy_current_state )
1756 yy_state_type yy_current_state;
1757 #endif
1759 register int yy_is_jam;
1760 register char *yy_cp = yy_c_buf_p;
1762 register YY_CHAR yy_c = 1;
1763 if ( yy_accept[yy_current_state] )
1765 yy_last_accepting_state = yy_current_state;
1766 yy_last_accepting_cpos = yy_cp;
1768 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1770 yy_current_state = (int) yy_def[yy_current_state];
1771 if ( yy_current_state >= 199 )
1772 yy_c = yy_meta[(unsigned int) yy_c];
1774 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1775 yy_is_jam = (yy_current_state == 198);
1777 return yy_is_jam ? 0 : yy_current_state;
1781 #ifndef YY_NO_UNPUT
1782 #ifdef YY_USE_PROTOS
1783 static void yyunput( int c, register char *yy_bp )
1784 #else
1785 static void yyunput( c, yy_bp )
1786 int c;
1787 register char *yy_bp;
1788 #endif
1790 register char *yy_cp = yy_c_buf_p;
1792 /* undo effects of setting up yytext */
1793 *yy_cp = yy_hold_char;
1795 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1796 { /* need to shift things up to make room */
1797 /* +2 for EOB chars. */
1798 register int number_to_move = yy_n_chars + 2;
1799 register char *dest = &yy_current_buffer->yy_ch_buf[
1800 yy_current_buffer->yy_buf_size + 2];
1801 register char *source =
1802 &yy_current_buffer->yy_ch_buf[number_to_move];
1804 while ( source > yy_current_buffer->yy_ch_buf )
1805 *--dest = *--source;
1807 yy_cp += (int) (dest - source);
1808 yy_bp += (int) (dest - source);
1809 yy_current_buffer->yy_n_chars =
1810 yy_n_chars = yy_current_buffer->yy_buf_size;
1812 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1813 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1816 *--yy_cp = (char) c;
1819 yytext_ptr = yy_bp;
1820 yy_hold_char = *yy_cp;
1821 yy_c_buf_p = yy_cp;
1823 #endif /* ifndef YY_NO_UNPUT */
1826 #ifdef __cplusplus
1827 static int yyinput()
1828 #else
1829 static int input()
1830 #endif
1832 int c;
1834 *yy_c_buf_p = yy_hold_char;
1836 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1838 /* yy_c_buf_p now points to the character we want to return.
1839 * If this occurs *before* the EOB characters, then it's a
1840 * valid NUL; if not, then we've hit the end of the buffer.
1842 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1843 /* This was really a NUL. */
1844 *yy_c_buf_p = '\0';
1846 else
1847 { /* need more input */
1848 int offset = yy_c_buf_p - yytext_ptr;
1849 ++yy_c_buf_p;
1851 switch ( yy_get_next_buffer() )
1853 case EOB_ACT_LAST_MATCH:
1854 /* This happens because yy_g_n_b()
1855 * sees that we've accumulated a
1856 * token and flags that we need to
1857 * try matching the token before
1858 * proceeding. But for input(),
1859 * there's no matching to consider.
1860 * So convert the EOB_ACT_LAST_MATCH
1861 * to EOB_ACT_END_OF_FILE.
1864 /* Reset buffer status. */
1865 yyrestart( yyin );
1867 /* fall through */
1869 case EOB_ACT_END_OF_FILE:
1871 if ( yywrap() )
1872 return EOF;
1874 if ( ! yy_did_buffer_switch_on_eof )
1875 YY_NEW_FILE;
1876 #ifdef __cplusplus
1877 return yyinput();
1878 #else
1879 return input();
1880 #endif
1883 case EOB_ACT_CONTINUE_SCAN:
1884 yy_c_buf_p = yytext_ptr + offset;
1885 break;
1890 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1891 *yy_c_buf_p = '\0'; /* preserve yytext */
1892 yy_hold_char = *++yy_c_buf_p;
1895 return c;
1899 #ifdef YY_USE_PROTOS
1900 void yyrestart( FILE *input_file )
1901 #else
1902 void yyrestart( input_file )
1903 FILE *input_file;
1904 #endif
1906 if ( ! yy_current_buffer )
1907 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1909 yy_init_buffer( yy_current_buffer, input_file );
1910 yy_load_buffer_state();
1914 #ifdef YY_USE_PROTOS
1915 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1916 #else
1917 void yy_switch_to_buffer( new_buffer )
1918 YY_BUFFER_STATE new_buffer;
1919 #endif
1921 if ( yy_current_buffer == new_buffer )
1922 return;
1924 if ( yy_current_buffer )
1926 /* Flush out information for old buffer. */
1927 *yy_c_buf_p = yy_hold_char;
1928 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1929 yy_current_buffer->yy_n_chars = yy_n_chars;
1932 yy_current_buffer = new_buffer;
1933 yy_load_buffer_state();
1935 /* We don't actually know whether we did this switch during
1936 * EOF (yywrap()) processing, but the only time this flag
1937 * is looked at is after yywrap() is called, so it's safe
1938 * to go ahead and always set it.
1940 yy_did_buffer_switch_on_eof = 1;
1944 #ifdef YY_USE_PROTOS
1945 void yy_load_buffer_state( void )
1946 #else
1947 void yy_load_buffer_state()
1948 #endif
1950 yy_n_chars = yy_current_buffer->yy_n_chars;
1951 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1952 yyin = yy_current_buffer->yy_input_file;
1953 yy_hold_char = *yy_c_buf_p;
1957 #ifdef YY_USE_PROTOS
1958 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1959 #else
1960 YY_BUFFER_STATE yy_create_buffer( file, size )
1961 FILE *file;
1962 int size;
1963 #endif
1965 YY_BUFFER_STATE b;
1967 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1968 if ( ! b )
1969 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1971 b->yy_buf_size = size;
1973 /* yy_ch_buf has to be 2 characters longer than the size given because
1974 * we need to put in 2 end-of-buffer characters.
1976 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1977 if ( ! b->yy_ch_buf )
1978 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1980 b->yy_is_our_buffer = 1;
1982 yy_init_buffer( b, file );
1984 return b;
1988 #ifdef YY_USE_PROTOS
1989 void yy_delete_buffer( YY_BUFFER_STATE b )
1990 #else
1991 void yy_delete_buffer( b )
1992 YY_BUFFER_STATE b;
1993 #endif
1995 if ( ! b )
1996 return;
1998 if ( b == yy_current_buffer )
1999 yy_current_buffer = (YY_BUFFER_STATE) 0;
2001 if ( b->yy_is_our_buffer )
2002 yy_flex_free( (void *) b->yy_ch_buf );
2004 yy_flex_free( (void *) b );
2008 #ifndef YY_ALWAYS_INTERACTIVE
2009 #ifndef YY_NEVER_INTERACTIVE
2010 extern int isatty YY_PROTO(( int ));
2011 #endif
2012 #endif
2014 #ifdef YY_USE_PROTOS
2015 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
2016 #else
2017 void yy_init_buffer( b, file )
2018 YY_BUFFER_STATE b;
2019 FILE *file;
2020 #endif
2024 yy_flush_buffer( b );
2026 b->yy_input_file = file;
2027 b->yy_fill_buffer = 1;
2029 #if YY_ALWAYS_INTERACTIVE
2030 b->yy_is_interactive = 1;
2031 #else
2032 #if YY_NEVER_INTERACTIVE
2033 b->yy_is_interactive = 0;
2034 #else
2035 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2036 #endif
2037 #endif
2041 #ifdef YY_USE_PROTOS
2042 void yy_flush_buffer( YY_BUFFER_STATE b )
2043 #else
2044 void yy_flush_buffer( b )
2045 YY_BUFFER_STATE b;
2046 #endif
2049 if ( ! b )
2050 return;
2052 b->yy_n_chars = 0;
2054 /* We always need two end-of-buffer characters. The first causes
2055 * a transition to the end-of-buffer state. The second causes
2056 * a jam in that state.
2058 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2059 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2061 b->yy_buf_pos = &b->yy_ch_buf[0];
2063 b->yy_at_bol = 1;
2064 b->yy_buffer_status = YY_BUFFER_NEW;
2066 if ( b == yy_current_buffer )
2067 yy_load_buffer_state();
2071 #ifndef YY_NO_SCAN_BUFFER
2072 #ifdef YY_USE_PROTOS
2073 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
2074 #else
2075 YY_BUFFER_STATE yy_scan_buffer( base, size )
2076 char *base;
2077 yy_size_t size;
2078 #endif
2080 YY_BUFFER_STATE b;
2082 if ( size < 2 ||
2083 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2084 base[size-1] != YY_END_OF_BUFFER_CHAR )
2085 /* They forgot to leave room for the EOB's. */
2086 return 0;
2088 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2089 if ( ! b )
2090 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2092 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2093 b->yy_buf_pos = b->yy_ch_buf = base;
2094 b->yy_is_our_buffer = 0;
2095 b->yy_input_file = 0;
2096 b->yy_n_chars = b->yy_buf_size;
2097 b->yy_is_interactive = 0;
2098 b->yy_at_bol = 1;
2099 b->yy_fill_buffer = 0;
2100 b->yy_buffer_status = YY_BUFFER_NEW;
2102 yy_switch_to_buffer( b );
2104 return b;
2106 #endif
2109 #ifndef YY_NO_SCAN_STRING
2110 #ifdef YY_USE_PROTOS
2111 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
2112 #else
2113 YY_BUFFER_STATE yy_scan_string( yy_str )
2114 yyconst char *yy_str;
2115 #endif
2117 int len;
2118 for ( len = 0; yy_str[len]; ++len )
2121 return yy_scan_bytes( yy_str, len );
2123 #endif
2126 #ifndef YY_NO_SCAN_BYTES
2127 #ifdef YY_USE_PROTOS
2128 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
2129 #else
2130 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
2131 yyconst char *bytes;
2132 int len;
2133 #endif
2135 YY_BUFFER_STATE b;
2136 char *buf;
2137 yy_size_t n;
2138 int i;
2140 /* Get memory for full buffer, including space for trailing EOB's. */
2141 n = len + 2;
2142 buf = (char *) yy_flex_alloc( n );
2143 if ( ! buf )
2144 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2146 for ( i = 0; i < len; ++i )
2147 buf[i] = bytes[i];
2149 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
2151 b = yy_scan_buffer( buf, n );
2152 if ( ! b )
2153 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2155 /* It's okay to grow etc. this buffer, and we should throw it
2156 * away when we're done.
2158 b->yy_is_our_buffer = 1;
2160 return b;
2162 #endif
2165 #ifndef YY_NO_PUSH_STATE
2166 #ifdef YY_USE_PROTOS
2167 static void yy_push_state( int new_state )
2168 #else
2169 static void yy_push_state( new_state )
2170 int new_state;
2171 #endif
2173 if ( yy_start_stack_ptr >= yy_start_stack_depth )
2175 yy_size_t new_size;
2177 yy_start_stack_depth += YY_START_STACK_INCR;
2178 new_size = yy_start_stack_depth * sizeof( int );
2180 if ( ! yy_start_stack )
2181 yy_start_stack = (int *) yy_flex_alloc( new_size );
2183 else
2184 yy_start_stack = (int *) yy_flex_realloc(
2185 (void *) yy_start_stack, new_size );
2187 if ( ! yy_start_stack )
2188 YY_FATAL_ERROR(
2189 "out of memory expanding start-condition stack" );
2192 yy_start_stack[yy_start_stack_ptr++] = YY_START;
2194 BEGIN(new_state);
2196 #endif
2199 #ifndef YY_NO_POP_STATE
2200 static void yy_pop_state()
2202 if ( --yy_start_stack_ptr < 0 )
2203 YY_FATAL_ERROR( "start-condition stack underflow" );
2205 BEGIN(yy_start_stack[yy_start_stack_ptr]);
2207 #endif
2210 #ifndef YY_NO_TOP_STATE
2211 static int yy_top_state()
2213 return yy_start_stack[yy_start_stack_ptr - 1];
2215 #endif
2217 #ifndef YY_EXIT_FAILURE
2218 #define YY_EXIT_FAILURE 2
2219 #endif
2221 #ifdef YY_USE_PROTOS
2222 static void yy_fatal_error( yyconst char msg[] )
2223 #else
2224 static void yy_fatal_error( msg )
2225 char msg[];
2226 #endif
2228 (void) fprintf( stderr, "%s\n", msg );
2229 exit( YY_EXIT_FAILURE );
2234 /* Redefine yyless() so it works in section 3 code. */
2236 #undef yyless
2237 #define yyless(n) \
2238 do \
2240 /* Undo effects of setting up yytext. */ \
2241 yytext[yyleng] = yy_hold_char; \
2242 yy_c_buf_p = yytext + n; \
2243 yy_hold_char = *yy_c_buf_p; \
2244 *yy_c_buf_p = '\0'; \
2245 yyleng = n; \
2247 while ( 0 )
2250 /* Internal utility routines. */
2252 #ifndef yytext_ptr
2253 #ifdef YY_USE_PROTOS
2254 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
2255 #else
2256 static void yy_flex_strncpy( s1, s2, n )
2257 char *s1;
2258 yyconst char *s2;
2259 int n;
2260 #endif
2262 register int i;
2263 for ( i = 0; i < n; ++i )
2264 s1[i] = s2[i];
2266 #endif
2268 #ifdef YY_NEED_STRLEN
2269 #ifdef YY_USE_PROTOS
2270 static int yy_flex_strlen( yyconst char *s )
2271 #else
2272 static int yy_flex_strlen( s )
2273 yyconst char *s;
2274 #endif
2276 register int n;
2277 for ( n = 0; s[n]; ++n )
2280 return n;
2282 #endif
2285 #ifdef YY_USE_PROTOS
2286 static void *yy_flex_alloc( yy_size_t size )
2287 #else
2288 static void *yy_flex_alloc( size )
2289 yy_size_t size;
2290 #endif
2292 return (void *) malloc( size );
2295 #ifdef YY_USE_PROTOS
2296 static void *yy_flex_realloc( void *ptr, yy_size_t size )
2297 #else
2298 static void *yy_flex_realloc( ptr, size )
2299 void *ptr;
2300 yy_size_t size;
2301 #endif
2303 /* The cast to (char *) in the following accommodates both
2304 * implementations that use char* generic pointers, and those
2305 * that use void* generic pointers. It works with the latter
2306 * because both ANSI C and C++ allow castless assignment from
2307 * any pointer type to void*, and deal with argument conversions
2308 * as though doing an assignment.
2310 return (void *) realloc( (char *) ptr, size );
2313 #ifdef YY_USE_PROTOS
2314 static void yy_flex_free( void *ptr )
2315 #else
2316 static void yy_flex_free( ptr )
2317 void *ptr;
2318 #endif
2320 free( ptr );
2323 #if YY_MAIN
2324 int main()
2326 yylex();
2327 return 0;
2329 #endif
2330 #line 333 "scan.l"
2333 void Include ( char * name )
2335 FILE *f;
2336 YY_BUFFER_STATE newb;
2338 if ( yy_buf_level == MAX_INCLUDE ) {
2339 printf("\nInclude nested too deep. Include %s ignored", name);
2340 return;
2343 yy_buffers[ yy_buf_level ] = yy_current_buffer;
2344 yy_line_no[ yy_buf_level ] = crt_line_no;
2345 yy_filename[ yy_buf_level ] = crt_filename;
2346 yy_buf_level++;
2348 crt_line_no = 1;
2350 crt_filename = malloc( 1 + strlen( name ) );
2351 strcpy( crt_filename, name );
2354 f = fopen( name, "r" );
2355 if( f == 0 )
2356 FatalError(3,"%s: Can't read file", name );
2358 newb = yy_create_buffer(f, YY_BUF_SIZE);
2359 yy_switch_to_buffer( newb );
2362 int EndInclude()
2364 YY_BUFFER_STATE oldb;
2365 char * oldn;
2367 if ( yy_buf_level > 0 ) {
2368 oldb = yy_current_buffer;
2369 oldn = crt_filename;
2370 yy_buf_level--;
2371 yy_switch_to_buffer( yy_buffers[yy_buf_level] );
2372 crt_line_no = yy_line_no[ yy_buf_level ];
2373 crt_filename = yy_filename[ yy_buf_level ];
2374 yy_delete_buffer( oldb );
2375 free( oldn );
2376 return 1;
2378 return 0;
2381 int EqNoCase( char *s1, char *s2 )
2383 while( *s1 ) {
2384 if ( toupper(*s1++) != toupper(*s2++) ) return 0;
2386 return *s1 == *s2;
2389 int CheckKeyword( char *cmd )
2391 int i;
2393 i = 0;
2394 while( 1 ) {
2395 if( keywords[i].name == 0 ) {
2396 ScanError( "'%s': Unknown command (ignored)", cmd);
2397 return -1;
2399 if( EqNoCase( cmd, keywords[i].name ) ) {
2400 return i;
2402 i++;