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
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, 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 32
310 #define YY_END_OF_BUFFER 33
311 static yyconst short int yy_acclist[130] =
313 26, 26, 33, 31, 32, 24, 31, 32, 24, 32,
314 31, 32, 31, 32, 31, 32, 31, 32, 31, 32,
315 23, 31, 32, 23, 31, 32, 20, 31, 32, 31,
316 32, 20, 31, 32, 20, 31, 32, 20, 31, 32,
317 20, 31, 32, 20, 31, 32, 20, 31, 32, 20,
318 31, 32, 26, 32, 27, 32, 29, 32, 24, 22,
319 21, 23, 25, 1, 20, 20, 20, 20, 20, 20,
320 20, 15, 20, 20, 20, 20, 26, 27, 27, 30,
321 29, 28, 29, 21, 1, 23, 23, 5, 20, 20,
322 20, 10, 20, 12, 20, 20, 20, 4, 20, 14,
324 20, 20, 20, 18, 16, 17, 3, 6, 20, 20,
325 9, 20, 20, 20, 8, 20, 20, 11, 20, 13,
326 20, 20, 20, 20, 7, 20, 20, 19, 2
329 static yyconst short int yy_accept[109] =
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, 84,
337 85, 86, 87, 88, 88, 88, 90, 91, 92, 94,
338 96, 97, 98, 100, 102, 103, 104, 105, 106, 107,
339 107, 107, 108, 110, 111, 113, 114, 115, 117, 118,
340 118, 120, 122, 123, 124, 124, 125, 127, 127, 128,
342 128, 128, 128, 128, 129, 129, 130, 130
345 static yyconst int yy_ec[256] =
347 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
348 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
349 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
350 1, 2, 5, 6, 1, 7, 1, 1, 1, 1,
351 1, 8, 9, 1, 9, 1, 10, 11, 12, 13,
352 13, 13, 13, 13, 13, 13, 13, 1, 1, 1,
353 1, 1, 1, 1, 14, 14, 14, 14, 14, 14,
354 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
355 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
356 16, 1, 17, 1, 15, 1, 18, 19, 20, 21,
358 22, 23, 24, 25, 26, 15, 15, 27, 15, 28,
359 29, 15, 15, 30, 31, 32, 33, 15, 15, 34,
360 15, 15, 35, 1, 36, 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,
367 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,
373 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
377 static yyconst int yy_meta[37] =
379 1, 1, 2, 1, 1, 1, 1, 3, 1, 3,
380 4, 4, 4, 5, 6, 1, 1, 5, 5, 5,
381 5, 5, 5, 6, 6, 6, 6, 6, 6, 6,
385 static yyconst short int yy_base[121] =
387 0, 0, 29, 30, 207, 208, 39, 42, 175, 199,
388 0, 36, 42, 42, 45, 0, 169, 177, 33, 41,
389 176, 173, 42, 168, 0, 57, 61, 70, 45, 193,
390 208, 0, 67, 208, 0, 70, 0, 0, 162, 165,
391 178, 174, 170, 170, 170, 63, 159, 159, 159, 0,
392 76, 77, 208, 80, 208, 81, 161, 74, 157, 0,
393 0, 82, 0, 150, 168, 153, 152, 160, 0, 0,
394 154, 153, 0, 0, 147, 152, 208, 208, 208, 157,
395 140, 208, 0, 144, 0, 153, 140, 0, 144, 142,
396 0, 0, 149, 145, 140, 145, 0, 122, 94, 104,
398 96, 68, 60, 208, 45, 208, 208, 102, 108, 110,
399 113, 119, 125, 131, 134, 140, 143, 148, 154, 160
402 static yyconst short int yy_def[121] =
404 107, 1, 108, 108, 107, 107, 107, 107, 107, 109,
405 110, 107, 107, 107, 107, 111, 107, 111, 111, 111,
406 111, 111, 111, 111, 112, 113, 114, 107, 107, 109,
407 107, 115, 107, 107, 116, 107, 117, 111, 118, 111,
408 111, 111, 111, 111, 111, 111, 111, 111, 111, 112,
409 113, 113, 107, 114, 107, 114, 107, 107, 107, 115,
410 116, 107, 117, 118, 119, 111, 111, 111, 111, 111,
411 111, 111, 111, 111, 111, 111, 107, 107, 107, 107,
412 118, 107, 111, 111, 111, 111, 111, 111, 111, 107,
413 111, 111, 111, 111, 107, 111, 111, 107, 111, 107,
415 107, 107, 120, 107, 120, 107, 0, 107, 107, 107,
416 107, 107, 107, 107, 107, 107, 107, 107, 107, 107
419 static yyconst short int yy_nxt[245] =
421 6, 7, 8, 7, 9, 10, 11, 6, 12, 13,
422 14, 15, 15, 16, 16, 17, 6, 16, 18, 19,
423 20, 16, 21, 16, 16, 22, 23, 16, 16, 16,
424 24, 16, 16, 16, 6, 6, 26, 26, 27, 27,
425 28, 28, 28, 28, 28, 28, 33, 33, 33, 34,
426 106, 35, 33, 33, 33, 33, 33, 33, 43, 41,
427 36, 42, 44, 47, 52, 106, 53, 48, 55, 57,
428 56, 28, 28, 28, 58, 37, 59, 33, 33, 33,
429 62, 62, 72, 107, 52, 107, 53, 107, 107, 107,
430 56, 78, 62, 62, 73, 101, 101, 101, 101, 104,
432 79, 103, 25, 25, 25, 25, 25, 25, 30, 30,
433 30, 30, 30, 30, 32, 32, 38, 38, 38, 50,
434 50, 102, 50, 50, 50, 51, 51, 51, 51, 51,
435 51, 54, 54, 54, 54, 54, 54, 60, 60, 60,
436 61, 100, 61, 61, 61, 61, 63, 63, 64, 64,
437 64, 64, 64, 64, 81, 81, 81, 81, 81, 81,
438 105, 105, 105, 105, 105, 105, 99, 98, 97, 96,
439 95, 94, 93, 92, 91, 65, 90, 89, 88, 87,
440 86, 85, 84, 83, 82, 65, 80, 77, 76, 75,
441 74, 71, 70, 69, 68, 67, 66, 65, 31, 49,
443 46, 45, 40, 39, 31, 29, 107, 5, 107, 107,
444 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
445 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
446 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
450 static yyconst short int yy_chk[245] =
452 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
453 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
454 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
455 1, 1, 1, 1, 1, 1, 3, 4, 3, 4,
456 7, 7, 7, 8, 8, 8, 12, 12, 12, 13,
457 105, 13, 14, 14, 14, 15, 15, 15, 20, 19,
458 14, 19, 20, 23, 26, 103, 26, 23, 27, 29,
459 27, 28, 28, 28, 29, 14, 29, 33, 33, 33,
460 36, 36, 46, 51, 52, 51, 52, 54, 56, 54,
461 56, 58, 62, 62, 46, 99, 99, 101, 101, 102,
463 58, 101, 108, 108, 108, 108, 108, 108, 109, 109,
464 109, 109, 109, 109, 110, 110, 111, 111, 111, 112,
465 112, 100, 112, 112, 112, 113, 113, 113, 113, 113,
466 113, 114, 114, 114, 114, 114, 114, 115, 115, 115,
467 116, 98, 116, 116, 116, 116, 117, 117, 118, 118,
468 118, 118, 118, 118, 119, 119, 119, 119, 119, 119,
469 120, 120, 120, 120, 120, 120, 96, 95, 94, 93,
470 90, 89, 87, 86, 84, 81, 80, 76, 75, 72,
471 71, 68, 67, 66, 65, 64, 59, 57, 49, 48,
472 47, 45, 44, 43, 42, 41, 40, 39, 30, 24,
474 22, 21, 18, 17, 10, 9, 5, 107, 107, 107,
475 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
476 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
477 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
481 static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
482 static char *yy_full_match;
486 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
487 yy_cp = yy_full_match; /* restore poss. backed-over text */ \
491 #define yymore() yymore_used_but_not_detected
492 #define YY_MORE_ADJ 0
493 #define YY_RESTORE_YY_MORE_OFFSET
495 #line 1 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
497 /*===-- FileLexer.l - Scanner for TableGen Files ----------------*- C++ -*-===//
499 // The LLVM Compiler Infrastructure
501 // This file was developed by the LLVM research group and is distributed under
502 // the University of Illinois Open Source License. See LICENSE.TXT for details.
504 //===----------------------------------------------------------------------===//
506 // This file defines a simple flex scanner for TableGen files. This is pretty
507 // straight-forward, except for the magic to handle file inclusion.
509 //===----------------------------------------------------------------------===*/
510 #define YY_NEVER_INTERACTIVE 1
513 #line 30 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
515 typedef std::pair<llvm::Record*, std::vector<llvm::Init*>*> SubClassRefTy;
516 #include "FileParser.h"
522 // Global variable recording the location of the include directory
523 std::vector<std::string> IncludeDirectories;
525 /// ParseInt - This has to handle the special case of binary numbers 0b0101
527 static int ParseInt(const char *Str) {
528 if (Str[0] == '0' && Str[1] == 'b')
529 return strtol(Str+2, 0, 2);
530 return strtol(Str, 0, 0);
533 static int CommentDepth = 0;
536 std::string Filename;
539 YY_BUFFER_STATE Buffer;
541 IncludeRec(const std::string &FN, FILE *F)
542 : Filename(FN), File(F), LineNo(0){
546 static std::vector<IncludeRec> IncludeStack;
548 std::ostream &err() {
549 if (IncludeStack.empty())
550 return std::cerr << "At end of input: ";
552 for (unsigned i = 0, e = IncludeStack.size()-1; i != e; ++i)
553 std::cerr << "Included from " << IncludeStack[i].Filename << ":"
554 << IncludeStack[i].LineNo << ":\n";
555 return std::cerr << "Parsing " << IncludeStack.back().Filename << ":"
556 << Filelineno << ": ";
559 /// ParseFile - this function begins the parsing of the specified tablegen file.
561 void ParseFile(const std::string &Filename,
562 const std::vector<std::string> &IncludeDirs) {
564 if (Filename != "-") {
565 F = fopen(Filename.c_str(), "r");
568 std::cerr << "Could not open input file '" + Filename + "'!\n";
571 IncludeStack.push_back(IncludeRec(Filename, F));
573 IncludeStack.push_back(IncludeRec("<stdin>", stdin));
576 // Record the location of the include directory so that the lexer can find
578 IncludeDirectories = IncludeDirs;
586 /// HandleInclude - This function is called when an include directive is
587 /// encountered in the input stream...
589 static void HandleInclude(const char *Buffer) {
590 unsigned Length = yyleng;
591 assert(Buffer[Length-1] == '"');
592 Buffer += strlen("include ");
593 Length -= strlen("include ");
594 while (*Buffer != '"') {
598 assert(Length >= 2 && "Double quotes not found?");
599 std::string Filename(Buffer+1, Buffer+Length-1);
600 //std::cerr << "Filename = '" << Filename << "'\n";
602 // Save the line number and lex buffer of the includer...
603 IncludeStack.back().LineNo = Filelineno;
604 IncludeStack.back().Buffer = YY_CURRENT_BUFFER;
606 // Open the new input file...
607 yyin = fopen(Filename.c_str(), "r");
609 // If we couldn't find the file in the current directory, look for it in
610 // the include directories.
612 std::string NextFilename;
613 for (unsigned i = 0, e = IncludeDirectories.size(); i != e; ++i) {
614 NextFilename = IncludeDirectories[i] + "/" + Filename;
615 if ((yyin = fopen(NextFilename.c_str(), "r")))
620 err() << "Could not find include file '" << Filename << "'!\n";
623 Filename = NextFilename;
626 // Add the file to our include stack...
627 IncludeStack.push_back(IncludeRec(Filename, yyin));
628 Filelineno = 1; // Reset line numbering...
629 //yyrestart(yyin); // Start lexing the new file...
631 yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
634 /// yywrap - This is called when the lexer runs out of input in one of the
635 /// files. Switch back to an includer if an includee has run out of input.
639 if (IncludeStack.back().File != stdin)
640 fclose(IncludeStack.back().File);
641 IncludeStack.pop_back();
642 if (IncludeStack.empty()) return 1; // Top-level file is done.
644 // Otherwise, we need to switch back to a file which included the current one.
645 Filelineno = IncludeStack.back().LineNo; // Restore current line number
646 yy_switch_to_buffer(IncludeStack.back().Buffer);
650 } // End llvm namespace
652 using namespace llvm;
654 #line 655 "Lexer.cpp"
656 /* Macros after this point can all be overridden by user definitions in
660 #ifndef YY_SKIP_YYWRAP
662 extern "C" int yywrap YY_PROTO(( void ));
664 extern int yywrap YY_PROTO(( void ));
669 static inline void yyunput YY_PROTO(( int c, char *buf_ptr ));
673 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
676 #ifdef YY_NEED_STRLEN
677 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
682 static int yyinput YY_PROTO(( void ));
684 static int input YY_PROTO(( void ));
689 static int yy_start_stack_ptr = 0;
690 static int yy_start_stack_depth = 0;
691 static int *yy_start_stack = 0;
692 #ifndef YY_NO_PUSH_STATE
693 static void yy_push_state YY_PROTO(( int new_state ));
695 #ifndef YY_NO_POP_STATE
696 static void yy_pop_state YY_PROTO(( void ));
698 #ifndef YY_NO_TOP_STATE
699 static int yy_top_state YY_PROTO(( void ));
703 #define YY_NO_PUSH_STATE 1
704 #define YY_NO_POP_STATE 1
705 #define YY_NO_TOP_STATE 1
708 #ifdef YY_MALLOC_DECL
716 /* Just try to get by without declaring the routines. This will fail
717 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
718 * or sizeof(void*) != sizeof(int).
723 /* Amount of stuff to slurp up with each read. */
724 #ifndef YY_READ_BUF_SIZE
725 #define YY_READ_BUF_SIZE 8192
728 /* Copy whatever the last rule matched to the standard output. */
731 /* This used to be an fputs(), but since the string might contain NUL's,
732 * we now use fwrite().
734 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
737 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
738 * is returned in "result".
741 #define YY_INPUT(buf,result,max_size) \
742 if ( yy_current_buffer->yy_is_interactive ) \
745 for ( n = 0; n < max_size && \
746 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
749 buf[n++] = (char) c; \
750 if ( c == EOF && ferror( yyin ) ) \
751 YY_FATAL_ERROR( "input in flex scanner failed" ); \
754 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
755 && ferror( yyin ) ) \
756 YY_FATAL_ERROR( "input in flex scanner failed" );
759 /* No semi-colon after return; correct usage is to write "yyterminate();" -
760 * we don't want an extra ';' after the "return" because that will cause
761 * some compilers to complain about unreachable statements.
764 #define yyterminate() return YY_NULL
767 /* Number of entries by which start-condition stack grows. */
768 #ifndef YY_START_STACK_INCR
769 #define YY_START_STACK_INCR 25
772 /* Report a fatal error. */
773 #ifndef YY_FATAL_ERROR
774 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
777 /* Default declaration of generated scanner - a define so the user can
778 * easily add parameters.
781 #define YY_DECL int yylex YY_PROTO(( void ))
784 /* Code executed at the beginning of each rule, after yytext and yyleng
787 #ifndef YY_USER_ACTION
788 #define YY_USER_ACTION
791 /* Code executed at the end of each rule. */
793 #define YY_BREAK break;
796 #define YY_RULE_SETUP \
801 register yy_state_type yy_current_state;
802 register char *yy_cp, *yy_bp;
805 #line 180 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
808 #line 809 "Lexer.cpp"
819 yy_start = 1; /* first start state */
827 if ( ! yy_current_buffer )
829 yy_create_buffer( yyin, YY_BUF_SIZE );
831 yy_load_buffer_state();
834 while ( 1 ) /* loops until end-of-file is reached */
838 /* Support of yytext. */
839 *yy_cp = yy_hold_char;
841 /* yy_bp points to the position in yy_ch_buf of the start of
846 yy_current_state = yy_start;
847 yy_state_ptr = yy_state_buf;
848 *yy_state_ptr++ = yy_current_state;
852 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
853 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
855 yy_current_state = (int) yy_def[yy_current_state];
856 if ( yy_current_state >= 108 )
857 yy_c = yy_meta[(unsigned int) yy_c];
859 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
860 *yy_state_ptr++ = yy_current_state;
863 while ( yy_current_state != 107 );
866 yy_current_state = *--yy_state_ptr;
867 yy_lp = yy_accept[yy_current_state];
868 find_rule: /* we branch to this label when backing up */
869 for ( ; ; ) /* until we find what rule we matched */
871 if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
873 yy_act = yy_acclist[yy_lp];
875 yy_full_match = yy_cp;
880 yy_current_state = *--yy_state_ptr;
881 yy_lp = yy_accept[yy_current_state];
886 if ( yy_act != YY_END_OF_BUFFER )
889 for ( yyl = 0; yyl < yyleng; ++yyl )
890 if ( yytext[yyl] == '\n' )
894 do_action: /* This label is used only to access EOF actions. */
898 { /* beginning of action switch */
901 #line 182 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
902 { /* Ignore comments */ }
906 #line 184 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
907 { HandleInclude(yytext); }
911 #line 185 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
912 { Filelval.StrVal = new std::string(yytext+2, yytext+yyleng-2);
913 return CODEFRAGMENT; }
917 #line 188 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
922 #line 189 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
927 #line 190 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
932 #line 191 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
937 #line 192 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
942 #line 193 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
947 #line 194 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
952 #line 196 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
957 #line 197 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
962 #line 198 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
967 #line 199 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
972 #line 200 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
977 #line 202 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
982 #line 203 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
987 #line 204 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
992 #line 205 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
993 { return STRCONCATTOK; }
997 #line 208 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
998 { Filelval.StrVal = new std::string(yytext, yytext+yyleng);
1003 #line 210 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1004 { Filelval.StrVal = new std::string(yytext+1, yytext+yyleng);
1009 #line 213 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1010 { Filelval.StrVal = new std::string(yytext+1, yytext+yyleng-1);
1015 #line 216 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1016 { Filelval.IntVal = ParseInt(Filetext); return INTVAL; }
1020 #line 218 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1021 { /* Ignore whitespace */ }
1025 #line 221 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1026 { BEGIN(comment); CommentDepth++; }
1030 #line 222 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1031 {} /* eat anything that's not a '*' or '/' */
1035 #line 223 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1036 {} /* eat up '*'s not followed by '/'s */
1040 #line 224 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1045 #line 225 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1046 {} /* eat up /'s not followed by *'s */
1050 #line 226 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1051 { if (!--CommentDepth) { BEGIN(INITIAL); } }
1053 case YY_STATE_EOF(comment):
1054 #line 227 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1055 { err() << "Unterminated comment!\n"; exit(1); }
1059 #line 229 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1060 { return Filetext[0]; }
1064 #line 231 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1065 YY_FATAL_ERROR( "flex scanner jammed" );
1067 #line 1068 "Lexer.cpp"
1068 case YY_STATE_EOF(INITIAL):
1071 case YY_END_OF_BUFFER:
1073 /* Amount of text matched not including the EOB char. */
1074 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1076 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1077 *yy_cp = yy_hold_char;
1078 YY_RESTORE_YY_MORE_OFFSET
1080 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1082 /* We're scanning a new file or input source. It's
1083 * possible that this happened because the user
1084 * just pointed yyin at a new source and called
1085 * yylex(). If so, then we have to assure
1086 * consistency between yy_current_buffer and our
1087 * globals. Here is the right place to do so, because
1088 * this is the first action (other than possibly a
1089 * back-up) that will match for the new input source.
1091 yy_n_chars = yy_current_buffer->yy_n_chars;
1092 yy_current_buffer->yy_input_file = yyin;
1093 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1096 /* Note that here we test for yy_c_buf_p "<=" to the position
1097 * of the first EOB in the buffer, since yy_c_buf_p will
1098 * already have been incremented past the NUL character
1099 * (since all states make transitions on EOB to the
1100 * end-of-buffer state). Contrast this with the test
1103 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1104 { /* This was really a NUL. */
1105 yy_state_type yy_next_state;
1107 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1109 yy_current_state = yy_get_previous_state();
1111 /* Okay, we're now positioned to make the NUL
1112 * transition. We couldn't have
1113 * yy_get_previous_state() go ahead and do it
1114 * for us because it doesn't know how to deal
1115 * with the possibility of jamming (and we don't
1116 * want to build jamming into it because then it
1117 * will run more slowly).
1120 yy_next_state = yy_try_NUL_trans( yy_current_state );
1122 yy_bp = yytext_ptr + YY_MORE_ADJ;
1124 if ( yy_next_state )
1126 /* Consume the NUL. */
1127 yy_cp = ++yy_c_buf_p;
1128 yy_current_state = yy_next_state;
1135 goto yy_find_action;
1139 else switch ( yy_get_next_buffer() )
1141 case EOB_ACT_END_OF_FILE:
1143 yy_did_buffer_switch_on_eof = 0;
1147 /* Note: because we've taken care in
1148 * yy_get_next_buffer() to have set up
1149 * yytext, we can now set up
1150 * yy_c_buf_p so that if some total
1151 * hoser (like flex itself) wants to
1152 * call the scanner after we return the
1153 * YY_NULL, it'll still work - another
1154 * YY_NULL will get returned.
1156 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1158 yy_act = YY_STATE_EOF(YY_START);
1164 if ( ! yy_did_buffer_switch_on_eof )
1170 case EOB_ACT_CONTINUE_SCAN:
1172 yytext_ptr + yy_amount_of_matched_text;
1174 yy_current_state = yy_get_previous_state();
1177 yy_bp = yytext_ptr + YY_MORE_ADJ;
1180 case EOB_ACT_LAST_MATCH:
1182 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1184 yy_current_state = yy_get_previous_state();
1187 yy_bp = yytext_ptr + YY_MORE_ADJ;
1188 goto yy_find_action;
1195 "fatal flex scanner internal error--no action found" );
1196 } /* end of action switch */
1197 } /* end of scanning one token */
1198 } /* end of yylex */
1201 /* yy_get_next_buffer - try to read in a new buffer
1203 * Returns a code representing an action:
1204 * EOB_ACT_LAST_MATCH -
1205 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1206 * EOB_ACT_END_OF_FILE - end of file
1209 static int yy_get_next_buffer()
1211 register char *dest = yy_current_buffer->yy_ch_buf;
1212 register char *source = yytext_ptr;
1213 register int number_to_move, i;
1216 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1218 "fatal flex scanner internal error--end of buffer missed" );
1220 if ( yy_current_buffer->yy_fill_buffer == 0 )
1221 { /* Don't try to fill the buffer, so this is an EOF. */
1222 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1224 /* We matched a single character, the EOB, so
1225 * treat this as a final EOF.
1227 return EOB_ACT_END_OF_FILE;
1232 /* We matched some text prior to the EOB, first
1235 return EOB_ACT_LAST_MATCH;
1239 /* Try to read more data. */
1241 /* First move last chars to start of buffer. */
1242 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1244 for ( i = 0; i < number_to_move; ++i )
1245 *(dest++) = *(source++);
1247 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1248 /* don't do the read, it's not guaranteed to return an EOF,
1251 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1256 yy_current_buffer->yy_buf_size - number_to_move - 1;
1258 while ( num_to_read <= 0 )
1259 { /* Not enough room in the buffer - grow it. */
1260 #ifdef YY_USES_REJECT
1262 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1265 /* just a shorter name for the current buffer */
1266 YY_BUFFER_STATE b = yy_current_buffer;
1268 int yy_c_buf_p_offset =
1269 (int) (yy_c_buf_p - b->yy_ch_buf);
1271 if ( b->yy_is_our_buffer )
1273 int new_size = b->yy_buf_size * 2;
1275 if ( new_size <= 0 )
1276 b->yy_buf_size += b->yy_buf_size / 8;
1278 b->yy_buf_size *= 2;
1280 b->yy_ch_buf = (char *)
1281 /* Include room in for 2 EOB chars. */
1282 yy_flex_realloc( (void *) b->yy_ch_buf,
1283 b->yy_buf_size + 2 );
1286 /* Can't grow it, we don't own it. */
1289 if ( ! b->yy_ch_buf )
1291 "fatal error - scanner input buffer overflow" );
1293 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1295 num_to_read = yy_current_buffer->yy_buf_size -
1300 if ( num_to_read > YY_READ_BUF_SIZE )
1301 num_to_read = YY_READ_BUF_SIZE;
1303 /* Read in more data. */
1304 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1305 yy_n_chars, num_to_read );
1307 yy_current_buffer->yy_n_chars = yy_n_chars;
1310 if ( yy_n_chars == 0 )
1312 if ( number_to_move == YY_MORE_ADJ )
1314 ret_val = EOB_ACT_END_OF_FILE;
1320 ret_val = EOB_ACT_LAST_MATCH;
1321 yy_current_buffer->yy_buffer_status =
1322 YY_BUFFER_EOF_PENDING;
1327 ret_val = EOB_ACT_CONTINUE_SCAN;
1329 yy_n_chars += number_to_move;
1330 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1331 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1333 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1339 /* yy_get_previous_state - get the state just before the EOB char was reached */
1341 static yy_state_type yy_get_previous_state()
1343 register yy_state_type yy_current_state;
1344 register char *yy_cp;
1346 yy_current_state = yy_start;
1347 yy_state_ptr = yy_state_buf;
1348 *yy_state_ptr++ = yy_current_state;
1350 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1352 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1353 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1355 yy_current_state = (int) yy_def[yy_current_state];
1356 if ( yy_current_state >= 108 )
1357 yy_c = yy_meta[(unsigned int) yy_c];
1359 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1360 *yy_state_ptr++ = yy_current_state;
1363 return yy_current_state;
1367 /* yy_try_NUL_trans - try to make a transition on the NUL character
1370 * next_state = yy_try_NUL_trans( current_state );
1373 #ifdef YY_USE_PROTOS
1374 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1376 static yy_state_type yy_try_NUL_trans( yy_current_state )
1377 yy_state_type yy_current_state;
1380 register int yy_is_jam;
1382 register YY_CHAR yy_c = 1;
1383 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1385 yy_current_state = (int) yy_def[yy_current_state];
1386 if ( yy_current_state >= 108 )
1387 yy_c = yy_meta[(unsigned int) yy_c];
1389 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1390 yy_is_jam = (yy_current_state == 107);
1392 *yy_state_ptr++ = yy_current_state;
1394 return yy_is_jam ? 0 : yy_current_state;
1399 #ifdef YY_USE_PROTOS
1400 static inline void yyunput( int c, register char *yy_bp )
1402 static inline void yyunput( c, yy_bp )
1404 register char *yy_bp;
1407 register char *yy_cp = yy_c_buf_p;
1409 /* undo effects of setting up yytext */
1410 *yy_cp = yy_hold_char;
1412 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1413 { /* need to shift things up to make room */
1414 /* +2 for EOB chars. */
1415 register int number_to_move = yy_n_chars + 2;
1416 register char *dest = &yy_current_buffer->yy_ch_buf[
1417 yy_current_buffer->yy_buf_size + 2];
1418 register char *source =
1419 &yy_current_buffer->yy_ch_buf[number_to_move];
1421 while ( source > yy_current_buffer->yy_ch_buf )
1422 *--dest = *--source;
1424 yy_cp += (int) (dest - source);
1425 yy_bp += (int) (dest - source);
1426 yy_current_buffer->yy_n_chars =
1427 yy_n_chars = yy_current_buffer->yy_buf_size;
1429 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1430 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1433 *--yy_cp = (char) c;
1439 yy_hold_char = *yy_cp;
1442 #endif /* ifndef YY_NO_UNPUT */
1446 static int yyinput()
1453 *yy_c_buf_p = yy_hold_char;
1455 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1457 /* yy_c_buf_p now points to the character we want to return.
1458 * If this occurs *before* the EOB characters, then it's a
1459 * valid NUL; if not, then we've hit the end of the buffer.
1461 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1462 /* This was really a NUL. */
1466 { /* need more input */
1467 int offset = yy_c_buf_p - yytext_ptr;
1470 switch ( yy_get_next_buffer() )
1472 case EOB_ACT_LAST_MATCH:
1473 /* This happens because yy_g_n_b()
1474 * sees that we've accumulated a
1475 * token and flags that we need to
1476 * try matching the token before
1477 * proceeding. But for input(),
1478 * there's no matching to consider.
1479 * So convert the EOB_ACT_LAST_MATCH
1480 * to EOB_ACT_END_OF_FILE.
1483 /* Reset buffer status. */
1488 case EOB_ACT_END_OF_FILE:
1493 if ( ! yy_did_buffer_switch_on_eof )
1502 case EOB_ACT_CONTINUE_SCAN:
1503 yy_c_buf_p = yytext_ptr + offset;
1509 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1510 *yy_c_buf_p = '\0'; /* preserve yytext */
1511 yy_hold_char = *++yy_c_buf_p;
1520 #ifdef YY_USE_PROTOS
1521 void yyrestart( FILE *input_file )
1523 void yyrestart( input_file )
1527 if ( ! yy_current_buffer )
1528 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1530 yy_init_buffer( yy_current_buffer, input_file );
1531 yy_load_buffer_state();
1535 #ifdef YY_USE_PROTOS
1536 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1538 void yy_switch_to_buffer( new_buffer )
1539 YY_BUFFER_STATE new_buffer;
1542 if ( yy_current_buffer == new_buffer )
1545 if ( yy_current_buffer )
1547 /* Flush out information for old buffer. */
1548 *yy_c_buf_p = yy_hold_char;
1549 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1550 yy_current_buffer->yy_n_chars = yy_n_chars;
1553 yy_current_buffer = new_buffer;
1554 yy_load_buffer_state();
1556 /* We don't actually know whether we did this switch during
1557 * EOF (yywrap()) processing, but the only time this flag
1558 * is looked at is after yywrap() is called, so it's safe
1559 * to go ahead and always set it.
1561 yy_did_buffer_switch_on_eof = 1;
1565 #ifdef YY_USE_PROTOS
1566 void yy_load_buffer_state( void )
1568 void yy_load_buffer_state()
1571 yy_n_chars = yy_current_buffer->yy_n_chars;
1572 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1573 yyin = yy_current_buffer->yy_input_file;
1574 yy_hold_char = *yy_c_buf_p;
1578 #ifdef YY_USE_PROTOS
1579 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1581 YY_BUFFER_STATE yy_create_buffer( file, size )
1588 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1590 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1592 b->yy_buf_size = size;
1594 /* yy_ch_buf has to be 2 characters longer than the size given because
1595 * we need to put in 2 end-of-buffer characters.
1597 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1598 if ( ! b->yy_ch_buf )
1599 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1601 b->yy_is_our_buffer = 1;
1603 yy_init_buffer( b, file );
1609 #ifdef YY_USE_PROTOS
1610 void yy_delete_buffer( YY_BUFFER_STATE b )
1612 void yy_delete_buffer( b )
1619 if ( b == yy_current_buffer )
1620 yy_current_buffer = (YY_BUFFER_STATE) 0;
1622 if ( b->yy_is_our_buffer )
1623 yy_flex_free( (void *) b->yy_ch_buf );
1625 yy_flex_free( (void *) b );
1629 #ifndef YY_ALWAYS_INTERACTIVE
1630 #ifndef YY_NEVER_INTERACTIVE
1631 extern int isatty YY_PROTO(( int ));
1635 #ifdef YY_USE_PROTOS
1636 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1638 void yy_init_buffer( b, file )
1645 yy_flush_buffer( b );
1647 b->yy_input_file = file;
1648 b->yy_fill_buffer = 1;
1650 #if YY_ALWAYS_INTERACTIVE
1651 b->yy_is_interactive = 1;
1653 #if YY_NEVER_INTERACTIVE
1654 b->yy_is_interactive = 0;
1656 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1662 #ifdef YY_USE_PROTOS
1663 void yy_flush_buffer( YY_BUFFER_STATE b )
1665 void yy_flush_buffer( b )
1675 /* We always need two end-of-buffer characters. The first causes
1676 * a transition to the end-of-buffer state. The second causes
1677 * a jam in that state.
1679 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1680 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1682 b->yy_buf_pos = &b->yy_ch_buf[0];
1685 b->yy_buffer_status = YY_BUFFER_NEW;
1687 if ( b == yy_current_buffer )
1688 yy_load_buffer_state();
1692 #ifndef YY_NO_SCAN_BUFFER
1693 #ifdef YY_USE_PROTOS
1694 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1696 YY_BUFFER_STATE yy_scan_buffer( base, size )
1704 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1705 base[size-1] != YY_END_OF_BUFFER_CHAR )
1706 /* They forgot to leave room for the EOB's. */
1709 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1711 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1713 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1714 b->yy_buf_pos = b->yy_ch_buf = base;
1715 b->yy_is_our_buffer = 0;
1716 b->yy_input_file = 0;
1717 b->yy_n_chars = b->yy_buf_size;
1718 b->yy_is_interactive = 0;
1720 b->yy_fill_buffer = 0;
1721 b->yy_buffer_status = YY_BUFFER_NEW;
1723 yy_switch_to_buffer( b );
1730 #ifndef YY_NO_SCAN_STRING
1731 #ifdef YY_USE_PROTOS
1732 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1734 YY_BUFFER_STATE yy_scan_string( yy_str )
1735 yyconst char *yy_str;
1739 for ( len = 0; yy_str[len]; ++len )
1742 return yy_scan_bytes( yy_str, len );
1747 #ifndef YY_NO_SCAN_BYTES
1748 #ifdef YY_USE_PROTOS
1749 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1751 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1752 yyconst char *bytes;
1761 /* Get memory for full buffer, including space for trailing EOB's. */
1763 buf = (char *) yy_flex_alloc( n );
1765 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1767 for ( i = 0; i < len; ++i )
1770 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1772 b = yy_scan_buffer( buf, n );
1774 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1776 /* It's okay to grow etc. this buffer, and we should throw it
1777 * away when we're done.
1779 b->yy_is_our_buffer = 1;
1786 #ifndef YY_NO_PUSH_STATE
1787 #ifdef YY_USE_PROTOS
1788 static void yy_push_state( int new_state )
1790 static void yy_push_state( new_state )
1794 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1798 yy_start_stack_depth += YY_START_STACK_INCR;
1799 new_size = yy_start_stack_depth * sizeof( int );
1801 if ( ! yy_start_stack )
1802 yy_start_stack = (int *) yy_flex_alloc( new_size );
1805 yy_start_stack = (int *) yy_flex_realloc(
1806 (void *) yy_start_stack, new_size );
1808 if ( ! yy_start_stack )
1810 "out of memory expanding start-condition stack" );
1813 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1820 #ifndef YY_NO_POP_STATE
1821 static void yy_pop_state()
1823 if ( --yy_start_stack_ptr < 0 )
1824 YY_FATAL_ERROR( "start-condition stack underflow" );
1826 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1831 #ifndef YY_NO_TOP_STATE
1832 static int yy_top_state()
1834 return yy_start_stack[yy_start_stack_ptr - 1];
1838 #ifndef YY_EXIT_FAILURE
1839 #define YY_EXIT_FAILURE 2
1842 #ifdef YY_USE_PROTOS
1843 static void yy_fatal_error( yyconst char msg[] )
1845 static void yy_fatal_error( msg )
1849 (void) fprintf( stderr, "%s\n", msg );
1850 exit( YY_EXIT_FAILURE );
1855 /* Redefine yyless() so it works in section 3 code. */
1861 /* Undo effects of setting up yytext. */ \
1862 yytext[yyleng] = yy_hold_char; \
1863 yy_c_buf_p = yytext + n; \
1864 yy_hold_char = *yy_c_buf_p; \
1865 *yy_c_buf_p = '\0'; \
1871 /* Internal utility routines. */
1874 #ifdef YY_USE_PROTOS
1875 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1877 static void yy_flex_strncpy( s1, s2, n )
1884 for ( i = 0; i < n; ++i )
1889 #ifdef YY_NEED_STRLEN
1890 #ifdef YY_USE_PROTOS
1891 static int yy_flex_strlen( yyconst char *s )
1893 static int yy_flex_strlen( s )
1898 for ( n = 0; s[n]; ++n )
1906 #ifdef YY_USE_PROTOS
1907 static void *yy_flex_alloc( yy_size_t size )
1909 static void *yy_flex_alloc( size )
1913 return (void *) malloc( size );
1916 #ifdef YY_USE_PROTOS
1917 static inline void *yy_flex_realloc( void *ptr, yy_size_t size )
1919 static inline void *yy_flex_realloc( ptr, size )
1924 /* The cast to (char *) in the following accommodates both
1925 * implementations that use char* generic pointers, and those
1926 * that use void* generic pointers. It works with the latter
1927 * because both ANSI C and C++ allow castless assignment from
1928 * any pointer type to void*, and deal with argument conversions
1929 * as though doing an assignment.
1931 return (void *) realloc( (char *) ptr, size );
1934 #ifdef YY_USE_PROTOS
1935 static void yy_flex_free( void *ptr )
1937 static void yy_flex_free( ptr )
1951 #line 231 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"