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