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