added README_changes.txt
[wrffire.git] / wrfv2_fire / chem / KPP / kpp / kpp-2.1 / src / lex.yy.c
blob167ceea1ca0a1c6980659a92cedbeb4beaf7a692
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 { "WRFCONFORM", INITIAL, WRFCONFORM },
766 { 0, 0, 0 }
769 int CheckKeyword( char *cmd );
771 #define RETURN( x ) \
772 if(1) { \
773 if ( yyerrflag == 0) { \
774 strcpy( crtToken, nextToken ); \
775 crtTokType = nextTokType; \
776 crtLine = crt_line_no; \
777 strcpy( crtFile, crt_filename ); \
779 strcpy( nextToken, yytext); \
780 nextTokType = x; \
781 return (x); \
783 #line 784 "lex.yy.c"
785 /* Macros after this point can all be overridden by user definitions in
786 * section 1.
789 #ifndef YY_SKIP_YYWRAP
790 #ifdef __cplusplus
791 extern "C" int yywrap YY_PROTO(( void ));
792 #else
793 extern int yywrap YY_PROTO(( void ));
794 #endif
795 #endif
797 #ifndef YY_NO_UNPUT
798 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
799 #endif
801 #ifndef yytext_ptr
802 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
803 #endif
805 #ifdef YY_NEED_STRLEN
806 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
807 #endif
809 #ifndef YY_NO_INPUT
810 #ifdef __cplusplus
811 static int yyinput YY_PROTO(( void ));
812 #else
813 static int input YY_PROTO(( void ));
814 #endif
815 #endif
817 #if YY_STACK_USED
818 static int yy_start_stack_ptr = 0;
819 static int yy_start_stack_depth = 0;
820 static int *yy_start_stack = 0;
821 #ifndef YY_NO_PUSH_STATE
822 static void yy_push_state YY_PROTO(( int new_state ));
823 #endif
824 #ifndef YY_NO_POP_STATE
825 static void yy_pop_state YY_PROTO(( void ));
826 #endif
827 #ifndef YY_NO_TOP_STATE
828 static int yy_top_state YY_PROTO(( void ));
829 #endif
831 #else
832 #define YY_NO_PUSH_STATE 1
833 #define YY_NO_POP_STATE 1
834 #define YY_NO_TOP_STATE 1
835 #endif
837 #ifdef YY_MALLOC_DECL
838 YY_MALLOC_DECL
839 #else
840 #if __STDC__
841 #ifndef __cplusplus
842 #include <stdlib.h>
843 #endif
844 #else
845 /* Just try to get by without declaring the routines. This will fail
846 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
847 * or sizeof(void*) != sizeof(int).
849 #endif
850 #endif
852 /* Amount of stuff to slurp up with each read. */
853 #ifndef YY_READ_BUF_SIZE
854 #define YY_READ_BUF_SIZE 8192
855 #endif
857 /* Copy whatever the last rule matched to the standard output. */
859 #ifndef ECHO
860 /* This used to be an fputs(), but since the string might contain NUL's,
861 * we now use fwrite().
863 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
864 #endif
866 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
867 * is returned in "result".
869 #ifndef YY_INPUT
870 #define YY_INPUT(buf,result,max_size) \
871 if ( yy_current_buffer->yy_is_interactive ) \
873 int c = '*', n; \
874 for ( n = 0; n < max_size && \
875 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
876 buf[n] = (char) c; \
877 if ( c == '\n' ) \
878 buf[n++] = (char) c; \
879 if ( c == EOF && ferror( yyin ) ) \
880 YY_FATAL_ERROR( "input in flex scanner failed" ); \
881 result = n; \
883 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
884 && ferror( yyin ) ) \
885 YY_FATAL_ERROR( "input in flex scanner failed" );
886 #endif
888 /* No semi-colon after return; correct usage is to write "yyterminate();" -
889 * we don't want an extra ';' after the "return" because that will cause
890 * some compilers to complain about unreachable statements.
892 #ifndef yyterminate
893 #define yyterminate() return YY_NULL
894 #endif
896 /* Number of entries by which start-condition stack grows. */
897 #ifndef YY_START_STACK_INCR
898 #define YY_START_STACK_INCR 25
899 #endif
901 /* Report a fatal error. */
902 #ifndef YY_FATAL_ERROR
903 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
904 #endif
906 /* Default declaration of generated scanner - a define so the user can
907 * easily add parameters.
909 #ifndef YY_DECL
910 #define YY_DECL int yylex YY_PROTO(( void ))
911 #endif
913 /* Code executed at the beginning of each rule, after yytext and yyleng
914 * have been set up.
916 #ifndef YY_USER_ACTION
917 #define YY_USER_ACTION
918 #endif
920 /* Code executed at the end of each rule. */
921 #ifndef YY_BREAK
922 #define YY_BREAK break;
923 #endif
925 #define YY_RULE_SETUP \
926 YY_USER_ACTION
928 YY_DECL
930 register yy_state_type yy_current_state;
931 register char *yy_cp, *yy_bp;
932 register int yy_act;
934 #line 165 "scan.l"
936 #line 937 "lex.yy.c"
938 if ( yy_init )
940 yy_init = 0;
942 #ifdef YY_USER_INIT
943 YY_USER_INIT;
944 #endif
946 if ( ! yy_start )
947 yy_start = 1; /* first start state */
949 if ( ! yyin )
950 yyin = stdin;
952 if ( ! yyout )
953 yyout = stdout;
955 if ( ! yy_current_buffer )
956 yy_current_buffer =
957 yy_create_buffer( yyin, YY_BUF_SIZE );
959 yy_load_buffer_state();
962 while ( 1 ) /* loops until end-of-file is reached */
964 yy_cp = yy_c_buf_p;
966 /* Support of yytext. */
967 *yy_cp = yy_hold_char;
969 /* yy_bp points to the position in yy_ch_buf of the start of
970 * the current run.
972 yy_bp = yy_cp;
974 yy_current_state = yy_start;
975 yy_match:
978 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
979 if ( yy_accept[yy_current_state] )
981 yy_last_accepting_state = yy_current_state;
982 yy_last_accepting_cpos = yy_cp;
984 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
986 yy_current_state = (int) yy_def[yy_current_state];
987 if ( yy_current_state >= 199 )
988 yy_c = yy_meta[(unsigned int) yy_c];
990 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
991 ++yy_cp;
993 while ( yy_base[yy_current_state] != 842 );
995 yy_find_action:
996 yy_act = yy_accept[yy_current_state];
997 if ( yy_act == 0 )
998 { /* have to back up */
999 yy_cp = yy_last_accepting_cpos;
1000 yy_current_state = yy_last_accepting_state;
1001 yy_act = yy_accept[yy_current_state];
1004 YY_DO_BEFORE_ACTION;
1007 do_action: /* This label is used only to access EOF actions. */
1010 switch ( yy_act )
1011 { /* beginning of action switch */
1012 case 0: /* must back up */
1013 /* undo the effects of YY_DO_BEFORE_ACTION */
1014 *yy_cp = yy_hold_char;
1015 yy_cp = yy_last_accepting_cpos;
1016 yy_current_state = yy_last_accepting_state;
1017 goto yy_find_action;
1019 case 1:
1020 YY_RULE_SETUP
1021 #line 166 "scan.l"
1024 YY_BREAK
1025 case 2:
1026 YY_RULE_SETUP
1027 #line 168 "scan.l"
1028 { BEGIN CMD_STATE;
1030 YY_BREAK
1031 case 3:
1032 YY_RULE_SETUP
1033 #line 170 "scan.l"
1034 { oldstate = (yy_start - 1) / 2;
1035 BEGIN COMMENT;
1037 YY_BREAK
1038 case 4:
1039 YY_RULE_SETUP
1040 #line 173 "scan.l"
1041 { oldstate = (yy_start - 1) / 2;
1042 BEGIN COMMENT2;
1044 YY_BREAK
1045 case 5:
1046 YY_RULE_SETUP
1047 #line 176 "scan.l"
1050 YY_BREAK
1051 case 6:
1052 YY_RULE_SETUP
1053 #line 178 "scan.l"
1054 { BEGIN oldstate;
1056 YY_BREAK
1057 case 7:
1058 YY_RULE_SETUP
1059 #line 180 "scan.l"
1062 YY_BREAK
1063 case 8:
1064 YY_RULE_SETUP
1065 #line 182 "scan.l"
1066 { crt_line_no++;
1067 BEGIN oldstate;
1069 YY_BREAK
1070 case 9:
1071 YY_RULE_SETUP
1072 #line 185 "scan.l"
1073 { crt_line_no++;
1075 YY_BREAK
1076 case 10:
1077 YY_RULE_SETUP
1078 #line 187 "scan.l"
1079 { idx = CheckKeyword( yytext );
1080 if ( idx < 0 ) {
1081 BEGIN CR_IGNORE;
1082 break;
1084 BEGIN keywords[idx].next;
1085 if ( keywords[idx].cmd ) {
1086 crt_section = keywords[idx].cmd;
1087 RETURN( keywords[idx].cmd );
1090 YY_BREAK
1091 case 11:
1092 YY_RULE_SETUP
1093 #line 198 "scan.l"
1094 { Include( IncName(yytext) );
1095 BEGIN CR_IGNORE;
1097 YY_BREAK
1098 case 12:
1099 YY_RULE_SETUP
1100 #line 201 "scan.l"
1101 { Include( ModelName(yytext) );
1102 BEGIN CR_IGNORE;
1104 YY_BREAK
1105 case 13:
1106 YY_RULE_SETUP
1107 #line 204 "scan.l"
1108 { Include( IntegName(yytext) );
1109 BEGIN CR_IGNORE;
1111 YY_BREAK
1112 case 14:
1113 YY_RULE_SETUP
1114 #line 207 "scan.l"
1115 { strcpy( yylval.str, yytext );
1116 BEGIN CR_IGNORE;
1117 RETURN( PARAMETER );
1119 YY_BREAK
1120 case 15:
1121 YY_RULE_SETUP
1122 #line 211 "scan.l"
1123 { ScanError("Extra parameter on command line '%s'", yytext);
1125 YY_BREAK
1126 case 16:
1127 YY_RULE_SETUP
1128 #line 213 "scan.l"
1129 { strcpy( yylval.str, yytext );
1130 RETURN( ATOMID );
1132 YY_BREAK
1133 case 17:
1134 YY_RULE_SETUP
1135 #line 216 "scan.l"
1136 { RETURN( yytext[0] );
1138 YY_BREAK
1139 case 18:
1140 YY_RULE_SETUP
1141 #line 218 "scan.l"
1142 { strcpy( yylval.str, yytext );
1143 RETURN( SPCSPC );
1145 YY_BREAK
1146 case 19:
1147 YY_RULE_SETUP
1148 #line 221 "scan.l"
1149 { strcpy( yylval.str, yytext );
1150 RETURN( SPCNR );
1152 YY_BREAK
1153 case 20:
1154 YY_RULE_SETUP
1155 #line 224 "scan.l"
1156 { RETURN( SPCEQUAL );
1158 YY_BREAK
1159 case 21:
1160 YY_RULE_SETUP
1161 #line 226 "scan.l"
1162 { RETURN( SPCPLUS );
1164 YY_BREAK
1165 case 22:
1166 YY_RULE_SETUP
1167 #line 228 "scan.l"
1168 { RETURN( yytext[0] );
1170 YY_BREAK
1171 case 23:
1172 YY_RULE_SETUP
1173 #line 230 "scan.l"
1174 { ScanError("Invalid character '%c' in species definition", yytext[0] );
1176 YY_BREAK
1177 case 24:
1178 YY_RULE_SETUP
1179 #line 232 "scan.l"
1180 { strcpy( yylval.str, yytext );
1181 RETURN( SSPID );
1183 YY_BREAK
1184 case 25:
1185 YY_RULE_SETUP
1186 #line 235 "scan.l"
1187 { RETURN( yytext[0] );
1189 YY_BREAK
1190 case 26:
1191 YY_RULE_SETUP
1192 #line 237 "scan.l"
1193 { strcpy( yylval.str, yytext );
1194 RETURN( INISPC );
1196 YY_BREAK
1197 case 27:
1198 YY_RULE_SETUP
1199 #line 240 "scan.l"
1200 { RETURN( INIEQUAL );
1202 YY_BREAK
1203 case 28:
1204 YY_RULE_SETUP
1205 #line 242 "scan.l"
1206 { RETURN( yytext[0] );
1208 YY_BREAK
1209 case 29:
1210 YY_RULE_SETUP
1211 #line 244 "scan.l"
1212 { strcpy( yylval.str, yytext );
1213 RETURN( INIVALUE );
1215 YY_BREAK
1216 case 30:
1217 YY_RULE_SETUP
1218 #line 247 "scan.l"
1219 { ScanError("Invalid character '%c' in initial values", yytext[0] );
1221 YY_BREAK
1222 case 31:
1223 YY_RULE_SETUP
1224 #line 249 "scan.l"
1225 { strcpy( yylval.str, yytext );
1226 RETURN( EQNSPC );
1228 YY_BREAK
1229 case 32:
1230 YY_RULE_SETUP
1231 #line 252 "scan.l"
1232 { RETURN( EQNEQUAL );
1234 YY_BREAK
1235 case 33:
1236 YY_RULE_SETUP
1237 #line 254 "scan.l"
1238 { strcpy( yylval.str, yytext );
1239 RETURN( EQNCOEF );
1241 YY_BREAK
1242 case 34:
1243 YY_RULE_SETUP
1244 #line 257 "scan.l"
1245 { BEGIN RATE_STATE;
1246 *crt_rate = 0;
1247 RETURN( EQNCOLON );
1249 YY_BREAK
1250 case 35:
1251 YY_RULE_SETUP
1252 #line 261 "scan.l"
1253 { strcpy( yylval.str, yytext );
1254 RETURN( EQNSIGN );
1256 YY_BREAK
1257 case 36:
1258 YY_RULE_SETUP
1259 #line 264 "scan.l"
1260 { BEGIN EQNTAG_STATE;
1261 RETURN( EQNLESS );
1263 YY_BREAK
1264 case 37:
1265 YY_RULE_SETUP
1266 #line 267 "scan.l"
1267 { strcpy( yylval.str, yytext );
1268 RETURN( EQNTAG );
1270 YY_BREAK
1271 case 38:
1272 YY_RULE_SETUP
1273 #line 270 "scan.l"
1274 { BEGIN EQN_STATE;
1275 RETURN( EQNGREATER );
1277 YY_BREAK
1278 case 39:
1279 YY_RULE_SETUP
1280 #line 273 "scan.l"
1281 { strcpy( yylval.str, yytext );
1282 RETURN( RATE );
1284 YY_BREAK
1285 case 40:
1286 YY_RULE_SETUP
1287 #line 276 "scan.l"
1288 { BEGIN EQN_STATE;
1289 RETURN( yytext[0] );
1291 YY_BREAK
1292 case 41:
1293 YY_RULE_SETUP
1294 #line 279 "scan.l"
1295 { strcpy( yylval.str, yytext );
1296 RETURN( LMPSPC );
1298 YY_BREAK
1299 case 42:
1300 YY_RULE_SETUP
1301 #line 282 "scan.l"
1302 { RETURN( LMPPLUS );
1304 YY_BREAK
1305 case 43:
1306 YY_RULE_SETUP
1307 #line 284 "scan.l"
1308 { RETURN( LMPCOLON );
1310 YY_BREAK
1311 case 44:
1312 YY_RULE_SETUP
1313 #line 286 "scan.l"
1314 { RETURN( yytext[0] );
1316 YY_BREAK
1317 case 45:
1318 YY_RULE_SETUP
1319 #line 288 "scan.l"
1320 { ScanError("Invalid character '%c' in species definition", yytext[0] );
1322 YY_BREAK
1323 case 46:
1324 YY_RULE_SETUP
1325 #line 290 "scan.l"
1326 { strcpy( yylval.str, yytext );
1327 RETURN( LKTID );
1329 YY_BREAK
1330 case 47:
1331 YY_RULE_SETUP
1332 #line 293 "scan.l"
1333 { RETURN( yytext[0] );
1335 YY_BREAK
1336 case 48:
1337 YY_RULE_SETUP
1338 #line 295 "scan.l"
1339 { strcpy( yylval.str, yytext );
1340 RETURN( TPTID );
1342 YY_BREAK
1343 case 49:
1344 YY_RULE_SETUP
1345 #line 298 "scan.l"
1346 { RETURN( yytext[0] );
1348 YY_BREAK
1349 case 50:
1350 YY_RULE_SETUP
1351 #line 300 "scan.l"
1352 { strcpy( yylval.str, yytext );
1353 RETURN( USEID );
1355 YY_BREAK
1356 case 51:
1357 YY_RULE_SETUP
1358 #line 303 "scan.l"
1359 { RETURN( yytext[0] );
1361 YY_BREAK
1362 case 52:
1363 YY_RULE_SETUP
1364 #line 305 "scan.l"
1365 { strcpy( yylval.str, yytext );
1366 RETURN( MNIID );
1368 YY_BREAK
1369 case 53:
1370 YY_RULE_SETUP
1371 #line 308 "scan.l"
1372 { RETURN( yytext[0] );
1374 YY_BREAK
1375 case 54:
1376 YY_RULE_SETUP
1377 #line 310 "scan.l"
1378 { strcpy( yylval.str, yytext );
1379 BEGIN INL_CODE;
1380 RETURN( INLCTX );
1382 YY_BREAK
1383 case 55:
1384 YY_RULE_SETUP
1385 #line 314 "scan.l"
1386 { if ( EqNoCase( yytext+1, "ENDINLINE" ) ){
1387 BEGIN INITIAL;
1388 RETURN( ENDINLINE );
1390 else {
1391 strcpy( yylval.str, yytext );
1392 RETURN( INCODE );
1395 YY_BREAK
1396 case 56:
1397 YY_RULE_SETUP
1398 #line 323 "scan.l"
1399 { crt_line_no++;
1400 strcpy( yylval.str,yytext );
1401 RETURN( INCODE );
1403 YY_BREAK
1404 case 57:
1405 YY_RULE_SETUP
1406 #line 327 "scan.l"
1407 { strcpy( yylval.str,yytext );
1408 RETURN( INCODE );
1410 YY_BREAK
1411 case YY_STATE_EOF(INITIAL):
1412 case YY_STATE_EOF(CMD_STATE):
1413 case YY_STATE_EOF(INC_STATE):
1414 case YY_STATE_EOF(MOD_STATE):
1415 case YY_STATE_EOF(INT_STATE):
1416 case YY_STATE_EOF(PRM_STATE):
1417 case YY_STATE_EOF(DSP_STATE):
1418 case YY_STATE_EOF(SSP_STATE):
1419 case YY_STATE_EOF(INI_STATE):
1420 case YY_STATE_EOF(EQN_STATE):
1421 case YY_STATE_EOF(EQNTAG_STATE):
1422 case YY_STATE_EOF(RATE_STATE):
1423 case YY_STATE_EOF(LMP_STATE):
1424 case YY_STATE_EOF(CR_IGNORE):
1425 case YY_STATE_EOF(SC_IGNORE):
1426 case YY_STATE_EOF(ATM_STATE):
1427 case YY_STATE_EOF(LKT_STATE):
1428 case YY_STATE_EOF(INL_STATE):
1429 case YY_STATE_EOF(MNI_STATE):
1430 case YY_STATE_EOF(TPT_STATE):
1431 case YY_STATE_EOF(USE_STATE):
1432 case YY_STATE_EOF(COMMENT):
1433 case YY_STATE_EOF(COMMENT2):
1434 case YY_STATE_EOF(EQN_ID):
1435 case YY_STATE_EOF(INL_CODE):
1436 #line 330 "scan.l"
1437 { if ( ! EndInclude() ) {
1438 RETURN( INITIAL );
1441 YY_BREAK
1442 case 58:
1443 YY_RULE_SETUP
1444 #line 334 "scan.l"
1445 ECHO;
1446 YY_BREAK
1447 #line 1448 "lex.yy.c"
1449 case YY_END_OF_BUFFER:
1451 /* Amount of text matched not including the EOB char. */
1452 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1454 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1455 *yy_cp = yy_hold_char;
1456 YY_RESTORE_YY_MORE_OFFSET
1458 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1460 /* We're scanning a new file or input source. It's
1461 * possible that this happened because the user
1462 * just pointed yyin at a new source and called
1463 * yylex(). If so, then we have to assure
1464 * consistency between yy_current_buffer and our
1465 * globals. Here is the right place to do so, because
1466 * this is the first action (other than possibly a
1467 * back-up) that will match for the new input source.
1469 yy_n_chars = yy_current_buffer->yy_n_chars;
1470 yy_current_buffer->yy_input_file = yyin;
1471 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1474 /* Note that here we test for yy_c_buf_p "<=" to the position
1475 * of the first EOB in the buffer, since yy_c_buf_p will
1476 * already have been incremented past the NUL character
1477 * (since all states make transitions on EOB to the
1478 * end-of-buffer state). Contrast this with the test
1479 * in input().
1481 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1482 { /* This was really a NUL. */
1483 yy_state_type yy_next_state;
1485 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1487 yy_current_state = yy_get_previous_state();
1489 /* Okay, we're now positioned to make the NUL
1490 * transition. We couldn't have
1491 * yy_get_previous_state() go ahead and do it
1492 * for us because it doesn't know how to deal
1493 * with the possibility of jamming (and we don't
1494 * want to build jamming into it because then it
1495 * will run more slowly).
1498 yy_next_state = yy_try_NUL_trans( yy_current_state );
1500 yy_bp = yytext_ptr + YY_MORE_ADJ;
1502 if ( yy_next_state )
1504 /* Consume the NUL. */
1505 yy_cp = ++yy_c_buf_p;
1506 yy_current_state = yy_next_state;
1507 goto yy_match;
1510 else
1512 yy_cp = yy_c_buf_p;
1513 goto yy_find_action;
1517 else switch ( yy_get_next_buffer() )
1519 case EOB_ACT_END_OF_FILE:
1521 yy_did_buffer_switch_on_eof = 0;
1523 if ( yywrap() )
1525 /* Note: because we've taken care in
1526 * yy_get_next_buffer() to have set up
1527 * yytext, we can now set up
1528 * yy_c_buf_p so that if some total
1529 * hoser (like flex itself) wants to
1530 * call the scanner after we return the
1531 * YY_NULL, it'll still work - another
1532 * YY_NULL will get returned.
1534 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1536 yy_act = YY_STATE_EOF(YY_START);
1537 goto do_action;
1540 else
1542 if ( ! yy_did_buffer_switch_on_eof )
1543 YY_NEW_FILE;
1545 break;
1548 case EOB_ACT_CONTINUE_SCAN:
1549 yy_c_buf_p =
1550 yytext_ptr + yy_amount_of_matched_text;
1552 yy_current_state = yy_get_previous_state();
1554 yy_cp = yy_c_buf_p;
1555 yy_bp = yytext_ptr + YY_MORE_ADJ;
1556 goto yy_match;
1558 case EOB_ACT_LAST_MATCH:
1559 yy_c_buf_p =
1560 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1562 yy_current_state = yy_get_previous_state();
1564 yy_cp = yy_c_buf_p;
1565 yy_bp = yytext_ptr + YY_MORE_ADJ;
1566 goto yy_find_action;
1568 break;
1571 default:
1572 YY_FATAL_ERROR(
1573 "fatal flex scanner internal error--no action found" );
1574 } /* end of action switch */
1575 } /* end of scanning one token */
1576 } /* end of yylex */
1579 /* yy_get_next_buffer - try to read in a new buffer
1581 * Returns a code representing an action:
1582 * EOB_ACT_LAST_MATCH -
1583 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1584 * EOB_ACT_END_OF_FILE - end of file
1587 static int yy_get_next_buffer()
1589 register char *dest = yy_current_buffer->yy_ch_buf;
1590 register char *source = yytext_ptr;
1591 register int number_to_move, i;
1592 int ret_val;
1594 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1595 YY_FATAL_ERROR(
1596 "fatal flex scanner internal error--end of buffer missed" );
1598 if ( yy_current_buffer->yy_fill_buffer == 0 )
1599 { /* Don't try to fill the buffer, so this is an EOF. */
1600 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1602 /* We matched a single character, the EOB, so
1603 * treat this as a final EOF.
1605 return EOB_ACT_END_OF_FILE;
1608 else
1610 /* We matched some text prior to the EOB, first
1611 * process it.
1613 return EOB_ACT_LAST_MATCH;
1617 /* Try to read more data. */
1619 /* First move last chars to start of buffer. */
1620 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1622 for ( i = 0; i < number_to_move; ++i )
1623 *(dest++) = *(source++);
1625 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1626 /* don't do the read, it's not guaranteed to return an EOF,
1627 * just force an EOF
1629 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1631 else
1633 int num_to_read =
1634 yy_current_buffer->yy_buf_size - number_to_move - 1;
1636 while ( num_to_read <= 0 )
1637 { /* Not enough room in the buffer - grow it. */
1638 #ifdef YY_USES_REJECT
1639 YY_FATAL_ERROR(
1640 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1641 #else
1643 /* just a shorter name for the current buffer */
1644 YY_BUFFER_STATE b = yy_current_buffer;
1646 int yy_c_buf_p_offset =
1647 (int) (yy_c_buf_p - b->yy_ch_buf);
1649 if ( b->yy_is_our_buffer )
1651 int new_size = b->yy_buf_size * 2;
1653 if ( new_size <= 0 )
1654 b->yy_buf_size += b->yy_buf_size / 8;
1655 else
1656 b->yy_buf_size *= 2;
1658 b->yy_ch_buf = (char *)
1659 /* Include room in for 2 EOB chars. */
1660 yy_flex_realloc( (void *) b->yy_ch_buf,
1661 b->yy_buf_size + 2 );
1663 else
1664 /* Can't grow it, we don't own it. */
1665 b->yy_ch_buf = 0;
1667 if ( ! b->yy_ch_buf )
1668 YY_FATAL_ERROR(
1669 "fatal error - scanner input buffer overflow" );
1671 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1673 num_to_read = yy_current_buffer->yy_buf_size -
1674 number_to_move - 1;
1675 #endif
1678 if ( num_to_read > YY_READ_BUF_SIZE )
1679 num_to_read = YY_READ_BUF_SIZE;
1681 /* Read in more data. */
1682 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1683 yy_n_chars, num_to_read );
1685 yy_current_buffer->yy_n_chars = yy_n_chars;
1688 if ( yy_n_chars == 0 )
1690 if ( number_to_move == YY_MORE_ADJ )
1692 ret_val = EOB_ACT_END_OF_FILE;
1693 yyrestart( yyin );
1696 else
1698 ret_val = EOB_ACT_LAST_MATCH;
1699 yy_current_buffer->yy_buffer_status =
1700 YY_BUFFER_EOF_PENDING;
1704 else
1705 ret_val = EOB_ACT_CONTINUE_SCAN;
1707 yy_n_chars += number_to_move;
1708 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1709 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1711 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1713 return ret_val;
1717 /* yy_get_previous_state - get the state just before the EOB char was reached */
1719 static yy_state_type yy_get_previous_state()
1721 register yy_state_type yy_current_state;
1722 register char *yy_cp;
1724 yy_current_state = yy_start;
1726 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1728 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1729 if ( yy_accept[yy_current_state] )
1731 yy_last_accepting_state = yy_current_state;
1732 yy_last_accepting_cpos = yy_cp;
1734 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1736 yy_current_state = (int) yy_def[yy_current_state];
1737 if ( yy_current_state >= 199 )
1738 yy_c = yy_meta[(unsigned int) yy_c];
1740 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1743 return yy_current_state;
1747 /* yy_try_NUL_trans - try to make a transition on the NUL character
1749 * synopsis
1750 * next_state = yy_try_NUL_trans( current_state );
1753 #ifdef YY_USE_PROTOS
1754 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1755 #else
1756 static yy_state_type yy_try_NUL_trans( yy_current_state )
1757 yy_state_type yy_current_state;
1758 #endif
1760 register int yy_is_jam;
1761 register char *yy_cp = yy_c_buf_p;
1763 register YY_CHAR yy_c = 1;
1764 if ( yy_accept[yy_current_state] )
1766 yy_last_accepting_state = yy_current_state;
1767 yy_last_accepting_cpos = yy_cp;
1769 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1771 yy_current_state = (int) yy_def[yy_current_state];
1772 if ( yy_current_state >= 199 )
1773 yy_c = yy_meta[(unsigned int) yy_c];
1775 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1776 yy_is_jam = (yy_current_state == 198);
1778 return yy_is_jam ? 0 : yy_current_state;
1782 #ifndef YY_NO_UNPUT
1783 #ifdef YY_USE_PROTOS
1784 static void yyunput( int c, register char *yy_bp )
1785 #else
1786 static void yyunput( c, yy_bp )
1787 int c;
1788 register char *yy_bp;
1789 #endif
1791 register char *yy_cp = yy_c_buf_p;
1793 /* undo effects of setting up yytext */
1794 *yy_cp = yy_hold_char;
1796 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1797 { /* need to shift things up to make room */
1798 /* +2 for EOB chars. */
1799 register int number_to_move = yy_n_chars + 2;
1800 register char *dest = &yy_current_buffer->yy_ch_buf[
1801 yy_current_buffer->yy_buf_size + 2];
1802 register char *source =
1803 &yy_current_buffer->yy_ch_buf[number_to_move];
1805 while ( source > yy_current_buffer->yy_ch_buf )
1806 *--dest = *--source;
1808 yy_cp += (int) (dest - source);
1809 yy_bp += (int) (dest - source);
1810 yy_current_buffer->yy_n_chars =
1811 yy_n_chars = yy_current_buffer->yy_buf_size;
1813 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1814 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1817 *--yy_cp = (char) c;
1820 yytext_ptr = yy_bp;
1821 yy_hold_char = *yy_cp;
1822 yy_c_buf_p = yy_cp;
1824 #endif /* ifndef YY_NO_UNPUT */
1827 #ifdef __cplusplus
1828 static int yyinput()
1829 #else
1830 static int input()
1831 #endif
1833 int c;
1835 *yy_c_buf_p = yy_hold_char;
1837 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1839 /* yy_c_buf_p now points to the character we want to return.
1840 * If this occurs *before* the EOB characters, then it's a
1841 * valid NUL; if not, then we've hit the end of the buffer.
1843 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1844 /* This was really a NUL. */
1845 *yy_c_buf_p = '\0';
1847 else
1848 { /* need more input */
1849 int offset = yy_c_buf_p - yytext_ptr;
1850 ++yy_c_buf_p;
1852 switch ( yy_get_next_buffer() )
1854 case EOB_ACT_LAST_MATCH:
1855 /* This happens because yy_g_n_b()
1856 * sees that we've accumulated a
1857 * token and flags that we need to
1858 * try matching the token before
1859 * proceeding. But for input(),
1860 * there's no matching to consider.
1861 * So convert the EOB_ACT_LAST_MATCH
1862 * to EOB_ACT_END_OF_FILE.
1865 /* Reset buffer status. */
1866 yyrestart( yyin );
1868 /* fall through */
1870 case EOB_ACT_END_OF_FILE:
1872 if ( yywrap() )
1873 return EOF;
1875 if ( ! yy_did_buffer_switch_on_eof )
1876 YY_NEW_FILE;
1877 #ifdef __cplusplus
1878 return yyinput();
1879 #else
1880 return input();
1881 #endif
1884 case EOB_ACT_CONTINUE_SCAN:
1885 yy_c_buf_p = yytext_ptr + offset;
1886 break;
1891 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1892 *yy_c_buf_p = '\0'; /* preserve yytext */
1893 yy_hold_char = *++yy_c_buf_p;
1896 return c;
1900 #ifdef YY_USE_PROTOS
1901 void yyrestart( FILE *input_file )
1902 #else
1903 void yyrestart( input_file )
1904 FILE *input_file;
1905 #endif
1907 if ( ! yy_current_buffer )
1908 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1910 yy_init_buffer( yy_current_buffer, input_file );
1911 yy_load_buffer_state();
1915 #ifdef YY_USE_PROTOS
1916 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1917 #else
1918 void yy_switch_to_buffer( new_buffer )
1919 YY_BUFFER_STATE new_buffer;
1920 #endif
1922 if ( yy_current_buffer == new_buffer )
1923 return;
1925 if ( yy_current_buffer )
1927 /* Flush out information for old buffer. */
1928 *yy_c_buf_p = yy_hold_char;
1929 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1930 yy_current_buffer->yy_n_chars = yy_n_chars;
1933 yy_current_buffer = new_buffer;
1934 yy_load_buffer_state();
1936 /* We don't actually know whether we did this switch during
1937 * EOF (yywrap()) processing, but the only time this flag
1938 * is looked at is after yywrap() is called, so it's safe
1939 * to go ahead and always set it.
1941 yy_did_buffer_switch_on_eof = 1;
1945 #ifdef YY_USE_PROTOS
1946 void yy_load_buffer_state( void )
1947 #else
1948 void yy_load_buffer_state()
1949 #endif
1951 yy_n_chars = yy_current_buffer->yy_n_chars;
1952 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1953 yyin = yy_current_buffer->yy_input_file;
1954 yy_hold_char = *yy_c_buf_p;
1958 #ifdef YY_USE_PROTOS
1959 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1960 #else
1961 YY_BUFFER_STATE yy_create_buffer( file, size )
1962 FILE *file;
1963 int size;
1964 #endif
1966 YY_BUFFER_STATE b;
1968 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1969 if ( ! b )
1970 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1972 b->yy_buf_size = size;
1974 /* yy_ch_buf has to be 2 characters longer than the size given because
1975 * we need to put in 2 end-of-buffer characters.
1977 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1978 if ( ! b->yy_ch_buf )
1979 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1981 b->yy_is_our_buffer = 1;
1983 yy_init_buffer( b, file );
1985 return b;
1989 #ifdef YY_USE_PROTOS
1990 void yy_delete_buffer( YY_BUFFER_STATE b )
1991 #else
1992 void yy_delete_buffer( b )
1993 YY_BUFFER_STATE b;
1994 #endif
1996 if ( ! b )
1997 return;
1999 if ( b == yy_current_buffer )
2000 yy_current_buffer = (YY_BUFFER_STATE) 0;
2002 if ( b->yy_is_our_buffer )
2003 yy_flex_free( (void *) b->yy_ch_buf );
2005 yy_flex_free( (void *) b );
2009 #ifndef YY_ALWAYS_INTERACTIVE
2010 #ifndef YY_NEVER_INTERACTIVE
2011 #include<unistd.h>
2012 #endif
2013 #endif
2015 #ifdef YY_USE_PROTOS
2016 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
2017 #else
2018 void yy_init_buffer( b, file )
2019 YY_BUFFER_STATE b;
2020 FILE *file;
2021 #endif
2025 yy_flush_buffer( b );
2027 b->yy_input_file = file;
2028 b->yy_fill_buffer = 1;
2030 #if YY_ALWAYS_INTERACTIVE
2031 b->yy_is_interactive = 1;
2032 #else
2033 #if YY_NEVER_INTERACTIVE
2034 b->yy_is_interactive = 0;
2035 #else
2036 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2037 #endif
2038 #endif
2042 #ifdef YY_USE_PROTOS
2043 void yy_flush_buffer( YY_BUFFER_STATE b )
2044 #else
2045 void yy_flush_buffer( b )
2046 YY_BUFFER_STATE b;
2047 #endif
2050 if ( ! b )
2051 return;
2053 b->yy_n_chars = 0;
2055 /* We always need two end-of-buffer characters. The first causes
2056 * a transition to the end-of-buffer state. The second causes
2057 * a jam in that state.
2059 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2060 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2062 b->yy_buf_pos = &b->yy_ch_buf[0];
2064 b->yy_at_bol = 1;
2065 b->yy_buffer_status = YY_BUFFER_NEW;
2067 if ( b == yy_current_buffer )
2068 yy_load_buffer_state();
2072 #ifndef YY_NO_SCAN_BUFFER
2073 #ifdef YY_USE_PROTOS
2074 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
2075 #else
2076 YY_BUFFER_STATE yy_scan_buffer( base, size )
2077 char *base;
2078 yy_size_t size;
2079 #endif
2081 YY_BUFFER_STATE b;
2083 if ( size < 2 ||
2084 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2085 base[size-1] != YY_END_OF_BUFFER_CHAR )
2086 /* They forgot to leave room for the EOB's. */
2087 return 0;
2089 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2090 if ( ! b )
2091 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2093 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2094 b->yy_buf_pos = b->yy_ch_buf = base;
2095 b->yy_is_our_buffer = 0;
2096 b->yy_input_file = 0;
2097 b->yy_n_chars = b->yy_buf_size;
2098 b->yy_is_interactive = 0;
2099 b->yy_at_bol = 1;
2100 b->yy_fill_buffer = 0;
2101 b->yy_buffer_status = YY_BUFFER_NEW;
2103 yy_switch_to_buffer( b );
2105 return b;
2107 #endif
2110 #ifndef YY_NO_SCAN_STRING
2111 #ifdef YY_USE_PROTOS
2112 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
2113 #else
2114 YY_BUFFER_STATE yy_scan_string( yy_str )
2115 yyconst char *yy_str;
2116 #endif
2118 int len;
2119 for ( len = 0; yy_str[len]; ++len )
2122 return yy_scan_bytes( yy_str, len );
2124 #endif
2127 #ifndef YY_NO_SCAN_BYTES
2128 #ifdef YY_USE_PROTOS
2129 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
2130 #else
2131 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
2132 yyconst char *bytes;
2133 int len;
2134 #endif
2136 YY_BUFFER_STATE b;
2137 char *buf;
2138 yy_size_t n;
2139 int i;
2141 /* Get memory for full buffer, including space for trailing EOB's. */
2142 n = len + 2;
2143 buf = (char *) yy_flex_alloc( n );
2144 if ( ! buf )
2145 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2147 for ( i = 0; i < len; ++i )
2148 buf[i] = bytes[i];
2150 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
2152 b = yy_scan_buffer( buf, n );
2153 if ( ! b )
2154 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2156 /* It's okay to grow etc. this buffer, and we should throw it
2157 * away when we're done.
2159 b->yy_is_our_buffer = 1;
2161 return b;
2163 #endif
2166 #ifndef YY_NO_PUSH_STATE
2167 #ifdef YY_USE_PROTOS
2168 static void yy_push_state( int new_state )
2169 #else
2170 static void yy_push_state( new_state )
2171 int new_state;
2172 #endif
2174 if ( yy_start_stack_ptr >= yy_start_stack_depth )
2176 yy_size_t new_size;
2178 yy_start_stack_depth += YY_START_STACK_INCR;
2179 new_size = yy_start_stack_depth * sizeof( int );
2181 if ( ! yy_start_stack )
2182 yy_start_stack = (int *) yy_flex_alloc( new_size );
2184 else
2185 yy_start_stack = (int *) yy_flex_realloc(
2186 (void *) yy_start_stack, new_size );
2188 if ( ! yy_start_stack )
2189 YY_FATAL_ERROR(
2190 "out of memory expanding start-condition stack" );
2193 yy_start_stack[yy_start_stack_ptr++] = YY_START;
2195 BEGIN(new_state);
2197 #endif
2200 #ifndef YY_NO_POP_STATE
2201 static void yy_pop_state()
2203 if ( --yy_start_stack_ptr < 0 )
2204 YY_FATAL_ERROR( "start-condition stack underflow" );
2206 BEGIN(yy_start_stack[yy_start_stack_ptr]);
2208 #endif
2211 #ifndef YY_NO_TOP_STATE
2212 static int yy_top_state()
2214 return yy_start_stack[yy_start_stack_ptr - 1];
2216 #endif
2218 #ifndef YY_EXIT_FAILURE
2219 #define YY_EXIT_FAILURE 2
2220 #endif
2222 #ifdef YY_USE_PROTOS
2223 static void yy_fatal_error( yyconst char msg[] )
2224 #else
2225 static void yy_fatal_error( msg )
2226 char msg[];
2227 #endif
2229 (void) fprintf( stderr, "%s\n", msg );
2230 exit( YY_EXIT_FAILURE );
2235 /* Redefine yyless() so it works in section 3 code. */
2237 #undef yyless
2238 #define yyless(n) \
2239 do \
2241 /* Undo effects of setting up yytext. */ \
2242 yytext[yyleng] = yy_hold_char; \
2243 yy_c_buf_p = yytext + n; \
2244 yy_hold_char = *yy_c_buf_p; \
2245 *yy_c_buf_p = '\0'; \
2246 yyleng = n; \
2248 while ( 0 )
2251 /* Internal utility routines. */
2253 #ifndef yytext_ptr
2254 #ifdef YY_USE_PROTOS
2255 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
2256 #else
2257 static void yy_flex_strncpy( s1, s2, n )
2258 char *s1;
2259 yyconst char *s2;
2260 int n;
2261 #endif
2263 register int i;
2264 for ( i = 0; i < n; ++i )
2265 s1[i] = s2[i];
2267 #endif
2269 #ifdef YY_NEED_STRLEN
2270 #ifdef YY_USE_PROTOS
2271 static int yy_flex_strlen( yyconst char *s )
2272 #else
2273 static int yy_flex_strlen( s )
2274 yyconst char *s;
2275 #endif
2277 register int n;
2278 for ( n = 0; s[n]; ++n )
2281 return n;
2283 #endif
2286 #ifdef YY_USE_PROTOS
2287 static void *yy_flex_alloc( yy_size_t size )
2288 #else
2289 static void *yy_flex_alloc( size )
2290 yy_size_t size;
2291 #endif
2293 return (void *) malloc( size );
2296 #ifdef YY_USE_PROTOS
2297 static void *yy_flex_realloc( void *ptr, yy_size_t size )
2298 #else
2299 static void *yy_flex_realloc( ptr, size )
2300 void *ptr;
2301 yy_size_t size;
2302 #endif
2304 /* The cast to (char *) in the following accommodates both
2305 * implementations that use char* generic pointers, and those
2306 * that use void* generic pointers. It works with the latter
2307 * because both ANSI C and C++ allow castless assignment from
2308 * any pointer type to void*, and deal with argument conversions
2309 * as though doing an assignment.
2311 return (void *) realloc( (char *) ptr, size );
2314 #ifdef YY_USE_PROTOS
2315 static void yy_flex_free( void *ptr )
2316 #else
2317 static void yy_flex_free( ptr )
2318 void *ptr;
2319 #endif
2321 free( ptr );
2324 #if YY_MAIN
2325 int main()
2327 yylex();
2328 return 0;
2330 #endif
2331 #line 334 "scan.l"
2334 void Include ( char * name )
2336 FILE *f;
2337 YY_BUFFER_STATE newb;
2339 if ( yy_buf_level == MAX_INCLUDE ) {
2340 printf("\nInclude nested too deep. Include %s ignored", name);
2341 return;
2344 yy_buffers[ yy_buf_level ] = yy_current_buffer;
2345 yy_line_no[ yy_buf_level ] = crt_line_no;
2346 yy_filename[ yy_buf_level ] = crt_filename;
2347 yy_buf_level++;
2349 crt_line_no = 1;
2351 crt_filename = malloc( 1 + strlen( name ) );
2352 strcpy( crt_filename, name );
2355 f = fopen( name, "r" );
2356 if( f == 0 )
2357 FatalError(3,"%s: Can't read file", name );
2359 newb = yy_create_buffer(f, YY_BUF_SIZE);
2360 yy_switch_to_buffer( newb );
2363 int EndInclude()
2365 YY_BUFFER_STATE oldb;
2366 char * oldn;
2368 if ( yy_buf_level > 0 ) {
2369 oldb = yy_current_buffer;
2370 oldn = crt_filename;
2371 yy_buf_level--;
2372 yy_switch_to_buffer( yy_buffers[yy_buf_level] );
2373 crt_line_no = yy_line_no[ yy_buf_level ];
2374 crt_filename = yy_filename[ yy_buf_level ];
2375 yy_delete_buffer( oldb );
2376 free( oldn );
2377 return 1;
2379 return 0;
2382 int EqNoCase( char *s1, char *s2 )
2384 while( *s1 ) {
2385 if ( toupper(*s1++) != toupper(*s2++) ) return 0;
2387 return *s1 == *s2;
2390 int CheckKeyword( char *cmd )
2392 int i;
2394 i = 0;
2395 while( 1 ) {
2396 if( keywords[i].name == 0 ) {
2397 ScanError( "'%s': Unknown command (ignored)", cmd);
2398 return -1;
2400 if( EqNoCase( cmd, keywords[i].name ) ) {
2401 return i;
2403 i++;