1 #define yy_create_buffer File_create_buffer
2 #define yy_delete_buffer File_delete_buffer
3 #define yy_scan_buffer File_scan_buffer
4 #define yy_scan_string File_scan_string
5 #define yy_scan_bytes File_scan_bytes
6 #define yy_flex_debug File_flex_debug
7 #define yy_init_buffer File_init_buffer
8 #define yy_flush_buffer File_flush_buffer
9 #define yy_load_buffer_state File_load_buffer_state
10 #define yy_switch_to_buffer File_switch_to_buffer
12 #define yyleng Fileleng
15 #define yyrestart Filerestart
16 #define yytext Filetext
17 #define yylineno Filelineno
18 #define yywrap Filewrap
21 /* A lexical scanner generated by flex */
23 /* Scanner skeleton version:
24 * $NetBSD: flex.skl,v 1.22 2005/08/08 01:28:08 christos Exp $
28 #define YY_FLEX_MAJOR_VERSION 2
29 #define YY_FLEX_MINOR_VERSION 5
34 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
47 /* Use prototypes in function declarations. */
50 /* The "const" storage-class-modifier is valid. */
53 #else /* ! __cplusplus */
61 #endif /* ! __cplusplus */
80 #define YY_PROTO(proto) proto
82 #define YY_PROTO(proto) ()
85 /* Returned upon end-of-file. */
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
93 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
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.
99 #define BEGIN yy_start = 1 + 2 *
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
105 #define YY_START ((yy_start - 1) / 2)
106 #define YYSTATE YY_START
108 /* Action number for EOF rule of a given start state. */
109 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
111 /* Special action meaning "start processing a new file". */
112 #define YY_NEW_FILE yyrestart( yyin )
114 #define YY_END_OF_BUFFER_CHAR 0
116 /* Size of default input buffer. */
117 #define YY_BUF_SIZE (16384*64)
119 typedef struct yy_buffer_state *YY_BUFFER_STATE;
122 extern FILE *yyin, *yyout;
124 #define EOB_ACT_CONTINUE_SCAN 0
125 #define EOB_ACT_END_OF_FILE 1
126 #define EOB_ACT_LAST_MATCH 2
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:
132 * if ( condition_holds )
135 * do_something_else();
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.
142 /* Return all but the first 'n' matched characters back to the input stream. */
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 */ \
155 #define unput(c) yyunput( c, yytext_ptr )
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).
161 typedef unsigned int yy_size_t;
164 struct yy_buffer_state
168 char *yy_ch_buf; /* input buffer */
169 char *yy_buf_pos; /* current position in input buffer */
171 /* Size of input buffer in bytes, not including room for EOB
174 yy_size_t yy_buf_size;
176 /* Number of characters read into yy_ch_buf, not including EOB
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
185 int yy_is_our_buffer;
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
192 int yy_is_interactive;
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
200 /* Whether to try to fill the input buffer when we reach the
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.
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.
218 #define YY_BUFFER_EOF_PENDING 2
221 static YY_BUFFER_STATE yy_current_buffer = 0;
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
227 #define YY_CURRENT_BUFFER yy_current_buffer
230 /* yy_hold_char holds the character lost when yytext is formed. */
231 static char yy_hold_char;
233 static int yy_n_chars; /* number of characters read into yy_ch_buf */
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 */
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 ...
246 static int yy_did_buffer_switch_on_eof;
248 void yyrestart YY_PROTO(( FILE *input_file ));
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 )
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, yy_size_t len ));
262 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, int size ));
263 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
266 #define yy_new_buffer yy_create_buffer
268 #define yy_set_interactive(is_interactive) \
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; \
275 #define yy_set_bol(at_bol) \
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; \
282 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
285 #define YY_USES_REJECT
286 typedef unsigned char YY_CHAR;
287 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
288 typedef int yy_state_type;
292 #define yytext_ptr yytext
294 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
295 static inline void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ))
297 __attribute__((__unused__))
300 static void yy_flex_free YY_PROTO(( void * ));
302 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
303 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
304 static int yy_get_next_buffer YY_PROTO(( void ));
305 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
307 /* Done after the current pattern has been matched and before the
308 * corresponding action - sets up yytext.
310 #define YY_DO_BEFORE_ACTION \
311 yytext_ptr = yy_bp; \
312 yyleng = (int) (yy_cp - yy_bp); \
313 yy_hold_char = *yy_cp; \
317 #define YY_NUM_RULES 35
318 #define YY_END_OF_BUFFER 36
319 static yyconst short int yy_acclist[146] =
321 29, 29, 36, 34, 35, 27, 34, 35, 27, 35,
322 34, 35, 34, 35, 34, 35, 34, 35, 34, 35,
323 26, 34, 35, 26, 34, 35, 23, 34, 35, 34,
324 35, 23, 34, 35, 23, 34, 35, 23, 34, 35,
325 23, 34, 35, 23, 34, 35, 23, 34, 35, 23,
326 34, 35, 23, 34, 35, 29, 35, 30, 35, 32,
327 35, 27, 25, 24, 26, 28, 1, 23, 23, 23,
328 23, 23, 23, 23, 17, 23, 23, 23, 23, 23,
329 29, 30, 30, 33, 32, 31, 32, 24, 1, 26,
330 26, 5, 23, 23, 23, 10, 23, 12, 23, 23,
332 23, 4, 23, 16, 23, 23, 23, 23, 18, 21,
333 19, 20, 3, 6, 23, 23, 9, 23, 13, 23,
334 23, 23, 8, 23, 23, 23, 11, 23, 15, 23,
335 23, 23, 23, 23, 23, 7, 23, 23, 23, 23,
339 static yyconst short int yy_accept[123] =
341 1, 1, 1, 2, 3, 4, 6, 9, 11, 13,
342 15, 17, 19, 21, 24, 27, 30, 32, 35, 38,
343 41, 44, 47, 50, 53, 56, 58, 60, 62, 63,
344 63, 63, 63, 64, 65, 66, 67, 68, 68, 68,
345 69, 69, 70, 71, 72, 73, 74, 75, 77, 78,
346 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
347 88, 88, 88, 88, 89, 90, 91, 92, 92, 92,
348 94, 95, 96, 98, 100, 101, 102, 104, 106, 107,
349 108, 109, 110, 111, 112, 113, 113, 113, 114, 116,
350 117, 119, 121, 122, 123, 125, 126, 127, 127, 129,
352 131, 132, 133, 134, 134, 135, 136, 138, 138, 139,
353 140, 140, 140, 141, 141, 141, 142, 143, 143, 144,
357 static yyconst int yy_ec[256] =
359 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
360 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
361 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
362 1, 2, 5, 6, 1, 7, 1, 1, 1, 1,
363 1, 8, 9, 1, 9, 1, 10, 11, 12, 13,
364 13, 13, 13, 13, 13, 13, 13, 1, 1, 1,
365 1, 1, 1, 1, 14, 14, 14, 14, 14, 14,
366 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
367 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
368 16, 1, 17, 1, 15, 1, 18, 19, 20, 21,
370 22, 23, 24, 25, 26, 15, 15, 27, 28, 29,
371 30, 15, 15, 31, 32, 33, 34, 15, 15, 35,
372 15, 15, 36, 1, 37, 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,
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,
389 static yyconst int yy_meta[38] =
391 1, 1, 2, 1, 1, 1, 1, 3, 1, 3,
392 4, 4, 4, 5, 6, 1, 1, 5, 5, 5,
393 5, 5, 5, 6, 6, 6, 6, 6, 6, 6,
397 static yyconst short int yy_base[135] =
399 0, 0, 30, 31, 221, 222, 40, 43, 28, 214,
400 0, 38, 44, 44, 53, 0, 183, 192, 31, 49,
401 191, 187, 46, 181, 181, 0, 65, 66, 78, 183,
402 52, 206, 222, 0, 75, 222, 0, 58, 0, 0,
403 174, 177, 191, 187, 183, 183, 183, 58, 171, 171,
404 175, 170, 0, 82, 85, 222, 86, 222, 89, 171,
405 172, 35, 167, 0, 0, 89, 0, 160, 179, 163,
406 162, 171, 0, 164, 164, 163, 0, 0, 156, 155,
407 161, 222, 222, 222, 222, 166, 148, 222, 0, 152,
408 0, 0, 162, 148, 0, 155, 151, 149, 0, 0,
410 157, 157, 152, 146, 152, 146, 0, 128, 100, 110,
411 89, 102, 74, 65, 83, 52, 222, 53, 222, 0,
412 222, 108, 114, 116, 119, 125, 131, 137, 140, 146,
416 static yyconst short int yy_def[135] =
418 121, 1, 122, 122, 121, 121, 121, 121, 121, 123,
419 124, 121, 121, 121, 121, 125, 121, 125, 125, 125,
420 125, 125, 125, 125, 125, 126, 127, 128, 121, 121,
421 121, 123, 121, 129, 121, 121, 130, 121, 131, 125,
422 132, 125, 125, 125, 125, 125, 125, 125, 125, 125,
423 125, 125, 126, 127, 127, 121, 128, 121, 128, 121,
424 121, 121, 121, 129, 130, 121, 131, 132, 133, 125,
425 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
426 125, 121, 121, 121, 121, 121, 132, 121, 125, 125,
427 125, 125, 125, 125, 125, 125, 125, 121, 125, 125,
429 125, 125, 125, 121, 125, 125, 125, 121, 125, 125,
430 121, 121, 125, 121, 134, 125, 121, 134, 121, 125,
431 0, 121, 121, 121, 121, 121, 121, 121, 121, 121,
435 static yyconst short int yy_nxt[260] =
437 6, 7, 8, 7, 9, 10, 11, 6, 12, 13,
438 14, 15, 15, 16, 16, 17, 6, 16, 18, 19,
439 20, 16, 21, 16, 16, 22, 23, 24, 16, 16,
440 16, 25, 16, 16, 16, 6, 6, 27, 27, 28,
441 28, 29, 29, 29, 29, 29, 29, 30, 35, 35,
442 35, 36, 84, 37, 35, 35, 35, 43, 119, 31,
443 44, 85, 38, 35, 35, 35, 45, 49, 66, 66,
444 46, 50, 55, 58, 56, 59, 61, 76, 39, 29,
445 29, 29, 62, 120, 63, 35, 35, 35, 119, 121,
446 77, 121, 55, 121, 56, 121, 121, 117, 59, 66,
448 66, 112, 112, 112, 112, 116, 114, 115, 26, 26,
449 26, 26, 26, 26, 32, 32, 32, 32, 32, 32,
450 34, 34, 40, 40, 40, 53, 53, 113, 53, 53,
451 53, 54, 54, 54, 54, 54, 54, 57, 57, 57,
452 57, 57, 57, 64, 64, 64, 65, 111, 65, 65,
453 65, 65, 67, 67, 68, 68, 68, 68, 68, 68,
454 87, 87, 87, 87, 87, 87, 118, 118, 118, 118,
455 118, 118, 110, 109, 108, 107, 106, 105, 104, 103,
456 102, 101, 100, 99, 69, 98, 97, 96, 95, 94,
457 93, 92, 91, 90, 89, 88, 69, 86, 83, 82,
459 81, 80, 79, 78, 75, 74, 73, 72, 71, 70,
460 69, 33, 60, 52, 51, 48, 47, 42, 41, 33,
461 121, 5, 121, 121, 121, 121, 121, 121, 121, 121,
462 121, 121, 121, 121, 121, 121, 121, 121, 121, 121,
463 121, 121, 121, 121, 121, 121, 121, 121, 121, 121,
464 121, 121, 121, 121, 121, 121, 121, 121, 121
467 static yyconst short int yy_chk[260] =
469 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
470 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
471 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
472 1, 1, 1, 1, 1, 1, 1, 3, 4, 3,
473 4, 7, 7, 7, 8, 8, 8, 9, 12, 12,
474 12, 13, 62, 13, 14, 14, 14, 19, 118, 9,
475 19, 62, 14, 15, 15, 15, 20, 23, 38, 38,
476 20, 23, 27, 28, 27, 28, 31, 48, 14, 29,
477 29, 29, 31, 116, 31, 35, 35, 35, 115, 54,
478 48, 54, 55, 57, 55, 57, 59, 114, 59, 66,
480 66, 109, 109, 112, 112, 113, 111, 112, 122, 122,
481 122, 122, 122, 122, 123, 123, 123, 123, 123, 123,
482 124, 124, 125, 125, 125, 126, 126, 110, 126, 126,
483 126, 127, 127, 127, 127, 127, 127, 128, 128, 128,
484 128, 128, 128, 129, 129, 129, 130, 108, 130, 130,
485 130, 130, 131, 131, 132, 132, 132, 132, 132, 132,
486 133, 133, 133, 133, 133, 133, 134, 134, 134, 134,
487 134, 134, 106, 105, 104, 103, 102, 101, 98, 97,
488 96, 94, 93, 90, 87, 86, 81, 80, 79, 76,
489 75, 74, 72, 71, 70, 69, 68, 63, 61, 60,
491 52, 51, 50, 49, 47, 46, 45, 44, 43, 42,
492 41, 32, 30, 25, 24, 22, 21, 18, 17, 10,
493 5, 121, 121, 121, 121, 121, 121, 121, 121, 121,
494 121, 121, 121, 121, 121, 121, 121, 121, 121, 121,
495 121, 121, 121, 121, 121, 121, 121, 121, 121, 121,
496 121, 121, 121, 121, 121, 121, 121, 121, 121
499 static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
500 static char *yy_full_match;
504 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
505 yy_cp = yy_full_match; /* restore poss. backed-over text */ \
509 #define yymore() yymore_used_but_not_detected
510 #define YY_MORE_ADJ 0
511 #define YY_RESTORE_YY_MORE_OFFSET
513 #line 1 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
515 /*===-- FileLexer.l - Scanner for TableGen Files ----------------*- C++ -*-===//
517 // The LLVM Compiler Infrastructure
519 // This file was developed by the LLVM research group and is distributed under
520 // the University of Illinois Open Source License. See LICENSE.TXT for details.
522 //===----------------------------------------------------------------------===//
524 // This file defines a simple flex scanner for TableGen files. This is pretty
525 // straight-forward, except for the magic to handle file inclusion.
527 //===----------------------------------------------------------------------===*/
528 #define YY_NEVER_INTERACTIVE 1
531 #line 30 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
532 #include "llvm/Config/config.h"
533 #include "llvm/Support/Streams.h"
535 typedef std::pair<llvm::Record*, std::vector<llvm::Init*>*> SubClassRefTy;
536 #include "FileParser.h"
542 // Global variable recording the location of the include directory
543 std::vector<std::string> IncludeDirectories;
545 /// ParseInt - This has to handle the special case of binary numbers 0b0101
547 static int ParseInt(const char *Str) {
548 if (Str[0] == '0' && Str[1] == 'b')
549 return strtoll(Str+2, 0, 2);
550 return strtoll(Str, 0, 0);
553 static int CommentDepth = 0;
556 std::string Filename;
559 YY_BUFFER_STATE Buffer;
561 IncludeRec(const std::string &FN, FILE *F)
562 : Filename(FN), File(F), LineNo(0){
566 static std::vector<IncludeRec> IncludeStack;
568 std::ostream &err() {
569 if (IncludeStack.empty()) {
570 cerr << "At end of input: ";
571 return *cerr.stream();
574 for (unsigned i = 0, e = IncludeStack.size()-1; i != e; ++i)
575 cerr << "Included from " << IncludeStack[i].Filename << ":"
576 << IncludeStack[i].LineNo << ":\n";
577 cerr << "Parsing " << IncludeStack.back().Filename << ":"
578 << Filelineno << ": ";
579 return *cerr.stream();
582 /// ParseFile - this function begins the parsing of the specified tablegen file.
584 void ParseFile(const std::string &Filename,
585 const std::vector<std::string> &IncludeDirs) {
587 if (Filename != "-") {
588 F = fopen(Filename.c_str(), "r");
591 cerr << "Could not open input file '" + Filename + "'!\n";
594 IncludeStack.push_back(IncludeRec(Filename, F));
596 IncludeStack.push_back(IncludeRec("<stdin>", stdin));
599 // Record the location of the include directory so that the lexer can find
601 IncludeDirectories = IncludeDirs;
609 /// HandleInclude - This function is called when an include directive is
610 /// encountered in the input stream...
612 static void HandleInclude(const char *Buffer) {
613 unsigned Length = yyleng;
614 assert(Buffer[Length-1] == '"');
615 Buffer += strlen("include ");
616 Length -= strlen("include ");
617 while (*Buffer != '"') {
621 assert(Length >= 2 && "Double quotes not found?");
622 std::string Filename(Buffer+1, Buffer+Length-1);
623 //cerr << "Filename = '" << Filename << "'\n";
625 // Save the line number and lex buffer of the includer...
626 IncludeStack.back().LineNo = Filelineno;
627 IncludeStack.back().Buffer = YY_CURRENT_BUFFER;
629 // Open the new input file...
630 yyin = fopen(Filename.c_str(), "r");
632 // If we couldn't find the file in the current directory, look for it in
633 // the include directories.
635 std::string NextFilename;
636 for (unsigned i = 0, e = IncludeDirectories.size(); i != e; ++i) {
637 NextFilename = IncludeDirectories[i] + "/" + Filename;
638 if ((yyin = fopen(NextFilename.c_str(), "r")))
643 err() << "Could not find include file '" << Filename << "'!\n";
646 Filename = NextFilename;
649 // Add the file to our include stack...
650 IncludeStack.push_back(IncludeRec(Filename, yyin));
651 Filelineno = 1; // Reset line numbering...
652 //yyrestart(yyin); // Start lexing the new file...
654 yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
657 /// yywrap - This is called when the lexer runs out of input in one of the
658 /// files. Switch back to an includer if an includee has run out of input.
662 if (IncludeStack.back().File != stdin)
663 fclose(IncludeStack.back().File);
664 IncludeStack.pop_back();
665 if (IncludeStack.empty()) return 1; // Top-level file is done.
667 // Otherwise, we need to switch back to a file which included the current one.
668 Filelineno = IncludeStack.back().LineNo; // Restore current line number
669 yy_switch_to_buffer(IncludeStack.back().Buffer);
673 } // End llvm namespace
675 using namespace llvm;
677 #line 678 "Lexer.cpp"
679 /* Macros after this point can all be overridden by user definitions in
683 #ifndef YY_SKIP_YYWRAP
685 extern "C" int yywrap YY_PROTO(( void ));
687 extern int yywrap YY_PROTO(( void ));
692 static inline void yyunput YY_PROTO(( int c, char *buf_ptr ))
694 __attribute__((__unused__))
700 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, yy_size_t ));
703 #ifdef YY_NEED_STRLEN
704 static yy_size_t yy_flex_strlen YY_PROTO(( yyconst char * ));
709 static int yyinput YY_PROTO(( void ));
711 static int input YY_PROTO(( void ));
716 static int yy_start_stack_ptr = 0;
717 static int yy_start_stack_depth = 0;
718 static int *yy_start_stack = 0;
719 #ifndef YY_NO_PUSH_STATE
720 static void yy_push_state YY_PROTO(( int new_state ));
722 #ifndef YY_NO_POP_STATE
723 static void yy_pop_state YY_PROTO(( void ));
725 #ifndef YY_NO_TOP_STATE
726 static int yy_top_state YY_PROTO(( void ));
730 #define YY_NO_PUSH_STATE 1
731 #define YY_NO_POP_STATE 1
732 #define YY_NO_TOP_STATE 1
735 #ifdef YY_MALLOC_DECL
743 /* Just try to get by without declaring the routines. This will fail
744 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
745 * or sizeof(void*) != sizeof(int).
750 /* Amount of stuff to slurp up with each read. */
751 #ifndef YY_READ_BUF_SIZE
752 #define YY_READ_BUF_SIZE 8192
755 /* Copy whatever the last rule matched to the standard output. */
758 /* This used to be an fputs(), but since the string might contain NUL's,
759 * we now use fwrite().
761 #define ECHO (void) fwrite( yytext, (size_t)yyleng, 1, yyout )
764 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
765 * is returned in "result".
768 #define YY_INPUT(buf,result,max_size) \
769 if ( yy_current_buffer->yy_is_interactive ) \
772 for ( n = 0; n < max_size && \
773 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
776 buf[n++] = (char) c; \
777 if ( c == EOF && ferror( yyin ) ) \
778 YY_FATAL_ERROR( "input in flex scanner failed" ); \
781 else if ( ((result = fread( buf, 1, (size_t)max_size, yyin )) == 0) \
782 && ferror( yyin ) ) \
783 YY_FATAL_ERROR( "input in flex scanner failed" );
786 /* No semi-colon after return; correct usage is to write "yyterminate();" -
787 * we don't want an extra ';' after the "return" because that will cause
788 * some compilers to complain about unreachable statements.
791 #define yyterminate() return YY_NULL
794 /* Number of entries by which start-condition stack grows. */
795 #ifndef YY_START_STACK_INCR
796 #define YY_START_STACK_INCR 25
799 /* Report a fatal error. */
800 #ifndef YY_FATAL_ERROR
801 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
804 /* Default declaration of generated scanner - a define so the user can
805 * easily add parameters.
808 #define YY_DECL int yylex YY_PROTO(( void ))
811 /* Code executed at the beginning of each rule, after yytext and yyleng
814 #ifndef YY_USER_ACTION
815 #define YY_USER_ACTION
818 /* Code executed at the end of each rule. */
820 #define YY_BREAK /*LINTED*/break;
823 #define YY_RULE_SETUP \
828 register yy_state_type yy_current_state;
829 register char *yy_cp, *yy_bp;
832 #line 185 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
835 #line 836 "Lexer.cpp"
837 #if defined(YY_USES_REJECT) && (defined(__GNUC__) || defined(lint))
838 /* XXX: shut up `unused label' warning with %options yylineno */
839 if (/*CONSTCOND*/0 && yy_full_match)
851 yy_start = 1; /* first start state */
859 if ( ! yy_current_buffer )
861 yy_create_buffer( yyin, YY_BUF_SIZE );
863 yy_load_buffer_state();
866 while (/*CONSTCOND*/ 1 ) /* loops until end-of-file is reached */
870 /* Support of yytext. */
871 *yy_cp = yy_hold_char;
873 /* yy_bp points to the position in yy_ch_buf of the start of
878 yy_current_state = yy_start;
879 yy_state_ptr = yy_state_buf;
880 *yy_state_ptr++ = yy_current_state;
884 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
885 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
887 yy_current_state = (int) yy_def[yy_current_state];
888 if ( yy_current_state >= 122 )
889 yy_c = yy_meta[(unsigned int) yy_c];
891 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
892 *yy_state_ptr++ = yy_current_state;
895 while ( yy_current_state != 121 );
898 yy_current_state = *--yy_state_ptr;
899 yy_lp = yy_accept[yy_current_state];
900 find_rule: /* we branch to this label when backing up */
901 for ( ; ; ) /* until we find what rule we matched */
903 if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
905 yy_act = yy_acclist[yy_lp];
907 yy_full_match = yy_cp;
912 yy_current_state = *--yy_state_ptr;
913 yy_lp = yy_accept[yy_current_state];
918 if ( yy_act != YY_END_OF_BUFFER )
921 for ( yyl = 0; yyl < yyleng; ++yyl )
922 if ( yytext[yyl] == '\n' )
926 do_action: /* This label is used only to access EOF actions. */
930 { /* beginning of action switch */
933 #line 187 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
934 { /* Ignore comments */ }
938 #line 189 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
939 { HandleInclude(yytext); }
943 #line 190 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
944 { Filelval.StrVal = new std::string(yytext+2, yytext+yyleng-2);
945 return CODEFRAGMENT; }
949 #line 193 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
954 #line 194 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
959 #line 195 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
964 #line 196 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
969 #line 197 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
974 #line 198 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
979 #line 199 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
984 #line 201 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
989 #line 202 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
994 #line 203 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
999 #line 204 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
1000 { return MULTICLASS; }
1004 #line 205 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
1009 #line 206 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
1014 #line 207 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
1019 #line 209 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
1020 { return CONCATTOK; }
1024 #line 210 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
1029 #line 211 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
1034 #line 212 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
1039 #line 213 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
1040 { return STRCONCATTOK; }
1044 #line 216 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
1045 { Filelval.StrVal = new std::string(yytext, yytext+yyleng);
1050 #line 218 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
1051 { Filelval.StrVal = new std::string(yytext+1, yytext+yyleng);
1056 #line 221 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
1057 { Filelval.StrVal = new std::string(yytext+1, yytext+yyleng-1);
1062 #line 224 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
1063 { Filelval.IntVal = ParseInt(Filetext); return INTVAL; }
1067 #line 226 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
1068 { /* Ignore whitespace */ }
1072 #line 229 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
1073 { BEGIN(in_comment); CommentDepth++; }
1077 #line 230 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
1078 {} /* eat anything that's not a '*' or '/' */
1082 #line 231 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
1083 {} /* eat up '*'s not followed by '/'s */
1087 #line 232 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
1092 #line 233 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
1093 {} /* eat up /'s not followed by *'s */
1097 #line 234 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
1098 { if (!--CommentDepth) { BEGIN(INITIAL); } }
1100 case YY_STATE_EOF(in_comment):
1101 #line 235 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
1102 { err() << "Unterminated comment!\n"; exit(1); }
1106 #line 237 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
1107 { return Filetext[0]; }
1111 #line 239 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
1112 YY_FATAL_ERROR( "flex scanner jammed" );
1114 #line 1115 "Lexer.cpp"
1115 case YY_STATE_EOF(INITIAL):
1118 case YY_END_OF_BUFFER:
1120 /* Amount of text matched not including the EOB char. */
1121 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1123 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1124 *yy_cp = yy_hold_char;
1125 YY_RESTORE_YY_MORE_OFFSET
1127 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1129 /* We're scanning a new file or input source. It's
1130 * possible that this happened because the user
1131 * just pointed yyin at a new source and called
1132 * yylex(). If so, then we have to assure
1133 * consistency between yy_current_buffer and our
1134 * globals. Here is the right place to do so, because
1135 * this is the first action (other than possibly a
1136 * back-up) that will match for the new input source.
1138 yy_n_chars = yy_current_buffer->yy_n_chars;
1139 yy_current_buffer->yy_input_file = yyin;
1140 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1143 /* Note that here we test for yy_c_buf_p "<=" to the position
1144 * of the first EOB in the buffer, since yy_c_buf_p will
1145 * already have been incremented past the NUL character
1146 * (since all states make transitions on EOB to the
1147 * end-of-buffer state). Contrast this with the test
1150 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1151 { /* This was really a NUL. */
1152 yy_state_type yy_next_state;
1154 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1156 yy_current_state = yy_get_previous_state();
1158 /* Okay, we're now positioned to make the NUL
1159 * transition. We couldn't have
1160 * yy_get_previous_state() go ahead and do it
1161 * for us because it doesn't know how to deal
1162 * with the possibility of jamming (and we don't
1163 * want to build jamming into it because then it
1164 * will run more slowly).
1167 yy_next_state = yy_try_NUL_trans( yy_current_state );
1169 yy_bp = yytext_ptr + YY_MORE_ADJ;
1171 if ( yy_next_state )
1173 /* Consume the NUL. */
1174 yy_cp = ++yy_c_buf_p;
1175 yy_current_state = yy_next_state;
1182 goto yy_find_action;
1186 else switch ( yy_get_next_buffer() )
1188 case EOB_ACT_END_OF_FILE:
1190 yy_did_buffer_switch_on_eof = 0;
1194 /* Note: because we've taken care in
1195 * yy_get_next_buffer() to have set up
1196 * yytext, we can now set up
1197 * yy_c_buf_p so that if some total
1198 * hoser (like flex itself) wants to
1199 * call the scanner after we return the
1200 * YY_NULL, it'll still work - another
1201 * YY_NULL will get returned.
1203 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1205 yy_act = YY_STATE_EOF(YY_START);
1211 if ( ! yy_did_buffer_switch_on_eof )
1217 case EOB_ACT_CONTINUE_SCAN:
1219 yytext_ptr + yy_amount_of_matched_text;
1221 yy_current_state = yy_get_previous_state();
1224 yy_bp = yytext_ptr + YY_MORE_ADJ;
1227 case EOB_ACT_LAST_MATCH:
1229 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1231 yy_current_state = yy_get_previous_state();
1234 yy_bp = yytext_ptr + YY_MORE_ADJ;
1235 goto yy_find_action;
1242 "fatal flex scanner internal error--no action found" );
1243 } /* end of action switch */
1244 } /* end of scanning one token */
1245 } /* end of yylex */
1248 /* yy_get_next_buffer - try to read in a new buffer
1250 * Returns a code representing an action:
1251 * EOB_ACT_LAST_MATCH -
1252 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1253 * EOB_ACT_END_OF_FILE - end of file
1256 static int yy_get_next_buffer()
1258 register char *dest = yy_current_buffer->yy_ch_buf;
1259 register char *source = yytext_ptr;
1260 register int number_to_move, i;
1263 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1265 "fatal flex scanner internal error--end of buffer missed" );
1267 if ( yy_current_buffer->yy_fill_buffer == 0 )
1268 { /* Don't try to fill the buffer, so this is an EOF. */
1269 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1271 /* We matched a single character, the EOB, so
1272 * treat this as a final EOF.
1274 return EOB_ACT_END_OF_FILE;
1279 /* We matched some text prior to the EOB, first
1282 return EOB_ACT_LAST_MATCH;
1286 /* Try to read more data. */
1288 /* First move last chars to start of buffer. */
1289 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1291 for ( i = 0; i < number_to_move; ++i )
1292 *(dest++) = *(source++);
1294 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1295 /* don't do the read, it's not guaranteed to return an EOF,
1298 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1303 yy_current_buffer->yy_buf_size - number_to_move - 1;
1305 while ( num_to_read <= 0 )
1306 { /* Not enough room in the buffer - grow it. */
1307 #ifdef YY_USES_REJECT
1309 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1312 /* just a shorter name for the current buffer */
1313 YY_BUFFER_STATE b = yy_current_buffer;
1315 int yy_c_buf_p_offset =
1316 (int) (yy_c_buf_p - b->yy_ch_buf);
1318 if ( b->yy_is_our_buffer )
1320 int new_size = b->yy_buf_size * 2;
1322 if ( new_size <= 0 )
1323 b->yy_buf_size += b->yy_buf_size / 8;
1325 b->yy_buf_size *= 2;
1327 b->yy_ch_buf = (char *)
1328 /* Include room in for 2 EOB chars. */
1329 yy_flex_realloc( (void *) b->yy_ch_buf,
1330 b->yy_buf_size + 2 );
1333 /* Can't grow it, we don't own it. */
1336 if ( ! b->yy_ch_buf )
1338 "fatal error - scanner input buffer overflow" );
1340 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1342 num_to_read = yy_current_buffer->yy_buf_size -
1347 if ( num_to_read > YY_READ_BUF_SIZE )
1348 num_to_read = YY_READ_BUF_SIZE;
1350 /* Read in more data. */
1351 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1352 yy_n_chars, num_to_read );
1354 yy_current_buffer->yy_n_chars = yy_n_chars;
1357 if ( yy_n_chars == 0 )
1359 if ( number_to_move == YY_MORE_ADJ )
1361 ret_val = EOB_ACT_END_OF_FILE;
1367 ret_val = EOB_ACT_LAST_MATCH;
1368 yy_current_buffer->yy_buffer_status =
1369 YY_BUFFER_EOF_PENDING;
1374 ret_val = EOB_ACT_CONTINUE_SCAN;
1376 yy_n_chars += number_to_move;
1377 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1378 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1380 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1386 /* yy_get_previous_state - get the state just before the EOB char was reached */
1388 static yy_state_type yy_get_previous_state()
1390 register yy_state_type yy_current_state;
1391 register char *yy_cp;
1393 yy_current_state = yy_start;
1394 yy_state_ptr = yy_state_buf;
1395 *yy_state_ptr++ = yy_current_state;
1397 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1399 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1400 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1402 yy_current_state = (int) yy_def[yy_current_state];
1403 if ( yy_current_state >= 122 )
1404 yy_c = yy_meta[(unsigned int) yy_c];
1406 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1407 *yy_state_ptr++ = yy_current_state;
1410 return yy_current_state;
1414 /* yy_try_NUL_trans - try to make a transition on the NUL character
1417 * next_state = yy_try_NUL_trans( current_state );
1420 #ifdef YY_USE_PROTOS
1421 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1423 static yy_state_type yy_try_NUL_trans( yy_current_state )
1424 yy_state_type yy_current_state;
1427 register int yy_is_jam;
1429 register YY_CHAR yy_c = 1;
1430 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1432 yy_current_state = (int) yy_def[yy_current_state];
1433 if ( yy_current_state >= 122 )
1434 yy_c = yy_meta[(unsigned int) yy_c];
1436 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1437 yy_is_jam = (yy_current_state == 121);
1439 *yy_state_ptr++ = yy_current_state;
1441 return yy_is_jam ? 0 : yy_current_state;
1446 #ifdef YY_USE_PROTOS
1447 static inline void yyunput( int c, register char *yy_bp )
1449 static inline void yyunput( c, yy_bp )
1451 register char *yy_bp;
1454 register char *yy_cp = yy_c_buf_p;
1456 /* undo effects of setting up yytext */
1457 *yy_cp = yy_hold_char;
1459 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1460 { /* need to shift things up to make room */
1461 /* +2 for EOB chars. */
1462 register int number_to_move = yy_n_chars + 2;
1463 register char *dest = &yy_current_buffer->yy_ch_buf[
1464 yy_current_buffer->yy_buf_size + 2];
1465 register char *source =
1466 &yy_current_buffer->yy_ch_buf[number_to_move];
1468 while ( source > yy_current_buffer->yy_ch_buf )
1469 *--dest = *--source;
1471 yy_cp += (int) (dest - source);
1472 yy_bp += (int) (dest - source);
1473 yy_current_buffer->yy_n_chars =
1474 yy_n_chars = yy_current_buffer->yy_buf_size;
1476 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1477 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1480 *--yy_cp = (char) c;
1486 yy_hold_char = *yy_cp;
1489 #endif /* ifndef YY_NO_UNPUT */
1493 static int yyinput()
1500 *yy_c_buf_p = yy_hold_char;
1502 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1504 /* yy_c_buf_p now points to the character we want to return.
1505 * If this occurs *before* the EOB characters, then it's a
1506 * valid NUL; if not, then we've hit the end of the buffer.
1508 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1509 /* This was really a NUL. */
1513 { /* need more input */
1514 int offset = yy_c_buf_p - yytext_ptr;
1517 switch ( yy_get_next_buffer() )
1519 case EOB_ACT_LAST_MATCH:
1520 /* This happens because yy_g_n_b()
1521 * sees that we've accumulated a
1522 * token and flags that we need to
1523 * try matching the token before
1524 * proceeding. But for input(),
1525 * there's no matching to consider.
1526 * So convert the EOB_ACT_LAST_MATCH
1527 * to EOB_ACT_END_OF_FILE.
1530 /* Reset buffer status. */
1535 case EOB_ACT_END_OF_FILE:
1540 if ( ! yy_did_buffer_switch_on_eof )
1549 case EOB_ACT_CONTINUE_SCAN:
1550 yy_c_buf_p = yytext_ptr + offset;
1556 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1557 *yy_c_buf_p = '\0'; /* preserve yytext */
1558 yy_hold_char = *++yy_c_buf_p;
1567 #ifdef YY_USE_PROTOS
1568 void yyrestart( FILE *input_file )
1570 void yyrestart( input_file )
1574 if ( ! yy_current_buffer )
1575 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1577 yy_init_buffer( yy_current_buffer, input_file );
1578 yy_load_buffer_state();
1582 #ifdef YY_USE_PROTOS
1583 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1585 void yy_switch_to_buffer( new_buffer )
1586 YY_BUFFER_STATE new_buffer;
1589 if ( yy_current_buffer == new_buffer )
1592 if ( yy_current_buffer )
1594 /* Flush out information for old buffer. */
1595 *yy_c_buf_p = yy_hold_char;
1596 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1597 yy_current_buffer->yy_n_chars = yy_n_chars;
1600 yy_current_buffer = new_buffer;
1601 yy_load_buffer_state();
1603 /* We don't actually know whether we did this switch during
1604 * EOF (yywrap()) processing, but the only time this flag
1605 * is looked at is after yywrap() is called, so it's safe
1606 * to go ahead and always set it.
1608 yy_did_buffer_switch_on_eof = 1;
1612 #ifdef YY_USE_PROTOS
1613 void yy_load_buffer_state( void )
1615 void yy_load_buffer_state()
1618 yy_n_chars = yy_current_buffer->yy_n_chars;
1619 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1620 yyin = yy_current_buffer->yy_input_file;
1621 yy_hold_char = *yy_c_buf_p;
1625 #ifdef YY_USE_PROTOS
1626 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1628 YY_BUFFER_STATE yy_create_buffer( file, size )
1635 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1637 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1639 b->yy_buf_size = size;
1641 /* yy_ch_buf has to be 2 characters longer than the size given because
1642 * we need to put in 2 end-of-buffer characters.
1644 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1645 if ( ! b->yy_ch_buf )
1646 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1648 b->yy_is_our_buffer = 1;
1650 yy_init_buffer( b, file );
1656 #ifdef YY_USE_PROTOS
1657 void yy_delete_buffer( YY_BUFFER_STATE b )
1659 void yy_delete_buffer( b )
1666 if ( b == yy_current_buffer )
1667 yy_current_buffer = (YY_BUFFER_STATE) 0;
1669 if ( b->yy_is_our_buffer )
1670 yy_flex_free( (void *) b->yy_ch_buf );
1672 yy_flex_free( (void *) b );
1676 #ifndef YY_ALWAYS_INTERACTIVE
1677 #ifndef YY_NEVER_INTERACTIVE
1682 #ifdef YY_USE_PROTOS
1683 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1685 void yy_init_buffer( b, file )
1692 yy_flush_buffer( b );
1694 b->yy_input_file = file;
1695 b->yy_fill_buffer = 1;
1697 #if YY_ALWAYS_INTERACTIVE
1698 b->yy_is_interactive = 1;
1700 #if YY_NEVER_INTERACTIVE
1701 b->yy_is_interactive = 0;
1703 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1709 #ifdef YY_USE_PROTOS
1710 void yy_flush_buffer( YY_BUFFER_STATE b )
1712 void yy_flush_buffer( b )
1722 /* We always need two end-of-buffer characters. The first causes
1723 * a transition to the end-of-buffer state. The second causes
1724 * a jam in that state.
1726 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1727 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1729 b->yy_buf_pos = &b->yy_ch_buf[0];
1732 b->yy_buffer_status = YY_BUFFER_NEW;
1734 if ( b == yy_current_buffer )
1735 yy_load_buffer_state();
1739 #ifndef YY_NO_SCAN_BUFFER
1740 #ifdef YY_USE_PROTOS
1741 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1743 YY_BUFFER_STATE yy_scan_buffer( base, size )
1751 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1752 base[size-1] != YY_END_OF_BUFFER_CHAR )
1753 /* They forgot to leave room for the EOB's. */
1756 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1758 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1760 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1761 b->yy_buf_pos = b->yy_ch_buf = base;
1762 b->yy_is_our_buffer = 0;
1763 b->yy_input_file = 0;
1764 b->yy_n_chars = b->yy_buf_size;
1765 b->yy_is_interactive = 0;
1767 b->yy_fill_buffer = 0;
1768 b->yy_buffer_status = YY_BUFFER_NEW;
1770 yy_switch_to_buffer( b );
1775 YY_BUFFER_STATE yy_scan_buffer( char *base, int size )
1777 return yy_scan_buffer(base, (yy_size_t) size);
1783 #ifndef YY_NO_SCAN_STRING
1784 #ifdef YY_USE_PROTOS
1785 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1787 YY_BUFFER_STATE yy_scan_string( yy_str )
1788 yyconst char *yy_str;
1792 for ( len = 0; yy_str[len]; ++len )
1795 return yy_scan_bytes( yy_str, len );
1800 #ifndef YY_NO_SCAN_BYTES
1801 #ifdef YY_USE_PROTOS
1802 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, yy_size_t len )
1804 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1805 yyconst char *bytes;
1813 /* Get memory for full buffer, including space for trailing EOB's. */
1815 buf = (char *) yy_flex_alloc( n );
1817 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1819 for ( i = 0; i < len; ++i )
1822 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1824 b = yy_scan_buffer( buf, n );
1826 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1828 /* It's okay to grow etc. this buffer, and we should throw it
1829 * away when we're done.
1831 b->yy_is_our_buffer = 1;
1836 YY_BUFFER_STATE yy_scan_bytes( yyconst char *base, int size )
1838 return yy_scan_bytes(base, (yy_size_t) size);
1844 #ifndef YY_NO_PUSH_STATE
1845 #ifdef YY_USE_PROTOS
1846 static void yy_push_state( int new_state )
1848 static void yy_push_state( new_state )
1852 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1856 yy_start_stack_depth += YY_START_STACK_INCR;
1857 new_size = yy_start_stack_depth * sizeof( int );
1859 if ( ! yy_start_stack )
1860 yy_start_stack = (int *) yy_flex_alloc( new_size );
1863 yy_start_stack = (int *) yy_flex_realloc(
1864 (void *) yy_start_stack, new_size );
1866 if ( ! yy_start_stack )
1868 "out of memory expanding start-condition stack" );
1871 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1878 #ifndef YY_NO_POP_STATE
1879 static void yy_pop_state()
1881 if ( --yy_start_stack_ptr < 0 )
1882 YY_FATAL_ERROR( "start-condition stack underflow" );
1884 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1889 #ifndef YY_NO_TOP_STATE
1890 static int yy_top_state()
1892 return yy_start_stack[yy_start_stack_ptr - 1];
1896 #ifndef YY_EXIT_FAILURE
1897 #define YY_EXIT_FAILURE 2
1900 #ifdef YY_USE_PROTOS
1901 static void yy_fatal_error( yyconst char msg[] )
1903 static void yy_fatal_error( msg )
1907 (void) fprintf( stderr, "%s\n", msg );
1908 exit( YY_EXIT_FAILURE );
1913 /* Redefine yyless() so it works in section 3 code. */
1919 /* Undo effects of setting up yytext. */ \
1920 yytext[yyleng] = yy_hold_char; \
1921 yy_c_buf_p = yytext + n; \
1922 yy_hold_char = *yy_c_buf_p; \
1923 *yy_c_buf_p = '\0'; \
1929 /* Internal utility routines. */
1932 #ifdef YY_USE_PROTOS
1933 static void yy_flex_strncpy( char *s1, yyconst char *s2, yy_size_t n )
1935 static void yy_flex_strncpy( s1, s2, n )
1941 register yy_size_t i;
1942 for ( i = 0; i < n; ++i )
1947 #ifdef YY_NEED_STRLEN
1948 #ifdef YY_USE_PROTOS
1949 static yy_size_t yy_flex_strlen( yyconst char *s )
1951 static yy_size_t yy_flex_strlen( s )
1955 register yy_size_t n;
1956 for ( n = 0; s[n]; ++n )
1964 #ifdef YY_USE_PROTOS
1965 static void *yy_flex_alloc( yy_size_t size )
1967 static void *yy_flex_alloc( size )
1971 return (void *) malloc( size );
1974 #ifdef YY_USE_PROTOS
1975 static inline void *yy_flex_realloc( void *ptr, yy_size_t size )
1977 static inline void *yy_flex_realloc( ptr, size )
1982 /* The cast to (char *) in the following accommodates both
1983 * implementations that use char* generic pointers, and those
1984 * that use void* generic pointers. It works with the latter
1985 * because both ANSI C and C++ allow castless assignment from
1986 * any pointer type to void*, and deal with argument conversions
1987 * as though doing an assignment.
1989 return (void *) realloc( (char *) ptr, size );
1992 #ifdef YY_USE_PROTOS
1993 static void yy_flex_free( void *ptr )
1995 static void yy_flex_free( ptr )
2009 #line 239 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"