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