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 $
8 #define YY_FLEX_MAJOR_VERSION 2
9 #define YY_FLEX_MINOR_VERSION 5
14 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
27 /* Use prototypes in function declarations. */
30 /* The "const" storage-class-modifier is valid. */
33 #else /* ! __cplusplus */
41 #endif /* ! __cplusplus */
60 #define YY_PROTO(proto) proto
62 #define YY_PROTO(proto) ()
65 /* Returned upon end-of-file. */
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
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
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
;
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 )
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. */
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 */ \
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
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
154 yy_size_t yy_buf_size
;
156 /* Number of characters read into yy_ch_buf, not including EOB
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
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
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
180 /* Whether to try to fill the input buffer when we reach the
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
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 */
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
;
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; \
285 #define YY_NUM_RULES 58
286 #define YY_END_OF_BUFFER 59
287 static yyconst
short int yy_accept
[199] =
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] =
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,
345 static yyconst
int yy_meta
[19] =
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] =
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] =
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] =
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] =
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
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
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.
644 Computer Science Department
645 Virginia Polytechnic Institute and State University
647 E-mail: sandu@cs.vt.edu
649 ******************************************************************************/
660 #define EQNTAG_STATE 10
662 #define RATE_STATE 11
685 void Include ( char * 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;
710 extern int yyerrflag
;
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
},
769 int CheckKeyword( char *cmd
);
771 #define RETURN( x ) \
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); \
785 /* Macros after this point can all be overridden by user definitions in
789 #ifndef YY_SKIP_YYWRAP
791 extern "C" int yywrap
YY_PROTO(( void ));
793 extern int yywrap
YY_PROTO(( void ));
798 static void yyunput
YY_PROTO(( int c
, char *buf_ptr
));
802 static void yy_flex_strncpy
YY_PROTO(( char *, yyconst
char *, int ));
805 #ifdef YY_NEED_STRLEN
806 static int yy_flex_strlen
YY_PROTO(( yyconst
char * ));
811 static int yyinput
YY_PROTO(( void ));
813 static int input
YY_PROTO(( void ));
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
));
824 #ifndef YY_NO_POP_STATE
825 static void yy_pop_state
YY_PROTO(( void ));
827 #ifndef YY_NO_TOP_STATE
828 static int yy_top_state
YY_PROTO(( void ));
832 #define YY_NO_PUSH_STATE 1
833 #define YY_NO_POP_STATE 1
834 #define YY_NO_TOP_STATE 1
837 #ifdef YY_MALLOC_DECL
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).
852 /* Amount of stuff to slurp up with each read. */
853 #ifndef YY_READ_BUF_SIZE
854 #define YY_READ_BUF_SIZE 8192
857 /* Copy whatever the last rule matched to the standard output. */
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 )
866 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
867 * is returned in "result".
870 #define YY_INPUT(buf,result,max_size) \
871 if ( yy_current_buffer->yy_is_interactive ) \
874 for ( n = 0; n < max_size && \
875 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
878 buf[n++] = (char) c; \
879 if ( c == EOF && ferror( yyin ) ) \
880 YY_FATAL_ERROR( "input in flex scanner failed" ); \
883 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
884 && ferror( yyin ) ) \
885 YY_FATAL_ERROR( "input in flex scanner failed" );
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.
893 #define yyterminate() return YY_NULL
896 /* Number of entries by which start-condition stack grows. */
897 #ifndef YY_START_STACK_INCR
898 #define YY_START_STACK_INCR 25
901 /* Report a fatal error. */
902 #ifndef YY_FATAL_ERROR
903 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
906 /* Default declaration of generated scanner - a define so the user can
907 * easily add parameters.
910 #define YY_DECL int yylex YY_PROTO(( void ))
913 /* Code executed at the beginning of each rule, after yytext and yyleng
916 #ifndef YY_USER_ACTION
917 #define YY_USER_ACTION
920 /* Code executed at the end of each rule. */
922 #define YY_BREAK break;
925 #define YY_RULE_SETUP \
930 register yy_state_type yy_current_state
;
931 register char *yy_cp
, *yy_bp
;
947 yy_start
= 1; /* first start state */
955 if ( ! 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 */
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
974 yy_current_state
= yy_start
;
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
];
993 while ( yy_base
[yy_current_state
] != 842 );
996 yy_act
= yy_accept
[yy_current_state
];
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. */
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
;
1034 { oldstate
= (yy_start
- 1) / 2;
1041 { oldstate
= (yy_start
- 1) / 2;
1079 { idx
= CheckKeyword( yytext
);
1084 BEGIN keywords
[idx
].next
;
1085 if ( keywords
[idx
].cmd
) {
1086 crt_section
= keywords
[idx
].cmd
;
1087 RETURN( keywords
[idx
].cmd
);
1094 { Include( IncName(yytext
) );
1101 { Include( ModelName(yytext
) );
1108 { Include( IntegName(yytext
) );
1115 { strcpy( yylval
.str
, yytext
);
1117 RETURN( PARAMETER
);
1123 { ScanError("Extra parameter on command line '%s'", yytext
);
1129 { strcpy( yylval
.str
, yytext
);
1136 { RETURN( yytext
[0] );
1142 { strcpy( yylval
.str
, yytext
);
1149 { strcpy( yylval
.str
, yytext
);
1156 { RETURN( SPCEQUAL
);
1162 { RETURN( SPCPLUS
);
1168 { RETURN( yytext
[0] );
1174 { ScanError("Invalid character '%c' in species definition", yytext
[0] );
1180 { strcpy( yylval
.str
, yytext
);
1187 { RETURN( yytext
[0] );
1193 { strcpy( yylval
.str
, yytext
);
1200 { RETURN( INIEQUAL
);
1206 { RETURN( yytext
[0] );
1212 { strcpy( yylval
.str
, yytext
);
1219 { ScanError("Invalid character '%c' in initial values", yytext
[0] );
1225 { strcpy( yylval
.str
, yytext
);
1232 { RETURN( EQNEQUAL
);
1238 { strcpy( yylval
.str
, yytext
);
1253 { strcpy( yylval
.str
, yytext
);
1260 { BEGIN EQNTAG_STATE
;
1267 { strcpy( yylval
.str
, yytext
);
1275 RETURN( EQNGREATER
);
1281 { strcpy( yylval
.str
, yytext
);
1289 RETURN( yytext
[0] );
1295 { strcpy( yylval
.str
, yytext
);
1302 { RETURN( LMPPLUS
);
1308 { RETURN( LMPCOLON
);
1314 { RETURN( yytext
[0] );
1320 { ScanError("Invalid character '%c' in species definition", yytext
[0] );
1326 { strcpy( yylval
.str
, yytext
);
1333 { RETURN( yytext
[0] );
1339 { strcpy( yylval
.str
, yytext
);
1346 { RETURN( yytext
[0] );
1352 { strcpy( yylval
.str
, yytext
);
1359 { RETURN( yytext
[0] );
1365 { strcpy( yylval
.str
, yytext
);
1372 { RETURN( yytext
[0] );
1378 { strcpy( yylval
.str
, yytext
);
1386 { if ( EqNoCase( yytext
+1, "ENDINLINE" ) ){
1388 RETURN( ENDINLINE
);
1391 strcpy( yylval
.str
, yytext
);
1400 strcpy( yylval
.str
,yytext
);
1407 { strcpy( yylval
.str
,yytext
);
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
):
1437 { if ( ! EndInclude() ) {
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
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
;
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;
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
);
1542 if ( ! yy_did_buffer_switch_on_eof
)
1548 case EOB_ACT_CONTINUE_SCAN
:
1550 yytext_ptr
+ yy_amount_of_matched_text
;
1552 yy_current_state
= yy_get_previous_state();
1555 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1558 case EOB_ACT_LAST_MATCH
:
1560 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
1562 yy_current_state
= yy_get_previous_state();
1565 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1566 goto yy_find_action
;
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
;
1594 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
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
;
1610 /* We matched some text prior to the EOB, first
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,
1629 yy_current_buffer
->yy_n_chars
= yy_n_chars
= 0;
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
1640 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
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;
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 );
1664 /* Can't grow it, we don't own it. */
1667 if ( ! b
->yy_ch_buf
)
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
-
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
;
1698 ret_val
= EOB_ACT_LAST_MATCH
;
1699 yy_current_buffer
->yy_buffer_status
=
1700 YY_BUFFER_EOF_PENDING
;
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];
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
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
)
1756 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
1757 yy_state_type yy_current_state
;
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
;
1783 #ifdef YY_USE_PROTOS
1784 static void yyunput( int c
, register char *yy_bp
)
1786 static void yyunput( c
, yy_bp
)
1788 register char *yy_bp
;
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
;
1821 yy_hold_char
= *yy_cp
;
1824 #endif /* ifndef YY_NO_UNPUT */
1828 static int yyinput()
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. */
1848 { /* need more input */
1849 int offset
= yy_c_buf_p
- yytext_ptr
;
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. */
1870 case EOB_ACT_END_OF_FILE
:
1875 if ( ! yy_did_buffer_switch_on_eof
)
1884 case EOB_ACT_CONTINUE_SCAN
:
1885 yy_c_buf_p
= yytext_ptr
+ offset
;
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
;
1900 #ifdef YY_USE_PROTOS
1901 void yyrestart( FILE *input_file
)
1903 void yyrestart( input_file
)
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
)
1918 void yy_switch_to_buffer( new_buffer
)
1919 YY_BUFFER_STATE new_buffer
;
1922 if ( yy_current_buffer
== new_buffer
)
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 )
1948 void yy_load_buffer_state()
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
)
1961 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
1968 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
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
);
1989 #ifdef YY_USE_PROTOS
1990 void yy_delete_buffer( YY_BUFFER_STATE b
)
1992 void yy_delete_buffer( b
)
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
2015 #ifdef YY_USE_PROTOS
2016 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
2018 void yy_init_buffer( b
, file
)
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;
2033 #if YY_NEVER_INTERACTIVE
2034 b
->yy_is_interactive
= 0;
2036 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
2042 #ifdef YY_USE_PROTOS
2043 void yy_flush_buffer( YY_BUFFER_STATE b
)
2045 void yy_flush_buffer( b
)
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];
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
)
2076 YY_BUFFER_STATE
yy_scan_buffer( base
, size
)
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. */
2089 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
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;
2100 b
->yy_fill_buffer
= 0;
2101 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2103 yy_switch_to_buffer( b
);
2110 #ifndef YY_NO_SCAN_STRING
2111 #ifdef YY_USE_PROTOS
2112 YY_BUFFER_STATE
yy_scan_string( yyconst
char *yy_str
)
2114 YY_BUFFER_STATE
yy_scan_string( yy_str
)
2115 yyconst
char *yy_str
;
2119 for ( len
= 0; yy_str
[len
]; ++len
)
2122 return yy_scan_bytes( yy_str
, len
);
2127 #ifndef YY_NO_SCAN_BYTES
2128 #ifdef YY_USE_PROTOS
2129 YY_BUFFER_STATE
yy_scan_bytes( yyconst
char *bytes
, int len
)
2131 YY_BUFFER_STATE
yy_scan_bytes( bytes
, len
)
2132 yyconst
char *bytes
;
2141 /* Get memory for full buffer, including space for trailing EOB's. */
2143 buf
= (char *) yy_flex_alloc( n
);
2145 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2147 for ( i
= 0; i
< len
; ++i
)
2150 buf
[len
] = buf
[len
+1] = YY_END_OF_BUFFER_CHAR
;
2152 b
= yy_scan_buffer( buf
, n
);
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;
2166 #ifndef YY_NO_PUSH_STATE
2167 #ifdef YY_USE_PROTOS
2168 static void yy_push_state( int new_state
)
2170 static void yy_push_state( new_state
)
2174 if ( yy_start_stack_ptr
>= yy_start_stack_depth
)
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
);
2185 yy_start_stack
= (int *) yy_flex_realloc(
2186 (void *) yy_start_stack
, new_size
);
2188 if ( ! yy_start_stack
)
2190 "out of memory expanding start-condition stack" );
2193 yy_start_stack
[yy_start_stack_ptr
++] = YY_START
;
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
]);
2211 #ifndef YY_NO_TOP_STATE
2212 static int yy_top_state()
2214 return yy_start_stack
[yy_start_stack_ptr
- 1];
2218 #ifndef YY_EXIT_FAILURE
2219 #define YY_EXIT_FAILURE 2
2222 #ifdef YY_USE_PROTOS
2223 static void yy_fatal_error( yyconst
char msg
[] )
2225 static void yy_fatal_error( msg
)
2229 (void) fprintf( stderr
, "%s\n", msg
);
2230 exit( YY_EXIT_FAILURE
);
2235 /* Redefine yyless() so it works in section 3 code. */
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'; \
2251 /* Internal utility routines. */
2254 #ifdef YY_USE_PROTOS
2255 static void yy_flex_strncpy( char *s1
, yyconst
char *s2
, int n
)
2257 static void yy_flex_strncpy( s1
, s2
, n
)
2264 for ( i
= 0; i
< n
; ++i
)
2269 #ifdef YY_NEED_STRLEN
2270 #ifdef YY_USE_PROTOS
2271 static int yy_flex_strlen( yyconst
char *s
)
2273 static int yy_flex_strlen( s
)
2278 for ( n
= 0; s
[n
]; ++n
)
2286 #ifdef YY_USE_PROTOS
2287 static void *yy_flex_alloc( yy_size_t size
)
2289 static void *yy_flex_alloc( size
)
2293 return (void *) malloc( size
);
2296 #ifdef YY_USE_PROTOS
2297 static void *yy_flex_realloc( void *ptr
, yy_size_t size
)
2299 static void *yy_flex_realloc( ptr
, size
)
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
)
2317 static void yy_flex_free( ptr
)
2334 void Include ( char * name
)
2337 YY_BUFFER_STATE newb
;
2339 if ( yy_buf_level
== MAX_INCLUDE
) {
2340 printf("\nInclude nested too deep. Include %s ignored", name
);
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
;
2351 crt_filename
= malloc( 1 + strlen( name
) );
2352 strcpy( crt_filename
, name
);
2355 f
= fopen( name
, "r" );
2357 FatalError(3,"%s: Can't read file", name
);
2359 newb
= yy_create_buffer(f
, YY_BUF_SIZE
);
2360 yy_switch_to_buffer( newb
);
2365 YY_BUFFER_STATE oldb
;
2368 if ( yy_buf_level
> 0 ) {
2369 oldb
= yy_current_buffer
;
2370 oldn
= crt_filename
;
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
);
2382 int EqNoCase( char *s1
, char *s2
)
2385 if ( toupper(*s1
++) != toupper(*s2
++) ) return 0;
2390 int CheckKeyword( char *cmd
)
2396 if( keywords
[i
].name
== 0 ) {
2397 ScanError( "'%s': Unknown command (ignored)", cmd
);
2400 if( EqNoCase( cmd
, keywords
[i
].name
) ) {