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