1 #define yy_create_buffer llvmAsm_create_buffer
2 #define yy_delete_buffer llvmAsm_delete_buffer
3 #define yy_scan_buffer llvmAsm_scan_buffer
4 #define yy_scan_string llvmAsm_scan_string
5 #define yy_scan_bytes llvmAsm_scan_bytes
6 #define yy_flex_debug llvmAsm_flex_debug
7 #define yy_init_buffer llvmAsm_init_buffer
8 #define yy_flush_buffer llvmAsm_flush_buffer
9 #define yy_load_buffer_state llvmAsm_load_buffer_state
10 #define yy_switch_to_buffer llvmAsm_switch_to_buffer
11 #define yyin llvmAsmin
12 #define yyleng llvmAsmleng
13 #define yylex llvmAsmlex
14 #define yyout llvmAsmout
15 #define yyrestart llvmAsmrestart
16 #define yytext llvmAsmtext
17 #define yylineno llvmAsmlineno
20 /* A lexical scanner generated by flex */
22 /* Scanner skeleton version:
27 #define YY_FLEX_MAJOR_VERSION 2
28 #define YY_FLEX_MINOR_VERSION 5
33 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
46 /* Use prototypes in function declarations. */
49 /* The "const" storage-class-modifier is valid. */
52 #else /* ! __cplusplus */
60 #endif /* ! __cplusplus */
79 #define YY_PROTO(proto) proto
81 #define YY_PROTO(proto) ()
84 /* Returned upon end-of-file. */
87 /* Promotes a possibly negative, possibly signed char to an unsigned
88 * integer for use as an array index. If the signed char is negative,
89 * we want to instead treat it as an 8-bit unsigned char, hence the
92 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
94 /* Enter a start condition. This macro really ought to take a parameter,
95 * but we do it the disgusting crufty way forced on us by the ()-less
96 * definition of BEGIN.
98 #define BEGIN yy_start = 1 + 2 *
100 /* Translate the current start state into a value that can be later handed
101 * to BEGIN to return to the state. The YYSTATE alias is for lex
104 #define YY_START ((yy_start - 1) / 2)
105 #define YYSTATE YY_START
107 /* Action number for EOF rule of a given start state. */
108 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
110 /* Special action meaning "start processing a new file". */
111 #define YY_NEW_FILE yyrestart( yyin )
113 #define YY_END_OF_BUFFER_CHAR 0
115 /* Size of default input buffer. */
116 #define YY_BUF_SIZE 16384
118 typedef struct yy_buffer_state *YY_BUFFER_STATE;
121 extern FILE *yyin, *yyout;
123 #define EOB_ACT_CONTINUE_SCAN 0
124 #define EOB_ACT_END_OF_FILE 1
125 #define EOB_ACT_LAST_MATCH 2
127 /* The funky do-while in the following #define is used to turn the definition
128 * int a single C statement (which needs a semi-colon terminator). This
129 * avoids problems with code like:
131 * if ( condition_holds )
134 * do_something_else();
136 * Prior to using the do-while the compiler would get upset at the
137 * "else" because it interpreted the "if" statement as being all
138 * done when it reached the ';' after the yyless() call.
141 /* Return all but the first 'n' matched characters back to the input stream. */
146 /* Undo effects of setting up yytext. */ \
147 *yy_cp = yy_hold_char; \
148 YY_RESTORE_YY_MORE_OFFSET \
149 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
150 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
154 #define unput(c) yyunput( c, yytext_ptr )
156 /* The following is because we cannot portably get our hands on size_t
157 * (without autoconf's help, which isn't available because we want
158 * flex-generated scanners to compile on their own).
160 typedef unsigned int yy_size_t;
163 struct yy_buffer_state
167 char *yy_ch_buf; /* input buffer */
168 char *yy_buf_pos; /* current position in input buffer */
170 /* Size of input buffer in bytes, not including room for EOB
173 yy_size_t yy_buf_size;
175 /* Number of characters read into yy_ch_buf, not including EOB
180 /* Whether we "own" the buffer - i.e., we know we created it,
181 * and can realloc() it to grow it, and should free() it to
184 int yy_is_our_buffer;
186 /* Whether this is an "interactive" input source; if so, and
187 * if we're using stdio for input, then we want to use getc()
188 * instead of fread(), to make sure we stop fetching input after
191 int yy_is_interactive;
193 /* Whether we're considered to be at the beginning of a line.
194 * If so, '^' rules will be active on the next match, otherwise
199 /* Whether to try to fill the input buffer when we reach the
204 int yy_buffer_status;
205 #define YY_BUFFER_NEW 0
206 #define YY_BUFFER_NORMAL 1
207 /* When an EOF's been seen but there's still some text to process
208 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
209 * shouldn't try reading from the input source any more. We might
210 * still have a bunch of tokens to match, though, because of
211 * possible backing-up.
213 * When we actually see the EOF, we change the status to "new"
214 * (via yyrestart()), so that the user can continue scanning by
215 * just pointing yyin at a new input file.
217 #define YY_BUFFER_EOF_PENDING 2
220 static YY_BUFFER_STATE yy_current_buffer = 0;
222 /* We provide macros for accessing buffer states in case in the
223 * future we want to put the buffer states in a more general
226 #define YY_CURRENT_BUFFER yy_current_buffer
229 /* yy_hold_char holds the character lost when yytext is formed. */
230 static char yy_hold_char;
232 static int yy_n_chars; /* number of characters read into yy_ch_buf */
237 /* Points to current character in buffer. */
238 static char *yy_c_buf_p = (char *) 0;
239 static int yy_init = 1; /* whether we need to initialize */
240 static int yy_start = 0; /* start state number */
242 /* Flag which is used to allow yywrap()'s to do buffer switches
243 * instead of setting up a fresh yyin. A bit of a hack ...
245 static int yy_did_buffer_switch_on_eof;
247 void yyrestart YY_PROTO(( FILE *input_file ));
249 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
250 void yy_load_buffer_state YY_PROTO(( void ));
251 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
252 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
253 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
254 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
255 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
257 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
258 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
259 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
261 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
262 static inline void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
263 static void yy_flex_free YY_PROTO(( void * ));
265 #define yy_new_buffer yy_create_buffer
267 #define yy_set_interactive(is_interactive) \
269 if ( ! yy_current_buffer ) \
270 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
271 yy_current_buffer->yy_is_interactive = is_interactive; \
274 #define yy_set_bol(at_bol) \
276 if ( ! yy_current_buffer ) \
277 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
278 yy_current_buffer->yy_at_bol = at_bol; \
281 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
284 #define YY_USES_REJECT
287 #define YY_SKIP_YYWRAP
288 typedef unsigned char YY_CHAR;
289 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
290 typedef int yy_state_type;
294 #define yytext_ptr yytext
296 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
297 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
298 static int yy_get_next_buffer YY_PROTO(( void ));
299 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
301 /* Done after the current pattern has been matched and before the
302 * corresponding action - sets up yytext.
304 #define YY_DO_BEFORE_ACTION \
305 yytext_ptr = yy_bp; \
306 yyleng = (int) (yy_cp - yy_bp); \
307 yy_hold_char = *yy_cp; \
311 #define YY_NUM_RULES 58
312 #define YY_END_OF_BUFFER 59
313 static yyconst short int yy_acclist[113] =
315 59, 57, 58, 56, 57, 58, 56, 58, 57, 58,
316 57, 58, 57, 58, 8, 57, 58, 52, 57, 58,
317 1, 57, 58, 57, 58, 57, 58, 57, 58, 57,
318 58, 57, 58, 57, 58, 57, 58, 57, 58, 57,
319 58, 57, 58, 57, 58, 57, 58, 57, 58, 57,
320 58, 57, 58, 57, 58, 57, 58, 50, 49, 54,
321 53, 52, 1, 9, 40, 51, 49, 55, 28, 31,
322 3, 16, 30, 24, 25, 26, 32, 39, 29, 11,
323 27, 44, 45, 18, 4, 22, 17, 10, 2, 5,
324 20, 23, 12, 34, 38, 36, 37, 35, 33, 14,
326 46, 13, 19, 43, 21, 42, 41, 15, 6, 47,
330 static yyconst short int yy_accept[199] =
332 1, 1, 1, 2, 4, 7, 9, 11, 13, 15,
333 18, 21, 24, 26, 28, 30, 32, 34, 36, 38,
334 40, 42, 44, 46, 48, 50, 52, 54, 56, 58,
335 58, 58, 59, 60, 60, 61, 62, 63, 64, 64,
336 64, 65, 65, 65, 66, 66, 66, 66, 66, 66,
337 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
338 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
339 66, 66, 66, 66, 66, 66, 66, 66, 67, 68,
340 69, 70, 70, 70, 70, 70, 70, 71, 71, 72,
341 72, 72, 72, 72, 72, 73, 73, 73, 73, 73,
343 74, 75, 76, 77, 77, 78, 79, 79, 79, 79,
344 79, 80, 80, 80, 80, 80, 80, 80, 80, 80,
345 80, 80, 81, 82, 82, 82, 82, 82, 83, 83,
346 83, 83, 84, 85, 85, 85, 85, 85, 85, 85,
347 85, 85, 85, 85, 86, 87, 87, 88, 88, 88,
348 89, 89, 90, 90, 90, 91, 92, 92, 92, 93,
349 93, 93, 94, 95, 96, 97, 98, 99, 100, 101,
350 102, 102, 103, 104, 104, 105, 105, 106, 106, 106,
351 107, 107, 108, 109, 110, 110, 110, 110, 111, 111,
352 112, 112, 112, 112, 112, 112, 113, 113
356 static yyconst int yy_ec[256] =
358 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
359 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
360 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
361 1, 2, 1, 4, 1, 5, 6, 1, 1, 1,
362 1, 1, 1, 1, 7, 5, 1, 8, 8, 8,
363 8, 8, 8, 8, 8, 8, 8, 9, 10, 1,
364 1, 1, 1, 1, 5, 5, 5, 5, 5, 5,
365 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
366 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
367 1, 1, 1, 1, 5, 1, 11, 12, 13, 14,
369 15, 16, 17, 18, 19, 5, 5, 20, 21, 22,
370 23, 24, 25, 26, 27, 28, 29, 30, 31, 5,
371 32, 5, 1, 1, 1, 1, 1, 1, 1, 1,
372 1, 1, 1, 1, 1, 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,
380 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
381 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
382 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
383 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
384 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
388 static yyconst int yy_meta[33] =
390 1, 1, 2, 3, 4, 1, 5, 4, 6, 1,
391 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
392 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
396 static yyconst short int yy_base[203] =
398 0, 0, 389, 390, 390, 390, 0, 379, 26, 379,
399 27, 0, 28, 40, 29, 35, 34, 42, 30, 38,
400 56, 60, 55, 63, 65, 84, 68, 107, 52, 382,
401 376, 390, 0, 376, 375, 374, 74, 0, 32, 64,
402 372, 78, 67, 371, 77, 92, 76, 79, 89, 98,
403 100, 95, 102, 105, 108, 112, 111, 119, 122, 123,
404 116, 126, 128, 129, 132, 134, 137, 138, 139, 140,
405 143, 144, 145, 149, 146, 156, 154, 390, 0, 371,
406 369, 157, 166, 158, 161, 167, 368, 170, 367, 174,
407 175, 179, 180, 182, 366, 183, 181, 188, 184, 365,
409 364, 363, 362, 190, 361, 360, 191, 211, 198, 199,
410 359, 194, 200, 201, 202, 204, 205, 212, 203, 225,
411 214, 358, 357, 228, 209, 231, 232, 356, 233, 234,
412 235, 355, 354, 236, 238, 239, 241, 247, 249, 252,
413 242, 254, 259, 353, 352, 256, 351, 264, 265, 350,
414 267, 349, 270, 271, 348, 347, 273, 274, 346, 276,
415 275, 345, 344, 343, 342, 341, 340, 335, 330, 325,
416 283, 320, 319, 278, 317, 284, 316, 285, 288, 315,
417 289, 313, 311, 310, 293, 291, 301, 308, 295, 244,
418 303, 299, 302, 307, 309, 82, 390, 331, 334, 337,
423 static yyconst short int yy_def[203] =
425 197, 1, 197, 197, 197, 197, 198, 199, 200, 197,
426 199, 201, 199, 199, 199, 199, 199, 199, 199, 199,
427 199, 199, 199, 199, 199, 199, 199, 199, 199, 198,
428 199, 197, 202, 197, 197, 197, 199, 201, 199, 199,
429 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
430 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
431 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
432 199, 199, 199, 199, 199, 199, 199, 197, 202, 197,
433 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
434 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
436 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
437 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
438 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
439 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
440 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
441 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
442 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
443 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
444 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
445 199, 199, 199, 199, 199, 199, 0, 197, 197, 197,
450 static yyconst short int yy_nxt[423] =
452 4, 5, 6, 7, 8, 9, 10, 11, 4, 12,
453 13, 14, 15, 16, 17, 18, 19, 8, 20, 21,
454 22, 23, 8, 24, 8, 25, 26, 27, 28, 29,
455 8, 8, 34, 35, 37, 32, 32, 32, 32, 45,
456 32, 39, 32, 32, 53, 81, 32, 40, 32, 46,
457 32, 41, 50, 47, 42, 49, 79, 48, 54, 55,
458 32, 51, 43, 32, 32, 44, 56, 52, 32, 60,
459 58, 32, 32, 32, 77, 32, 32, 61, 57, 64,
460 62, 37, 32, 82, 32, 32, 32, 32, 59, 84,
461 32, 63, 32, 71, 83, 65, 85, 32, 66, 72,
463 32, 67, 89, 32, 86, 87, 32, 88, 32, 92,
464 32, 68, 69, 32, 70, 32, 32, 90, 73, 32,
465 32, 97, 91, 96, 32, 74, 75, 32, 94, 93,
466 32, 32, 98, 76, 32, 95, 32, 32, 99, 101,
467 32, 100, 32, 102, 103, 32, 32, 32, 32, 105,
468 111, 32, 32, 32, 32, 104, 106, 32, 112, 109,
469 110, 108, 32, 107, 32, 32, 32, 114, 117, 32,
470 116, 113, 119, 118, 32, 32, 115, 122, 32, 120,
471 123, 125, 32, 32, 121, 127, 124, 32, 32, 32,
472 32, 32, 32, 128, 132, 129, 32, 131, 32, 32,
474 126, 130, 32, 134, 133, 135, 32, 32, 32, 32,
475 32, 32, 32, 32, 144, 145, 150, 32, 136, 32,
476 32, 143, 32, 141, 142, 137, 148, 138, 154, 146,
477 139, 147, 140, 32, 149, 152, 32, 151, 153, 32,
478 32, 32, 32, 32, 32, 155, 32, 32, 158, 32,
479 32, 157, 32, 162, 159, 32, 161, 32, 160, 156,
480 32, 164, 32, 166, 32, 163, 168, 32, 170, 169,
481 172, 171, 32, 32, 165, 32, 167, 175, 32, 32,
482 173, 32, 32, 32, 32, 177, 32, 178, 180, 181,
483 174, 32, 32, 32, 179, 176, 32, 32, 184, 32,
485 182, 32, 186, 32, 185, 183, 188, 32, 187, 32,
486 32, 32, 189, 192, 190, 32, 32, 32, 32, 32,
487 194, 32, 191, 32, 32, 32, 193, 32, 32, 195,
488 196, 30, 30, 32, 30, 30, 30, 31, 32, 31,
489 33, 33, 38, 32, 38, 38, 38, 38, 32, 32,
490 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
491 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
492 32, 32, 32, 32, 32, 32, 32, 32, 80, 32,
493 32, 36, 35, 80, 32, 78, 36, 32, 197, 3,
494 197, 197, 197, 197, 197, 197, 197, 197, 197, 197,
496 197, 197, 197, 197, 197, 197, 197, 197, 197, 197,
497 197, 197, 197, 197, 197, 197, 197, 197, 197, 197,
501 static yyconst short int yy_chk[423] =
503 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
504 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
505 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
506 1, 1, 9, 9, 11, 11, 13, 15, 19, 15,
507 39, 13, 17, 16, 19, 39, 20, 13, 14, 16,
508 18, 14, 18, 16, 14, 17, 202, 16, 20, 20,
509 29, 18, 14, 23, 21, 14, 21, 18, 22, 23,
510 22, 24, 40, 25, 29, 43, 27, 23, 21, 25,
511 24, 37, 37, 40, 47, 45, 42, 48, 22, 43,
512 196, 24, 26, 27, 42, 26, 45, 49, 26, 27,
514 46, 26, 49, 52, 46, 47, 50, 48, 51, 52,
515 53, 26, 26, 54, 26, 28, 55, 50, 28, 57,
516 56, 57, 51, 56, 61, 28, 28, 58, 54, 53,
517 59, 60, 57, 28, 62, 55, 63, 64, 58, 60,
518 65, 59, 66, 61, 62, 67, 68, 69, 70, 64,
519 69, 71, 72, 73, 75, 63, 64, 74, 70, 67,
520 68, 66, 77, 65, 76, 82, 84, 72, 75, 85,
521 74, 71, 77, 76, 83, 86, 73, 84, 88, 82,
522 85, 88, 90, 91, 83, 91, 86, 92, 93, 97,
523 94, 96, 99, 92, 97, 93, 98, 96, 104, 107,
525 90, 94, 112, 99, 98, 104, 109, 110, 113, 114,
526 115, 119, 116, 117, 113, 114, 119, 125, 107, 108,
527 118, 112, 121, 109, 110, 108, 117, 108, 125, 115,
528 108, 116, 108, 120, 118, 121, 124, 120, 124, 126,
529 127, 129, 130, 131, 134, 126, 135, 136, 130, 137,
530 141, 129, 190, 136, 131, 138, 135, 139, 134, 127,
531 140, 138, 142, 139, 146, 137, 140, 143, 142, 141,
532 146, 143, 148, 149, 138, 151, 139, 151, 153, 154,
533 148, 157, 158, 161, 160, 154, 174, 157, 160, 161,
534 149, 171, 176, 178, 158, 153, 179, 181, 176, 186,
536 171, 185, 179, 189, 178, 174, 185, 192, 181, 187,
537 193, 191, 186, 191, 187, 194, 188, 195, 184, 183,
538 193, 182, 189, 180, 177, 175, 192, 173, 172, 194,
539 195, 198, 198, 170, 198, 198, 198, 199, 169, 199,
540 200, 200, 201, 168, 201, 201, 201, 201, 167, 166,
541 165, 164, 163, 162, 159, 156, 155, 152, 150, 147,
542 145, 144, 133, 132, 128, 123, 122, 111, 106, 105,
543 103, 102, 101, 100, 95, 89, 87, 81, 80, 44,
544 41, 36, 35, 34, 31, 30, 10, 8, 3, 197,
545 197, 197, 197, 197, 197, 197, 197, 197, 197, 197,
547 197, 197, 197, 197, 197, 197, 197, 197, 197, 197,
548 197, 197, 197, 197, 197, 197, 197, 197, 197, 197,
552 static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
553 static char *yy_full_match;
557 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
558 yy_cp = yy_full_match; /* restore poss. backed-over text */ \
562 #define yymore() yymore_used_but_not_detected
563 #define YY_MORE_ADJ 0
564 #define YY_RESTORE_YY_MORE_OFFSET
568 /*===-- Lexer.l - Scanner for llvm assembly files ----------------*- C++ -*--=//
570 // This file implements the flex scanner for LLVM assembly languages files.
572 //===------------------------------------------------------------------------=*/
573 #define YY_NEVER_INTERACTIVE 1
575 #include "ParserInternals.h"
576 #include "llvm/BasicBlock.h"
577 #include "llvm/Method.h"
578 #include "llvm/Module.h"
580 #include "llvmAsmParser.h"
582 #define RET_TOK(type, Enum, sym) \
583 llvmAsmlval.type = Instruction::Enum; return sym
586 // TODO: All of the static identifiers are figured out by the lexer,
587 // these should be hashed.
590 // atoull - Convert an ascii string of decimal digits into the unsigned long
591 // long representation... this does not have to do input error checking,
592 // because we know that the input will be matched by a suitable regex...
594 uint64_t atoull(const char *Buffer) {
596 for (; *Buffer; Buffer++) {
597 uint64_t OldRes = Result;
599 Result += *Buffer-'0';
600 if (Result < OldRes) { // Uh, oh, overflow detected!!!
601 ThrowException("constant bigger than 64 bits detected!");
608 #define YY_NEVER_INTERACTIVE 1
609 /* Comments start with a ; and go till end of line */
610 /* Variable(Def) identifiers start with a % sign */
611 /* Label identifiers end with a colon */
612 /* Quoted names can contain any character except " and \ */
613 /* [PN]Integer: match positive and negative literal integer values that
614 * are preceeded by a '%' character. These represent unnamed variable slots.
616 /* E[PN]Integer: match positive and negative literal integer values */
617 #line 618 "Lexer.cpp"
619 /* Macros after this point can all be overridden by user definitions in
623 #ifndef YY_SKIP_YYWRAP
625 extern "C" int yywrap YY_PROTO(( void ));
627 extern int yywrap YY_PROTO(( void ));
632 static inline void yyunput YY_PROTO(( int c, char *buf_ptr ));
636 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
639 #ifdef YY_NEED_STRLEN
640 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
645 static int yyinput YY_PROTO(( void ));
647 static int input YY_PROTO(( void ));
652 static int yy_start_stack_ptr = 0;
653 static int yy_start_stack_depth = 0;
654 static int *yy_start_stack = 0;
655 #ifndef YY_NO_PUSH_STATE
656 static void yy_push_state YY_PROTO(( int new_state ));
658 #ifndef YY_NO_POP_STATE
659 static void yy_pop_state YY_PROTO(( void ));
661 #ifndef YY_NO_TOP_STATE
662 static int yy_top_state YY_PROTO(( void ));
666 #define YY_NO_PUSH_STATE 1
667 #define YY_NO_POP_STATE 1
668 #define YY_NO_TOP_STATE 1
671 #ifdef YY_MALLOC_DECL
679 /* Just try to get by without declaring the routines. This will fail
680 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
681 * or sizeof(void*) != sizeof(int).
686 /* Amount of stuff to slurp up with each read. */
687 #ifndef YY_READ_BUF_SIZE
688 #define YY_READ_BUF_SIZE 8192
691 /* Copy whatever the last rule matched to the standard output. */
694 /* This used to be an fputs(), but since the string might contain NUL's,
695 * we now use fwrite().
697 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
700 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
701 * is returned in "result".
704 #define YY_INPUT(buf,result,max_size) \
705 if ( yy_current_buffer->yy_is_interactive ) \
708 for ( n = 0; n < max_size && \
709 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
712 buf[n++] = (char) c; \
713 if ( c == EOF && ferror( yyin ) ) \
714 YY_FATAL_ERROR( "input in flex scanner failed" ); \
717 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
718 && ferror( yyin ) ) \
719 YY_FATAL_ERROR( "input in flex scanner failed" );
722 /* No semi-colon after return; correct usage is to write "yyterminate();" -
723 * we don't want an extra ';' after the "return" because that will cause
724 * some compilers to complain about unreachable statements.
727 #define yyterminate() return YY_NULL
730 /* Number of entries by which start-condition stack grows. */
731 #ifndef YY_START_STACK_INCR
732 #define YY_START_STACK_INCR 25
735 /* Report a fatal error. */
736 #ifndef YY_FATAL_ERROR
737 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
740 /* Default declaration of generated scanner - a define so the user can
741 * easily add parameters.
744 #define YY_DECL int yylex YY_PROTO(( void ))
747 /* Code executed at the beginning of each rule, after yytext and yyleng
750 #ifndef YY_USER_ACTION
751 #define YY_USER_ACTION
754 /* Code executed at the end of each rule. */
756 #define YY_BREAK break;
759 #define YY_RULE_SETUP \
764 register yy_state_type yy_current_state;
765 register char *yy_cp, *yy_bp;
771 #line 772 "Lexer.cpp"
782 yy_start = 1; /* first start state */
790 if ( ! yy_current_buffer )
792 yy_create_buffer( yyin, YY_BUF_SIZE );
794 yy_load_buffer_state();
797 while ( 1 ) /* loops until end-of-file is reached */
801 /* Support of yytext. */
802 *yy_cp = yy_hold_char;
804 /* yy_bp points to the position in yy_ch_buf of the start of
809 yy_current_state = yy_start;
810 yy_state_ptr = yy_state_buf;
811 *yy_state_ptr++ = yy_current_state;
815 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
816 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
818 yy_current_state = (int) yy_def[yy_current_state];
819 if ( yy_current_state >= 198 )
820 yy_c = yy_meta[(unsigned int) yy_c];
822 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
823 *yy_state_ptr++ = yy_current_state;
826 while ( yy_current_state != 197 );
829 yy_current_state = *--yy_state_ptr;
830 yy_lp = yy_accept[yy_current_state];
831 for ( ; ; ) /* until we find what rule we matched */
833 if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
835 yy_act = yy_acclist[yy_lp];
837 yy_full_match = yy_cp;
842 yy_current_state = *--yy_state_ptr;
843 yy_lp = yy_accept[yy_current_state];
848 if ( yy_act != YY_END_OF_BUFFER )
851 for ( yyl = 0; yyl < yyleng; ++yyl )
852 if ( yytext[yyl] == '\n' )
856 do_action: /* This label is used only to access EOF actions. */
860 { /* beginning of action switch */
864 { /* Ignore comments for now */ }
894 { return IMPLEMENTATION; }
899 { cerr << "deprecated argument '-' used!\n"; return '-'; }
904 { cerr << "deprecated type 'bb' used!\n"; llvmAsmlval.TypeVal = Type::LabelTy; return LABEL;}
909 { llvmAsmlval.TypeVal = Type::VoidTy ; return VOID; }
914 { llvmAsmlval.TypeVal = Type::BoolTy ; return BOOL; }
919 { llvmAsmlval.TypeVal = Type::SByteTy ; return SBYTE; }
924 { llvmAsmlval.TypeVal = Type::UByteTy ; return UBYTE; }
929 { llvmAsmlval.TypeVal = Type::ShortTy ; return SHORT; }
934 { llvmAsmlval.TypeVal = Type::UShortTy; return USHORT; }
939 { llvmAsmlval.TypeVal = Type::IntTy ; return INT; }
944 { llvmAsmlval.TypeVal = Type::UIntTy ; return UINT; }
949 { llvmAsmlval.TypeVal = Type::LongTy ; return LONG; }
954 { llvmAsmlval.TypeVal = Type::ULongTy ; return ULONG; }
959 { llvmAsmlval.TypeVal = Type::FloatTy ; return FLOAT; }
964 { llvmAsmlval.TypeVal = Type::DoubleTy; return DOUBLE; }
969 { llvmAsmlval.TypeVal = Type::TypeTy ; return TYPE; }
974 { llvmAsmlval.TypeVal = Type::LabelTy ; return LABEL; }
979 { RET_TOK(UnaryOpVal, Neg, NEG); }
984 { RET_TOK(UnaryOpVal, Not, NOT); }
999 { RET_TOK(BinaryOpVal, Add, ADD); }
1004 { RET_TOK(BinaryOpVal, Sub, SUB); }
1009 { RET_TOK(BinaryOpVal, Mul, MUL); }
1014 { RET_TOK(BinaryOpVal, Div, DIV); }
1019 { RET_TOK(BinaryOpVal, Rem, REM); }
1024 { RET_TOK(BinaryOpVal, SetNE, SETNE); }
1029 { RET_TOK(BinaryOpVal, SetEQ, SETEQ); }
1034 { RET_TOK(BinaryOpVal, SetLT, SETLT); }
1039 { RET_TOK(BinaryOpVal, SetGT, SETGT); }
1044 { RET_TOK(BinaryOpVal, SetLE, SETLE); }
1049 { RET_TOK(BinaryOpVal, SetGE, SETGE); }
1054 { RET_TOK(TermOpVal, Ret, RET); }
1059 { RET_TOK(TermOpVal, Br, BR); }
1064 { RET_TOK(TermOpVal, Switch, SWITCH); }
1069 { RET_TOK(MemOpVal, Malloc, MALLOC); }
1074 { RET_TOK(MemOpVal, Alloca, ALLOCA); }
1079 { RET_TOK(MemOpVal, Free, FREE); }
1084 { RET_TOK(MemOpVal, Load, LOAD); }
1089 { RET_TOK(MemOpVal, Store, STORE); }
1094 { RET_TOK(MemOpVal, GetField, GETFIELD); }
1099 { RET_TOK(MemOpVal, PutField, PUTFIELD); }
1104 { llvmAsmlval.StrVal = strdup(yytext+1); return VAR_ID; }
1110 yytext[strlen(yytext)-1] = 0; // nuke colon
1111 llvmAsmlval.StrVal = strdup(yytext);
1119 yytext[strlen(yytext)-1] = 0; // nuke end quote
1120 llvmAsmlval.StrVal = strdup(yytext+1); // Nuke start quote
1121 return STRINGCONSTANT;
1127 { llvmAsmlval.UInt64Val = atoull(yytext); return EUINT64VAL; }
1133 uint64_t Val = atoull(yytext+1);
1134 // +1: we have bigger negative range
1135 if (Val > (uint64_t)INT64_MAX+1)
1136 ThrowException("Constant too large for signed 64 bits!");
1137 llvmAsmlval.SInt64Val = -Val;
1144 { llvmAsmlval.UIntVal = atoull(yytext+1); return UINTVAL; }
1150 uint64_t Val = atoull(yytext+2);
1151 // +1: we have bigger negative range
1152 if (Val > (uint64_t)INT32_MAX+1)
1153 ThrowException("Constant too large for signed 32 bits!");
1154 llvmAsmlval.SIntVal = -Val;
1161 { /* Ignore whitespace */ }
1166 { /*printf("'%s'", yytext);*/ return yytext[0]; }
1171 YY_FATAL_ERROR( "flex scanner jammed" );
1173 #line 1175 "Lexer.cpp"
1174 case YY_STATE_EOF(INITIAL):
1177 case YY_END_OF_BUFFER:
1179 /* Amount of text matched not including the EOB char. */
1180 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1182 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1183 *yy_cp = yy_hold_char;
1184 YY_RESTORE_YY_MORE_OFFSET
1186 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1188 /* We're scanning a new file or input source. It's
1189 * possible that this happened because the user
1190 * just pointed yyin at a new source and called
1191 * yylex(). If so, then we have to assure
1192 * consistency between yy_current_buffer and our
1193 * globals. Here is the right place to do so, because
1194 * this is the first action (other than possibly a
1195 * back-up) that will match for the new input source.
1197 yy_n_chars = yy_current_buffer->yy_n_chars;
1198 yy_current_buffer->yy_input_file = yyin;
1199 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1202 /* Note that here we test for yy_c_buf_p "<=" to the position
1203 * of the first EOB in the buffer, since yy_c_buf_p will
1204 * already have been incremented past the NUL character
1205 * (since all states make transitions on EOB to the
1206 * end-of-buffer state). Contrast this with the test
1209 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1210 { /* This was really a NUL. */
1211 yy_state_type yy_next_state;
1213 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1215 yy_current_state = yy_get_previous_state();
1217 /* Okay, we're now positioned to make the NUL
1218 * transition. We couldn't have
1219 * yy_get_previous_state() go ahead and do it
1220 * for us because it doesn't know how to deal
1221 * with the possibility of jamming (and we don't
1222 * want to build jamming into it because then it
1223 * will run more slowly).
1226 yy_next_state = yy_try_NUL_trans( yy_current_state );
1228 yy_bp = yytext_ptr + YY_MORE_ADJ;
1230 if ( yy_next_state )
1232 /* Consume the NUL. */
1233 yy_cp = ++yy_c_buf_p;
1234 yy_current_state = yy_next_state;
1241 goto yy_find_action;
1245 else switch ( yy_get_next_buffer() )
1247 case EOB_ACT_END_OF_FILE:
1249 yy_did_buffer_switch_on_eof = 0;
1253 /* Note: because we've taken care in
1254 * yy_get_next_buffer() to have set up
1255 * yytext, we can now set up
1256 * yy_c_buf_p so that if some total
1257 * hoser (like flex itself) wants to
1258 * call the scanner after we return the
1259 * YY_NULL, it'll still work - another
1260 * YY_NULL will get returned.
1262 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1264 yy_act = YY_STATE_EOF(YY_START);
1270 if ( ! yy_did_buffer_switch_on_eof )
1276 case EOB_ACT_CONTINUE_SCAN:
1278 yytext_ptr + yy_amount_of_matched_text;
1280 yy_current_state = yy_get_previous_state();
1283 yy_bp = yytext_ptr + YY_MORE_ADJ;
1286 case EOB_ACT_LAST_MATCH:
1288 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1290 yy_current_state = yy_get_previous_state();
1293 yy_bp = yytext_ptr + YY_MORE_ADJ;
1294 goto yy_find_action;
1301 "fatal flex scanner internal error--no action found" );
1302 } /* end of action switch */
1303 } /* end of scanning one token */
1304 } /* end of yylex */
1307 /* yy_get_next_buffer - try to read in a new buffer
1309 * Returns a code representing an action:
1310 * EOB_ACT_LAST_MATCH -
1311 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1312 * EOB_ACT_END_OF_FILE - end of file
1315 static int yy_get_next_buffer()
1317 register char *dest = yy_current_buffer->yy_ch_buf;
1318 register char *source = yytext_ptr;
1319 register int number_to_move, i;
1322 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1324 "fatal flex scanner internal error--end of buffer missed" );
1326 if ( yy_current_buffer->yy_fill_buffer == 0 )
1327 { /* Don't try to fill the buffer, so this is an EOF. */
1328 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1330 /* We matched a single character, the EOB, so
1331 * treat this as a final EOF.
1333 return EOB_ACT_END_OF_FILE;
1338 /* We matched some text prior to the EOB, first
1341 return EOB_ACT_LAST_MATCH;
1345 /* Try to read more data. */
1347 /* First move last chars to start of buffer. */
1348 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1350 for ( i = 0; i < number_to_move; ++i )
1351 *(dest++) = *(source++);
1353 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1354 /* don't do the read, it's not guaranteed to return an EOF,
1357 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1362 yy_current_buffer->yy_buf_size - number_to_move - 1;
1364 while ( num_to_read <= 0 )
1365 { /* Not enough room in the buffer - grow it. */
1366 #ifdef YY_USES_REJECT
1368 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1371 /* just a shorter name for the current buffer */
1372 YY_BUFFER_STATE b = yy_current_buffer;
1374 int yy_c_buf_p_offset =
1375 (int) (yy_c_buf_p - b->yy_ch_buf);
1377 if ( b->yy_is_our_buffer )
1379 int new_size = b->yy_buf_size * 2;
1381 if ( new_size <= 0 )
1382 b->yy_buf_size += b->yy_buf_size / 8;
1384 b->yy_buf_size *= 2;
1386 b->yy_ch_buf = (char *)
1387 /* Include room in for 2 EOB chars. */
1388 yy_flex_realloc( (void *) b->yy_ch_buf,
1389 b->yy_buf_size + 2 );
1392 /* Can't grow it, we don't own it. */
1395 if ( ! b->yy_ch_buf )
1397 "fatal error - scanner input buffer overflow" );
1399 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1401 num_to_read = yy_current_buffer->yy_buf_size -
1406 if ( num_to_read > YY_READ_BUF_SIZE )
1407 num_to_read = YY_READ_BUF_SIZE;
1409 /* Read in more data. */
1410 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1411 yy_n_chars, num_to_read );
1413 yy_current_buffer->yy_n_chars = yy_n_chars;
1416 if ( yy_n_chars == 0 )
1418 if ( number_to_move == YY_MORE_ADJ )
1420 ret_val = EOB_ACT_END_OF_FILE;
1426 ret_val = EOB_ACT_LAST_MATCH;
1427 yy_current_buffer->yy_buffer_status =
1428 YY_BUFFER_EOF_PENDING;
1433 ret_val = EOB_ACT_CONTINUE_SCAN;
1435 yy_n_chars += number_to_move;
1436 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1437 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1439 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1445 /* yy_get_previous_state - get the state just before the EOB char was reached */
1447 static yy_state_type yy_get_previous_state()
1449 register yy_state_type yy_current_state;
1450 register char *yy_cp;
1452 yy_current_state = yy_start;
1453 yy_state_ptr = yy_state_buf;
1454 *yy_state_ptr++ = yy_current_state;
1456 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1458 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1459 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1461 yy_current_state = (int) yy_def[yy_current_state];
1462 if ( yy_current_state >= 198 )
1463 yy_c = yy_meta[(unsigned int) yy_c];
1465 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1466 *yy_state_ptr++ = yy_current_state;
1469 return yy_current_state;
1473 /* yy_try_NUL_trans - try to make a transition on the NUL character
1476 * next_state = yy_try_NUL_trans( current_state );
1479 #ifdef YY_USE_PROTOS
1480 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1482 static yy_state_type yy_try_NUL_trans( yy_current_state )
1483 yy_state_type yy_current_state;
1486 register int yy_is_jam;
1488 register YY_CHAR yy_c = 1;
1489 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1491 yy_current_state = (int) yy_def[yy_current_state];
1492 if ( yy_current_state >= 198 )
1493 yy_c = yy_meta[(unsigned int) yy_c];
1495 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1496 yy_is_jam = (yy_current_state == 197);
1498 *yy_state_ptr++ = yy_current_state;
1500 return yy_is_jam ? 0 : yy_current_state;
1505 #ifdef YY_USE_PROTOS
1506 static inline void yyunput( int c, register char *yy_bp )
1508 static inline void yyunput( c, yy_bp )
1510 register char *yy_bp;
1513 register char *yy_cp = yy_c_buf_p;
1515 /* undo effects of setting up yytext */
1516 *yy_cp = yy_hold_char;
1518 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1519 { /* need to shift things up to make room */
1520 /* +2 for EOB chars. */
1521 register int number_to_move = yy_n_chars + 2;
1522 register char *dest = &yy_current_buffer->yy_ch_buf[
1523 yy_current_buffer->yy_buf_size + 2];
1524 register char *source =
1525 &yy_current_buffer->yy_ch_buf[number_to_move];
1527 while ( source > yy_current_buffer->yy_ch_buf )
1528 *--dest = *--source;
1530 yy_cp += (int) (dest - source);
1531 yy_bp += (int) (dest - source);
1532 yy_current_buffer->yy_n_chars =
1533 yy_n_chars = yy_current_buffer->yy_buf_size;
1535 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1536 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1539 *--yy_cp = (char) c;
1545 yy_hold_char = *yy_cp;
1548 #endif /* ifndef YY_NO_UNPUT */
1552 static int yyinput()
1559 *yy_c_buf_p = yy_hold_char;
1561 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1563 /* yy_c_buf_p now points to the character we want to return.
1564 * If this occurs *before* the EOB characters, then it's a
1565 * valid NUL; if not, then we've hit the end of the buffer.
1567 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1568 /* This was really a NUL. */
1572 { /* need more input */
1573 int offset = yy_c_buf_p - yytext_ptr;
1576 switch ( yy_get_next_buffer() )
1578 case EOB_ACT_LAST_MATCH:
1579 /* This happens because yy_g_n_b()
1580 * sees that we've accumulated a
1581 * token and flags that we need to
1582 * try matching the token before
1583 * proceeding. But for input(),
1584 * there's no matching to consider.
1585 * So convert the EOB_ACT_LAST_MATCH
1586 * to EOB_ACT_END_OF_FILE.
1589 /* Reset buffer status. */
1594 case EOB_ACT_END_OF_FILE:
1599 if ( ! yy_did_buffer_switch_on_eof )
1608 case EOB_ACT_CONTINUE_SCAN:
1609 yy_c_buf_p = yytext_ptr + offset;
1615 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1616 *yy_c_buf_p = '\0'; /* preserve yytext */
1617 yy_hold_char = *++yy_c_buf_p;
1626 #ifdef YY_USE_PROTOS
1627 void yyrestart( FILE *input_file )
1629 void yyrestart( input_file )
1633 if ( ! yy_current_buffer )
1634 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1636 yy_init_buffer( yy_current_buffer, input_file );
1637 yy_load_buffer_state();
1641 #ifdef YY_USE_PROTOS
1642 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1644 void yy_switch_to_buffer( new_buffer )
1645 YY_BUFFER_STATE new_buffer;
1648 if ( yy_current_buffer == new_buffer )
1651 if ( yy_current_buffer )
1653 /* Flush out information for old buffer. */
1654 *yy_c_buf_p = yy_hold_char;
1655 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1656 yy_current_buffer->yy_n_chars = yy_n_chars;
1659 yy_current_buffer = new_buffer;
1660 yy_load_buffer_state();
1662 /* We don't actually know whether we did this switch during
1663 * EOF (yywrap()) processing, but the only time this flag
1664 * is looked at is after yywrap() is called, so it's safe
1665 * to go ahead and always set it.
1667 yy_did_buffer_switch_on_eof = 1;
1671 #ifdef YY_USE_PROTOS
1672 void yy_load_buffer_state( void )
1674 void yy_load_buffer_state()
1677 yy_n_chars = yy_current_buffer->yy_n_chars;
1678 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1679 yyin = yy_current_buffer->yy_input_file;
1680 yy_hold_char = *yy_c_buf_p;
1684 #ifdef YY_USE_PROTOS
1685 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1687 YY_BUFFER_STATE yy_create_buffer( file, size )
1694 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1696 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1698 b->yy_buf_size = size;
1700 /* yy_ch_buf has to be 2 characters longer than the size given because
1701 * we need to put in 2 end-of-buffer characters.
1703 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1704 if ( ! b->yy_ch_buf )
1705 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1707 b->yy_is_our_buffer = 1;
1709 yy_init_buffer( b, file );
1715 #ifdef YY_USE_PROTOS
1716 void yy_delete_buffer( YY_BUFFER_STATE b )
1718 void yy_delete_buffer( b )
1725 if ( b == yy_current_buffer )
1726 yy_current_buffer = (YY_BUFFER_STATE) 0;
1728 if ( b->yy_is_our_buffer )
1729 yy_flex_free( (void *) b->yy_ch_buf );
1731 yy_flex_free( (void *) b );
1735 #ifndef YY_ALWAYS_INTERACTIVE
1736 #ifndef YY_NEVER_INTERACTIVE
1737 extern int isatty YY_PROTO(( int ));
1741 #ifdef YY_USE_PROTOS
1742 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1744 void yy_init_buffer( b, file )
1751 yy_flush_buffer( b );
1753 b->yy_input_file = file;
1754 b->yy_fill_buffer = 1;
1756 #if YY_ALWAYS_INTERACTIVE
1757 b->yy_is_interactive = 1;
1759 #if YY_NEVER_INTERACTIVE
1760 b->yy_is_interactive = 0;
1762 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1768 #ifdef YY_USE_PROTOS
1769 void yy_flush_buffer( YY_BUFFER_STATE b )
1771 void yy_flush_buffer( b )
1781 /* We always need two end-of-buffer characters. The first causes
1782 * a transition to the end-of-buffer state. The second causes
1783 * a jam in that state.
1785 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1786 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1788 b->yy_buf_pos = &b->yy_ch_buf[0];
1791 b->yy_buffer_status = YY_BUFFER_NEW;
1793 if ( b == yy_current_buffer )
1794 yy_load_buffer_state();
1798 #ifndef YY_NO_SCAN_BUFFER
1799 #ifdef YY_USE_PROTOS
1800 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1802 YY_BUFFER_STATE yy_scan_buffer( base, size )
1810 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1811 base[size-1] != YY_END_OF_BUFFER_CHAR )
1812 /* They forgot to leave room for the EOB's. */
1815 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1817 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1819 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1820 b->yy_buf_pos = b->yy_ch_buf = base;
1821 b->yy_is_our_buffer = 0;
1822 b->yy_input_file = 0;
1823 b->yy_n_chars = b->yy_buf_size;
1824 b->yy_is_interactive = 0;
1826 b->yy_fill_buffer = 0;
1827 b->yy_buffer_status = YY_BUFFER_NEW;
1829 yy_switch_to_buffer( b );
1836 #ifndef YY_NO_SCAN_STRING
1837 #ifdef YY_USE_PROTOS
1838 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1840 YY_BUFFER_STATE yy_scan_string( yy_str )
1841 yyconst char *yy_str;
1845 for ( len = 0; yy_str[len]; ++len )
1848 return yy_scan_bytes( yy_str, len );
1853 #ifndef YY_NO_SCAN_BYTES
1854 #ifdef YY_USE_PROTOS
1855 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1857 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1858 yyconst char *bytes;
1867 /* Get memory for full buffer, including space for trailing EOB's. */
1869 buf = (char *) yy_flex_alloc( n );
1871 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1873 for ( i = 0; i < len; ++i )
1876 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1878 b = yy_scan_buffer( buf, n );
1880 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1882 /* It's okay to grow etc. this buffer, and we should throw it
1883 * away when we're done.
1885 b->yy_is_our_buffer = 1;
1892 #ifndef YY_NO_PUSH_STATE
1893 #ifdef YY_USE_PROTOS
1894 static void yy_push_state( int new_state )
1896 static void yy_push_state( new_state )
1900 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1904 yy_start_stack_depth += YY_START_STACK_INCR;
1905 new_size = yy_start_stack_depth * sizeof( int );
1907 if ( ! yy_start_stack )
1908 yy_start_stack = (int *) yy_flex_alloc( new_size );
1911 yy_start_stack = (int *) yy_flex_realloc(
1912 (void *) yy_start_stack, new_size );
1914 if ( ! yy_start_stack )
1916 "out of memory expanding start-condition stack" );
1919 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1926 #ifndef YY_NO_POP_STATE
1927 static void yy_pop_state()
1929 if ( --yy_start_stack_ptr < 0 )
1930 YY_FATAL_ERROR( "start-condition stack underflow" );
1932 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1937 #ifndef YY_NO_TOP_STATE
1938 static int yy_top_state()
1940 return yy_start_stack[yy_start_stack_ptr - 1];
1944 #ifndef YY_EXIT_FAILURE
1945 #define YY_EXIT_FAILURE 2
1948 #ifdef YY_USE_PROTOS
1949 static void yy_fatal_error( yyconst char msg[] )
1951 static void yy_fatal_error( msg )
1955 (void) fprintf( stderr, "%s\n", msg );
1956 exit( YY_EXIT_FAILURE );
1961 /* Redefine yyless() so it works in section 3 code. */
1967 /* Undo effects of setting up yytext. */ \
1968 yytext[yyleng] = yy_hold_char; \
1969 yy_c_buf_p = yytext + n; \
1970 yy_hold_char = *yy_c_buf_p; \
1971 *yy_c_buf_p = '\0'; \
1977 /* Internal utility routines. */
1980 #ifdef YY_USE_PROTOS
1981 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1983 static void yy_flex_strncpy( s1, s2, n )
1990 for ( i = 0; i < n; ++i )
1995 #ifdef YY_NEED_STRLEN
1996 #ifdef YY_USE_PROTOS
1997 static int yy_flex_strlen( yyconst char *s )
1999 static int yy_flex_strlen( s )
2004 for ( n = 0; s[n]; ++n )
2012 #ifdef YY_USE_PROTOS
2013 static void *yy_flex_alloc( yy_size_t size )
2015 static void *yy_flex_alloc( size )
2019 return (void *) malloc( size );
2022 #ifdef YY_USE_PROTOS
2023 static inline void *yy_flex_realloc( void *ptr, yy_size_t size )
2025 static inline void *yy_flex_realloc( ptr, size )
2030 /* The cast to (char *) in the following accommodates both
2031 * implementations that use char* generic pointers, and those
2032 * that use void* generic pointers. It works with the latter
2033 * because both ANSI C and C++ allow castless assignment from
2034 * any pointer type to void*, and deal with argument conversions
2035 * as though doing an assignment.
2037 return (void *) realloc( (char *) ptr, size );
2040 #ifdef YY_USE_PROTOS
2041 static void yy_flex_free( void *ptr )
2043 static void yy_flex_free( ptr )