]>
Commit | Line | Data |
---|---|---|
1 | #define yy_create_buffer gram__create_buffer | |
2 | #define yy_delete_buffer gram__delete_buffer | |
3 | #define yy_scan_buffer gram__scan_buffer | |
4 | #define yy_scan_string gram__scan_string | |
5 | #define yy_scan_bytes gram__scan_bytes | |
6 | #define yy_flex_debug gram__flex_debug | |
7 | #define yy_init_buffer gram__init_buffer | |
8 | #define yy_flush_buffer gram__flush_buffer | |
9 | #define yy_load_buffer_state gram__load_buffer_state | |
10 | #define yy_switch_to_buffer gram__switch_to_buffer | |
11 | #define yyin gram_in | |
12 | #define yyleng gram_leng | |
13 | #define yylex gram_lex | |
14 | #define yyout gram_out | |
15 | #define yyrestart gram_restart | |
16 | #define yytext gram_text | |
17 | ||
18 | #line 19 "scan-gram.c" | |
19 | /* A lexical scanner generated by flex */ | |
20 | ||
21 | /* Scanner skeleton version: | |
22 | * $Header$ | |
23 | */ | |
24 | ||
25 | #define FLEX_SCANNER | |
26 | #define YY_FLEX_MAJOR_VERSION 2 | |
27 | #define YY_FLEX_MINOR_VERSION 5 | |
28 | ||
29 | #include <stdio.h> | |
30 | #include <errno.h> | |
31 | ||
32 | /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ | |
33 | #ifdef c_plusplus | |
34 | #ifndef __cplusplus | |
35 | #define __cplusplus | |
36 | #endif | |
37 | #endif | |
38 | ||
39 | ||
40 | #ifdef __cplusplus | |
41 | ||
42 | #include <stdlib.h> | |
43 | #ifndef _WIN32 | |
44 | #include <unistd.h> | |
45 | #endif | |
46 | ||
47 | /* Use prototypes in function declarations. */ | |
48 | #define YY_USE_PROTOS | |
49 | ||
50 | /* The "const" storage-class-modifier is valid. */ | |
51 | #define YY_USE_CONST | |
52 | ||
53 | #else /* ! __cplusplus */ | |
54 | ||
55 | #if __STDC__ | |
56 | ||
57 | #define YY_USE_PROTOS | |
58 | #define YY_USE_CONST | |
59 | ||
60 | #endif /* __STDC__ */ | |
61 | #endif /* ! __cplusplus */ | |
62 | ||
63 | #ifdef __TURBOC__ | |
64 | #pragma warn -rch | |
65 | #pragma warn -use | |
66 | #include <io.h> | |
67 | #include <stdlib.h> | |
68 | #define YY_USE_CONST | |
69 | #define YY_USE_PROTOS | |
70 | #endif | |
71 | ||
72 | #ifdef YY_USE_CONST | |
73 | #define yyconst const | |
74 | #else | |
75 | #define yyconst | |
76 | #endif | |
77 | ||
78 | ||
79 | #ifdef YY_USE_PROTOS | |
80 | #define YY_PROTO(proto) proto | |
81 | #else | |
82 | #define YY_PROTO(proto) () | |
83 | #endif | |
84 | ||
85 | /* Returned upon end-of-file. */ | |
86 | #define YY_NULL 0 | |
87 | ||
88 | /* Promotes a possibly negative, possibly signed char to an unsigned | |
89 | * integer for use as an array index. If the signed char is negative, | |
90 | * we want to instead treat it as an 8-bit unsigned char, hence the | |
91 | * double cast. | |
92 | */ | |
93 | #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) | |
94 | ||
95 | /* Enter a start condition. This macro really ought to take a parameter, | |
96 | * but we do it the disgusting crufty way forced on us by the ()-less | |
97 | * definition of BEGIN. | |
98 | */ | |
99 | #define BEGIN yy_start = 1 + 2 * | |
100 | ||
101 | /* Translate the current start state into a value that can be later handed | |
102 | * to BEGIN to return to the state. The YYSTATE alias is for lex | |
103 | * compatibility. | |
104 | */ | |
105 | #define YY_START ((yy_start - 1) / 2) | |
106 | #define YYSTATE YY_START | |
107 | ||
108 | /* Action number for EOF rule of a given start state. */ | |
109 | #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) | |
110 | ||
111 | /* Special action meaning "start processing a new file". */ | |
112 | #define YY_NEW_FILE yyrestart( yyin ) | |
113 | ||
114 | #define YY_END_OF_BUFFER_CHAR 0 | |
115 | ||
116 | /* Size of default input buffer. */ | |
117 | #define YY_BUF_SIZE 16384 | |
118 | ||
119 | typedef struct yy_buffer_state *YY_BUFFER_STATE; | |
120 | ||
121 | extern int yyleng; | |
122 | extern FILE *yyin, *yyout; | |
123 | ||
124 | #define EOB_ACT_CONTINUE_SCAN 0 | |
125 | #define EOB_ACT_END_OF_FILE 1 | |
126 | #define EOB_ACT_LAST_MATCH 2 | |
127 | ||
128 | /* The funky do-while in the following #define is used to turn the definition | |
129 | * int a single C statement (which needs a semi-colon terminator). This | |
130 | * avoids problems with code like: | |
131 | * | |
132 | * if ( condition_holds ) | |
133 | * yyless( 5 ); | |
134 | * else | |
135 | * do_something_else(); | |
136 | * | |
137 | * Prior to using the do-while the compiler would get upset at the | |
138 | * "else" because it interpreted the "if" statement as being all | |
139 | * done when it reached the ';' after the yyless() call. | |
140 | */ | |
141 | ||
142 | /* Return all but the first 'n' matched characters back to the input stream. */ | |
143 | ||
144 | #define yyless(n) \ | |
145 | do \ | |
146 | { \ | |
147 | /* Undo effects of setting up yytext. */ \ | |
148 | *yy_cp = yy_hold_char; \ | |
149 | YY_RESTORE_YY_MORE_OFFSET \ | |
150 | yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ | |
151 | YY_DO_BEFORE_ACTION; /* set up yytext again */ \ | |
152 | } \ | |
153 | while ( 0 ) | |
154 | ||
155 | #define unput(c) yyunput( c, yytext_ptr ) | |
156 | ||
157 | /* The following is because we cannot portably get our hands on size_t | |
158 | * (without autoconf's help, which isn't available because we want | |
159 | * flex-generated scanners to compile on their own). | |
160 | */ | |
161 | typedef unsigned int yy_size_t; | |
162 | ||
163 | ||
164 | struct yy_buffer_state | |
165 | { | |
166 | FILE *yy_input_file; | |
167 | ||
168 | char *yy_ch_buf; /* input buffer */ | |
169 | char *yy_buf_pos; /* current position in input buffer */ | |
170 | ||
171 | /* Size of input buffer in bytes, not including room for EOB | |
172 | * characters. | |
173 | */ | |
174 | yy_size_t yy_buf_size; | |
175 | ||
176 | /* Number of characters read into yy_ch_buf, not including EOB | |
177 | * characters. | |
178 | */ | |
179 | int yy_n_chars; | |
180 | ||
181 | /* Whether we "own" the buffer - i.e., we know we created it, | |
182 | * and can realloc() it to grow it, and should free() it to | |
183 | * delete it. | |
184 | */ | |
185 | int yy_is_our_buffer; | |
186 | ||
187 | /* Whether this is an "interactive" input source; if so, and | |
188 | * if we're using stdio for input, then we want to use getc() | |
189 | * instead of fread(), to make sure we stop fetching input after | |
190 | * each newline. | |
191 | */ | |
192 | int yy_is_interactive; | |
193 | ||
194 | /* Whether we're considered to be at the beginning of a line. | |
195 | * If so, '^' rules will be active on the next match, otherwise | |
196 | * not. | |
197 | */ | |
198 | int yy_at_bol; | |
199 | ||
200 | /* Whether to try to fill the input buffer when we reach the | |
201 | * end of it. | |
202 | */ | |
203 | int yy_fill_buffer; | |
204 | ||
205 | int yy_buffer_status; | |
206 | #define YY_BUFFER_NEW 0 | |
207 | #define YY_BUFFER_NORMAL 1 | |
208 | /* When an EOF's been seen but there's still some text to process | |
209 | * then we mark the buffer as YY_EOF_PENDING, to indicate that we | |
210 | * shouldn't try reading from the input source any more. We might | |
211 | * still have a bunch of tokens to match, though, because of | |
212 | * possible backing-up. | |
213 | * | |
214 | * When we actually see the EOF, we change the status to "new" | |
215 | * (via yyrestart()), so that the user can continue scanning by | |
216 | * just pointing yyin at a new input file. | |
217 | */ | |
218 | #define YY_BUFFER_EOF_PENDING 2 | |
219 | }; | |
220 | ||
221 | static YY_BUFFER_STATE yy_current_buffer = 0; | |
222 | ||
223 | /* We provide macros for accessing buffer states in case in the | |
224 | * future we want to put the buffer states in a more general | |
225 | * "scanner state". | |
226 | */ | |
227 | #define YY_CURRENT_BUFFER yy_current_buffer | |
228 | ||
229 | ||
230 | /* yy_hold_char holds the character lost when yytext is formed. */ | |
231 | static char yy_hold_char; | |
232 | ||
233 | static int yy_n_chars; /* number of characters read into yy_ch_buf */ | |
234 | ||
235 | ||
236 | int yyleng; | |
237 | ||
238 | /* Points to current character in buffer. */ | |
239 | static char *yy_c_buf_p = (char *) 0; | |
240 | static int yy_init = 1; /* whether we need to initialize */ | |
241 | static int yy_start = 0; /* start state number */ | |
242 | ||
243 | /* Flag which is used to allow yywrap()'s to do buffer switches | |
244 | * instead of setting up a fresh yyin. A bit of a hack ... | |
245 | */ | |
246 | static int yy_did_buffer_switch_on_eof; | |
247 | ||
248 | void yyrestart YY_PROTO(( FILE *input_file )); | |
249 | ||
250 | void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); | |
251 | void yy_load_buffer_state YY_PROTO(( void )); | |
252 | YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); | |
253 | void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); | |
254 | void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); | |
255 | void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); | |
256 | #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) | |
257 | ||
258 | YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); | |
259 | YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); | |
260 | YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); | |
261 | ||
262 | static void *yy_flex_alloc YY_PROTO(( yy_size_t )); | |
263 | static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); | |
264 | static void yy_flex_free YY_PROTO(( void * )); | |
265 | ||
266 | #define yy_new_buffer yy_create_buffer | |
267 | ||
268 | #define yy_set_interactive(is_interactive) \ | |
269 | { \ | |
270 | if ( ! yy_current_buffer ) \ | |
271 | yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ | |
272 | yy_current_buffer->yy_is_interactive = is_interactive; \ | |
273 | } | |
274 | ||
275 | #define yy_set_bol(at_bol) \ | |
276 | { \ | |
277 | if ( ! yy_current_buffer ) \ | |
278 | yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ | |
279 | yy_current_buffer->yy_at_bol = at_bol; \ | |
280 | } | |
281 | ||
282 | #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) | |
283 | ||
284 | ||
285 | #define yywrap() 1 | |
286 | #define YY_SKIP_YYWRAP | |
287 | ||
288 | #define FLEX_DEBUG | |
289 | typedef unsigned char YY_CHAR; | |
290 | FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; | |
291 | typedef int yy_state_type; | |
292 | ||
293 | #define FLEX_DEBUG | |
294 | extern char *yytext; | |
295 | #define yytext_ptr yytext | |
296 | ||
297 | static yy_state_type yy_get_previous_state YY_PROTO(( void )); | |
298 | static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); | |
299 | static int yy_get_next_buffer YY_PROTO(( void )); | |
300 | static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); | |
301 | ||
302 | /* Done after the current pattern has been matched and before the | |
303 | * corresponding action - sets up yytext. | |
304 | */ | |
305 | #define YY_DO_BEFORE_ACTION \ | |
306 | yytext_ptr = yy_bp; \ | |
307 | yyleng = (int) (yy_cp - yy_bp); \ | |
308 | yy_hold_char = *yy_cp; \ | |
309 | *yy_cp = '\0'; \ | |
310 | yy_c_buf_p = yy_cp; | |
311 | ||
312 | #define YY_NUM_RULES 102 | |
313 | #define YY_END_OF_BUFFER 103 | |
314 | static yyconst short int yy_accept[391] = | |
315 | { 0, | |
316 | 0, 0, 0, 0, 59, 59, 0, 0, 85, 85, | |
317 | 80, 80, 0, 0, 0, 0, 0, 0, 0, 0, | |
318 | 0, 0, 103, 51, 40, 40, 44, 51, 43, 38, | |
319 | 41, 51, 42, 36, 39, 51, 35, 48, 37, 57, | |
320 | 57, 52, 53, 59, 58, 59, 55, 55, 83, 82, | |
321 | 86, 78, 77, 81, 61, 60, 76, 63, 62, 96, | |
322 | 96, 88, 97, 87, 91, 97, 52, 53, 93, 92, | |
323 | 99, 88, 100, 87, 91, 101, 88, 87, 91, 40, | |
324 | 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
325 | 0, 0, 0, 0, 0, 0, 0, 47, 41, 45, | |
326 | ||
327 | 46, 42, 0, 57, 56, 0, 59, 59, 59, 59, | |
328 | 55, 54, 83, 84, 84, 84, 84, 78, 79, 79, | |
329 | 79, 79, 61, 75, 73, 64, 75, 66, 67, 68, | |
330 | 69, 70, 71, 75, 72, 75, 63, 96, 94, 0, | |
331 | 94, 0, 89, 90, 0, 95, 0, 95, 99, 98, | |
332 | 101, 89, 90, 101, 0, 0, 0, 0, 0, 0, | |
333 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
334 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
335 | 46, 49, 0, 0, 0, 85, 0, 0, 0, 0, | |
336 | 80, 0, 0, 0, 64, 0, 0, 65, 0, 0, | |
337 | ||
338 | 0, 101, 101, 0, 0, 0, 0, 0, 0, 0, | |
339 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
340 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
341 | 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, | |
342 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, | |
343 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, | |
344 | 0, 0, 0, 0, 0, 28, 0, 31, 0, 0, | |
345 | 34, 0, 0, 0, 2, 0, 0, 6, 0, 0, | |
346 | 0, 0, 0, 0, 0, 14, 0, 0, 0, 18, | |
347 | 0, 0, 0, 0, 24, 0, 27, 29, 32, 0, | |
348 | ||
349 | 0, 74, 1, 3, 0, 0, 8, 0, 0, 0, | |
350 | 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, | |
351 | 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, | |
352 | 0, 0, 0, 0, 22, 0, 0, 0, 33, 0, | |
353 | 0, 0, 0, 0, 0, 0, 0, 16, 17, 0, | |
354 | 0, 26, 0, 0, 0, 0, 0, 0, 25, 13, | |
355 | 0, 0, 0, 0, 5, 0, 0, 0, 11, 0, | |
356 | 0, 0, 0, 0, 9, 0, 15, 20, 23, 30, | |
357 | 0, 0, 7, 0, 0, 0, 0, 0, 10, 0 | |
358 | } ; | |
359 | ||
360 | static yyconst int yy_ec[256] = | |
361 | { 0, | |
362 | 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, | |
363 | 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, | |
364 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
365 | 1, 2, 1, 4, 1, 5, 6, 1, 7, 1, | |
366 | 1, 8, 1, 9, 10, 11, 12, 13, 13, 13, | |
367 | 13, 13, 13, 13, 13, 14, 14, 15, 16, 17, | |
368 | 18, 19, 20, 21, 22, 22, 22, 22, 22, 22, | |
369 | 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, | |
370 | 11, 11, 11, 11, 23, 11, 11, 11, 11, 11, | |
371 | 24, 25, 26, 1, 27, 1, 28, 29, 30, 31, | |
372 | ||
373 | 32, 33, 34, 35, 36, 11, 37, 38, 39, 40, | |
374 | 41, 42, 11, 43, 44, 45, 46, 47, 11, 48, | |
375 | 49, 11, 50, 51, 52, 1, 1, 1, 1, 1, | |
376 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
377 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
378 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
379 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
380 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
381 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
382 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
383 | ||
384 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
385 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
386 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
387 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
388 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
389 | 1, 1, 1, 1, 1 | |
390 | } ; | |
391 | ||
392 | static yyconst int yy_meta[54] = | |
393 | { 0, | |
394 | 1, 1, 2, 3, 4, 5, 6, 7, 1, 1, | |
395 | 8, 9, 10, 10, 1, 1, 1, 1, 11, 1, | |
396 | 4, 10, 8, 12, 13, 12, 8, 10, 10, 10, | |
397 | 10, 10, 10, 8, 8, 8, 8, 8, 8, 8, | |
398 | 8, 8, 8, 8, 8, 8, 8, 8, 8, 4, | |
399 | 1, 4, 11 | |
400 | } ; | |
401 | ||
402 | static yyconst short int yy_base[427] = | |
403 | { 0, | |
404 | 0, 0, 46, 47, 53, 56, 802, 801, 59, 62, | |
405 | 50, 82, 65, 87, 85, 86, 110, 160, 92, 117, | |
406 | 121, 128, 808, 811, 58, 62, 811, 207, 811, 811, | |
407 | 0, 50, 54, 811, 811, 0, 811, 811, 811, 0, | |
408 | 114, 811, 811, 782, 811, 117, 0, 794, 0, 811, | |
409 | 146, 0, 811, 148, 0, 811, 254, 0, 811, 0, | |
410 | 0, 811, 165, 811, 149, 175, 811, 811, 811, 811, | |
411 | 0, 811, 753, 811, 175, 0, 0, 0, 182, 92, | |
412 | 811, 768, 95, 54, 767, 764, 68, 769, 163, 754, | |
413 | 110, 763, 121, 127, 758, 765, 768, 811, 0, 811, | |
414 | ||
415 | 0, 179, 776, 0, 811, 193, 769, 195, 199, 768, | |
416 | 0, 811, 0, 811, 203, 767, 212, 0, 811, 214, | |
417 | 766, 216, 0, 811, 811, 777, 0, 811, 811, 811, | |
418 | 811, 811, 811, 0, 811, 0, 0, 0, 811, 208, | |
419 | 212, 0, 811, 811, 225, 811, 216, 218, 0, 811, | |
420 | 0, 0, 0, 231, 749, 226, 745, 744, 744, 161, | |
421 | 742, 227, 754, 740, 743, 253, 749, 735, 736, 69, | |
422 | 735, 743, 744, 747, 731, 736, 730, 735, 727, 739, | |
423 | 0, 811, 240, 253, 266, 743, 269, 282, 742, 286, | |
424 | 741, 288, 293, 740, 751, 0, 0, 0, 744, 301, | |
425 | ||
426 | 297, 304, 300, 734, 715, 724, 714, 726, 716, 724, | |
427 | 723, 722, 743, 707, 741, 722, 715, 716, 709, 718, | |
428 | 702, 702, 699, 712, 701, 708, 704, 700, 694, 697, | |
429 | 703, 702, 692, 703, 701, 811, 0, 0, 305, 687, | |
430 | 695, 688, 684, 696, 682, 694, 713, 691, 679, 811, | |
431 | 678, 674, 686, 254, 681, 672, 676, 668, 681, 811, | |
432 | 667, 301, 666, 678, 664, 811, 668, 811, 667, 665, | |
433 | 811, 0, 0, 656, 811, 672, 657, 811, 303, 657, | |
434 | 659, 304, 672, 671, 662, 811, 655, 656, 651, 811, | |
435 | 649, 683, 660, 649, 811, 645, 811, 306, 811, 645, | |
436 | ||
437 | 0, 811, 811, 644, 657, 639, 811, 642, 643, 640, | |
438 | 639, 640, 637, 647, 637, 811, 635, 633, 647, 633, | |
439 | 628, 640, 811, 626, 638, 635, 612, 601, 614, 589, | |
440 | 594, 579, 592, 592, 811, 573, 573, 582, 811, 567, | |
441 | 564, 565, 525, 534, 510, 498, 489, 811, 811, 470, | |
442 | 461, 811, 466, 449, 458, 442, 427, 423, 811, 811, | |
443 | 296, 301, 295, 288, 811, 283, 275, 275, 811, 272, | |
444 | 259, 249, 254, 232, 811, 228, 811, 811, 811, 811, | |
445 | 234, 307, 811, 229, 208, 199, 203, 179, 811, 811, | |
446 | 334, 347, 360, 373, 386, 399, 412, 425, 438, 451, | |
447 | ||
448 | 457, 467, 480, 493, 506, 519, 530, 543, 554, 567, | |
449 | 579, 592, 604, 617, 630, 643, 201, 193, 167, 656, | |
450 | 159, 145, 136, 134, 120, 93 | |
451 | } ; | |
452 | ||
453 | static yyconst short int yy_def[427] = | |
454 | { 0, | |
455 | 390, 1, 391, 391, 392, 392, 393, 393, 394, 394, | |
456 | 395, 395, 396, 396, 397, 397, 398, 398, 399, 399, | |
457 | 400, 400, 390, 390, 390, 390, 390, 390, 390, 390, | |
458 | 401, 390, 390, 390, 390, 402, 390, 390, 390, 403, | |
459 | 390, 390, 390, 404, 390, 404, 405, 390, 406, 390, | |
460 | 407, 408, 390, 409, 410, 390, 411, 412, 390, 413, | |
461 | 413, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
462 | 414, 390, 390, 390, 390, 415, 415, 415, 415, 390, | |
463 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
464 | 390, 390, 390, 390, 390, 390, 390, 390, 401, 390, | |
465 | ||
466 | 416, 390, 402, 403, 390, 390, 404, 404, 404, 404, | |
467 | 405, 390, 406, 390, 390, 390, 390, 408, 390, 390, | |
468 | 390, 390, 410, 390, 390, 390, 417, 390, 390, 390, | |
469 | 390, 390, 390, 418, 390, 419, 412, 413, 390, 390, | |
470 | 390, 420, 390, 390, 390, 390, 390, 390, 414, 390, | |
471 | 415, 415, 415, 415, 390, 390, 390, 390, 390, 390, | |
472 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
473 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
474 | 416, 390, 390, 390, 390, 390, 390, 390, 407, 390, | |
475 | 390, 390, 390, 409, 390, 421, 422, 419, 420, 390, | |
476 | ||
477 | 390, 415, 415, 390, 390, 390, 390, 390, 390, 390, | |
478 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
479 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
480 | 390, 390, 390, 390, 390, 390, 423, 424, 390, 390, | |
481 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
482 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
483 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
484 | 390, 425, 426, 390, 390, 390, 390, 390, 390, 390, | |
485 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
486 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
487 | ||
488 | 418, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
489 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
490 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
491 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
492 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
493 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
494 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
495 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
496 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 0, | |
497 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
498 | ||
499 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
500 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
501 | 390, 390, 390, 390, 390, 390 | |
502 | } ; | |
503 | ||
504 | static yyconst short int yy_nxt[865] = | |
505 | { 0, | |
506 | 24, 25, 26, 27, 24, 28, 29, 24, 30, 24, | |
507 | 31, 32, 33, 33, 34, 35, 36, 37, 24, 24, | |
508 | 24, 31, 31, 24, 24, 24, 31, 31, 31, 31, | |
509 | 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, | |
510 | 31, 31, 31, 31, 31, 31, 31, 31, 31, 38, | |
511 | 39, 24, 24, 41, 41, 45, 53, 100, 45, 80, | |
512 | 80, 101, 50, 80, 80, 50, 102, 102, 56, 42, | |
513 | 42, 43, 43, 42, 54, 43, 42, 46, 43, 42, | |
514 | 46, 43, 42, 51, 43, 42, 51, 43, 53, 57, | |
515 | 56, 59, 59, 80, 80, 72, 158, 73, 74, 162, | |
516 | ||
517 | 224, 159, 302, 75, 225, 42, 54, 43, 163, 57, | |
518 | 57, 57, 61, 62, 63, 42, 64, 43, 109, 110, | |
519 | 72, 65, 73, 74, 77, 105, 156, 78, 75, 301, | |
520 | 66, 77, 79, 67, 78, 68, 157, 169, 106, 79, | |
521 | 42, 108, 43, 273, 42, 272, 43, 115, 116, 120, | |
522 | 121, 42, 170, 43, 238, 171, 143, 173, 175, 69, | |
523 | 144, 70, 61, 62, 63, 174, 64, 176, 237, 139, | |
524 | 117, 65, 122, 145, 140, 177, 198, 141, 141, 146, | |
525 | 66, 142, 143, 67, 147, 68, 144, 148, 148, 152, | |
526 | 165, 102, 102, 153, 183, 184, 109, 110, 211, 145, | |
527 | ||
528 | 109, 110, 197, 166, 185, 186, 154, 167, 212, 69, | |
529 | 196, 70, 81, 188, 189, 190, 191, 193, 194, 108, | |
530 | 141, 141, 389, 108, 141, 141, 200, 201, 148, 148, | |
531 | 148, 148, 202, 203, 388, 82, 387, 83, 84, 85, | |
532 | 86, 183, 184, 386, 87, 88, 89, 90, 91, 92, | |
533 | 93, 94, 95, 96, 205, 97, 98, 125, 206, 214, | |
534 | 125, 385, 219, 287, 105, 383, 126, 185, 186, 207, | |
535 | 185, 186, 382, 125, 215, 381, 127, 106, 125, 219, | |
536 | 287, 128, 129, 188, 189, 380, 130, 190, 191, 190, | |
537 | 191, 379, 220, 131, 193, 194, 132, 378, 133, 134, | |
538 | ||
539 | 135, 136, 200, 201, 143, 202, 203, 152, 144, 139, | |
540 | 294, 153, 306, 309, 140, 321, 384, 141, 141, 377, | |
541 | 376, 145, 375, 374, 154, 373, 372, 294, 371, 306, | |
542 | 309, 370, 321, 384, 40, 40, 40, 40, 40, 40, | |
543 | 40, 40, 40, 40, 40, 40, 40, 44, 44, 44, | |
544 | 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, | |
545 | 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, | |
546 | 47, 47, 47, 49, 49, 49, 49, 49, 49, 49, | |
547 | 49, 49, 49, 49, 49, 49, 52, 52, 52, 52, | |
548 | 52, 52, 52, 52, 52, 52, 52, 52, 52, 55, | |
549 | ||
550 | 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, | |
551 | 55, 55, 58, 58, 58, 58, 58, 58, 58, 58, | |
552 | 58, 58, 58, 58, 58, 60, 60, 60, 60, 60, | |
553 | 60, 60, 60, 60, 60, 60, 60, 60, 71, 71, | |
554 | 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, | |
555 | 71, 76, 76, 76, 76, 76, 76, 76, 76, 76, | |
556 | 76, 76, 76, 76, 99, 369, 99, 103, 368, 103, | |
557 | 103, 103, 103, 103, 103, 103, 103, 367, 103, 103, | |
558 | 104, 104, 104, 104, 104, 104, 366, 104, 104, 104, | |
559 | 104, 365, 104, 107, 364, 107, 107, 107, 107, 107, | |
560 | ||
561 | 107, 107, 107, 107, 363, 107, 111, 111, 111, 111, | |
562 | 111, 111, 362, 111, 111, 111, 111, 111, 111, 113, | |
563 | 113, 361, 113, 113, 113, 113, 113, 113, 113, 113, | |
564 | 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, | |
565 | 114, 360, 114, 118, 118, 118, 118, 118, 359, 118, | |
566 | 118, 118, 118, 118, 119, 119, 119, 119, 119, 119, | |
567 | 119, 119, 119, 119, 119, 358, 119, 123, 123, 357, | |
568 | 123, 123, 123, 123, 123, 123, 123, 123, 123, 124, | |
569 | 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, | |
570 | 124, 124, 137, 137, 137, 137, 137, 356, 137, 137, | |
571 | ||
572 | 137, 137, 137, 137, 138, 138, 355, 354, 138, 353, | |
573 | 138, 138, 352, 138, 138, 351, 138, 149, 149, 350, | |
574 | 149, 349, 348, 149, 149, 347, 149, 149, 346, 149, | |
575 | 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, | |
576 | 151, 345, 151, 181, 344, 181, 181, 181, 181, 181, | |
577 | 181, 181, 181, 181, 181, 181, 199, 343, 199, 199, | |
578 | 199, 199, 199, 199, 199, 199, 342, 199, 199, 341, | |
579 | 340, 339, 338, 337, 336, 335, 334, 333, 332, 331, | |
580 | 330, 329, 328, 327, 326, 325, 324, 323, 322, 320, | |
581 | 319, 318, 317, 316, 315, 314, 313, 312, 311, 310, | |
582 | ||
583 | 308, 307, 305, 304, 303, 300, 299, 298, 297, 296, | |
584 | 295, 293, 292, 291, 290, 289, 288, 286, 285, 284, | |
585 | 283, 282, 281, 280, 279, 278, 277, 276, 275, 274, | |
586 | 271, 270, 269, 268, 267, 266, 265, 264, 263, 262, | |
587 | 261, 260, 259, 258, 257, 256, 255, 254, 253, 252, | |
588 | 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, | |
589 | 241, 240, 239, 236, 122, 192, 117, 187, 235, 234, | |
590 | 233, 232, 231, 230, 229, 228, 227, 226, 223, 222, | |
591 | 221, 218, 217, 216, 213, 210, 209, 208, 204, 195, | |
592 | 192, 187, 108, 108, 182, 180, 179, 178, 172, 168, | |
593 | ||
594 | 164, 161, 160, 155, 150, 112, 108, 390, 48, 48, | |
595 | 23, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
596 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
597 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
598 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
599 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
600 | 390, 390, 390, 390 | |
601 | } ; | |
602 | ||
603 | static yyconst short int yy_chk[865] = | |
604 | { 0, | |
605 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
606 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
607 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
608 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
609 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
610 | 1, 1, 1, 3, 4, 5, 11, 32, 6, 25, | |
611 | 25, 32, 9, 26, 26, 10, 33, 33, 13, 3, | |
612 | 4, 3, 4, 11, 11, 11, 5, 5, 5, 6, | |
613 | 6, 6, 9, 9, 9, 10, 10, 10, 12, 13, | |
614 | 14, 15, 16, 80, 80, 19, 84, 19, 19, 87, | |
615 | ||
616 | 170, 84, 426, 19, 170, 12, 12, 12, 87, 15, | |
617 | 16, 14, 17, 17, 17, 19, 17, 19, 46, 46, | |
618 | 20, 17, 20, 20, 21, 41, 83, 21, 20, 425, | |
619 | 17, 22, 21, 17, 22, 17, 83, 91, 41, 22, | |
620 | 20, 46, 20, 424, 21, 423, 21, 51, 51, 54, | |
621 | 54, 22, 91, 22, 422, 91, 65, 93, 94, 17, | |
622 | 65, 17, 18, 18, 18, 93, 18, 94, 421, 63, | |
623 | 51, 18, 54, 65, 63, 94, 419, 63, 63, 66, | |
624 | 18, 63, 75, 18, 66, 18, 75, 66, 66, 79, | |
625 | 89, 102, 102, 79, 106, 106, 108, 108, 160, 75, | |
626 | ||
627 | 109, 109, 418, 89, 115, 115, 79, 89, 160, 18, | |
628 | 417, 18, 28, 117, 117, 120, 120, 122, 122, 108, | |
629 | 140, 140, 388, 109, 141, 141, 145, 145, 147, 147, | |
630 | 148, 148, 154, 154, 387, 28, 386, 28, 28, 28, | |
631 | 28, 183, 183, 385, 28, 28, 28, 28, 28, 28, | |
632 | 28, 28, 28, 28, 156, 28, 28, 57, 156, 162, | |
633 | 57, 384, 166, 254, 184, 381, 57, 185, 185, 156, | |
634 | 187, 187, 376, 57, 162, 374, 57, 184, 57, 166, | |
635 | 254, 57, 57, 188, 188, 373, 57, 190, 190, 192, | |
636 | 192, 372, 166, 57, 193, 193, 57, 371, 57, 57, | |
637 | ||
638 | 57, 57, 200, 200, 201, 202, 202, 203, 201, 239, | |
639 | 262, 203, 279, 282, 239, 298, 382, 239, 239, 370, | |
640 | 368, 201, 367, 366, 203, 364, 363, 262, 362, 279, | |
641 | 282, 361, 298, 382, 391, 391, 391, 391, 391, 391, | |
642 | 391, 391, 391, 391, 391, 391, 391, 392, 392, 392, | |
643 | 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, | |
644 | 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, | |
645 | 393, 393, 393, 394, 394, 394, 394, 394, 394, 394, | |
646 | 394, 394, 394, 394, 394, 394, 395, 395, 395, 395, | |
647 | 395, 395, 395, 395, 395, 395, 395, 395, 395, 396, | |
648 | ||
649 | 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, | |
650 | 396, 396, 397, 397, 397, 397, 397, 397, 397, 397, | |
651 | 397, 397, 397, 397, 397, 398, 398, 398, 398, 398, | |
652 | 398, 398, 398, 398, 398, 398, 398, 398, 399, 399, | |
653 | 399, 399, 399, 399, 399, 399, 399, 399, 399, 399, | |
654 | 399, 400, 400, 400, 400, 400, 400, 400, 400, 400, | |
655 | 400, 400, 400, 400, 401, 358, 401, 402, 357, 402, | |
656 | 402, 402, 402, 402, 402, 402, 402, 356, 402, 402, | |
657 | 403, 403, 403, 403, 403, 403, 355, 403, 403, 403, | |
658 | 403, 354, 403, 404, 353, 404, 404, 404, 404, 404, | |
659 | ||
660 | 404, 404, 404, 404, 351, 404, 405, 405, 405, 405, | |
661 | 405, 405, 350, 405, 405, 405, 405, 405, 405, 406, | |
662 | 406, 347, 406, 406, 406, 406, 406, 406, 406, 406, | |
663 | 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, | |
664 | 407, 346, 407, 408, 408, 408, 408, 408, 345, 408, | |
665 | 408, 408, 408, 408, 409, 409, 409, 409, 409, 409, | |
666 | 409, 409, 409, 409, 409, 344, 409, 410, 410, 343, | |
667 | 410, 410, 410, 410, 410, 410, 410, 410, 410, 411, | |
668 | 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, | |
669 | 411, 411, 412, 412, 412, 412, 412, 342, 412, 412, | |
670 | ||
671 | 412, 412, 412, 412, 413, 413, 341, 340, 413, 338, | |
672 | 413, 413, 337, 413, 413, 336, 413, 414, 414, 334, | |
673 | 414, 333, 332, 414, 414, 331, 414, 414, 330, 414, | |
674 | 415, 415, 415, 415, 415, 415, 415, 415, 415, 415, | |
675 | 415, 329, 415, 416, 328, 416, 416, 416, 416, 416, | |
676 | 416, 416, 416, 416, 416, 416, 420, 327, 420, 420, | |
677 | 420, 420, 420, 420, 420, 420, 326, 420, 420, 325, | |
678 | 324, 322, 321, 320, 319, 318, 317, 315, 314, 313, | |
679 | 312, 311, 310, 309, 308, 306, 305, 304, 300, 296, | |
680 | 294, 293, 292, 291, 289, 288, 287, 285, 284, 283, | |
681 | ||
682 | 281, 280, 277, 276, 274, 270, 269, 267, 265, 264, | |
683 | 263, 261, 259, 258, 257, 256, 255, 253, 252, 251, | |
684 | 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, | |
685 | 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, | |
686 | 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, | |
687 | 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, | |
688 | 205, 204, 199, 195, 194, 191, 189, 186, 180, 179, | |
689 | 178, 177, 176, 175, 174, 173, 172, 171, 169, 168, | |
690 | 167, 165, 164, 163, 161, 159, 158, 157, 155, 126, | |
691 | 121, 116, 110, 107, 103, 97, 96, 95, 92, 90, | |
692 | ||
693 | 88, 86, 85, 82, 73, 48, 44, 23, 8, 7, | |
694 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
695 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
696 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
697 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
698 | 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, | |
699 | 390, 390, 390, 390 | |
700 | } ; | |
701 | ||
702 | static yy_state_type yy_last_accepting_state; | |
703 | static char *yy_last_accepting_cpos; | |
704 | ||
705 | extern int yy_flex_debug; | |
706 | int yy_flex_debug = 1; | |
707 | ||
708 | static yyconst short int yy_rule_linenum[102] = | |
709 | { 0, | |
710 | 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, | |
711 | 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, | |
712 | 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, | |
713 | 245, 246, 247, 248, 250, 251, 252, 253, 254, 256, | |
714 | 258, 264, 278, 281, 284, 285, 288, 291, 294, 302, | |
715 | 308, 323, 324, 334, 339, 354, 355, 370, 371, 383, | |
716 | 393, 412, 428, 447, 458, 471, 472, 473, 474, 475, | |
717 | 476, 477, 478, 479, 489, 494, 505, 511, 512, 513, | |
718 | 515, 532, 538, 539, 540, 542, 559, 562, 565, 566, | |
719 | 569, 580, 592, 594, 596, 599, 602, 621, 628, 629, | |
720 | ||
721 | 648 | |
722 | } ; | |
723 | ||
724 | /* The intent behind this definition is that it'll catch | |
725 | * any uses of REJECT which flex missed. | |
726 | */ | |
727 | #define REJECT reject_used_but_not_detected | |
728 | #define yymore() yymore_used_but_not_detected | |
729 | #define YY_MORE_ADJ 0 | |
730 | #define YY_RESTORE_YY_MORE_OFFSET | |
731 | char *yytext; | |
732 | #line 1 "scan-gram.l" | |
733 | #define INITIAL 0 | |
734 | /* Bison Grammar Scanner -*- C -*- | |
735 | Copyright (C) 2002 Free Software Foundation, Inc. | |
736 | ||
737 | This file is part of Bison, the GNU Compiler Compiler. | |
738 | ||
739 | This program is free software; you can redistribute it and/or modify | |
740 | it under the terms of the GNU General Public License as published by | |
741 | the Free Software Foundation; either version 2 of the License, or | |
742 | (at your option) any later version. | |
743 | ||
744 | This program is distributed in the hope that it will be useful, | |
745 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
746 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
747 | GNU General Public License for more details. | |
748 | ||
749 | You should have received a copy of the GNU General Public License | |
750 | along with this program; if not, write to the Free Software | |
751 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | |
752 | 02111-1307 USA | |
753 | */ | |
754 | #define YY_NO_UNPUT 1 | |
755 | #define YY_NEVER_INTERACTIVE 1 | |
756 | #define YY_STACK_USED 1 | |
757 | #line 26 "scan-gram.l" | |
758 | #include "system.h" | |
759 | #include "mbswidth.h" | |
760 | #include "complain.h" | |
761 | #include "quote.h" | |
762 | #include "getargs.h" | |
763 | #include "gram.h" | |
764 | #include "reader.h" | |
765 | ||
766 | /* Each time we match a string, move the end cursor to its end. */ | |
767 | #define YY_USER_INIT \ | |
768 | do { \ | |
769 | LOCATION_RESET (*yylloc); \ | |
770 | yylloc->file = infile; \ | |
771 | /* This is only to avoid GCC warnings. */ \ | |
772 | if (yycontrol) {;}; \ | |
773 | } while (0) | |
774 | ||
775 | #define YY_USER_ACTION extend_location (yylloc, yytext, yyleng); | |
776 | #define YY_STEP LOCATION_STEP (*yylloc) | |
777 | ||
778 | #define YY_INPUT(buf, result, size) ((result) = no_cr_read (yyin, buf, size)) | |
779 | ||
780 | ||
781 | /* Read bytes from FP into buffer BUF of size SIZE. Return the | |
782 | number of bytes read. Remove '\r' from input, treating \r\n | |
783 | and isolated \r as \n. */ | |
784 | ||
785 | static size_t | |
786 | no_cr_read (FILE *fp, char *buf, size_t size) | |
787 | { | |
788 | size_t s = fread (buf, 1, size, fp); | |
789 | if (s) | |
790 | { | |
791 | char *w = memchr (buf, '\r', s); | |
792 | if (w) | |
793 | { | |
794 | char const *r = ++w; | |
795 | char const *lim = buf + s; | |
796 | ||
797 | for (;;) | |
798 | { | |
799 | /* Found an '\r'. Treat it like '\n', but ignore any | |
800 | '\n' that immediately follows. */ | |
801 | w[-1] = '\n'; | |
802 | if (r == lim) | |
803 | { | |
804 | int ch = getc (fp); | |
805 | if (ch != '\n' && ungetc (ch, fp) != ch) | |
806 | break; | |
807 | } | |
808 | else if (*r == '\n') | |
809 | r++; | |
810 | ||
811 | /* Copy until the next '\r'. */ | |
812 | do | |
813 | { | |
814 | if (r == lim) | |
815 | return w - buf; | |
816 | } | |
817 | while ((*w++ = *r++) != '\r'); | |
818 | } | |
819 | ||
820 | return w - buf; | |
821 | } | |
822 | } | |
823 | ||
824 | return s; | |
825 | } | |
826 | ||
827 | ||
828 | /* Extend *LOC to account for token TOKEN of size SIZE. */ | |
829 | ||
830 | static void | |
831 | extend_location (location_t *loc, char const *token, int size) | |
832 | { | |
833 | int line = loc->last_line; | |
834 | int column = loc->last_column; | |
835 | char const *p0 = token; | |
836 | char const *p = token; | |
837 | char const *lim = token + size; | |
838 | ||
839 | for (p = token; p < lim; p++) | |
840 | switch (*p) | |
841 | { | |
842 | case '\r': | |
843 | /* \r shouldn't survive no_cr_read. */ | |
844 | abort (); | |
845 | ||
846 | case '\n': | |
847 | line++; | |
848 | column = 1; | |
849 | p0 = p + 1; | |
850 | break; | |
851 | ||
852 | case '\t': | |
853 | column += mbsnwidth (p0, p - p0, 0); | |
854 | column += 8 - ((column - 1) & 7); | |
855 | p0 = p + 1; | |
856 | break; | |
857 | } | |
858 | ||
859 | loc->last_line = line; | |
860 | loc->last_column = column + mbsnwidth (p0, p - p0, 0); | |
861 | } | |
862 | ||
863 | ||
864 | ||
865 | /* STRING_OBSTACK -- Used to store all the characters that we need to | |
866 | keep (to construct ID, STRINGS etc.). Use the following macros to | |
867 | use it. | |
868 | ||
869 | Use YY_OBS_GROW to append what has just been matched, and | |
870 | YY_OBS_FINISH to end the string (it puts the ending 0). | |
871 | YY_OBS_FINISH also stores this string in LAST_STRING, which can be | |
872 | used, and which is used by YY_OBS_FREE to free the last string. */ | |
873 | ||
874 | static struct obstack string_obstack; | |
875 | char *last_string; | |
876 | ||
877 | #define YY_OBS_GROW \ | |
878 | obstack_grow (&string_obstack, yytext, yyleng) | |
879 | ||
880 | #define YY_OBS_FINISH \ | |
881 | do { \ | |
882 | obstack_1grow (&string_obstack, '\0'); \ | |
883 | last_string = obstack_finish (&string_obstack); \ | |
884 | } while (0) | |
885 | ||
886 | #define YY_OBS_FREE \ | |
887 | do { \ | |
888 | obstack_free (&string_obstack, last_string); \ | |
889 | } while (0) | |
890 | ||
891 | void | |
892 | scanner_last_string_free (void) | |
893 | { | |
894 | YY_OBS_FREE; | |
895 | } | |
896 | ||
897 | ||
898 | static int braces_level = 0; | |
899 | static int percent_percent_count = 0; | |
900 | ||
901 | /* Within well-formed rules, RULE_LENGTH is the number of values in | |
902 | the current rule so far, which says where to find `$0' with respect | |
903 | to the top of the stack. It is not the same as the rule->length in | |
904 | the case of mid rule actions. | |
905 | ||
906 | Outside of well-formed rules, RULE_LENGTH has an undefined value. */ | |
907 | static int rule_length; | |
908 | ||
909 | static void handle_dollar (braced_code_t code_kind, | |
910 | char *cp, location_t location); | |
911 | static void handle_at (braced_code_t code_kind, | |
912 | char *cp, location_t location); | |
913 | static int convert_ucn_to_byte (char const *hex_text); | |
914 | ||
915 | #define SC_COMMENT 1 | |
916 | #define SC_LINE_COMMENT 2 | |
917 | #define SC_YACC_COMMENT 3 | |
918 | ||
919 | #define SC_STRING 4 | |
920 | #define SC_CHARACTER 5 | |
921 | ||
922 | #define SC_ESCAPED_STRING 6 | |
923 | #define SC_ESCAPED_CHARACTER 7 | |
924 | ||
925 | #define SC_BRACED_CODE 8 | |
926 | #define SC_PROLOGUE 9 | |
927 | #define SC_EPILOGUE 10 | |
928 | ||
929 | /* POSIX says that a tag must be both an id and a C union member, but | |
930 | historically almost any character is allowed in a tag. We disallow | |
931 | NUL and newline, as this simplifies our implementation. */ | |
932 | /* Zero or more instances of backslash-newline. Following GCC, allow | |
933 | white space between the backslash and the newline. */ | |
934 | #line 935 "scan-gram.c" | |
935 | ||
936 | /* Macros after this point can all be overridden by user definitions in | |
937 | * section 1. | |
938 | */ | |
939 | ||
940 | #ifndef YY_SKIP_YYWRAP | |
941 | #ifdef __cplusplus | |
942 | extern "C" int yywrap YY_PROTO(( void )); | |
943 | #else | |
944 | extern int yywrap YY_PROTO(( void )); | |
945 | #endif | |
946 | #endif | |
947 | ||
948 | #ifndef YY_NO_UNPUT | |
949 | static void yyunput YY_PROTO(( int c, char *buf_ptr )); | |
950 | #endif | |
951 | ||
952 | #ifndef yytext_ptr | |
953 | static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); | |
954 | #endif | |
955 | ||
956 | #ifdef YY_NEED_STRLEN | |
957 | static int yy_flex_strlen YY_PROTO(( yyconst char * )); | |
958 | #endif | |
959 | ||
960 | #ifndef YY_NO_INPUT | |
961 | #ifdef __cplusplus | |
962 | static int yyinput YY_PROTO(( void )); | |
963 | #else | |
964 | static int input YY_PROTO(( void )); | |
965 | #endif | |
966 | #endif | |
967 | ||
968 | #if YY_STACK_USED | |
969 | static int yy_start_stack_ptr = 0; | |
970 | static int yy_start_stack_depth = 0; | |
971 | static int *yy_start_stack = 0; | |
972 | #ifndef YY_NO_PUSH_STATE | |
973 | static void yy_push_state YY_PROTO(( int new_state )); | |
974 | #endif | |
975 | #ifndef YY_NO_POP_STATE | |
976 | static void yy_pop_state YY_PROTO(( void )); | |
977 | #endif | |
978 | #ifndef YY_NO_TOP_STATE | |
979 | static int yy_top_state YY_PROTO(( void )); | |
980 | #endif | |
981 | ||
982 | #else | |
983 | #define YY_NO_PUSH_STATE 1 | |
984 | #define YY_NO_POP_STATE 1 | |
985 | #define YY_NO_TOP_STATE 1 | |
986 | #endif | |
987 | ||
988 | #ifdef YY_MALLOC_DECL | |
989 | YY_MALLOC_DECL | |
990 | #else | |
991 | #if __STDC__ | |
992 | #ifndef __cplusplus | |
993 | #include <stdlib.h> | |
994 | #endif | |
995 | #else | |
996 | /* Just try to get by without declaring the routines. This will fail | |
997 | * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) | |
998 | * or sizeof(void*) != sizeof(int). | |
999 | */ | |
1000 | #endif | |
1001 | #endif | |
1002 | ||
1003 | /* Amount of stuff to slurp up with each read. */ | |
1004 | #ifndef YY_READ_BUF_SIZE | |
1005 | #define YY_READ_BUF_SIZE 8192 | |
1006 | #endif | |
1007 | ||
1008 | /* Copy whatever the last rule matched to the standard output. */ | |
1009 | ||
1010 | #ifndef ECHO | |
1011 | /* This used to be an fputs(), but since the string might contain NUL's, | |
1012 | * we now use fwrite(). | |
1013 | */ | |
1014 | #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) | |
1015 | #endif | |
1016 | ||
1017 | /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, | |
1018 | * is returned in "result". | |
1019 | */ | |
1020 | #ifndef YY_INPUT | |
1021 | #define YY_INPUT(buf,result,max_size) \ | |
1022 | if ( yy_current_buffer->yy_is_interactive ) \ | |
1023 | { \ | |
1024 | int c = '*', n; \ | |
1025 | for ( n = 0; n < max_size && \ | |
1026 | (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ | |
1027 | buf[n] = (char) c; \ | |
1028 | if ( c == '\n' ) \ | |
1029 | buf[n++] = (char) c; \ | |
1030 | if ( c == EOF && ferror( yyin ) ) \ | |
1031 | YY_FATAL_ERROR( "input in flex scanner failed" ); \ | |
1032 | result = n; \ | |
1033 | } \ | |
1034 | else \ | |
1035 | { \ | |
1036 | errno=0; \ | |
1037 | while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ | |
1038 | { \ | |
1039 | if( errno != EINTR) \ | |
1040 | { \ | |
1041 | YY_FATAL_ERROR( "input in flex scanner failed" ); \ | |
1042 | break; \ | |
1043 | } \ | |
1044 | errno=0; \ | |
1045 | clearerr(yyin); \ | |
1046 | } \ | |
1047 | } | |
1048 | #endif | |
1049 | ||
1050 | /* No semi-colon after return; correct usage is to write "yyterminate();" - | |
1051 | * we don't want an extra ';' after the "return" because that will cause | |
1052 | * some compilers to complain about unreachable statements. | |
1053 | */ | |
1054 | #ifndef yyterminate | |
1055 | #define yyterminate() return YY_NULL | |
1056 | #endif | |
1057 | ||
1058 | /* Number of entries by which start-condition stack grows. */ | |
1059 | #ifndef YY_START_STACK_INCR | |
1060 | #define YY_START_STACK_INCR 25 | |
1061 | #endif | |
1062 | ||
1063 | /* Report a fatal error. */ | |
1064 | #ifndef YY_FATAL_ERROR | |
1065 | #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) | |
1066 | #endif | |
1067 | ||
1068 | /* Default declaration of generated scanner - a define so the user can | |
1069 | * easily add parameters. | |
1070 | */ | |
1071 | #ifndef YY_DECL | |
1072 | #define YY_DECL int yylex YY_PROTO(( void )) | |
1073 | #endif | |
1074 | ||
1075 | /* Code executed at the beginning of each rule, after yytext and yyleng | |
1076 | * have been set up. | |
1077 | */ | |
1078 | #ifndef YY_USER_ACTION | |
1079 | #define YY_USER_ACTION | |
1080 | #endif | |
1081 | ||
1082 | /* Code executed at the end of each rule. */ | |
1083 | #ifndef YY_BREAK | |
1084 | #define YY_BREAK break; | |
1085 | #endif | |
1086 | ||
1087 | #define YY_RULE_SETUP \ | |
1088 | YY_USER_ACTION | |
1089 | ||
1090 | YY_DECL | |
1091 | { | |
1092 | register yy_state_type yy_current_state; | |
1093 | register char *yy_cp, *yy_bp; | |
1094 | register int yy_act; | |
1095 | ||
1096 | #line 202 "scan-gram.l" | |
1097 | ||
1098 | ||
1099 | /* At each yylex invocation, mark the current position as the | |
1100 | start of the next token. */ | |
1101 | YY_STEP; | |
1102 | ||
1103 | ||
1104 | ||
1105 | /*----------------------------. | |
1106 | | Scanning Bison directives. | | |
1107 | `----------------------------*/ | |
1108 | #line 1109 "scan-gram.c" | |
1109 | ||
1110 | if ( yy_init ) | |
1111 | { | |
1112 | yy_init = 0; | |
1113 | ||
1114 | #ifdef YY_USER_INIT | |
1115 | YY_USER_INIT; | |
1116 | #endif | |
1117 | ||
1118 | if ( ! yy_start ) | |
1119 | yy_start = 1; /* first start state */ | |
1120 | ||
1121 | if ( ! yyin ) | |
1122 | yyin = stdin; | |
1123 | ||
1124 | if ( ! yyout ) | |
1125 | yyout = stdout; | |
1126 | ||
1127 | if ( ! yy_current_buffer ) | |
1128 | yy_current_buffer = | |
1129 | yy_create_buffer( yyin, YY_BUF_SIZE ); | |
1130 | ||
1131 | yy_load_buffer_state(); | |
1132 | } | |
1133 | ||
1134 | while ( 1 ) /* loops until end-of-file is reached */ | |
1135 | { | |
1136 | yy_cp = yy_c_buf_p; | |
1137 | ||
1138 | /* Support of yytext. */ | |
1139 | *yy_cp = yy_hold_char; | |
1140 | ||
1141 | /* yy_bp points to the position in yy_ch_buf of the start of | |
1142 | * the current run. | |
1143 | */ | |
1144 | yy_bp = yy_cp; | |
1145 | ||
1146 | yy_current_state = yy_start; | |
1147 | yy_match: | |
1148 | do | |
1149 | { | |
1150 | register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; | |
1151 | if ( yy_accept[yy_current_state] ) | |
1152 | { | |
1153 | yy_last_accepting_state = yy_current_state; | |
1154 | yy_last_accepting_cpos = yy_cp; | |
1155 | } | |
1156 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) | |
1157 | { | |
1158 | yy_current_state = (int) yy_def[yy_current_state]; | |
1159 | if ( yy_current_state >= 391 ) | |
1160 | yy_c = yy_meta[(unsigned int) yy_c]; | |
1161 | } | |
1162 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; | |
1163 | ++yy_cp; | |
1164 | } | |
1165 | while ( yy_base[yy_current_state] != 811 ); | |
1166 | ||
1167 | yy_find_action: | |
1168 | yy_act = yy_accept[yy_current_state]; | |
1169 | if ( yy_act == 0 ) | |
1170 | { /* have to back up */ | |
1171 | yy_cp = yy_last_accepting_cpos; | |
1172 | yy_current_state = yy_last_accepting_state; | |
1173 | yy_act = yy_accept[yy_current_state]; | |
1174 | } | |
1175 | ||
1176 | YY_DO_BEFORE_ACTION; | |
1177 | ||
1178 | ||
1179 | do_action: /* This label is used only to access EOF actions. */ | |
1180 | ||
1181 | if ( yy_flex_debug ) | |
1182 | { | |
1183 | if ( yy_act == 0 ) | |
1184 | fprintf( stderr, "--scanner backing up\n" ); | |
1185 | else if ( yy_act < 102 ) | |
1186 | fprintf( stderr, "--accepting rule at line %d (\"%s\")\n", | |
1187 | yy_rule_linenum[yy_act], yytext ); | |
1188 | else if ( yy_act == 102 ) | |
1189 | fprintf( stderr, "--accepting default rule (\"%s\")\n", | |
1190 | yytext ); | |
1191 | else if ( yy_act == 103 ) | |
1192 | fprintf( stderr, "--(end of buffer or a NUL)\n" ); | |
1193 | else | |
1194 | fprintf( stderr, "--EOF (start condition %d)\n", YY_START ); | |
1195 | } | |
1196 | ||
1197 | switch ( yy_act ) | |
1198 | { /* beginning of action switch */ | |
1199 | case 0: /* must back up */ | |
1200 | /* undo the effects of YY_DO_BEFORE_ACTION */ | |
1201 | *yy_cp = yy_hold_char; | |
1202 | yy_cp = yy_last_accepting_cpos; | |
1203 | yy_current_state = yy_last_accepting_state; | |
1204 | goto yy_find_action; | |
1205 | ||
1206 | ||
1207 | ||
1208 | case 1: | |
1209 | YY_RULE_SETUP | |
1210 | #line 215 "scan-gram.l" | |
1211 | return PERCENT_NONASSOC; | |
1212 | YY_BREAK | |
1213 | case 2: | |
1214 | YY_RULE_SETUP | |
1215 | #line 216 "scan-gram.l" | |
1216 | return PERCENT_DEBUG; | |
1217 | YY_BREAK | |
1218 | case 3: | |
1219 | YY_RULE_SETUP | |
1220 | #line 217 "scan-gram.l" | |
1221 | return PERCENT_DEFINE; | |
1222 | YY_BREAK | |
1223 | case 4: | |
1224 | YY_RULE_SETUP | |
1225 | #line 218 "scan-gram.l" | |
1226 | return PERCENT_DEFINES; | |
1227 | YY_BREAK | |
1228 | case 5: | |
1229 | YY_RULE_SETUP | |
1230 | #line 219 "scan-gram.l" | |
1231 | return PERCENT_DESTRUCTOR; | |
1232 | YY_BREAK | |
1233 | case 6: | |
1234 | YY_RULE_SETUP | |
1235 | #line 220 "scan-gram.l" | |
1236 | return PERCENT_DPREC; | |
1237 | YY_BREAK | |
1238 | case 7: | |
1239 | YY_RULE_SETUP | |
1240 | #line 221 "scan-gram.l" | |
1241 | return PERCENT_ERROR_VERBOSE; | |
1242 | YY_BREAK | |
1243 | case 8: | |
1244 | YY_RULE_SETUP | |
1245 | #line 222 "scan-gram.l" | |
1246 | return PERCENT_EXPECT; | |
1247 | YY_BREAK | |
1248 | case 9: | |
1249 | YY_RULE_SETUP | |
1250 | #line 223 "scan-gram.l" | |
1251 | return PERCENT_FILE_PREFIX; | |
1252 | YY_BREAK | |
1253 | case 10: | |
1254 | YY_RULE_SETUP | |
1255 | #line 224 "scan-gram.l" | |
1256 | return PERCENT_YACC; | |
1257 | YY_BREAK | |
1258 | case 11: | |
1259 | YY_RULE_SETUP | |
1260 | #line 225 "scan-gram.l" | |
1261 | return PERCENT_GLR_PARSER; | |
1262 | YY_BREAK | |
1263 | case 12: | |
1264 | YY_RULE_SETUP | |
1265 | #line 226 "scan-gram.l" | |
1266 | return PERCENT_LEFT; | |
1267 | YY_BREAK | |
1268 | case 13: | |
1269 | YY_RULE_SETUP | |
1270 | #line 227 "scan-gram.l" | |
1271 | return PERCENT_LOCATIONS; | |
1272 | YY_BREAK | |
1273 | case 14: | |
1274 | YY_RULE_SETUP | |
1275 | #line 228 "scan-gram.l" | |
1276 | return PERCENT_MERGE; | |
1277 | YY_BREAK | |
1278 | case 15: | |
1279 | YY_RULE_SETUP | |
1280 | #line 229 "scan-gram.l" | |
1281 | return PERCENT_NAME_PREFIX; | |
1282 | YY_BREAK | |
1283 | case 16: | |
1284 | YY_RULE_SETUP | |
1285 | #line 230 "scan-gram.l" | |
1286 | return PERCENT_NO_LINES; | |
1287 | YY_BREAK | |
1288 | case 17: | |
1289 | YY_RULE_SETUP | |
1290 | #line 231 "scan-gram.l" | |
1291 | return PERCENT_NONASSOC; | |
1292 | YY_BREAK | |
1293 | case 18: | |
1294 | YY_RULE_SETUP | |
1295 | #line 232 "scan-gram.l" | |
1296 | return PERCENT_NTERM; | |
1297 | YY_BREAK | |
1298 | case 19: | |
1299 | YY_RULE_SETUP | |
1300 | #line 233 "scan-gram.l" | |
1301 | return PERCENT_OUTPUT; | |
1302 | YY_BREAK | |
1303 | case 20: | |
1304 | YY_RULE_SETUP | |
1305 | #line 234 "scan-gram.l" | |
1306 | return PERCENT_PARSE_PARAM; | |
1307 | YY_BREAK | |
1308 | case 21: | |
1309 | YY_RULE_SETUP | |
1310 | #line 235 "scan-gram.l" | |
1311 | rule_length--; return PERCENT_PREC; | |
1312 | YY_BREAK | |
1313 | case 22: | |
1314 | YY_RULE_SETUP | |
1315 | #line 236 "scan-gram.l" | |
1316 | return PERCENT_PRINTER; | |
1317 | YY_BREAK | |
1318 | case 23: | |
1319 | YY_RULE_SETUP | |
1320 | #line 237 "scan-gram.l" | |
1321 | return PERCENT_PURE_PARSER; | |
1322 | YY_BREAK | |
1323 | case 24: | |
1324 | YY_RULE_SETUP | |
1325 | #line 238 "scan-gram.l" | |
1326 | return PERCENT_RIGHT; | |
1327 | YY_BREAK | |
1328 | case 25: | |
1329 | YY_RULE_SETUP | |
1330 | #line 239 "scan-gram.l" | |
1331 | return PERCENT_LEX_PARAM; | |
1332 | YY_BREAK | |
1333 | case 26: | |
1334 | YY_RULE_SETUP | |
1335 | #line 240 "scan-gram.l" | |
1336 | return PERCENT_SKELETON; | |
1337 | YY_BREAK | |
1338 | case 27: | |
1339 | YY_RULE_SETUP | |
1340 | #line 241 "scan-gram.l" | |
1341 | return PERCENT_START; | |
1342 | YY_BREAK | |
1343 | case 28: | |
1344 | YY_RULE_SETUP | |
1345 | #line 242 "scan-gram.l" | |
1346 | return PERCENT_TOKEN; | |
1347 | YY_BREAK | |
1348 | case 29: | |
1349 | YY_RULE_SETUP | |
1350 | #line 243 "scan-gram.l" | |
1351 | return PERCENT_TOKEN; | |
1352 | YY_BREAK | |
1353 | case 30: | |
1354 | YY_RULE_SETUP | |
1355 | #line 244 "scan-gram.l" | |
1356 | return PERCENT_TOKEN_TABLE; | |
1357 | YY_BREAK | |
1358 | case 31: | |
1359 | YY_RULE_SETUP | |
1360 | #line 245 "scan-gram.l" | |
1361 | return PERCENT_TYPE; | |
1362 | YY_BREAK | |
1363 | case 32: | |
1364 | YY_RULE_SETUP | |
1365 | #line 246 "scan-gram.l" | |
1366 | return PERCENT_UNION; | |
1367 | YY_BREAK | |
1368 | case 33: | |
1369 | YY_RULE_SETUP | |
1370 | #line 247 "scan-gram.l" | |
1371 | return PERCENT_VERBOSE; | |
1372 | YY_BREAK | |
1373 | case 34: | |
1374 | YY_RULE_SETUP | |
1375 | #line 248 "scan-gram.l" | |
1376 | return PERCENT_YACC; | |
1377 | YY_BREAK | |
1378 | case 35: | |
1379 | YY_RULE_SETUP | |
1380 | #line 250 "scan-gram.l" | |
1381 | return EQUAL; | |
1382 | YY_BREAK | |
1383 | case 36: | |
1384 | YY_RULE_SETUP | |
1385 | #line 251 "scan-gram.l" | |
1386 | rule_length = 0; return COLON; | |
1387 | YY_BREAK | |
1388 | case 37: | |
1389 | YY_RULE_SETUP | |
1390 | #line 252 "scan-gram.l" | |
1391 | rule_length = 0; return PIPE; | |
1392 | YY_BREAK | |
1393 | case 38: | |
1394 | YY_RULE_SETUP | |
1395 | #line 253 "scan-gram.l" | |
1396 | return COMMA; | |
1397 | YY_BREAK | |
1398 | case 39: | |
1399 | YY_RULE_SETUP | |
1400 | #line 254 "scan-gram.l" | |
1401 | return SEMICOLON; | |
1402 | YY_BREAK | |
1403 | case 40: | |
1404 | YY_RULE_SETUP | |
1405 | #line 256 "scan-gram.l" | |
1406 | YY_STEP; | |
1407 | YY_BREAK | |
1408 | case 41: | |
1409 | YY_RULE_SETUP | |
1410 | #line 258 "scan-gram.l" | |
1411 | { | |
1412 | yylval->symbol = symbol_get (yytext, *yylloc); | |
1413 | rule_length++; | |
1414 | return ID; | |
1415 | } | |
1416 | YY_BREAK | |
1417 | case 42: | |
1418 | YY_RULE_SETUP | |
1419 | #line 264 "scan-gram.l" | |
1420 | { | |
1421 | unsigned long num; | |
1422 | errno = 0; | |
1423 | num = strtoul (yytext, 0, 10); | |
1424 | if (INT_MAX < num || errno) | |
1425 | { | |
1426 | complain_at (*yylloc, _("invalid value: %s"), quote (yytext)); | |
1427 | num = INT_MAX; | |
1428 | } | |
1429 | yylval->integer = num; | |
1430 | return INT; | |
1431 | } | |
1432 | YY_BREAK | |
1433 | /* Characters. We don't check there is only one. */ | |
1434 | case 43: | |
1435 | YY_RULE_SETUP | |
1436 | #line 278 "scan-gram.l" | |
1437 | YY_OBS_GROW; yy_push_state (SC_ESCAPED_CHARACTER); | |
1438 | YY_BREAK | |
1439 | /* Strings. */ | |
1440 | case 44: | |
1441 | YY_RULE_SETUP | |
1442 | #line 281 "scan-gram.l" | |
1443 | YY_OBS_GROW; yy_push_state (SC_ESCAPED_STRING); | |
1444 | YY_BREAK | |
1445 | /* Comments. */ | |
1446 | case 45: | |
1447 | YY_RULE_SETUP | |
1448 | #line 284 "scan-gram.l" | |
1449 | BEGIN SC_YACC_COMMENT; | |
1450 | YY_BREAK | |
1451 | case 46: | |
1452 | YY_RULE_SETUP | |
1453 | #line 285 "scan-gram.l" | |
1454 | YY_STEP; | |
1455 | YY_BREAK | |
1456 | /* Prologue. */ | |
1457 | case 47: | |
1458 | YY_RULE_SETUP | |
1459 | #line 288 "scan-gram.l" | |
1460 | yy_push_state (SC_PROLOGUE); | |
1461 | YY_BREAK | |
1462 | /* Code in between braces. */ | |
1463 | case 48: | |
1464 | YY_RULE_SETUP | |
1465 | #line 291 "scan-gram.l" | |
1466 | YY_OBS_GROW; ++braces_level; yy_push_state (SC_BRACED_CODE); | |
1467 | YY_BREAK | |
1468 | /* A type. */ | |
1469 | case 49: | |
1470 | YY_RULE_SETUP | |
1471 | #line 294 "scan-gram.l" | |
1472 | { | |
1473 | obstack_grow (&string_obstack, yytext + 1, yyleng - 2); | |
1474 | YY_OBS_FINISH; | |
1475 | yylval->string = last_string; | |
1476 | return TYPE; | |
1477 | } | |
1478 | YY_BREAK | |
1479 | case 50: | |
1480 | YY_RULE_SETUP | |
1481 | #line 302 "scan-gram.l" | |
1482 | { | |
1483 | if (++percent_percent_count == 2) | |
1484 | yy_push_state (SC_EPILOGUE); | |
1485 | return PERCENT_PERCENT; | |
1486 | } | |
1487 | YY_BREAK | |
1488 | case 51: | |
1489 | YY_RULE_SETUP | |
1490 | #line 308 "scan-gram.l" | |
1491 | { | |
1492 | complain_at (*yylloc, _("invalid character: %s"), quote (yytext)); | |
1493 | YY_STEP; | |
1494 | } | |
1495 | YY_BREAK | |
1496 | ||
1497 | /*-------------------------------------------------------------------. | |
1498 | | Whatever the start condition (but those which correspond to | | |
1499 | | entities `swallowed' by Bison: SC_YACC_COMMENT, SC_ESCAPED_STRING, | | |
1500 | | and SC_ESCAPED_CHARACTER), no M4 character must escape as is. | | |
1501 | `-------------------------------------------------------------------*/ | |
1502 | ||
1503 | ||
1504 | case 52: | |
1505 | YY_RULE_SETUP | |
1506 | #line 323 "scan-gram.l" | |
1507 | obstack_sgrow (&string_obstack, "@<:@"); | |
1508 | YY_BREAK | |
1509 | case 53: | |
1510 | YY_RULE_SETUP | |
1511 | #line 324 "scan-gram.l" | |
1512 | obstack_sgrow (&string_obstack, "@:>@"); | |
1513 | YY_BREAK | |
1514 | ||
1515 | /*---------------------------------------------------------------. | |
1516 | | Scanning a Yacc comment. The initial `/ *' is already eaten. | | |
1517 | `---------------------------------------------------------------*/ | |
1518 | ||
1519 | ||
1520 | case 54: | |
1521 | YY_RULE_SETUP | |
1522 | #line 334 "scan-gram.l" | |
1523 | { | |
1524 | YY_STEP; | |
1525 | BEGIN INITIAL; | |
1526 | } | |
1527 | YY_BREAK | |
1528 | case 55: | |
1529 | YY_RULE_SETUP | |
1530 | #line 339 "scan-gram.l" | |
1531 | ; | |
1532 | YY_BREAK | |
1533 | case YY_STATE_EOF(SC_YACC_COMMENT): | |
1534 | #line 341 "scan-gram.l" | |
1535 | { | |
1536 | complain_at (*yylloc, _("unexpected end of file in a comment")); | |
1537 | BEGIN INITIAL; | |
1538 | } | |
1539 | YY_BREAK | |
1540 | ||
1541 | /*------------------------------------------------------------. | |
1542 | | Scanning a C comment. The initial `/ *' is already eaten. | | |
1543 | `------------------------------------------------------------*/ | |
1544 | ||
1545 | ||
1546 | case 56: | |
1547 | YY_RULE_SETUP | |
1548 | #line 354 "scan-gram.l" | |
1549 | YY_OBS_GROW; yy_pop_state (); | |
1550 | YY_BREAK | |
1551 | case 57: | |
1552 | YY_RULE_SETUP | |
1553 | #line 355 "scan-gram.l" | |
1554 | YY_OBS_GROW; | |
1555 | YY_BREAK | |
1556 | case YY_STATE_EOF(SC_COMMENT): | |
1557 | #line 357 "scan-gram.l" | |
1558 | { | |
1559 | complain_at (*yylloc, _("unexpected end of file in a comment")); | |
1560 | yy_pop_state (); | |
1561 | } | |
1562 | YY_BREAK | |
1563 | ||
1564 | /*--------------------------------------------------------------. | |
1565 | | Scanning a line comment. The initial `//' is already eaten. | | |
1566 | `--------------------------------------------------------------*/ | |
1567 | ||
1568 | ||
1569 | case 58: | |
1570 | YY_RULE_SETUP | |
1571 | #line 370 "scan-gram.l" | |
1572 | YY_OBS_GROW; yy_pop_state (); | |
1573 | YY_BREAK | |
1574 | case 59: | |
1575 | YY_RULE_SETUP | |
1576 | #line 371 "scan-gram.l" | |
1577 | YY_OBS_GROW; | |
1578 | YY_BREAK | |
1579 | case YY_STATE_EOF(SC_LINE_COMMENT): | |
1580 | #line 372 "scan-gram.l" | |
1581 | yy_pop_state (); | |
1582 | YY_BREAK | |
1583 | ||
1584 | /*----------------------------------------------------------------. | |
1585 | | Scanning a C string, including its escapes. The initial `"' is | | |
1586 | | already eaten. | | |
1587 | `----------------------------------------------------------------*/ | |
1588 | ||
1589 | ||
1590 | case 60: | |
1591 | YY_RULE_SETUP | |
1592 | #line 383 "scan-gram.l" | |
1593 | { | |
1594 | assert (yy_top_state () == INITIAL); | |
1595 | YY_OBS_GROW; | |
1596 | YY_OBS_FINISH; | |
1597 | yylval->string = last_string; | |
1598 | yy_pop_state (); | |
1599 | rule_length++; | |
1600 | return STRING; | |
1601 | } | |
1602 | YY_BREAK | |
1603 | case 61: | |
1604 | YY_RULE_SETUP | |
1605 | #line 393 "scan-gram.l" | |
1606 | YY_OBS_GROW; | |
1607 | YY_BREAK | |
1608 | case YY_STATE_EOF(SC_ESCAPED_STRING): | |
1609 | #line 395 "scan-gram.l" | |
1610 | { | |
1611 | complain_at (*yylloc, _("unexpected end of file in a string")); | |
1612 | assert (yy_top_state () == INITIAL); | |
1613 | YY_OBS_FINISH; | |
1614 | yylval->string = last_string; | |
1615 | yy_pop_state (); | |
1616 | return STRING; | |
1617 | } | |
1618 | YY_BREAK | |
1619 | ||
1620 | /*---------------------------------------------------------------. | |
1621 | | Scanning a C character, decoding its escapes. The initial "'" | | |
1622 | | is already eaten. | | |
1623 | `---------------------------------------------------------------*/ | |
1624 | ||
1625 | ||
1626 | case 62: | |
1627 | YY_RULE_SETUP | |
1628 | #line 412 "scan-gram.l" | |
1629 | { | |
1630 | YY_OBS_GROW; | |
1631 | assert (yy_top_state () == INITIAL); | |
1632 | { | |
1633 | YY_OBS_FINISH; | |
1634 | yylval->symbol = symbol_get (last_string, *yylloc); | |
1635 | symbol_class_set (yylval->symbol, token_sym, *yylloc); | |
1636 | symbol_user_token_number_set (yylval->symbol, | |
1637 | (unsigned char) last_string[1], *yylloc); | |
1638 | YY_OBS_FREE; | |
1639 | yy_pop_state (); | |
1640 | rule_length++; | |
1641 | return ID; | |
1642 | } | |
1643 | } | |
1644 | YY_BREAK | |
1645 | case 63: | |
1646 | YY_RULE_SETUP | |
1647 | #line 428 "scan-gram.l" | |
1648 | YY_OBS_GROW; | |
1649 | YY_BREAK | |
1650 | case YY_STATE_EOF(SC_ESCAPED_CHARACTER): | |
1651 | #line 430 "scan-gram.l" | |
1652 | { | |
1653 | complain_at (*yylloc, _("unexpected end of file in a character")); | |
1654 | assert (yy_top_state () == INITIAL); | |
1655 | YY_OBS_FINISH; | |
1656 | yylval->string = last_string; | |
1657 | yy_pop_state (); | |
1658 | return CHARACTER; | |
1659 | } | |
1660 | YY_BREAK | |
1661 | ||
1662 | /*----------------------------. | |
1663 | | Decode escaped characters. | | |
1664 | `----------------------------*/ | |
1665 | ||
1666 | ||
1667 | case 64: | |
1668 | YY_RULE_SETUP | |
1669 | #line 447 "scan-gram.l" | |
1670 | { | |
1671 | unsigned long c = strtoul (yytext + 1, 0, 8); | |
1672 | if (UCHAR_MAX < c) | |
1673 | { | |
1674 | complain_at (*yylloc, _("invalid escape: %s"), quote (yytext)); | |
1675 | YY_STEP; | |
1676 | } | |
1677 | else | |
1678 | obstack_1grow (&string_obstack, c); | |
1679 | } | |
1680 | YY_BREAK | |
1681 | case 65: | |
1682 | YY_RULE_SETUP | |
1683 | #line 458 "scan-gram.l" | |
1684 | { | |
1685 | unsigned long c; | |
1686 | errno = 0; | |
1687 | c = strtoul (yytext + 2, 0, 16); | |
1688 | if (UCHAR_MAX < c || errno) | |
1689 | { | |
1690 | complain_at (*yylloc, _("invalid escape: %s"), quote (yytext)); | |
1691 | YY_STEP; | |
1692 | } | |
1693 | else | |
1694 | obstack_1grow (&string_obstack, c); | |
1695 | } | |
1696 | YY_BREAK | |
1697 | case 66: | |
1698 | YY_RULE_SETUP | |
1699 | #line 471 "scan-gram.l" | |
1700 | obstack_1grow (&string_obstack, '\a'); | |
1701 | YY_BREAK | |
1702 | case 67: | |
1703 | YY_RULE_SETUP | |
1704 | #line 472 "scan-gram.l" | |
1705 | obstack_1grow (&string_obstack, '\b'); | |
1706 | YY_BREAK | |
1707 | case 68: | |
1708 | YY_RULE_SETUP | |
1709 | #line 473 "scan-gram.l" | |
1710 | obstack_1grow (&string_obstack, '\f'); | |
1711 | YY_BREAK | |
1712 | case 69: | |
1713 | YY_RULE_SETUP | |
1714 | #line 474 "scan-gram.l" | |
1715 | obstack_1grow (&string_obstack, '\n'); | |
1716 | YY_BREAK | |
1717 | case 70: | |
1718 | YY_RULE_SETUP | |
1719 | #line 475 "scan-gram.l" | |
1720 | obstack_1grow (&string_obstack, '\r'); | |
1721 | YY_BREAK | |
1722 | case 71: | |
1723 | YY_RULE_SETUP | |
1724 | #line 476 "scan-gram.l" | |
1725 | obstack_1grow (&string_obstack, '\t'); | |
1726 | YY_BREAK | |
1727 | case 72: | |
1728 | YY_RULE_SETUP | |
1729 | #line 477 "scan-gram.l" | |
1730 | obstack_1grow (&string_obstack, '\v'); | |
1731 | YY_BREAK | |
1732 | case 73: | |
1733 | YY_RULE_SETUP | |
1734 | #line 478 "scan-gram.l" | |
1735 | obstack_1grow (&string_obstack, yytext[1]); | |
1736 | YY_BREAK | |
1737 | case 74: | |
1738 | YY_RULE_SETUP | |
1739 | #line 479 "scan-gram.l" | |
1740 | { | |
1741 | int c = convert_ucn_to_byte (yytext); | |
1742 | if (c < 0) | |
1743 | { | |
1744 | complain_at (*yylloc, _("invalid escape: %s"), quote (yytext)); | |
1745 | YY_STEP; | |
1746 | } | |
1747 | else | |
1748 | obstack_1grow (&string_obstack, c); | |
1749 | } | |
1750 | YY_BREAK | |
1751 | case 75: | |
1752 | YY_RULE_SETUP | |
1753 | #line 489 "scan-gram.l" | |
1754 | { | |
1755 | complain_at (*yylloc, _("unrecognized escape: %s"), quote (yytext)); | |
1756 | YY_OBS_GROW; | |
1757 | } | |
1758 | YY_BREAK | |
1759 | /* FLex wants this rule, in case of a `\<<EOF>>'. */ | |
1760 | case 76: | |
1761 | YY_RULE_SETUP | |
1762 | #line 494 "scan-gram.l" | |
1763 | YY_OBS_GROW; | |
1764 | YY_BREAK | |
1765 | ||
1766 | /*----------------------------------------------------------. | |
1767 | | Scanning a C character without decoding its escapes. The | | |
1768 | | initial "'" is already eaten. | | |
1769 | `----------------------------------------------------------*/ | |
1770 | ||
1771 | ||
1772 | case 77: | |
1773 | YY_RULE_SETUP | |
1774 | #line 505 "scan-gram.l" | |
1775 | { | |
1776 | YY_OBS_GROW; | |
1777 | assert (yy_top_state () != INITIAL); | |
1778 | yy_pop_state (); | |
1779 | } | |
1780 | YY_BREAK | |
1781 | case 78: | |
1782 | YY_RULE_SETUP | |
1783 | #line 511 "scan-gram.l" | |
1784 | YY_OBS_GROW; | |
1785 | YY_BREAK | |
1786 | case 79: | |
1787 | YY_RULE_SETUP | |
1788 | #line 512 "scan-gram.l" | |
1789 | YY_OBS_GROW; | |
1790 | YY_BREAK | |
1791 | case 80: | |
1792 | YY_RULE_SETUP | |
1793 | #line 513 "scan-gram.l" | |
1794 | YY_OBS_GROW; | |
1795 | YY_BREAK | |
1796 | /* Needed for `\<<EOF>>', `\\<<newline>>[', and `\\<<newline>>]'. */ | |
1797 | case 81: | |
1798 | YY_RULE_SETUP | |
1799 | #line 515 "scan-gram.l" | |
1800 | YY_OBS_GROW; | |
1801 | YY_BREAK | |
1802 | case YY_STATE_EOF(SC_CHARACTER): | |
1803 | #line 517 "scan-gram.l" | |
1804 | { | |
1805 | complain_at (*yylloc, _("unexpected end of file in a character")); | |
1806 | assert (yy_top_state () != INITIAL); | |
1807 | yy_pop_state (); | |
1808 | } | |
1809 | YY_BREAK | |
1810 | ||
1811 | /*----------------------------------------------------------------. | |
1812 | | Scanning a C string, without decoding its escapes. The initial | | |
1813 | | `"' is already eaten. | | |
1814 | `----------------------------------------------------------------*/ | |
1815 | ||
1816 | ||
1817 | case 82: | |
1818 | YY_RULE_SETUP | |
1819 | #line 532 "scan-gram.l" | |
1820 | { | |
1821 | assert (yy_top_state () != INITIAL); | |
1822 | YY_OBS_GROW; | |
1823 | yy_pop_state (); | |
1824 | } | |
1825 | YY_BREAK | |
1826 | case 83: | |
1827 | YY_RULE_SETUP | |
1828 | #line 538 "scan-gram.l" | |
1829 | YY_OBS_GROW; | |
1830 | YY_BREAK | |
1831 | case 84: | |
1832 | YY_RULE_SETUP | |
1833 | #line 539 "scan-gram.l" | |
1834 | YY_OBS_GROW; | |
1835 | YY_BREAK | |
1836 | case 85: | |
1837 | YY_RULE_SETUP | |
1838 | #line 540 "scan-gram.l" | |
1839 | YY_OBS_GROW; | |
1840 | YY_BREAK | |
1841 | /* Needed for `\<<EOF>>', `\\<<newline>>[', and `\\<<newline>>]'. */ | |
1842 | case 86: | |
1843 | YY_RULE_SETUP | |
1844 | #line 542 "scan-gram.l" | |
1845 | YY_OBS_GROW; | |
1846 | YY_BREAK | |
1847 | case YY_STATE_EOF(SC_STRING): | |
1848 | #line 544 "scan-gram.l" | |
1849 | { | |
1850 | complain_at (*yylloc, _("unexpected end of file in a string")); | |
1851 | assert (yy_top_state () != INITIAL); | |
1852 | yy_pop_state (); | |
1853 | } | |
1854 | YY_BREAK | |
1855 | ||
1856 | /*---------------------------------------------------. | |
1857 | | Strings, comments etc. can be found in user code. | | |
1858 | `---------------------------------------------------*/ | |
1859 | ||
1860 | ||
1861 | /* Characters. We don't check there is only one. */ | |
1862 | case 87: | |
1863 | YY_RULE_SETUP | |
1864 | #line 559 "scan-gram.l" | |
1865 | YY_OBS_GROW; yy_push_state (SC_CHARACTER); | |
1866 | YY_BREAK | |
1867 | /* Strings. */ | |
1868 | case 88: | |
1869 | YY_RULE_SETUP | |
1870 | #line 562 "scan-gram.l" | |
1871 | YY_OBS_GROW; yy_push_state (SC_STRING); | |
1872 | YY_BREAK | |
1873 | /* Comments. */ | |
1874 | case 89: | |
1875 | YY_RULE_SETUP | |
1876 | #line 565 "scan-gram.l" | |
1877 | YY_OBS_GROW; yy_push_state (SC_COMMENT); | |
1878 | YY_BREAK | |
1879 | case 90: | |
1880 | YY_RULE_SETUP | |
1881 | #line 566 "scan-gram.l" | |
1882 | YY_OBS_GROW; yy_push_state (SC_LINE_COMMENT); | |
1883 | YY_BREAK | |
1884 | /* Not comments. */ | |
1885 | case 91: | |
1886 | YY_RULE_SETUP | |
1887 | #line 569 "scan-gram.l" | |
1888 | YY_OBS_GROW; | |
1889 | YY_BREAK | |
1890 | ||
1891 | /*---------------------------------------------------------------. | |
1892 | | Scanning some code in braces (%union and actions). The initial | | |
1893 | | "{" is already eaten. | | |
1894 | `---------------------------------------------------------------*/ | |
1895 | ||
1896 | ||
1897 | case 92: | |
1898 | YY_RULE_SETUP | |
1899 | #line 580 "scan-gram.l" | |
1900 | { | |
1901 | YY_OBS_GROW; | |
1902 | if (--braces_level == 0) | |
1903 | { | |
1904 | yy_pop_state (); | |
1905 | YY_OBS_FINISH; | |
1906 | yylval->string = last_string; | |
1907 | rule_length++; | |
1908 | return BRACED_CODE; | |
1909 | } | |
1910 | } | |
1911 | YY_BREAK | |
1912 | case 93: | |
1913 | YY_RULE_SETUP | |
1914 | #line 592 "scan-gram.l" | |
1915 | YY_OBS_GROW; braces_level++; | |
1916 | YY_BREAK | |
1917 | case 94: | |
1918 | YY_RULE_SETUP | |
1919 | #line 594 "scan-gram.l" | |
1920 | { handle_dollar (current_braced_code, | |
1921 | yytext, *yylloc); } | |
1922 | YY_BREAK | |
1923 | case 95: | |
1924 | YY_RULE_SETUP | |
1925 | #line 596 "scan-gram.l" | |
1926 | { handle_at (current_braced_code, | |
1927 | yytext, *yylloc); } | |
1928 | YY_BREAK | |
1929 | case 96: | |
1930 | YY_RULE_SETUP | |
1931 | #line 599 "scan-gram.l" | |
1932 | YY_OBS_GROW; | |
1933 | YY_BREAK | |
1934 | /* A stray $, or /, or etc. */ | |
1935 | case 97: | |
1936 | YY_RULE_SETUP | |
1937 | #line 602 "scan-gram.l" | |
1938 | YY_OBS_GROW; | |
1939 | YY_BREAK | |
1940 | case YY_STATE_EOF(SC_BRACED_CODE): | |
1941 | #line 604 "scan-gram.l" | |
1942 | { | |
1943 | complain_at (*yylloc, _("unexpected end of file in a braced code")); | |
1944 | yy_pop_state (); | |
1945 | YY_OBS_FINISH; | |
1946 | yylval->string = last_string; | |
1947 | return BRACED_CODE; | |
1948 | } | |
1949 | YY_BREAK | |
1950 | ||
1951 | /*--------------------------------------------------------------. | |
1952 | | Scanning some prologue: from "%{" (already scanned) to "%}". | | |
1953 | `--------------------------------------------------------------*/ | |
1954 | ||
1955 | ||
1956 | case 98: | |
1957 | YY_RULE_SETUP | |
1958 | #line 621 "scan-gram.l" | |
1959 | { | |
1960 | yy_pop_state (); | |
1961 | YY_OBS_FINISH; | |
1962 | yylval->string = last_string; | |
1963 | return PROLOGUE; | |
1964 | } | |
1965 | YY_BREAK | |
1966 | case 99: | |
1967 | YY_RULE_SETUP | |
1968 | #line 628 "scan-gram.l" | |
1969 | YY_OBS_GROW; | |
1970 | YY_BREAK | |
1971 | case 100: | |
1972 | YY_RULE_SETUP | |
1973 | #line 629 "scan-gram.l" | |
1974 | YY_OBS_GROW; | |
1975 | YY_BREAK | |
1976 | case YY_STATE_EOF(SC_PROLOGUE): | |
1977 | #line 631 "scan-gram.l" | |
1978 | { | |
1979 | complain_at (*yylloc, _("unexpected end of file in a prologue")); | |
1980 | yy_pop_state (); | |
1981 | YY_OBS_FINISH; | |
1982 | yylval->string = last_string; | |
1983 | return PROLOGUE; | |
1984 | } | |
1985 | YY_BREAK | |
1986 | ||
1987 | /*---------------------------------------------------------------. | |
1988 | | Scanning the epilogue (everything after the second "%%", which | | |
1989 | | has already been eaten). | | |
1990 | `---------------------------------------------------------------*/ | |
1991 | ||
1992 | ||
1993 | case 101: | |
1994 | YY_RULE_SETUP | |
1995 | #line 648 "scan-gram.l" | |
1996 | YY_OBS_GROW; | |
1997 | YY_BREAK | |
1998 | case YY_STATE_EOF(SC_EPILOGUE): | |
1999 | #line 650 "scan-gram.l" | |
2000 | { | |
2001 | yy_pop_state (); | |
2002 | YY_OBS_FINISH; | |
2003 | yylval->string = last_string; | |
2004 | return EPILOGUE; | |
2005 | } | |
2006 | YY_BREAK | |
2007 | ||
2008 | case 102: | |
2009 | YY_RULE_SETUP | |
2010 | #line 659 "scan-gram.l" | |
2011 | YY_FATAL_ERROR( "flex scanner jammed" ); | |
2012 | YY_BREAK | |
2013 | #line 2014 "scan-gram.c" | |
2014 | case YY_STATE_EOF(INITIAL): | |
2015 | yyterminate(); | |
2016 | ||
2017 | case YY_END_OF_BUFFER: | |
2018 | { | |
2019 | /* Amount of text matched not including the EOB char. */ | |
2020 | int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; | |
2021 | ||
2022 | /* Undo the effects of YY_DO_BEFORE_ACTION. */ | |
2023 | *yy_cp = yy_hold_char; | |
2024 | YY_RESTORE_YY_MORE_OFFSET | |
2025 | ||
2026 | if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) | |
2027 | { | |
2028 | /* We're scanning a new file or input source. It's | |
2029 | * possible that this happened because the user | |
2030 | * just pointed yyin at a new source and called | |
2031 | * yylex(). If so, then we have to assure | |
2032 | * consistency between yy_current_buffer and our | |
2033 | * globals. Here is the right place to do so, because | |
2034 | * this is the first action (other than possibly a | |
2035 | * back-up) that will match for the new input source. | |
2036 | */ | |
2037 | yy_n_chars = yy_current_buffer->yy_n_chars; | |
2038 | yy_current_buffer->yy_input_file = yyin; | |
2039 | yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; | |
2040 | } | |
2041 | ||
2042 | /* Note that here we test for yy_c_buf_p "<=" to the position | |
2043 | * of the first EOB in the buffer, since yy_c_buf_p will | |
2044 | * already have been incremented past the NUL character | |
2045 | * (since all states make transitions on EOB to the | |
2046 | * end-of-buffer state). Contrast this with the test | |
2047 | * in input(). | |
2048 | */ | |
2049 | if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) | |
2050 | { /* This was really a NUL. */ | |
2051 | yy_state_type yy_next_state; | |
2052 | ||
2053 | yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; | |
2054 | ||
2055 | yy_current_state = yy_get_previous_state(); | |
2056 | ||
2057 | /* Okay, we're now positioned to make the NUL | |
2058 | * transition. We couldn't have | |
2059 | * yy_get_previous_state() go ahead and do it | |
2060 | * for us because it doesn't know how to deal | |
2061 | * with the possibility of jamming (and we don't | |
2062 | * want to build jamming into it because then it | |
2063 | * will run more slowly). | |
2064 | */ | |
2065 | ||
2066 | yy_next_state = yy_try_NUL_trans( yy_current_state ); | |
2067 | ||
2068 | yy_bp = yytext_ptr + YY_MORE_ADJ; | |
2069 | ||
2070 | if ( yy_next_state ) | |
2071 | { | |
2072 | /* Consume the NUL. */ | |
2073 | yy_cp = ++yy_c_buf_p; | |
2074 | yy_current_state = yy_next_state; | |
2075 | goto yy_match; | |
2076 | } | |
2077 | ||
2078 | else | |
2079 | { | |
2080 | yy_cp = yy_c_buf_p; | |
2081 | goto yy_find_action; | |
2082 | } | |
2083 | } | |
2084 | ||
2085 | else switch ( yy_get_next_buffer() ) | |
2086 | { | |
2087 | case EOB_ACT_END_OF_FILE: | |
2088 | { | |
2089 | yy_did_buffer_switch_on_eof = 0; | |
2090 | ||
2091 | if ( yywrap() ) | |
2092 | { | |
2093 | /* Note: because we've taken care in | |
2094 | * yy_get_next_buffer() to have set up | |
2095 | * yytext, we can now set up | |
2096 | * yy_c_buf_p so that if some total | |
2097 | * hoser (like flex itself) wants to | |
2098 | * call the scanner after we return the | |
2099 | * YY_NULL, it'll still work - another | |
2100 | * YY_NULL will get returned. | |
2101 | */ | |
2102 | yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; | |
2103 | ||
2104 | yy_act = YY_STATE_EOF(YY_START); | |
2105 | goto do_action; | |
2106 | } | |
2107 | ||
2108 | else | |
2109 | { | |
2110 | if ( ! yy_did_buffer_switch_on_eof ) | |
2111 | YY_NEW_FILE; | |
2112 | } | |
2113 | break; | |
2114 | } | |
2115 | ||
2116 | case EOB_ACT_CONTINUE_SCAN: | |
2117 | yy_c_buf_p = | |
2118 | yytext_ptr + yy_amount_of_matched_text; | |
2119 | ||
2120 | yy_current_state = yy_get_previous_state(); | |
2121 | ||
2122 | yy_cp = yy_c_buf_p; | |
2123 | yy_bp = yytext_ptr + YY_MORE_ADJ; | |
2124 | goto yy_match; | |
2125 | ||
2126 | case EOB_ACT_LAST_MATCH: | |
2127 | yy_c_buf_p = | |
2128 | &yy_current_buffer->yy_ch_buf[yy_n_chars]; | |
2129 | ||
2130 | yy_current_state = yy_get_previous_state(); | |
2131 | ||
2132 | yy_cp = yy_c_buf_p; | |
2133 | yy_bp = yytext_ptr + YY_MORE_ADJ; | |
2134 | goto yy_find_action; | |
2135 | } | |
2136 | break; | |
2137 | } | |
2138 | ||
2139 | default: | |
2140 | YY_FATAL_ERROR( | |
2141 | "fatal flex scanner internal error--no action found" ); | |
2142 | } /* end of action switch */ | |
2143 | } /* end of scanning one token */ | |
2144 | } /* end of yylex */ | |
2145 | ||
2146 | ||
2147 | /* yy_get_next_buffer - try to read in a new buffer | |
2148 | * | |
2149 | * Returns a code representing an action: | |
2150 | * EOB_ACT_LAST_MATCH - | |
2151 | * EOB_ACT_CONTINUE_SCAN - continue scanning from current position | |
2152 | * EOB_ACT_END_OF_FILE - end of file | |
2153 | */ | |
2154 | ||
2155 | static int yy_get_next_buffer() | |
2156 | { | |
2157 | register char *dest = yy_current_buffer->yy_ch_buf; | |
2158 | register char *source = yytext_ptr; | |
2159 | register int number_to_move, i; | |
2160 | int ret_val; | |
2161 | ||
2162 | if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) | |
2163 | YY_FATAL_ERROR( | |
2164 | "fatal flex scanner internal error--end of buffer missed" ); | |
2165 | ||
2166 | if ( yy_current_buffer->yy_fill_buffer == 0 ) | |
2167 | { /* Don't try to fill the buffer, so this is an EOF. */ | |
2168 | if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) | |
2169 | { | |
2170 | /* We matched a single character, the EOB, so | |
2171 | * treat this as a final EOF. | |
2172 | */ | |
2173 | return EOB_ACT_END_OF_FILE; | |
2174 | } | |
2175 | ||
2176 | else | |
2177 | { | |
2178 | /* We matched some text prior to the EOB, first | |
2179 | * process it. | |
2180 | */ | |
2181 | return EOB_ACT_LAST_MATCH; | |
2182 | } | |
2183 | } | |
2184 | ||
2185 | /* Try to read more data. */ | |
2186 | ||
2187 | /* First move last chars to start of buffer. */ | |
2188 | number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; | |
2189 | ||
2190 | for ( i = 0; i < number_to_move; ++i ) | |
2191 | *(dest++) = *(source++); | |
2192 | ||
2193 | if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) | |
2194 | /* don't do the read, it's not guaranteed to return an EOF, | |
2195 | * just force an EOF | |
2196 | */ | |
2197 | yy_current_buffer->yy_n_chars = yy_n_chars = 0; | |
2198 | ||
2199 | else | |
2200 | { | |
2201 | int num_to_read = | |
2202 | yy_current_buffer->yy_buf_size - number_to_move - 1; | |
2203 | ||
2204 | while ( num_to_read <= 0 ) | |
2205 | { /* Not enough room in the buffer - grow it. */ | |
2206 | #ifdef YY_USES_REJECT | |
2207 | YY_FATAL_ERROR( | |
2208 | "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); | |
2209 | #else | |
2210 | ||
2211 | /* just a shorter name for the current buffer */ | |
2212 | YY_BUFFER_STATE b = yy_current_buffer; | |
2213 | ||
2214 | int yy_c_buf_p_offset = | |
2215 | (int) (yy_c_buf_p - b->yy_ch_buf); | |
2216 | ||
2217 | if ( b->yy_is_our_buffer ) | |
2218 | { | |
2219 | int new_size = b->yy_buf_size * 2; | |
2220 | ||
2221 | if ( new_size <= 0 ) | |
2222 | b->yy_buf_size += b->yy_buf_size / 8; | |
2223 | else | |
2224 | b->yy_buf_size *= 2; | |
2225 | ||
2226 | b->yy_ch_buf = (char *) | |
2227 | /* Include room in for 2 EOB chars. */ | |
2228 | yy_flex_realloc( (void *) b->yy_ch_buf, | |
2229 | b->yy_buf_size + 2 ); | |
2230 | } | |
2231 | else | |
2232 | /* Can't grow it, we don't own it. */ | |
2233 | b->yy_ch_buf = 0; | |
2234 | ||
2235 | if ( ! b->yy_ch_buf ) | |
2236 | YY_FATAL_ERROR( | |
2237 | "fatal error - scanner input buffer overflow" ); | |
2238 | ||
2239 | yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; | |
2240 | ||
2241 | num_to_read = yy_current_buffer->yy_buf_size - | |
2242 | number_to_move - 1; | |
2243 | #endif | |
2244 | } | |
2245 | ||
2246 | if ( num_to_read > YY_READ_BUF_SIZE ) | |
2247 | num_to_read = YY_READ_BUF_SIZE; | |
2248 | ||
2249 | /* Read in more data. */ | |
2250 | YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), | |
2251 | yy_n_chars, num_to_read ); | |
2252 | ||
2253 | yy_current_buffer->yy_n_chars = yy_n_chars; | |
2254 | } | |
2255 | ||
2256 | if ( yy_n_chars == 0 ) | |
2257 | { | |
2258 | if ( number_to_move == YY_MORE_ADJ ) | |
2259 | { | |
2260 | ret_val = EOB_ACT_END_OF_FILE; | |
2261 | yyrestart( yyin ); | |
2262 | } | |
2263 | ||
2264 | else | |
2265 | { | |
2266 | ret_val = EOB_ACT_LAST_MATCH; | |
2267 | yy_current_buffer->yy_buffer_status = | |
2268 | YY_BUFFER_EOF_PENDING; | |
2269 | } | |
2270 | } | |
2271 | ||
2272 | else | |
2273 | ret_val = EOB_ACT_CONTINUE_SCAN; | |
2274 | ||
2275 | yy_n_chars += number_to_move; | |
2276 | yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; | |
2277 | yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; | |
2278 | ||
2279 | yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; | |
2280 | ||
2281 | return ret_val; | |
2282 | } | |
2283 | ||
2284 | ||
2285 | /* yy_get_previous_state - get the state just before the EOB char was reached */ | |
2286 | ||
2287 | static yy_state_type yy_get_previous_state() | |
2288 | { | |
2289 | register yy_state_type yy_current_state; | |
2290 | register char *yy_cp; | |
2291 | ||
2292 | yy_current_state = yy_start; | |
2293 | ||
2294 | for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) | |
2295 | { | |
2296 | register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 53); | |
2297 | if ( yy_accept[yy_current_state] ) | |
2298 | { | |
2299 | yy_last_accepting_state = yy_current_state; | |
2300 | yy_last_accepting_cpos = yy_cp; | |
2301 | } | |
2302 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) | |
2303 | { | |
2304 | yy_current_state = (int) yy_def[yy_current_state]; | |
2305 | if ( yy_current_state >= 391 ) | |
2306 | yy_c = yy_meta[(unsigned int) yy_c]; | |
2307 | } | |
2308 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; | |
2309 | } | |
2310 | ||
2311 | return yy_current_state; | |
2312 | } | |
2313 | ||
2314 | ||
2315 | /* yy_try_NUL_trans - try to make a transition on the NUL character | |
2316 | * | |
2317 | * synopsis | |
2318 | * next_state = yy_try_NUL_trans( current_state ); | |
2319 | */ | |
2320 | ||
2321 | #ifdef YY_USE_PROTOS | |
2322 | static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) | |
2323 | #else | |
2324 | static yy_state_type yy_try_NUL_trans( yy_current_state ) | |
2325 | yy_state_type yy_current_state; | |
2326 | #endif | |
2327 | { | |
2328 | register int yy_is_jam; | |
2329 | register char *yy_cp = yy_c_buf_p; | |
2330 | ||
2331 | register YY_CHAR yy_c = 53; | |
2332 | if ( yy_accept[yy_current_state] ) | |
2333 | { | |
2334 | yy_last_accepting_state = yy_current_state; | |
2335 | yy_last_accepting_cpos = yy_cp; | |
2336 | } | |
2337 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) | |
2338 | { | |
2339 | yy_current_state = (int) yy_def[yy_current_state]; | |
2340 | if ( yy_current_state >= 391 ) | |
2341 | yy_c = yy_meta[(unsigned int) yy_c]; | |
2342 | } | |
2343 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; | |
2344 | yy_is_jam = (yy_current_state == 390); | |
2345 | ||
2346 | return yy_is_jam ? 0 : yy_current_state; | |
2347 | } | |
2348 | ||
2349 | ||
2350 | #ifndef YY_NO_UNPUT | |
2351 | #ifdef YY_USE_PROTOS | |
2352 | static void yyunput( int c, register char *yy_bp ) | |
2353 | #else | |
2354 | static void yyunput( c, yy_bp ) | |
2355 | int c; | |
2356 | register char *yy_bp; | |
2357 | #endif | |
2358 | { | |
2359 | register char *yy_cp = yy_c_buf_p; | |
2360 | ||
2361 | /* undo effects of setting up yytext */ | |
2362 | *yy_cp = yy_hold_char; | |
2363 | ||
2364 | if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) | |
2365 | { /* need to shift things up to make room */ | |
2366 | /* +2 for EOB chars. */ | |
2367 | register int number_to_move = yy_n_chars + 2; | |
2368 | register char *dest = &yy_current_buffer->yy_ch_buf[ | |
2369 | yy_current_buffer->yy_buf_size + 2]; | |
2370 | register char *source = | |
2371 | &yy_current_buffer->yy_ch_buf[number_to_move]; | |
2372 | ||
2373 | while ( source > yy_current_buffer->yy_ch_buf ) | |
2374 | *--dest = *--source; | |
2375 | ||
2376 | yy_cp += (int) (dest - source); | |
2377 | yy_bp += (int) (dest - source); | |
2378 | yy_current_buffer->yy_n_chars = | |
2379 | yy_n_chars = yy_current_buffer->yy_buf_size; | |
2380 | ||
2381 | if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) | |
2382 | YY_FATAL_ERROR( "flex scanner push-back overflow" ); | |
2383 | } | |
2384 | ||
2385 | *--yy_cp = (char) c; | |
2386 | ||
2387 | ||
2388 | yytext_ptr = yy_bp; | |
2389 | yy_hold_char = *yy_cp; | |
2390 | yy_c_buf_p = yy_cp; | |
2391 | } | |
2392 | #endif /* ifndef YY_NO_UNPUT */ | |
2393 | ||
2394 | ||
2395 | #ifdef __cplusplus | |
2396 | static int yyinput() | |
2397 | #else | |
2398 | static int input() | |
2399 | #endif | |
2400 | { | |
2401 | int c; | |
2402 | ||
2403 | *yy_c_buf_p = yy_hold_char; | |
2404 | ||
2405 | if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) | |
2406 | { | |
2407 | /* yy_c_buf_p now points to the character we want to return. | |
2408 | * If this occurs *before* the EOB characters, then it's a | |
2409 | * valid NUL; if not, then we've hit the end of the buffer. | |
2410 | */ | |
2411 | if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) | |
2412 | /* This was really a NUL. */ | |
2413 | *yy_c_buf_p = '\0'; | |
2414 | ||
2415 | else | |
2416 | { /* need more input */ | |
2417 | int offset = yy_c_buf_p - yytext_ptr; | |
2418 | ++yy_c_buf_p; | |
2419 | ||
2420 | switch ( yy_get_next_buffer() ) | |
2421 | { | |
2422 | case EOB_ACT_LAST_MATCH: | |
2423 | /* This happens because yy_g_n_b() | |
2424 | * sees that we've accumulated a | |
2425 | * token and flags that we need to | |
2426 | * try matching the token before | |
2427 | * proceeding. But for input(), | |
2428 | * there's no matching to consider. | |
2429 | * So convert the EOB_ACT_LAST_MATCH | |
2430 | * to EOB_ACT_END_OF_FILE. | |
2431 | */ | |
2432 | ||
2433 | /* Reset buffer status. */ | |
2434 | yyrestart( yyin ); | |
2435 | ||
2436 | /* fall through */ | |
2437 | ||
2438 | case EOB_ACT_END_OF_FILE: | |
2439 | { | |
2440 | if ( yywrap() ) | |
2441 | return EOF; | |
2442 | ||
2443 | if ( ! yy_did_buffer_switch_on_eof ) | |
2444 | YY_NEW_FILE; | |
2445 | #ifdef __cplusplus | |
2446 | return yyinput(); | |
2447 | #else | |
2448 | return input(); | |
2449 | #endif | |
2450 | } | |
2451 | ||
2452 | case EOB_ACT_CONTINUE_SCAN: | |
2453 | yy_c_buf_p = yytext_ptr + offset; | |
2454 | break; | |
2455 | } | |
2456 | } | |
2457 | } | |
2458 | ||
2459 | c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ | |
2460 | *yy_c_buf_p = '\0'; /* preserve yytext */ | |
2461 | yy_hold_char = *++yy_c_buf_p; | |
2462 | ||
2463 | ||
2464 | return c; | |
2465 | } | |
2466 | ||
2467 | ||
2468 | #ifdef YY_USE_PROTOS | |
2469 | void yyrestart( FILE *input_file ) | |
2470 | #else | |
2471 | void yyrestart( input_file ) | |
2472 | FILE *input_file; | |
2473 | #endif | |
2474 | { | |
2475 | if ( ! yy_current_buffer ) | |
2476 | yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); | |
2477 | ||
2478 | yy_init_buffer( yy_current_buffer, input_file ); | |
2479 | yy_load_buffer_state(); | |
2480 | } | |
2481 | ||
2482 | ||
2483 | #ifdef YY_USE_PROTOS | |
2484 | void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) | |
2485 | #else | |
2486 | void yy_switch_to_buffer( new_buffer ) | |
2487 | YY_BUFFER_STATE new_buffer; | |
2488 | #endif | |
2489 | { | |
2490 | if ( yy_current_buffer == new_buffer ) | |
2491 | return; | |
2492 | ||
2493 | if ( yy_current_buffer ) | |
2494 | { | |
2495 | /* Flush out information for old buffer. */ | |
2496 | *yy_c_buf_p = yy_hold_char; | |
2497 | yy_current_buffer->yy_buf_pos = yy_c_buf_p; | |
2498 | yy_current_buffer->yy_n_chars = yy_n_chars; | |
2499 | } | |
2500 | ||
2501 | yy_current_buffer = new_buffer; | |
2502 | yy_load_buffer_state(); | |
2503 | ||
2504 | /* We don't actually know whether we did this switch during | |
2505 | * EOF (yywrap()) processing, but the only time this flag | |
2506 | * is looked at is after yywrap() is called, so it's safe | |
2507 | * to go ahead and always set it. | |
2508 | */ | |
2509 | yy_did_buffer_switch_on_eof = 1; | |
2510 | } | |
2511 | ||
2512 | ||
2513 | #ifdef YY_USE_PROTOS | |
2514 | void yy_load_buffer_state( void ) | |
2515 | #else | |
2516 | void yy_load_buffer_state() | |
2517 | #endif | |
2518 | { | |
2519 | yy_n_chars = yy_current_buffer->yy_n_chars; | |
2520 | yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; | |
2521 | yyin = yy_current_buffer->yy_input_file; | |
2522 | yy_hold_char = *yy_c_buf_p; | |
2523 | } | |
2524 | ||
2525 | ||
2526 | #ifdef YY_USE_PROTOS | |
2527 | YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) | |
2528 | #else | |
2529 | YY_BUFFER_STATE yy_create_buffer( file, size ) | |
2530 | FILE *file; | |
2531 | int size; | |
2532 | #endif | |
2533 | { | |
2534 | YY_BUFFER_STATE b; | |
2535 | ||
2536 | b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); | |
2537 | if ( ! b ) | |
2538 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); | |
2539 | ||
2540 | b->yy_buf_size = size; | |
2541 | ||
2542 | /* yy_ch_buf has to be 2 characters longer than the size given because | |
2543 | * we need to put in 2 end-of-buffer characters. | |
2544 | */ | |
2545 | b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); | |
2546 | if ( ! b->yy_ch_buf ) | |
2547 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); | |
2548 | ||
2549 | b->yy_is_our_buffer = 1; | |
2550 | ||
2551 | yy_init_buffer( b, file ); | |
2552 | ||
2553 | return b; | |
2554 | } | |
2555 | ||
2556 | ||
2557 | #ifdef YY_USE_PROTOS | |
2558 | void yy_delete_buffer( YY_BUFFER_STATE b ) | |
2559 | #else | |
2560 | void yy_delete_buffer( b ) | |
2561 | YY_BUFFER_STATE b; | |
2562 | #endif | |
2563 | { | |
2564 | if ( ! b ) | |
2565 | return; | |
2566 | ||
2567 | if ( b == yy_current_buffer ) | |
2568 | yy_current_buffer = (YY_BUFFER_STATE) 0; | |
2569 | ||
2570 | if ( b->yy_is_our_buffer ) | |
2571 | yy_flex_free( (void *) b->yy_ch_buf ); | |
2572 | ||
2573 | yy_flex_free( (void *) b ); | |
2574 | } | |
2575 | ||
2576 | ||
2577 | #ifndef _WIN32 | |
2578 | #include <unistd.h> | |
2579 | #else | |
2580 | #ifndef YY_ALWAYS_INTERACTIVE | |
2581 | #ifndef YY_NEVER_INTERACTIVE | |
2582 | extern int isatty YY_PROTO(( int )); | |
2583 | #endif | |
2584 | #endif | |
2585 | #endif | |
2586 | ||
2587 | #ifdef YY_USE_PROTOS | |
2588 | void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) | |
2589 | #else | |
2590 | void yy_init_buffer( b, file ) | |
2591 | YY_BUFFER_STATE b; | |
2592 | FILE *file; | |
2593 | #endif | |
2594 | ||
2595 | ||
2596 | { | |
2597 | yy_flush_buffer( b ); | |
2598 | ||
2599 | b->yy_input_file = file; | |
2600 | b->yy_fill_buffer = 1; | |
2601 | ||
2602 | #if YY_ALWAYS_INTERACTIVE | |
2603 | b->yy_is_interactive = 1; | |
2604 | #else | |
2605 | #if YY_NEVER_INTERACTIVE | |
2606 | b->yy_is_interactive = 0; | |
2607 | #else | |
2608 | b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; | |
2609 | #endif | |
2610 | #endif | |
2611 | } | |
2612 | ||
2613 | ||
2614 | #ifdef YY_USE_PROTOS | |
2615 | void yy_flush_buffer( YY_BUFFER_STATE b ) | |
2616 | #else | |
2617 | void yy_flush_buffer( b ) | |
2618 | YY_BUFFER_STATE b; | |
2619 | #endif | |
2620 | ||
2621 | { | |
2622 | if ( ! b ) | |
2623 | return; | |
2624 | ||
2625 | b->yy_n_chars = 0; | |
2626 | ||
2627 | /* We always need two end-of-buffer characters. The first causes | |
2628 | * a transition to the end-of-buffer state. The second causes | |
2629 | * a jam in that state. | |
2630 | */ | |
2631 | b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; | |
2632 | b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; | |
2633 | ||
2634 | b->yy_buf_pos = &b->yy_ch_buf[0]; | |
2635 | ||
2636 | b->yy_at_bol = 1; | |
2637 | b->yy_buffer_status = YY_BUFFER_NEW; | |
2638 | ||
2639 | if ( b == yy_current_buffer ) | |
2640 | yy_load_buffer_state(); | |
2641 | } | |
2642 | ||
2643 | ||
2644 | #ifndef YY_NO_SCAN_BUFFER | |
2645 | #ifdef YY_USE_PROTOS | |
2646 | YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) | |
2647 | #else | |
2648 | YY_BUFFER_STATE yy_scan_buffer( base, size ) | |
2649 | char *base; | |
2650 | yy_size_t size; | |
2651 | #endif | |
2652 | { | |
2653 | YY_BUFFER_STATE b; | |
2654 | ||
2655 | if ( size < 2 || | |
2656 | base[size-2] != YY_END_OF_BUFFER_CHAR || | |
2657 | base[size-1] != YY_END_OF_BUFFER_CHAR ) | |
2658 | /* They forgot to leave room for the EOB's. */ | |
2659 | return 0; | |
2660 | ||
2661 | b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); | |
2662 | if ( ! b ) | |
2663 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); | |
2664 | ||
2665 | b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ | |
2666 | b->yy_buf_pos = b->yy_ch_buf = base; | |
2667 | b->yy_is_our_buffer = 0; | |
2668 | b->yy_input_file = 0; | |
2669 | b->yy_n_chars = b->yy_buf_size; | |
2670 | b->yy_is_interactive = 0; | |
2671 | b->yy_at_bol = 1; | |
2672 | b->yy_fill_buffer = 0; | |
2673 | b->yy_buffer_status = YY_BUFFER_NEW; | |
2674 | ||
2675 | yy_switch_to_buffer( b ); | |
2676 | ||
2677 | return b; | |
2678 | } | |
2679 | #endif | |
2680 | ||
2681 | ||
2682 | #ifndef YY_NO_SCAN_STRING | |
2683 | #ifdef YY_USE_PROTOS | |
2684 | YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) | |
2685 | #else | |
2686 | YY_BUFFER_STATE yy_scan_string( yy_str ) | |
2687 | yyconst char *yy_str; | |
2688 | #endif | |
2689 | { | |
2690 | int len; | |
2691 | for ( len = 0; yy_str[len]; ++len ) | |
2692 | ; | |
2693 | ||
2694 | return yy_scan_bytes( yy_str, len ); | |
2695 | } | |
2696 | #endif | |
2697 | ||
2698 | ||
2699 | #ifndef YY_NO_SCAN_BYTES | |
2700 | #ifdef YY_USE_PROTOS | |
2701 | YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) | |
2702 | #else | |
2703 | YY_BUFFER_STATE yy_scan_bytes( bytes, len ) | |
2704 | yyconst char *bytes; | |
2705 | int len; | |
2706 | #endif | |
2707 | { | |
2708 | YY_BUFFER_STATE b; | |
2709 | char *buf; | |
2710 | yy_size_t n; | |
2711 | int i; | |
2712 | ||
2713 | /* Get memory for full buffer, including space for trailing EOB's. */ | |
2714 | n = len + 2; | |
2715 | buf = (char *) yy_flex_alloc( n ); | |
2716 | if ( ! buf ) | |
2717 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); | |
2718 | ||
2719 | for ( i = 0; i < len; ++i ) | |
2720 | buf[i] = bytes[i]; | |
2721 | ||
2722 | buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; | |
2723 | ||
2724 | b = yy_scan_buffer( buf, n ); | |
2725 | if ( ! b ) | |
2726 | YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); | |
2727 | ||
2728 | /* It's okay to grow etc. this buffer, and we should throw it | |
2729 | * away when we're done. | |
2730 | */ | |
2731 | b->yy_is_our_buffer = 1; | |
2732 | ||
2733 | return b; | |
2734 | } | |
2735 | #endif | |
2736 | ||
2737 | ||
2738 | #ifndef YY_NO_PUSH_STATE | |
2739 | #ifdef YY_USE_PROTOS | |
2740 | static void yy_push_state( int new_state ) | |
2741 | #else | |
2742 | static void yy_push_state( new_state ) | |
2743 | int new_state; | |
2744 | #endif | |
2745 | { | |
2746 | if ( yy_start_stack_ptr >= yy_start_stack_depth ) | |
2747 | { | |
2748 | yy_size_t new_size; | |
2749 | ||
2750 | yy_start_stack_depth += YY_START_STACK_INCR; | |
2751 | new_size = yy_start_stack_depth * sizeof( int ); | |
2752 | ||
2753 | if ( ! yy_start_stack ) | |
2754 | yy_start_stack = (int *) yy_flex_alloc( new_size ); | |
2755 | ||
2756 | else | |
2757 | yy_start_stack = (int *) yy_flex_realloc( | |
2758 | (void *) yy_start_stack, new_size ); | |
2759 | ||
2760 | if ( ! yy_start_stack ) | |
2761 | YY_FATAL_ERROR( | |
2762 | "out of memory expanding start-condition stack" ); | |
2763 | } | |
2764 | ||
2765 | yy_start_stack[yy_start_stack_ptr++] = YY_START; | |
2766 | ||
2767 | BEGIN(new_state); | |
2768 | } | |
2769 | #endif | |
2770 | ||
2771 | ||
2772 | #ifndef YY_NO_POP_STATE | |
2773 | static void yy_pop_state() | |
2774 | { | |
2775 | if ( --yy_start_stack_ptr < 0 ) | |
2776 | YY_FATAL_ERROR( "start-condition stack underflow" ); | |
2777 | ||
2778 | BEGIN(yy_start_stack[yy_start_stack_ptr]); | |
2779 | } | |
2780 | #endif | |
2781 | ||
2782 | ||
2783 | #ifndef YY_NO_TOP_STATE | |
2784 | static int yy_top_state() | |
2785 | { | |
2786 | return yy_start_stack[yy_start_stack_ptr - 1]; | |
2787 | } | |
2788 | #endif | |
2789 | ||
2790 | #ifndef YY_EXIT_FAILURE | |
2791 | #define YY_EXIT_FAILURE 2 | |
2792 | #endif | |
2793 | ||
2794 | #ifdef YY_USE_PROTOS | |
2795 | static void yy_fatal_error( yyconst char msg[] ) | |
2796 | #else | |
2797 | static void yy_fatal_error( msg ) | |
2798 | char msg[]; | |
2799 | #endif | |
2800 | { | |
2801 | (void) fprintf( stderr, "%s\n", msg ); | |
2802 | exit( YY_EXIT_FAILURE ); | |
2803 | } | |
2804 | ||
2805 | ||
2806 | ||
2807 | /* Redefine yyless() so it works in section 3 code. */ | |
2808 | ||
2809 | #undef yyless | |
2810 | #define yyless(n) \ | |
2811 | do \ | |
2812 | { \ | |
2813 | /* Undo effects of setting up yytext. */ \ | |
2814 | yytext[yyleng] = yy_hold_char; \ | |
2815 | yy_c_buf_p = yytext + n; \ | |
2816 | yy_hold_char = *yy_c_buf_p; \ | |
2817 | *yy_c_buf_p = '\0'; \ | |
2818 | yyleng = n; \ | |
2819 | } \ | |
2820 | while ( 0 ) | |
2821 | ||
2822 | ||
2823 | /* Internal utility routines. */ | |
2824 | ||
2825 | #ifndef yytext_ptr | |
2826 | #ifdef YY_USE_PROTOS | |
2827 | static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) | |
2828 | #else | |
2829 | static void yy_flex_strncpy( s1, s2, n ) | |
2830 | char *s1; | |
2831 | yyconst char *s2; | |
2832 | int n; | |
2833 | #endif | |
2834 | { | |
2835 | register int i; | |
2836 | for ( i = 0; i < n; ++i ) | |
2837 | s1[i] = s2[i]; | |
2838 | } | |
2839 | #endif | |
2840 | ||
2841 | #ifdef YY_NEED_STRLEN | |
2842 | #ifdef YY_USE_PROTOS | |
2843 | static int yy_flex_strlen( yyconst char *s ) | |
2844 | #else | |
2845 | static int yy_flex_strlen( s ) | |
2846 | yyconst char *s; | |
2847 | #endif | |
2848 | { | |
2849 | register int n; | |
2850 | for ( n = 0; s[n]; ++n ) | |
2851 | ; | |
2852 | ||
2853 | return n; | |
2854 | } | |
2855 | #endif | |
2856 | ||
2857 | ||
2858 | #ifdef YY_USE_PROTOS | |
2859 | static void *yy_flex_alloc( yy_size_t size ) | |
2860 | #else | |
2861 | static void *yy_flex_alloc( size ) | |
2862 | yy_size_t size; | |
2863 | #endif | |
2864 | { | |
2865 | return (void *) malloc( size ); | |
2866 | } | |
2867 | ||
2868 | #ifdef YY_USE_PROTOS | |
2869 | static void *yy_flex_realloc( void *ptr, yy_size_t size ) | |
2870 | #else | |
2871 | static void *yy_flex_realloc( ptr, size ) | |
2872 | void *ptr; | |
2873 | yy_size_t size; | |
2874 | #endif | |
2875 | { | |
2876 | /* The cast to (char *) in the following accommodates both | |
2877 | * implementations that use char* generic pointers, and those | |
2878 | * that use void* generic pointers. It works with the latter | |
2879 | * because both ANSI C and C++ allow castless assignment from | |
2880 | * any pointer type to void*, and deal with argument conversions | |
2881 | * as though doing an assignment. | |
2882 | */ | |
2883 | return (void *) realloc( (char *) ptr, size ); | |
2884 | } | |
2885 | ||
2886 | #ifdef YY_USE_PROTOS | |
2887 | static void yy_flex_free( void *ptr ) | |
2888 | #else | |
2889 | static void yy_flex_free( ptr ) | |
2890 | void *ptr; | |
2891 | #endif | |
2892 | { | |
2893 | free( ptr ); | |
2894 | } | |
2895 | ||
2896 | #if YY_MAIN | |
2897 | int main() | |
2898 | { | |
2899 | yylex(); | |
2900 | return 0; | |
2901 | } | |
2902 | #endif | |
2903 | #line 659 "scan-gram.l" | |
2904 | ||
2905 | ||
2906 | /*------------------------------------------------------------------. | |
2907 | | TEXT is pointing to a wannabee semantic value (i.e., a `$'). | | |
2908 | | | | |
2909 | | Possible inputs: $[<TYPENAME>]($|integer) | | |
2910 | | | | |
2911 | | Output to the STRING_OBSTACK a reference to this semantic value. | | |
2912 | `------------------------------------------------------------------*/ | |
2913 | ||
2914 | static inline void | |
2915 | handle_action_dollar (char *text, location_t location) | |
2916 | { | |
2917 | const char *type_name = NULL; | |
2918 | char *cp = text + 1; | |
2919 | ||
2920 | /* Get the type name if explicit. */ | |
2921 | if (*cp == '<') | |
2922 | { | |
2923 | type_name = ++cp; | |
2924 | while (*cp != '>') | |
2925 | ++cp; | |
2926 | *cp = '\0'; | |
2927 | ++cp; | |
2928 | } | |
2929 | ||
2930 | if (*cp == '$') | |
2931 | { | |
2932 | if (!type_name) | |
2933 | type_name = symbol_list_n_type_name_get (current_rule, location, 0); | |
2934 | if (!type_name && typed) | |
2935 | complain_at (location, _("$$ of `%s' has no declared type"), | |
2936 | current_rule->sym->tag); | |
2937 | if (!type_name) | |
2938 | type_name = ""; | |
2939 | obstack_fgrow1 (&string_obstack, | |
2940 | "]b4_lhs_value([%s])[", type_name); | |
2941 | } | |
2942 | else | |
2943 | { | |
2944 | long num; | |
2945 | errno = 0; | |
2946 | num = strtol (cp, 0, 10); | |
2947 | ||
2948 | if (INT_MIN <= num && num <= rule_length && ! errno) | |
2949 | { | |
2950 | int n = num; | |
2951 | if (!type_name && n > 0) | |
2952 | type_name = symbol_list_n_type_name_get (current_rule, location, | |
2953 | n); | |
2954 | if (!type_name && typed) | |
2955 | complain_at (location, _("$%d of `%s' has no declared type"), | |
2956 | n, current_rule->sym->tag); | |
2957 | if (!type_name) | |
2958 | type_name = ""; | |
2959 | obstack_fgrow3 (&string_obstack, | |
2960 | "]b4_rhs_value([%d], [%d], [%s])[", | |
2961 | rule_length, n, type_name); | |
2962 | } | |
2963 | else | |
2964 | complain_at (location, _("invalid value: %s"), quote (text)); | |
2965 | } | |
2966 | } | |
2967 | ||
2968 | ||
2969 | /*---------------------------------------------------------------. | |
2970 | | TEXT is expected to be $$ in some code associated to a symbol: | | |
2971 | | destructor or printer. | | |
2972 | `---------------------------------------------------------------*/ | |
2973 | ||
2974 | static inline void | |
2975 | handle_symbol_code_dollar (char *text, location_t location) | |
2976 | { | |
2977 | char *cp = text + 1; | |
2978 | if (*cp == '$') | |
2979 | obstack_sgrow (&string_obstack, "]b4_dollar_dollar["); | |
2980 | else | |
2981 | complain_at (location, _("invalid value: %s"), quote (text)); | |
2982 | } | |
2983 | ||
2984 | ||
2985 | /*-----------------------------------------------------------------. | |
2986 | | Dispatch onto handle_action_dollar, or handle_destructor_dollar, | | |
2987 | | depending upon CODE_KIND. | | |
2988 | `-----------------------------------------------------------------*/ | |
2989 | ||
2990 | static void | |
2991 | handle_dollar (braced_code_t braced_code_kind, | |
2992 | char *text, location_t location) | |
2993 | { | |
2994 | switch (braced_code_kind) | |
2995 | { | |
2996 | case action_braced_code: | |
2997 | handle_action_dollar (text, location); | |
2998 | break; | |
2999 | ||
3000 | case destructor_braced_code: | |
3001 | case printer_braced_code: | |
3002 | handle_symbol_code_dollar (text, location); | |
3003 | break; | |
3004 | } | |
3005 | } | |
3006 | ||
3007 | ||
3008 | /*------------------------------------------------------. | |
3009 | | TEXT is a location token (i.e., a `@...'). Output to | | |
3010 | | STRING_OBSTACK a reference to this location. | | |
3011 | `------------------------------------------------------*/ | |
3012 | ||
3013 | static inline void | |
3014 | handle_action_at (char *text, location_t location) | |
3015 | { | |
3016 | char *cp = text + 1; | |
3017 | locations_flag = 1; | |
3018 | ||
3019 | if (*cp == '$') | |
3020 | { | |
3021 | obstack_sgrow (&string_obstack, "]b4_lhs_location["); | |
3022 | } | |
3023 | else | |
3024 | { | |
3025 | long num; | |
3026 | errno = 0; | |
3027 | num = strtol (cp, 0, 10); | |
3028 | ||
3029 | if (INT_MIN <= num && num <= rule_length && ! errno) | |
3030 | { | |
3031 | int n = num; | |
3032 | obstack_fgrow2 (&string_obstack, "]b4_rhs_location([%d], [%d])[", | |
3033 | rule_length, n); | |
3034 | } | |
3035 | else | |
3036 | complain_at (location, _("invalid value: %s"), quote (text)); | |
3037 | } | |
3038 | } | |
3039 | ||
3040 | ||
3041 | /*---------------------------------------------------------------. | |
3042 | | TEXT is expected to be @$ in some code associated to a symbol: | | |
3043 | | destructor or printer. | | |
3044 | `---------------------------------------------------------------*/ | |
3045 | ||
3046 | static inline void | |
3047 | handle_symbol_code_at (char *text, location_t location) | |
3048 | { | |
3049 | char *cp = text + 1; | |
3050 | if (*cp == '$') | |
3051 | obstack_sgrow (&string_obstack, "]b4_at_dollar["); | |
3052 | else | |
3053 | complain_at (location, _("invalid value: %s"), quote (text)); | |
3054 | } | |
3055 | ||
3056 | ||
3057 | /*-------------------------------------------------------------------. | |
3058 | | Dispatch onto handle_action_at, or handle_destructor_at, depending | | |
3059 | | upon CODE_KIND. | | |
3060 | `-------------------------------------------------------------------*/ | |
3061 | ||
3062 | static void | |
3063 | handle_at (braced_code_t braced_code_kind, | |
3064 | char *text, location_t location) | |
3065 | { | |
3066 | switch (braced_code_kind) | |
3067 | { | |
3068 | case action_braced_code: | |
3069 | handle_action_at (text, location); | |
3070 | break; | |
3071 | ||
3072 | case destructor_braced_code: | |
3073 | case printer_braced_code: | |
3074 | handle_symbol_code_at (text, location); | |
3075 | break; | |
3076 | } | |
3077 | } | |
3078 | ||
3079 | ||
3080 | /*------------------------------------------------------------------. | |
3081 | | Convert universal character name UCN to a single-byte character, | | |
3082 | | and return that character. Return -1 if UCN does not correspond | | |
3083 | | to a single-byte character. | | |
3084 | `------------------------------------------------------------------*/ | |
3085 | ||
3086 | static int | |
3087 | convert_ucn_to_byte (char const *ucn) | |
3088 | { | |
3089 | unsigned long code = strtoul (ucn + 2, 0, 16); | |
3090 | ||
3091 | /* FIXME: Currently we assume Unicode-compatible unibyte characters | |
3092 | on ASCII hosts (i.e., Latin-1 on hosts with 8-bit bytes). On | |
3093 | non-ASCII hosts we support only the portable C character set. | |
3094 | These limitations should be removed once we add support for | |
3095 | multibyte characters. */ | |
3096 | ||
3097 | if (UCHAR_MAX < code) | |
3098 | return -1; | |
3099 | ||
3100 | #if ! ('$' == 0x24 && '@' == 0x40 && '`' == 0x60 && '~' == 0x7e) | |
3101 | { | |
3102 | /* A non-ASCII host. Use CODE to index into a table of the C | |
3103 | basic execution character set, which is guaranteed to exist on | |
3104 | all Standard C platforms. This table also includes '$', '@', | |
3105 | and '`', which not in the basic execution character set but | |
3106 | which are unibyte characters on all the platforms that we know | |
3107 | about. */ | |
3108 | static signed char const table[] = | |
3109 | { | |
3110 | '\0', -1, -1, -1, -1, -1, -1, '\a', | |
3111 | '\b', '\t', '\n', '\v', '\f', '\r', -1, -1, | |
3112 | -1, -1, -1, -1, -1, -1, -1, -1, | |
3113 | -1, -1, -1, -1, -1, -1, -1, -1, | |
3114 | ' ', '!', '"', '#', '$', '%', '&', '\'', | |
3115 | '(', ')', '*', '+', ',', '-', '.', '/', | |
3116 | '0', '1', '2', '3', '4', '5', '6', '7', | |
3117 | '8', '9', ':', ';', '<', '=', '>', '?', | |
3118 | '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', | |
3119 | 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', | |
3120 | 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', | |
3121 | 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', | |
3122 | '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', | |
3123 | 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', | |
3124 | 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', | |
3125 | 'x', 'y', 'z', '{', '|', '}', '~' | |
3126 | }; | |
3127 | ||
3128 | code = code < sizeof table ? table[code] : -1; | |
3129 | } | |
3130 | #endif | |
3131 | ||
3132 | return code; | |
3133 | } | |
3134 | ||
3135 | ||
3136 | /*-------------------------. | |
3137 | | Initialize the scanner. | | |
3138 | `-------------------------*/ | |
3139 | ||
3140 | void | |
3141 | scanner_initialize (void) | |
3142 | { | |
3143 | obstack_init (&string_obstack); | |
3144 | } | |
3145 | ||
3146 | ||
3147 | /*-----------------------------------------------. | |
3148 | | Free all the memory allocated to the scanner. | | |
3149 | `-----------------------------------------------*/ | |
3150 | ||
3151 | void | |
3152 | scanner_free (void) | |
3153 | { | |
3154 | obstack_free (&string_obstack, 0); | |
3155 | /* Reclaim Flex's buffers. */ | |
3156 | yy_delete_buffer (YY_CURRENT_BUFFER); | |
3157 | } |