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