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:
28 #define YY_FLEX_MAJOR_VERSION 2
29 #define YY_FLEX_MINOR_VERSION 5
35 /* 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, int len ));
262 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
263 static inline void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
264 static void yy_flex_free YY_PROTO(( void * ));
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 yy_state_type yy_get_previous_state YY_PROTO(( void ));
295 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
296 static int yy_get_next_buffer YY_PROTO(( void ));
297 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
299 /* Done after the current pattern has been matched and before the
300 * corresponding action - sets up yytext.
302 #define YY_DO_BEFORE_ACTION \
303 yytext_ptr = yy_bp; \
304 yyleng = (int) (yy_cp - yy_bp); \
305 yy_hold_char = *yy_cp; \
309 #define YY_NUM_RULES 31
310 #define YY_END_OF_BUFFER 32
311 static yyconst short int yy_acclist[129] =
313 25, 25, 32, 30, 31, 23, 30, 31, 23, 31,
314 30, 31, 30, 31, 30, 31, 30, 31, 30, 31,
315 22, 30, 31, 22, 30, 31, 19, 30, 31, 30,
316 31, 19, 30, 31, 19, 30, 31, 19, 30, 31,
317 19, 30, 31, 19, 30, 31, 19, 30, 31, 19,
318 30, 31, 25, 31, 26, 31, 28, 31, 23, 21,
319 20, 22, 24, 1, 19, 19, 19, 19, 19, 19,
320 19, 15, 19, 19, 19, 19, 25, 26, 26, 29,
321 28, 27, 28, 20, 1, 22, 22, 5, 19, 19,
322 19, 10, 19, 12, 19, 19, 19, 4, 19, 14,
324 19, 19, 19, 18, 16, 17, 3, 6, 19, 19,
325 9, 19, 19, 19, 8, 19, 19, 11, 19, 13,
326 19, 19, 19, 19, 7, 19, 19, 2
329 static yyconst short int yy_accept[101] =
331 1, 1, 1, 2, 3, 4, 6, 9, 11, 13,
332 15, 17, 19, 21, 24, 27, 30, 32, 35, 38,
333 41, 44, 47, 50, 53, 55, 57, 59, 60, 60,
334 60, 61, 62, 63, 64, 65, 65, 65, 66, 66,
335 67, 68, 69, 70, 71, 72, 74, 75, 76, 77,
336 78, 79, 80, 81, 82, 83, 84, 84, 84, 85,
337 86, 87, 88, 88, 88, 90, 91, 92, 94, 96,
338 97, 98, 100, 102, 103, 104, 105, 106, 107, 107,
339 108, 110, 111, 113, 114, 115, 117, 118, 120, 122,
340 123, 124, 125, 127, 128, 128, 128, 128, 129, 129
344 static yyconst int yy_ec[256] =
346 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
347 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
348 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
349 1, 2, 5, 6, 1, 7, 1, 1, 1, 1,
350 1, 8, 9, 1, 9, 1, 10, 11, 12, 13,
351 13, 13, 13, 13, 13, 13, 13, 1, 1, 1,
352 1, 1, 1, 1, 14, 14, 14, 14, 14, 14,
353 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
354 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
355 16, 1, 17, 1, 15, 1, 18, 19, 20, 21,
357 22, 23, 24, 25, 26, 15, 15, 27, 15, 28,
358 29, 15, 15, 30, 31, 32, 33, 15, 15, 34,
359 15, 15, 35, 1, 36, 1, 1, 1, 1, 1,
360 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
361 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
362 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
363 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
364 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
365 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
366 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
368 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
369 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
370 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
371 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
372 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
376 static yyconst int yy_meta[37] =
378 1, 1, 2, 1, 1, 1, 1, 3, 1, 3,
379 4, 4, 4, 5, 6, 1, 1, 5, 5, 5,
380 5, 5, 5, 6, 6, 6, 6, 6, 6, 6,
384 static yyconst short int yy_base[113] =
386 0, 0, 29, 30, 199, 200, 39, 42, 167, 191,
387 0, 36, 42, 42, 45, 0, 161, 169, 33, 41,
388 168, 165, 42, 160, 0, 57, 61, 70, 45, 185,
389 200, 0, 66, 200, 0, 69, 0, 0, 154, 157,
390 170, 166, 162, 162, 162, 62, 151, 151, 151, 0,
391 75, 76, 200, 79, 200, 80, 153, 73, 0, 0,
392 81, 0, 143, 161, 146, 145, 153, 0, 0, 147,
393 146, 0, 0, 140, 145, 200, 200, 200, 134, 200,
394 0, 138, 0, 147, 134, 0, 138, 0, 0, 120,
395 97, 77, 0, 93, 95, 60, 45, 200, 200, 101,
397 107, 109, 112, 118, 124, 130, 133, 139, 142, 147,
401 static yyconst short int yy_def[113] =
403 99, 1, 100, 100, 99, 99, 99, 99, 99, 101,
404 102, 99, 99, 99, 99, 103, 99, 103, 103, 103,
405 103, 103, 103, 103, 104, 105, 106, 99, 99, 101,
406 99, 107, 99, 99, 108, 99, 109, 103, 110, 103,
407 103, 103, 103, 103, 103, 103, 103, 103, 103, 104,
408 105, 105, 99, 106, 99, 106, 99, 99, 107, 108,
409 99, 109, 110, 111, 103, 103, 103, 103, 103, 103,
410 103, 103, 103, 103, 103, 99, 99, 99, 110, 99,
411 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
412 103, 103, 103, 103, 99, 112, 112, 99, 0, 99,
414 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
418 static yyconst short int yy_nxt[237] =
420 6, 7, 8, 7, 9, 10, 11, 6, 12, 13,
421 14, 15, 15, 16, 16, 17, 6, 16, 18, 19,
422 20, 16, 21, 16, 16, 22, 23, 16, 16, 16,
423 24, 16, 16, 16, 6, 6, 26, 26, 27, 27,
424 28, 28, 28, 28, 28, 28, 33, 33, 33, 34,
425 98, 35, 33, 33, 33, 33, 33, 33, 43, 41,
426 36, 42, 44, 47, 52, 98, 53, 48, 55, 57,
427 56, 28, 28, 28, 58, 37, 33, 33, 33, 61,
428 61, 71, 99, 52, 99, 53, 99, 99, 99, 56,
429 77, 61, 61, 72, 95, 95, 95, 95, 94, 78,
431 96, 25, 25, 25, 25, 25, 25, 30, 30, 30,
432 30, 30, 30, 32, 32, 38, 38, 38, 50, 50,
433 93, 50, 50, 50, 51, 51, 51, 51, 51, 51,
434 54, 54, 54, 54, 54, 54, 59, 59, 59, 60,
435 92, 60, 60, 60, 60, 62, 62, 63, 63, 63,
436 63, 63, 63, 79, 79, 79, 79, 79, 79, 97,
437 97, 97, 97, 97, 97, 91, 90, 89, 88, 64,
438 87, 86, 85, 84, 83, 82, 81, 80, 64, 76,
439 75, 74, 73, 70, 69, 68, 67, 66, 65, 64,
440 31, 49, 46, 45, 40, 39, 31, 29, 99, 5,
442 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
443 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
444 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
445 99, 99, 99, 99, 99, 99
448 static yyconst short int yy_chk[237] =
450 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
451 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
452 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
453 1, 1, 1, 1, 1, 1, 3, 4, 3, 4,
454 7, 7, 7, 8, 8, 8, 12, 12, 12, 13,
455 97, 13, 14, 14, 14, 15, 15, 15, 20, 19,
456 14, 19, 20, 23, 26, 96, 26, 23, 27, 29,
457 27, 28, 28, 28, 29, 14, 33, 33, 33, 36,
458 36, 46, 51, 52, 51, 52, 54, 56, 54, 56,
459 58, 61, 61, 46, 94, 94, 95, 95, 92, 58,
461 95, 100, 100, 100, 100, 100, 100, 101, 101, 101,
462 101, 101, 101, 102, 102, 103, 103, 103, 104, 104,
463 91, 104, 104, 104, 105, 105, 105, 105, 105, 105,
464 106, 106, 106, 106, 106, 106, 107, 107, 107, 108,
465 90, 108, 108, 108, 108, 109, 109, 110, 110, 110,
466 110, 110, 110, 111, 111, 111, 111, 111, 111, 112,
467 112, 112, 112, 112, 112, 87, 85, 84, 82, 79,
468 75, 74, 71, 70, 67, 66, 65, 64, 63, 57,
469 49, 48, 47, 45, 44, 43, 42, 41, 40, 39,
470 30, 24, 22, 21, 18, 17, 10, 9, 5, 99,
472 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
473 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
474 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
475 99, 99, 99, 99, 99, 99
478 static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
479 static char *yy_full_match;
483 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
484 yy_cp = yy_full_match; /* restore poss. backed-over text */ \
488 #define yymore() yymore_used_but_not_detected
489 #define YY_MORE_ADJ 0
490 #define YY_RESTORE_YY_MORE_OFFSET
492 #line 1 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
494 /*===-- FileLexer.l - Scanner for TableGen Files ----------------*- C++ -*-===//
496 // The LLVM Compiler Infrastructure
498 // This file was developed by the LLVM research group and is distributed under
499 // the University of Illinois Open Source License. See LICENSE.TXT for details.
501 //===----------------------------------------------------------------------===//
503 // This file defines a simple flex scanner for TableGen files. This is pretty
504 // straight-forward, except for the magic to handle file inclusion.
506 //===----------------------------------------------------------------------===*/
507 #define YY_NEVER_INTERACTIVE 1
510 #line 30 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
512 typedef std::pair<llvm::Record*, std::vector<llvm::Init*>*> SubClassRefTy;
513 #include "FileParser.h"
519 // Global variable recording the location of the include directory
520 std::string IncludeDirectory;
522 /// ParseInt - This has to handle the special case of binary numbers 0b0101
524 static int ParseInt(const char *Str) {
525 if (Str[0] == '0' && Str[1] == 'b')
526 return strtol(Str+2, 0, 2);
527 return strtol(Str, 0, 0);
530 static int CommentDepth = 0;
533 std::string Filename;
536 YY_BUFFER_STATE Buffer;
538 IncludeRec(const std::string &FN, FILE *F)
539 : Filename(FN), File(F), LineNo(0){
543 static std::vector<IncludeRec> IncludeStack;
545 std::ostream &err() {
546 if (IncludeStack.empty())
547 return std::cerr << "At end of input: ";
549 for (unsigned i = 0, e = IncludeStack.size()-1; i != e; ++i)
550 std::cerr << "Included from " << IncludeStack[i].Filename << ":"
551 << IncludeStack[i].LineNo << ":\n";
552 return std::cerr << "Parsing " << IncludeStack.back().Filename << ":"
553 << Filelineno << ": ";
556 /// ParseFile - this function begins the parsing of the specified tablegen file.
558 void ParseFile(const std::string &Filename, const std::string & IncludeDir) {
560 if (Filename != "-") {
561 F = fopen(Filename.c_str(), "r");
564 std::cerr << "Could not open input file '" + Filename + "'!\n";
567 IncludeStack.push_back(IncludeRec(Filename, F));
569 IncludeStack.push_back(IncludeRec("<stdin>", stdin));
572 // Record the location of the include directory so that the lexer can find
574 IncludeDirectory = IncludeDir;
582 /// HandleInclude - This function is called when an include directive is
583 /// encountered in the input stream...
585 static void HandleInclude(const char *Buffer) {
586 unsigned Length = yyleng;
587 assert(Buffer[Length-1] == '"');
588 Buffer += strlen("include ");
589 Length -= strlen("include ");
590 while (*Buffer != '"') {
594 assert(Length >= 2 && "Double quotes not found?");
595 std::string Filename(Buffer+1, Buffer+Length-1);
596 //std::cerr << "Filename = '" << Filename << "'\n";
598 // Save the line number and lex buffer of the includer...
599 IncludeStack.back().LineNo = Filelineno;
600 IncludeStack.back().Buffer = YY_CURRENT_BUFFER;
602 // Open the new input file...
603 yyin = fopen(Filename.c_str(), "r");
605 // If we couldn't find the file in the current directory, look for it in
606 // the include directories.
608 // NOTE: Right now, there is only one directory. We need to eventually add
610 std::string NextFilename = IncludeDirectory + "/" + Filename;
611 yyin = fopen(NextFilename.c_str(), "r");
613 err() << "Could not find include file '" << Filename << "'!\n";
616 Filename = NextFilename;
619 // Add the file to our include stack...
620 IncludeStack.push_back(IncludeRec(Filename, yyin));
621 Filelineno = 1; // Reset line numbering...
622 //yyrestart(yyin); // Start lexing the new file...
624 yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
627 /// yywrap - This is called when the lexer runs out of input in one of the
628 /// files. Switch back to an includer if an includee has run out of input.
632 if (IncludeStack.back().File != stdin)
633 fclose(IncludeStack.back().File);
634 IncludeStack.pop_back();
635 if (IncludeStack.empty()) return 1; // Top-level file is done.
637 // Otherwise, we need to switch back to a file which included the current one.
638 Filelineno = IncludeStack.back().LineNo; // Restore current line number
639 yy_switch_to_buffer(IncludeStack.back().Buffer);
643 } // End llvm namespace
645 using namespace llvm;
647 #line 648 "Lexer.cpp"
649 /* Macros after this point can all be overridden by user definitions in
653 #ifndef YY_SKIP_YYWRAP
655 extern "C" int yywrap YY_PROTO(( void ));
657 extern int yywrap YY_PROTO(( void ));
662 static inline void yyunput YY_PROTO(( int c, char *buf_ptr ));
666 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
669 #ifdef YY_NEED_STRLEN
670 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
675 static int yyinput YY_PROTO(( void ));
677 static int input YY_PROTO(( void ));
682 static int yy_start_stack_ptr = 0;
683 static int yy_start_stack_depth = 0;
684 static int *yy_start_stack = 0;
685 #ifndef YY_NO_PUSH_STATE
686 static void yy_push_state YY_PROTO(( int new_state ));
688 #ifndef YY_NO_POP_STATE
689 static void yy_pop_state YY_PROTO(( void ));
691 #ifndef YY_NO_TOP_STATE
692 static int yy_top_state YY_PROTO(( void ));
696 #define YY_NO_PUSH_STATE 1
697 #define YY_NO_POP_STATE 1
698 #define YY_NO_TOP_STATE 1
701 #ifdef YY_MALLOC_DECL
709 /* Just try to get by without declaring the routines. This will fail
710 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
711 * or sizeof(void*) != sizeof(int).
716 /* Amount of stuff to slurp up with each read. */
717 #ifndef YY_READ_BUF_SIZE
718 #define YY_READ_BUF_SIZE 8192
721 /* Copy whatever the last rule matched to the standard output. */
724 /* This used to be an fputs(), but since the string might contain NUL's,
725 * we now use fwrite().
727 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
730 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
731 * is returned in "result".
734 #define YY_INPUT(buf,result,max_size) \
735 if ( yy_current_buffer->yy_is_interactive ) \
738 for ( n = 0; n < max_size && \
739 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
742 buf[n++] = (char) c; \
743 if ( c == EOF && ferror( yyin ) ) \
744 YY_FATAL_ERROR( "input in flex scanner failed" ); \
747 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
748 && ferror( yyin ) ) \
749 YY_FATAL_ERROR( "input in flex scanner failed" );
752 /* No semi-colon after return; correct usage is to write "yyterminate();" -
753 * we don't want an extra ';' after the "return" because that will cause
754 * some compilers to complain about unreachable statements.
757 #define yyterminate() return YY_NULL
760 /* Number of entries by which start-condition stack grows. */
761 #ifndef YY_START_STACK_INCR
762 #define YY_START_STACK_INCR 25
765 /* Report a fatal error. */
766 #ifndef YY_FATAL_ERROR
767 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
770 /* Default declaration of generated scanner - a define so the user can
771 * easily add parameters.
774 #define YY_DECL int yylex YY_PROTO(( void ))
777 /* Code executed at the beginning of each rule, after yytext and yyleng
780 #ifndef YY_USER_ACTION
781 #define YY_USER_ACTION
784 /* Code executed at the end of each rule. */
786 #define YY_BREAK break;
789 #define YY_RULE_SETUP \
794 register yy_state_type yy_current_state;
795 register char *yy_cp = NULL, *yy_bp = NULL;
798 #line 176 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
801 #line 802 "Lexer.cpp"
812 yy_start = 1; /* first start state */
820 if ( ! yy_current_buffer )
822 yy_create_buffer( yyin, YY_BUF_SIZE );
824 yy_load_buffer_state();
827 while ( 1 ) /* loops until end-of-file is reached */
831 /* Support of yytext. */
832 *yy_cp = yy_hold_char;
834 /* yy_bp points to the position in yy_ch_buf of the start of
839 yy_current_state = yy_start;
840 yy_state_ptr = yy_state_buf;
841 *yy_state_ptr++ = yy_current_state;
845 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
846 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
848 yy_current_state = (int) yy_def[yy_current_state];
849 if ( yy_current_state >= 100 )
850 yy_c = yy_meta[(unsigned int) yy_c];
852 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
853 *yy_state_ptr++ = yy_current_state;
856 while ( yy_current_state != 99 );
859 yy_current_state = *--yy_state_ptr;
860 yy_lp = yy_accept[yy_current_state];
861 find_rule: /* we branch to this label when backing up */
862 for ( ; ; ) /* until we find what rule we matched */
864 if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
866 yy_act = yy_acclist[yy_lp];
868 yy_full_match = yy_cp;
873 yy_current_state = *--yy_state_ptr;
874 yy_lp = yy_accept[yy_current_state];
879 if ( yy_act != YY_END_OF_BUFFER )
882 for ( yyl = 0; yyl < yyleng; ++yyl )
883 if ( yytext[yyl] == '\n' )
887 do_action: /* This label is used only to access EOF actions. */
891 { /* beginning of action switch */
894 #line 178 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
895 { /* Ignore comments */ }
899 #line 180 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
900 { HandleInclude(yytext); }
904 #line 181 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
905 { Filelval.StrVal = new std::string(yytext+2, yytext+yyleng-2);
906 return CODEFRAGMENT; }
910 #line 184 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
915 #line 185 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
920 #line 186 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
925 #line 187 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
930 #line 188 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
935 #line 189 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
940 #line 190 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
945 #line 192 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
950 #line 193 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
955 #line 194 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
960 #line 195 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
965 #line 196 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
970 #line 198 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
975 #line 199 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
980 #line 200 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
985 #line 203 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
986 { Filelval.StrVal = new std::string(yytext, yytext+yyleng);
991 #line 205 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
992 { Filelval.StrVal = new std::string(yytext+1, yytext+yyleng);
997 #line 208 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
998 { Filelval.StrVal = new std::string(yytext+1, yytext+yyleng-1);
1003 #line 211 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
1004 { Filelval.IntVal = ParseInt(Filetext); return INTVAL; }
1008 #line 213 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
1009 { /* Ignore whitespace */ }
1013 #line 216 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
1014 { BEGIN(comment); CommentDepth++; }
1018 #line 217 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
1019 {} /* eat anything that's not a '*' or '/' */
1023 #line 218 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
1024 {} /* eat up '*'s not followed by '/'s */
1028 #line 219 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
1033 #line 220 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
1034 {} /* eat up /'s not followed by *'s */
1038 #line 221 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
1039 { if (!--CommentDepth) { BEGIN(INITIAL); } }
1041 case YY_STATE_EOF(comment):
1042 #line 222 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
1043 { err() << "Unterminated comment!\n"; exit(1); }
1047 #line 224 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
1048 { return Filetext[0]; }
1052 #line 226 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"
1053 YY_FATAL_ERROR( "flex scanner jammed" );
1055 #line 1056 "Lexer.cpp"
1056 case YY_STATE_EOF(INITIAL):
1059 case YY_END_OF_BUFFER:
1061 /* Amount of text matched not including the EOB char. */
1062 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1064 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1065 *yy_cp = yy_hold_char;
1066 YY_RESTORE_YY_MORE_OFFSET
1068 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1070 /* We're scanning a new file or input source. It's
1071 * possible that this happened because the user
1072 * just pointed yyin at a new source and called
1073 * yylex(). If so, then we have to assure
1074 * consistency between yy_current_buffer and our
1075 * globals. Here is the right place to do so, because
1076 * this is the first action (other than possibly a
1077 * back-up) that will match for the new input source.
1079 yy_n_chars = yy_current_buffer->yy_n_chars;
1080 yy_current_buffer->yy_input_file = yyin;
1081 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1084 /* Note that here we test for yy_c_buf_p "<=" to the position
1085 * of the first EOB in the buffer, since yy_c_buf_p will
1086 * already have been incremented past the NUL character
1087 * (since all states make transitions on EOB to the
1088 * end-of-buffer state). Contrast this with the test
1091 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1092 { /* This was really a NUL. */
1093 yy_state_type yy_next_state;
1095 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1097 yy_current_state = yy_get_previous_state();
1099 /* Okay, we're now positioned to make the NUL
1100 * transition. We couldn't have
1101 * yy_get_previous_state() go ahead and do it
1102 * for us because it doesn't know how to deal
1103 * with the possibility of jamming (and we don't
1104 * want to build jamming into it because then it
1105 * will run more slowly).
1108 yy_next_state = yy_try_NUL_trans( yy_current_state );
1110 yy_bp = yytext_ptr + YY_MORE_ADJ;
1112 if ( yy_next_state )
1114 /* Consume the NUL. */
1115 yy_cp = ++yy_c_buf_p;
1116 yy_current_state = yy_next_state;
1123 goto yy_find_action;
1127 else switch ( yy_get_next_buffer() )
1129 case EOB_ACT_END_OF_FILE:
1131 yy_did_buffer_switch_on_eof = 0;
1135 /* Note: because we've taken care in
1136 * yy_get_next_buffer() to have set up
1137 * yytext, we can now set up
1138 * yy_c_buf_p so that if some total
1139 * hoser (like flex itself) wants to
1140 * call the scanner after we return the
1141 * YY_NULL, it'll still work - another
1142 * YY_NULL will get returned.
1144 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1146 yy_act = YY_STATE_EOF(YY_START);
1152 if ( ! yy_did_buffer_switch_on_eof )
1158 case EOB_ACT_CONTINUE_SCAN:
1160 yytext_ptr + yy_amount_of_matched_text;
1162 yy_current_state = yy_get_previous_state();
1165 yy_bp = yytext_ptr + YY_MORE_ADJ;
1168 case EOB_ACT_LAST_MATCH:
1170 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1172 yy_current_state = yy_get_previous_state();
1175 yy_bp = yytext_ptr + YY_MORE_ADJ;
1176 goto yy_find_action;
1183 "fatal flex scanner internal error--no action found" );
1184 } /* end of action switch */
1185 } /* end of scanning one token */
1186 } /* end of yylex */
1189 /* yy_get_next_buffer - try to read in a new buffer
1191 * Returns a code representing an action:
1192 * EOB_ACT_LAST_MATCH -
1193 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1194 * EOB_ACT_END_OF_FILE - end of file
1197 static int yy_get_next_buffer()
1199 register char *dest = yy_current_buffer->yy_ch_buf;
1200 register char *source = yytext_ptr;
1201 register int number_to_move, i;
1204 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1206 "fatal flex scanner internal error--end of buffer missed" );
1208 if ( yy_current_buffer->yy_fill_buffer == 0 )
1209 { /* Don't try to fill the buffer, so this is an EOF. */
1210 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1212 /* We matched a single character, the EOB, so
1213 * treat this as a final EOF.
1215 return EOB_ACT_END_OF_FILE;
1220 /* We matched some text prior to the EOB, first
1223 return EOB_ACT_LAST_MATCH;
1227 /* Try to read more data. */
1229 /* First move last chars to start of buffer. */
1230 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1232 for ( i = 0; i < number_to_move; ++i )
1233 *(dest++) = *(source++);
1235 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1236 /* don't do the read, it's not guaranteed to return an EOF,
1239 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1244 yy_current_buffer->yy_buf_size - number_to_move - 1;
1246 while ( num_to_read <= 0 )
1247 { /* Not enough room in the buffer - grow it. */
1248 #ifdef YY_USES_REJECT
1250 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1253 /* just a shorter name for the current buffer */
1254 YY_BUFFER_STATE b = yy_current_buffer;
1256 int yy_c_buf_p_offset =
1257 (int) (yy_c_buf_p - b->yy_ch_buf);
1259 if ( b->yy_is_our_buffer )
1261 int new_size = b->yy_buf_size * 2;
1263 if ( new_size <= 0 )
1264 b->yy_buf_size += b->yy_buf_size / 8;
1266 b->yy_buf_size *= 2;
1268 b->yy_ch_buf = (char *)
1269 /* Include room in for 2 EOB chars. */
1270 yy_flex_realloc( (void *) b->yy_ch_buf,
1271 b->yy_buf_size + 2 );
1274 /* Can't grow it, we don't own it. */
1277 if ( ! b->yy_ch_buf )
1279 "fatal error - scanner input buffer overflow" );
1281 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1283 num_to_read = yy_current_buffer->yy_buf_size -
1288 if ( num_to_read > YY_READ_BUF_SIZE )
1289 num_to_read = YY_READ_BUF_SIZE;
1291 /* Read in more data. */
1292 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1293 yy_n_chars, num_to_read );
1295 yy_current_buffer->yy_n_chars = yy_n_chars;
1298 if ( yy_n_chars == 0 )
1300 if ( number_to_move == YY_MORE_ADJ )
1302 ret_val = EOB_ACT_END_OF_FILE;
1308 ret_val = EOB_ACT_LAST_MATCH;
1309 yy_current_buffer->yy_buffer_status =
1310 YY_BUFFER_EOF_PENDING;
1315 ret_val = EOB_ACT_CONTINUE_SCAN;
1317 yy_n_chars += number_to_move;
1318 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1319 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1321 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1327 /* yy_get_previous_state - get the state just before the EOB char was reached */
1329 static yy_state_type yy_get_previous_state()
1331 register yy_state_type yy_current_state;
1332 register char *yy_cp;
1334 yy_current_state = yy_start;
1335 yy_state_ptr = yy_state_buf;
1336 *yy_state_ptr++ = yy_current_state;
1338 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1340 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1341 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1343 yy_current_state = (int) yy_def[yy_current_state];
1344 if ( yy_current_state >= 100 )
1345 yy_c = yy_meta[(unsigned int) yy_c];
1347 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1348 *yy_state_ptr++ = yy_current_state;
1351 return yy_current_state;
1355 /* yy_try_NUL_trans - try to make a transition on the NUL character
1358 * next_state = yy_try_NUL_trans( current_state );
1361 #ifdef YY_USE_PROTOS
1362 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1364 static yy_state_type yy_try_NUL_trans( yy_current_state )
1365 yy_state_type yy_current_state;
1368 register int yy_is_jam;
1370 register YY_CHAR yy_c = 1;
1371 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1373 yy_current_state = (int) yy_def[yy_current_state];
1374 if ( yy_current_state >= 100 )
1375 yy_c = yy_meta[(unsigned int) yy_c];
1377 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1378 yy_is_jam = (yy_current_state == 99);
1380 *yy_state_ptr++ = yy_current_state;
1382 return yy_is_jam ? 0 : yy_current_state;
1387 #ifdef YY_USE_PROTOS
1388 static inline void yyunput( int c, register char *yy_bp )
1390 static inline void yyunput( c, yy_bp )
1392 register char *yy_bp;
1395 register char *yy_cp = yy_c_buf_p;
1397 /* undo effects of setting up yytext */
1398 *yy_cp = yy_hold_char;
1400 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1401 { /* need to shift things up to make room */
1402 /* +2 for EOB chars. */
1403 register int number_to_move = yy_n_chars + 2;
1404 register char *dest = &yy_current_buffer->yy_ch_buf[
1405 yy_current_buffer->yy_buf_size + 2];
1406 register char *source =
1407 &yy_current_buffer->yy_ch_buf[number_to_move];
1409 while ( source > yy_current_buffer->yy_ch_buf )
1410 *--dest = *--source;
1412 yy_cp += (int) (dest - source);
1413 yy_bp += (int) (dest - source);
1414 yy_current_buffer->yy_n_chars =
1415 yy_n_chars = yy_current_buffer->yy_buf_size;
1417 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1418 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1421 *--yy_cp = (char) c;
1427 yy_hold_char = *yy_cp;
1430 #endif /* ifndef YY_NO_UNPUT */
1435 static int yyinput()
1442 *yy_c_buf_p = yy_hold_char;
1444 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1446 /* yy_c_buf_p now points to the character we want to return.
1447 * If this occurs *before* the EOB characters, then it's a
1448 * valid NUL; if not, then we've hit the end of the buffer.
1450 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1451 /* This was really a NUL. */
1455 { /* need more input */
1456 int offset = yy_c_buf_p - yytext_ptr;
1459 switch ( yy_get_next_buffer() )
1461 case EOB_ACT_LAST_MATCH:
1462 /* This happens because yy_g_n_b()
1463 * sees that we've accumulated a
1464 * token and flags that we need to
1465 * try matching the token before
1466 * proceeding. But for input(),
1467 * there's no matching to consider.
1468 * So convert the EOB_ACT_LAST_MATCH
1469 * to EOB_ACT_END_OF_FILE.
1472 /* Reset buffer status. */
1477 case EOB_ACT_END_OF_FILE:
1482 if ( ! yy_did_buffer_switch_on_eof )
1491 case EOB_ACT_CONTINUE_SCAN:
1492 yy_c_buf_p = yytext_ptr + offset;
1498 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1499 *yy_c_buf_p = '\0'; /* preserve yytext */
1500 yy_hold_char = *++yy_c_buf_p;
1507 #endif /* YY_NO_INPUT */
1509 #ifdef YY_USE_PROTOS
1510 void yyrestart( FILE *input_file )
1512 void yyrestart( input_file )
1516 if ( ! yy_current_buffer )
1517 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1519 yy_init_buffer( yy_current_buffer, input_file );
1520 yy_load_buffer_state();
1524 #ifdef YY_USE_PROTOS
1525 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1527 void yy_switch_to_buffer( new_buffer )
1528 YY_BUFFER_STATE new_buffer;
1531 if ( yy_current_buffer == new_buffer )
1534 if ( yy_current_buffer )
1536 /* Flush out information for old buffer. */
1537 *yy_c_buf_p = yy_hold_char;
1538 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1539 yy_current_buffer->yy_n_chars = yy_n_chars;
1542 yy_current_buffer = new_buffer;
1543 yy_load_buffer_state();
1545 /* We don't actually know whether we did this switch during
1546 * EOF (yywrap()) processing, but the only time this flag
1547 * is looked at is after yywrap() is called, so it's safe
1548 * to go ahead and always set it.
1550 yy_did_buffer_switch_on_eof = 1;
1554 #ifdef YY_USE_PROTOS
1555 void yy_load_buffer_state( void )
1557 void yy_load_buffer_state()
1560 yy_n_chars = yy_current_buffer->yy_n_chars;
1561 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1562 yyin = yy_current_buffer->yy_input_file;
1563 yy_hold_char = *yy_c_buf_p;
1567 #ifdef YY_USE_PROTOS
1568 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1570 YY_BUFFER_STATE yy_create_buffer( file, size )
1577 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1579 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1581 b->yy_buf_size = size;
1583 /* yy_ch_buf has to be 2 characters longer than the size given because
1584 * we need to put in 2 end-of-buffer characters.
1586 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1587 if ( ! b->yy_ch_buf )
1588 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1590 b->yy_is_our_buffer = 1;
1592 yy_init_buffer( b, file );
1598 #ifdef YY_USE_PROTOS
1599 void yy_delete_buffer( YY_BUFFER_STATE b )
1601 void yy_delete_buffer( b )
1608 if ( b == yy_current_buffer )
1609 yy_current_buffer = (YY_BUFFER_STATE) 0;
1611 if ( b->yy_is_our_buffer )
1612 yy_flex_free( (void *) b->yy_ch_buf );
1614 yy_flex_free( (void *) b );
1619 #ifdef YY_USE_PROTOS
1620 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1622 void yy_init_buffer( b, file )
1629 yy_flush_buffer( b );
1631 b->yy_input_file = file;
1632 b->yy_fill_buffer = 1;
1634 #if YY_ALWAYS_INTERACTIVE
1635 b->yy_is_interactive = 1;
1637 #if YY_NEVER_INTERACTIVE
1638 b->yy_is_interactive = 0;
1640 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1646 #ifdef YY_USE_PROTOS
1647 void yy_flush_buffer( YY_BUFFER_STATE b )
1649 void yy_flush_buffer( b )
1659 /* We always need two end-of-buffer characters. The first causes
1660 * a transition to the end-of-buffer state. The second causes
1661 * a jam in that state.
1663 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1664 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1666 b->yy_buf_pos = &b->yy_ch_buf[0];
1669 b->yy_buffer_status = YY_BUFFER_NEW;
1671 if ( b == yy_current_buffer )
1672 yy_load_buffer_state();
1676 #ifndef YY_NO_SCAN_BUFFER
1677 #ifdef YY_USE_PROTOS
1678 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1680 YY_BUFFER_STATE yy_scan_buffer( base, size )
1688 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1689 base[size-1] != YY_END_OF_BUFFER_CHAR )
1690 /* They forgot to leave room for the EOB's. */
1693 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1695 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1697 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1698 b->yy_buf_pos = b->yy_ch_buf = base;
1699 b->yy_is_our_buffer = 0;
1700 b->yy_input_file = 0;
1701 b->yy_n_chars = b->yy_buf_size;
1702 b->yy_is_interactive = 0;
1704 b->yy_fill_buffer = 0;
1705 b->yy_buffer_status = YY_BUFFER_NEW;
1707 yy_switch_to_buffer( b );
1714 #ifndef YY_NO_SCAN_STRING
1715 #ifdef YY_USE_PROTOS
1716 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1718 YY_BUFFER_STATE yy_scan_string( yy_str )
1719 yyconst char *yy_str;
1723 for ( len = 0; yy_str[len]; ++len )
1726 return yy_scan_bytes( yy_str, len );
1731 #ifndef YY_NO_SCAN_BYTES
1732 #ifdef YY_USE_PROTOS
1733 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1735 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1736 yyconst char *bytes;
1745 /* Get memory for full buffer, including space for trailing EOB's. */
1747 buf = (char *) yy_flex_alloc( n );
1749 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1751 for ( i = 0; i < len; ++i )
1754 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1756 b = yy_scan_buffer( buf, n );
1758 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1760 /* It's okay to grow etc. this buffer, and we should throw it
1761 * away when we're done.
1763 b->yy_is_our_buffer = 1;
1770 #ifndef YY_NO_PUSH_STATE
1771 #ifdef YY_USE_PROTOS
1772 static void yy_push_state( int new_state )
1774 static void yy_push_state( new_state )
1778 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1782 yy_start_stack_depth += YY_START_STACK_INCR;
1783 new_size = yy_start_stack_depth * sizeof( int );
1785 if ( ! yy_start_stack )
1786 yy_start_stack = (int *) yy_flex_alloc( new_size );
1789 yy_start_stack = (int *) yy_flex_realloc(
1790 (void *) yy_start_stack, new_size );
1792 if ( ! yy_start_stack )
1794 "out of memory expanding start-condition stack" );
1797 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1804 #ifndef YY_NO_POP_STATE
1805 static void yy_pop_state()
1807 if ( --yy_start_stack_ptr < 0 )
1808 YY_FATAL_ERROR( "start-condition stack underflow" );
1810 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1815 #ifndef YY_NO_TOP_STATE
1816 static int yy_top_state()
1818 return yy_start_stack[yy_start_stack_ptr - 1];
1822 #ifndef YY_EXIT_FAILURE
1823 #define YY_EXIT_FAILURE 2
1826 #ifdef YY_USE_PROTOS
1827 static void yy_fatal_error( yyconst char msg[] )
1829 static void yy_fatal_error( msg )
1833 (void) fprintf( stderr, "%s\n", msg );
1834 exit( YY_EXIT_FAILURE );
1839 /* Redefine yyless() so it works in section 3 code. */
1845 /* Undo effects of setting up yytext. */ \
1846 yytext[yyleng] = yy_hold_char; \
1847 yy_c_buf_p = yytext + n; \
1848 yy_hold_char = *yy_c_buf_p; \
1849 *yy_c_buf_p = '\0'; \
1855 /* Internal utility routines. */
1858 #ifdef YY_USE_PROTOS
1859 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1861 static void yy_flex_strncpy( s1, s2, n )
1868 for ( i = 0; i < n; ++i )
1873 #ifdef YY_NEED_STRLEN
1874 #ifdef YY_USE_PROTOS
1875 static int yy_flex_strlen( yyconst char *s )
1877 static int yy_flex_strlen( s )
1882 for ( n = 0; s[n]; ++n )
1890 #ifdef YY_USE_PROTOS
1891 static void *yy_flex_alloc( yy_size_t size )
1893 static void *yy_flex_alloc( size )
1897 return (void *) malloc( size );
1900 #ifdef YY_USE_PROTOS
1901 static inline void *yy_flex_realloc( void *ptr, yy_size_t size )
1903 static inline void *yy_flex_realloc( ptr, size )
1908 /* The cast to (char *) in the following accommodates both
1909 * implementations that use char* generic pointers, and those
1910 * that use void* generic pointers. It works with the latter
1911 * because both ANSI C and C++ allow castless assignment from
1912 * any pointer type to void*, and deal with argument conversions
1913 * as though doing an assignment.
1915 return (void *) realloc( (char *) ptr, size );
1918 #ifdef YY_USE_PROTOS
1919 static void yy_flex_free( void *ptr )
1921 static void yy_flex_free( ptr )
1935 #line 226 "/home/vadve/lattner/llvm/utils/TableGen/FileLexer.l"