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 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 "/Volumes/ProjectsDisk/cvs/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 "/Volumes/ProjectsDisk/cvs/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::vector<std::string> IncludeDirectories;
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,
559 const std::vector<std::string> &IncludeDirs) {
561 if (Filename != "-") {
562 F = fopen(Filename.c_str(), "r");
565 std::cerr << "Could not open input file '" + Filename + "'!\n";
568 IncludeStack.push_back(IncludeRec(Filename, F));
570 IncludeStack.push_back(IncludeRec("<stdin>", stdin));
573 // Record the location of the include directory so that the lexer can find
575 IncludeDirectories = IncludeDirs;
583 /// HandleInclude - This function is called when an include directive is
584 /// encountered in the input stream...
586 static void HandleInclude(const char *Buffer) {
587 unsigned Length = yyleng;
588 assert(Buffer[Length-1] == '"');
589 Buffer += strlen("include ");
590 Length -= strlen("include ");
591 while (*Buffer != '"') {
595 assert(Length >= 2 && "Double quotes not found?");
596 std::string Filename(Buffer+1, Buffer+Length-1);
597 //std::cerr << "Filename = '" << Filename << "'\n";
599 // Save the line number and lex buffer of the includer...
600 IncludeStack.back().LineNo = Filelineno;
601 IncludeStack.back().Buffer = YY_CURRENT_BUFFER;
603 // Open the new input file...
604 yyin = fopen(Filename.c_str(), "r");
606 // If we couldn't find the file in the current directory, look for it in
607 // the include directories.
609 std::string NextFilename;
610 for (unsigned i = 0, e = IncludeDirectories.size(); i != e; ++i) {
611 NextFilename = IncludeDirectories[i] + "/" + Filename;
612 if ((yyin = fopen(NextFilename.c_str(), "r")))
617 err() << "Could not find include file '" << Filename << "'!\n";
620 Filename = NextFilename;
623 // Add the file to our include stack...
624 IncludeStack.push_back(IncludeRec(Filename, yyin));
625 Filelineno = 1; // Reset line numbering...
626 //yyrestart(yyin); // Start lexing the new file...
628 yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
631 /// yywrap - This is called when the lexer runs out of input in one of the
632 /// files. Switch back to an includer if an includee has run out of input.
636 if (IncludeStack.back().File != stdin)
637 fclose(IncludeStack.back().File);
638 IncludeStack.pop_back();
639 if (IncludeStack.empty()) return 1; // Top-level file is done.
641 // Otherwise, we need to switch back to a file which included the current one.
642 Filelineno = IncludeStack.back().LineNo; // Restore current line number
643 yy_switch_to_buffer(IncludeStack.back().Buffer);
647 } // End llvm namespace
649 using namespace llvm;
651 #line 652 "Lexer.cpp"
653 /* Macros after this point can all be overridden by user definitions in
657 #ifndef YY_SKIP_YYWRAP
659 extern "C" int yywrap YY_PROTO(( void ));
661 extern int yywrap YY_PROTO(( void ));
666 static inline void yyunput YY_PROTO(( int c, char *buf_ptr ));
670 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
673 #ifdef YY_NEED_STRLEN
674 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
679 static int yyinput YY_PROTO(( void ));
681 static int input YY_PROTO(( void ));
686 static int yy_start_stack_ptr = 0;
687 static int yy_start_stack_depth = 0;
688 static int *yy_start_stack = 0;
689 #ifndef YY_NO_PUSH_STATE
690 static void yy_push_state YY_PROTO(( int new_state ));
692 #ifndef YY_NO_POP_STATE
693 static void yy_pop_state YY_PROTO(( void ));
695 #ifndef YY_NO_TOP_STATE
696 static int yy_top_state YY_PROTO(( void ));
700 #define YY_NO_PUSH_STATE 1
701 #define YY_NO_POP_STATE 1
702 #define YY_NO_TOP_STATE 1
705 #ifdef YY_MALLOC_DECL
713 /* Just try to get by without declaring the routines. This will fail
714 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
715 * or sizeof(void*) != sizeof(int).
720 /* Amount of stuff to slurp up with each read. */
721 #ifndef YY_READ_BUF_SIZE
722 #define YY_READ_BUF_SIZE 8192
725 /* Copy whatever the last rule matched to the standard output. */
728 /* This used to be an fputs(), but since the string might contain NUL's,
729 * we now use fwrite().
731 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
734 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
735 * is returned in "result".
738 #define YY_INPUT(buf,result,max_size) \
739 if ( yy_current_buffer->yy_is_interactive ) \
742 for ( n = 0; n < max_size && \
743 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
746 buf[n++] = (char) c; \
747 if ( c == EOF && ferror( yyin ) ) \
748 YY_FATAL_ERROR( "input in flex scanner failed" ); \
751 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
752 && ferror( yyin ) ) \
753 YY_FATAL_ERROR( "input in flex scanner failed" );
756 /* No semi-colon after return; correct usage is to write "yyterminate();" -
757 * we don't want an extra ';' after the "return" because that will cause
758 * some compilers to complain about unreachable statements.
761 #define yyterminate() return YY_NULL
764 /* Number of entries by which start-condition stack grows. */
765 #ifndef YY_START_STACK_INCR
766 #define YY_START_STACK_INCR 25
769 /* Report a fatal error. */
770 #ifndef YY_FATAL_ERROR
771 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
774 /* Default declaration of generated scanner - a define so the user can
775 * easily add parameters.
778 #define YY_DECL int yylex YY_PROTO(( void ))
781 /* Code executed at the beginning of each rule, after yytext and yyleng
784 #ifndef YY_USER_ACTION
785 #define YY_USER_ACTION
788 /* Code executed at the end of each rule. */
790 #define YY_BREAK break;
793 #define YY_RULE_SETUP \
798 register yy_state_type yy_current_state;
799 register char *yy_cp, *yy_bp;
802 #line 180 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
805 #line 806 "Lexer.cpp"
816 yy_start = 1; /* first start state */
824 if ( ! yy_current_buffer )
826 yy_create_buffer( yyin, YY_BUF_SIZE );
828 yy_load_buffer_state();
831 while ( 1 ) /* loops until end-of-file is reached */
835 /* Support of yytext. */
836 *yy_cp = yy_hold_char;
838 /* yy_bp points to the position in yy_ch_buf of the start of
843 yy_current_state = yy_start;
844 yy_state_ptr = yy_state_buf;
845 *yy_state_ptr++ = yy_current_state;
849 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
850 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
852 yy_current_state = (int) yy_def[yy_current_state];
853 if ( yy_current_state >= 100 )
854 yy_c = yy_meta[(unsigned int) yy_c];
856 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
857 *yy_state_ptr++ = yy_current_state;
860 while ( yy_current_state != 99 );
863 yy_current_state = *--yy_state_ptr;
864 yy_lp = yy_accept[yy_current_state];
865 find_rule: /* we branch to this label when backing up */
866 for ( ; ; ) /* until we find what rule we matched */
868 if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
870 yy_act = yy_acclist[yy_lp];
872 yy_full_match = yy_cp;
877 yy_current_state = *--yy_state_ptr;
878 yy_lp = yy_accept[yy_current_state];
883 if ( yy_act != YY_END_OF_BUFFER )
886 for ( yyl = 0; yyl < yyleng; ++yyl )
887 if ( yytext[yyl] == '\n' )
891 do_action: /* This label is used only to access EOF actions. */
895 { /* beginning of action switch */
898 #line 182 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
899 { /* Ignore comments */ }
903 #line 184 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
904 { HandleInclude(yytext); }
908 #line 185 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
909 { Filelval.StrVal = new std::string(yytext+2, yytext+yyleng-2);
910 return CODEFRAGMENT; }
914 #line 188 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
919 #line 189 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
924 #line 190 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
929 #line 191 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
934 #line 192 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
939 #line 193 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
944 #line 194 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
949 #line 196 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
954 #line 197 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
959 #line 198 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
964 #line 199 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
969 #line 200 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
974 #line 202 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
979 #line 203 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
984 #line 204 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
989 #line 207 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
990 { Filelval.StrVal = new std::string(yytext, yytext+yyleng);
995 #line 209 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
996 { Filelval.StrVal = new std::string(yytext+1, yytext+yyleng);
1001 #line 212 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1002 { Filelval.StrVal = new std::string(yytext+1, yytext+yyleng-1);
1007 #line 215 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1008 { Filelval.IntVal = ParseInt(Filetext); return INTVAL; }
1012 #line 217 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1013 { /* Ignore whitespace */ }
1017 #line 220 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1018 { BEGIN(comment); CommentDepth++; }
1022 #line 221 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1023 {} /* eat anything that's not a '*' or '/' */
1027 #line 222 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1028 {} /* eat up '*'s not followed by '/'s */
1032 #line 223 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1037 #line 224 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1038 {} /* eat up /'s not followed by *'s */
1042 #line 225 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1043 { if (!--CommentDepth) { BEGIN(INITIAL); } }
1045 case YY_STATE_EOF(comment):
1046 #line 226 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1047 { err() << "Unterminated comment!\n"; exit(1); }
1051 #line 228 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1052 { return Filetext[0]; }
1056 #line 230 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1057 YY_FATAL_ERROR( "flex scanner jammed" );
1059 #line 1060 "Lexer.cpp"
1060 case YY_STATE_EOF(INITIAL):
1063 case YY_END_OF_BUFFER:
1065 /* Amount of text matched not including the EOB char. */
1066 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1068 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1069 *yy_cp = yy_hold_char;
1070 YY_RESTORE_YY_MORE_OFFSET
1072 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1074 /* We're scanning a new file or input source. It's
1075 * possible that this happened because the user
1076 * just pointed yyin at a new source and called
1077 * yylex(). If so, then we have to assure
1078 * consistency between yy_current_buffer and our
1079 * globals. Here is the right place to do so, because
1080 * this is the first action (other than possibly a
1081 * back-up) that will match for the new input source.
1083 yy_n_chars = yy_current_buffer->yy_n_chars;
1084 yy_current_buffer->yy_input_file = yyin;
1085 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1088 /* Note that here we test for yy_c_buf_p "<=" to the position
1089 * of the first EOB in the buffer, since yy_c_buf_p will
1090 * already have been incremented past the NUL character
1091 * (since all states make transitions on EOB to the
1092 * end-of-buffer state). Contrast this with the test
1095 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1096 { /* This was really a NUL. */
1097 yy_state_type yy_next_state;
1099 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1101 yy_current_state = yy_get_previous_state();
1103 /* Okay, we're now positioned to make the NUL
1104 * transition. We couldn't have
1105 * yy_get_previous_state() go ahead and do it
1106 * for us because it doesn't know how to deal
1107 * with the possibility of jamming (and we don't
1108 * want to build jamming into it because then it
1109 * will run more slowly).
1112 yy_next_state = yy_try_NUL_trans( yy_current_state );
1114 yy_bp = yytext_ptr + YY_MORE_ADJ;
1116 if ( yy_next_state )
1118 /* Consume the NUL. */
1119 yy_cp = ++yy_c_buf_p;
1120 yy_current_state = yy_next_state;
1127 goto yy_find_action;
1131 else switch ( yy_get_next_buffer() )
1133 case EOB_ACT_END_OF_FILE:
1135 yy_did_buffer_switch_on_eof = 0;
1139 /* Note: because we've taken care in
1140 * yy_get_next_buffer() to have set up
1141 * yytext, we can now set up
1142 * yy_c_buf_p so that if some total
1143 * hoser (like flex itself) wants to
1144 * call the scanner after we return the
1145 * YY_NULL, it'll still work - another
1146 * YY_NULL will get returned.
1148 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1150 yy_act = YY_STATE_EOF(YY_START);
1156 if ( ! yy_did_buffer_switch_on_eof )
1162 case EOB_ACT_CONTINUE_SCAN:
1164 yytext_ptr + yy_amount_of_matched_text;
1166 yy_current_state = yy_get_previous_state();
1169 yy_bp = yytext_ptr + YY_MORE_ADJ;
1172 case EOB_ACT_LAST_MATCH:
1174 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1176 yy_current_state = yy_get_previous_state();
1179 yy_bp = yytext_ptr + YY_MORE_ADJ;
1180 goto yy_find_action;
1187 "fatal flex scanner internal error--no action found" );
1188 } /* end of action switch */
1189 } /* end of scanning one token */
1190 } /* end of yylex */
1193 /* yy_get_next_buffer - try to read in a new buffer
1195 * Returns a code representing an action:
1196 * EOB_ACT_LAST_MATCH -
1197 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1198 * EOB_ACT_END_OF_FILE - end of file
1201 static int yy_get_next_buffer()
1203 register char *dest = yy_current_buffer->yy_ch_buf;
1204 register char *source = yytext_ptr;
1205 register int number_to_move, i;
1208 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1210 "fatal flex scanner internal error--end of buffer missed" );
1212 if ( yy_current_buffer->yy_fill_buffer == 0 )
1213 { /* Don't try to fill the buffer, so this is an EOF. */
1214 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1216 /* We matched a single character, the EOB, so
1217 * treat this as a final EOF.
1219 return EOB_ACT_END_OF_FILE;
1224 /* We matched some text prior to the EOB, first
1227 return EOB_ACT_LAST_MATCH;
1231 /* Try to read more data. */
1233 /* First move last chars to start of buffer. */
1234 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1236 for ( i = 0; i < number_to_move; ++i )
1237 *(dest++) = *(source++);
1239 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1240 /* don't do the read, it's not guaranteed to return an EOF,
1243 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1248 yy_current_buffer->yy_buf_size - number_to_move - 1;
1250 while ( num_to_read <= 0 )
1251 { /* Not enough room in the buffer - grow it. */
1252 #ifdef YY_USES_REJECT
1254 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1257 /* just a shorter name for the current buffer */
1258 YY_BUFFER_STATE b = yy_current_buffer;
1260 int yy_c_buf_p_offset =
1261 (int) (yy_c_buf_p - b->yy_ch_buf);
1263 if ( b->yy_is_our_buffer )
1265 int new_size = b->yy_buf_size * 2;
1267 if ( new_size <= 0 )
1268 b->yy_buf_size += b->yy_buf_size / 8;
1270 b->yy_buf_size *= 2;
1272 b->yy_ch_buf = (char *)
1273 /* Include room in for 2 EOB chars. */
1274 yy_flex_realloc( (void *) b->yy_ch_buf,
1275 b->yy_buf_size + 2 );
1278 /* Can't grow it, we don't own it. */
1281 if ( ! b->yy_ch_buf )
1283 "fatal error - scanner input buffer overflow" );
1285 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1287 num_to_read = yy_current_buffer->yy_buf_size -
1292 if ( num_to_read > YY_READ_BUF_SIZE )
1293 num_to_read = YY_READ_BUF_SIZE;
1295 /* Read in more data. */
1296 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1297 yy_n_chars, num_to_read );
1299 yy_current_buffer->yy_n_chars = yy_n_chars;
1302 if ( yy_n_chars == 0 )
1304 if ( number_to_move == YY_MORE_ADJ )
1306 ret_val = EOB_ACT_END_OF_FILE;
1312 ret_val = EOB_ACT_LAST_MATCH;
1313 yy_current_buffer->yy_buffer_status =
1314 YY_BUFFER_EOF_PENDING;
1319 ret_val = EOB_ACT_CONTINUE_SCAN;
1321 yy_n_chars += number_to_move;
1322 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1323 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1325 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1331 /* yy_get_previous_state - get the state just before the EOB char was reached */
1333 static yy_state_type yy_get_previous_state()
1335 register yy_state_type yy_current_state;
1336 register char *yy_cp;
1338 yy_current_state = yy_start;
1339 yy_state_ptr = yy_state_buf;
1340 *yy_state_ptr++ = yy_current_state;
1342 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1344 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1345 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1347 yy_current_state = (int) yy_def[yy_current_state];
1348 if ( yy_current_state >= 100 )
1349 yy_c = yy_meta[(unsigned int) yy_c];
1351 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1352 *yy_state_ptr++ = yy_current_state;
1355 return yy_current_state;
1359 /* yy_try_NUL_trans - try to make a transition on the NUL character
1362 * next_state = yy_try_NUL_trans( current_state );
1365 #ifdef YY_USE_PROTOS
1366 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1368 static yy_state_type yy_try_NUL_trans( yy_current_state )
1369 yy_state_type yy_current_state;
1372 register int yy_is_jam;
1374 register YY_CHAR yy_c = 1;
1375 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1377 yy_current_state = (int) yy_def[yy_current_state];
1378 if ( yy_current_state >= 100 )
1379 yy_c = yy_meta[(unsigned int) yy_c];
1381 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1382 yy_is_jam = (yy_current_state == 99);
1384 *yy_state_ptr++ = yy_current_state;
1386 return yy_is_jam ? 0 : yy_current_state;
1391 #ifdef YY_USE_PROTOS
1392 static inline void yyunput( int c, register char *yy_bp )
1394 static inline void yyunput( c, yy_bp )
1396 register char *yy_bp;
1399 register char *yy_cp = yy_c_buf_p;
1401 /* undo effects of setting up yytext */
1402 *yy_cp = yy_hold_char;
1404 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1405 { /* need to shift things up to make room */
1406 /* +2 for EOB chars. */
1407 register int number_to_move = yy_n_chars + 2;
1408 register char *dest = &yy_current_buffer->yy_ch_buf[
1409 yy_current_buffer->yy_buf_size + 2];
1410 register char *source =
1411 &yy_current_buffer->yy_ch_buf[number_to_move];
1413 while ( source > yy_current_buffer->yy_ch_buf )
1414 *--dest = *--source;
1416 yy_cp += (int) (dest - source);
1417 yy_bp += (int) (dest - source);
1418 yy_current_buffer->yy_n_chars =
1419 yy_n_chars = yy_current_buffer->yy_buf_size;
1421 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1422 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1425 *--yy_cp = (char) c;
1431 yy_hold_char = *yy_cp;
1434 #endif /* ifndef YY_NO_UNPUT */
1438 static int yyinput()
1445 *yy_c_buf_p = yy_hold_char;
1447 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1449 /* yy_c_buf_p now points to the character we want to return.
1450 * If this occurs *before* the EOB characters, then it's a
1451 * valid NUL; if not, then we've hit the end of the buffer.
1453 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1454 /* This was really a NUL. */
1458 { /* need more input */
1459 int offset = yy_c_buf_p - yytext_ptr;
1462 switch ( yy_get_next_buffer() )
1464 case EOB_ACT_LAST_MATCH:
1465 /* This happens because yy_g_n_b()
1466 * sees that we've accumulated a
1467 * token and flags that we need to
1468 * try matching the token before
1469 * proceeding. But for input(),
1470 * there's no matching to consider.
1471 * So convert the EOB_ACT_LAST_MATCH
1472 * to EOB_ACT_END_OF_FILE.
1475 /* Reset buffer status. */
1480 case EOB_ACT_END_OF_FILE:
1485 if ( ! yy_did_buffer_switch_on_eof )
1494 case EOB_ACT_CONTINUE_SCAN:
1495 yy_c_buf_p = yytext_ptr + offset;
1501 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1502 *yy_c_buf_p = '\0'; /* preserve yytext */
1503 yy_hold_char = *++yy_c_buf_p;
1512 #ifdef YY_USE_PROTOS
1513 void yyrestart( FILE *input_file )
1515 void yyrestart( input_file )
1519 if ( ! yy_current_buffer )
1520 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1522 yy_init_buffer( yy_current_buffer, input_file );
1523 yy_load_buffer_state();
1527 #ifdef YY_USE_PROTOS
1528 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1530 void yy_switch_to_buffer( new_buffer )
1531 YY_BUFFER_STATE new_buffer;
1534 if ( yy_current_buffer == new_buffer )
1537 if ( yy_current_buffer )
1539 /* Flush out information for old buffer. */
1540 *yy_c_buf_p = yy_hold_char;
1541 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1542 yy_current_buffer->yy_n_chars = yy_n_chars;
1545 yy_current_buffer = new_buffer;
1546 yy_load_buffer_state();
1548 /* We don't actually know whether we did this switch during
1549 * EOF (yywrap()) processing, but the only time this flag
1550 * is looked at is after yywrap() is called, so it's safe
1551 * to go ahead and always set it.
1553 yy_did_buffer_switch_on_eof = 1;
1557 #ifdef YY_USE_PROTOS
1558 void yy_load_buffer_state( void )
1560 void yy_load_buffer_state()
1563 yy_n_chars = yy_current_buffer->yy_n_chars;
1564 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1565 yyin = yy_current_buffer->yy_input_file;
1566 yy_hold_char = *yy_c_buf_p;
1570 #ifdef YY_USE_PROTOS
1571 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1573 YY_BUFFER_STATE yy_create_buffer( file, size )
1580 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1582 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1584 b->yy_buf_size = size;
1586 /* yy_ch_buf has to be 2 characters longer than the size given because
1587 * we need to put in 2 end-of-buffer characters.
1589 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1590 if ( ! b->yy_ch_buf )
1591 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1593 b->yy_is_our_buffer = 1;
1595 yy_init_buffer( b, file );
1601 #ifdef YY_USE_PROTOS
1602 void yy_delete_buffer( YY_BUFFER_STATE b )
1604 void yy_delete_buffer( b )
1611 if ( b == yy_current_buffer )
1612 yy_current_buffer = (YY_BUFFER_STATE) 0;
1614 if ( b->yy_is_our_buffer )
1615 yy_flex_free( (void *) b->yy_ch_buf );
1617 yy_flex_free( (void *) b );
1621 #ifndef YY_ALWAYS_INTERACTIVE
1622 #ifndef YY_NEVER_INTERACTIVE
1623 extern int isatty YY_PROTO(( int ));
1627 #ifdef YY_USE_PROTOS
1628 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1630 void yy_init_buffer( b, file )
1637 yy_flush_buffer( b );
1639 b->yy_input_file = file;
1640 b->yy_fill_buffer = 1;
1642 #if YY_ALWAYS_INTERACTIVE
1643 b->yy_is_interactive = 1;
1645 #if YY_NEVER_INTERACTIVE
1646 b->yy_is_interactive = 0;
1648 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1654 #ifdef YY_USE_PROTOS
1655 void yy_flush_buffer( YY_BUFFER_STATE b )
1657 void yy_flush_buffer( b )
1667 /* We always need two end-of-buffer characters. The first causes
1668 * a transition to the end-of-buffer state. The second causes
1669 * a jam in that state.
1671 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1672 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1674 b->yy_buf_pos = &b->yy_ch_buf[0];
1677 b->yy_buffer_status = YY_BUFFER_NEW;
1679 if ( b == yy_current_buffer )
1680 yy_load_buffer_state();
1684 #ifndef YY_NO_SCAN_BUFFER
1685 #ifdef YY_USE_PROTOS
1686 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1688 YY_BUFFER_STATE yy_scan_buffer( base, size )
1696 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1697 base[size-1] != YY_END_OF_BUFFER_CHAR )
1698 /* They forgot to leave room for the EOB's. */
1701 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1703 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1705 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1706 b->yy_buf_pos = b->yy_ch_buf = base;
1707 b->yy_is_our_buffer = 0;
1708 b->yy_input_file = 0;
1709 b->yy_n_chars = b->yy_buf_size;
1710 b->yy_is_interactive = 0;
1712 b->yy_fill_buffer = 0;
1713 b->yy_buffer_status = YY_BUFFER_NEW;
1715 yy_switch_to_buffer( b );
1722 #ifndef YY_NO_SCAN_STRING
1723 #ifdef YY_USE_PROTOS
1724 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1726 YY_BUFFER_STATE yy_scan_string( yy_str )
1727 yyconst char *yy_str;
1731 for ( len = 0; yy_str[len]; ++len )
1734 return yy_scan_bytes( yy_str, len );
1739 #ifndef YY_NO_SCAN_BYTES
1740 #ifdef YY_USE_PROTOS
1741 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1743 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1744 yyconst char *bytes;
1753 /* Get memory for full buffer, including space for trailing EOB's. */
1755 buf = (char *) yy_flex_alloc( n );
1757 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1759 for ( i = 0; i < len; ++i )
1762 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1764 b = yy_scan_buffer( buf, n );
1766 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1768 /* It's okay to grow etc. this buffer, and we should throw it
1769 * away when we're done.
1771 b->yy_is_our_buffer = 1;
1778 #ifndef YY_NO_PUSH_STATE
1779 #ifdef YY_USE_PROTOS
1780 static void yy_push_state( int new_state )
1782 static void yy_push_state( new_state )
1786 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1790 yy_start_stack_depth += YY_START_STACK_INCR;
1791 new_size = yy_start_stack_depth * sizeof( int );
1793 if ( ! yy_start_stack )
1794 yy_start_stack = (int *) yy_flex_alloc( new_size );
1797 yy_start_stack = (int *) yy_flex_realloc(
1798 (void *) yy_start_stack, new_size );
1800 if ( ! yy_start_stack )
1802 "out of memory expanding start-condition stack" );
1805 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1812 #ifndef YY_NO_POP_STATE
1813 static void yy_pop_state()
1815 if ( --yy_start_stack_ptr < 0 )
1816 YY_FATAL_ERROR( "start-condition stack underflow" );
1818 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1823 #ifndef YY_NO_TOP_STATE
1824 static int yy_top_state()
1826 return yy_start_stack[yy_start_stack_ptr - 1];
1830 #ifndef YY_EXIT_FAILURE
1831 #define YY_EXIT_FAILURE 2
1834 #ifdef YY_USE_PROTOS
1835 static void yy_fatal_error( yyconst char msg[] )
1837 static void yy_fatal_error( msg )
1841 (void) fprintf( stderr, "%s\n", msg );
1842 exit( YY_EXIT_FAILURE );
1847 /* Redefine yyless() so it works in section 3 code. */
1853 /* Undo effects of setting up yytext. */ \
1854 yytext[yyleng] = yy_hold_char; \
1855 yy_c_buf_p = yytext + n; \
1856 yy_hold_char = *yy_c_buf_p; \
1857 *yy_c_buf_p = '\0'; \
1863 /* Internal utility routines. */
1866 #ifdef YY_USE_PROTOS
1867 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1869 static void yy_flex_strncpy( s1, s2, n )
1876 for ( i = 0; i < n; ++i )
1881 #ifdef YY_NEED_STRLEN
1882 #ifdef YY_USE_PROTOS
1883 static int yy_flex_strlen( yyconst char *s )
1885 static int yy_flex_strlen( s )
1890 for ( n = 0; s[n]; ++n )
1898 #ifdef YY_USE_PROTOS
1899 static void *yy_flex_alloc( yy_size_t size )
1901 static void *yy_flex_alloc( size )
1905 return (void *) malloc( size );
1908 #ifdef YY_USE_PROTOS
1909 static inline void *yy_flex_realloc( void *ptr, yy_size_t size )
1911 static inline void *yy_flex_realloc( ptr, size )
1916 /* The cast to (char *) in the following accommodates both
1917 * implementations that use char* generic pointers, and those
1918 * that use void* generic pointers. It works with the latter
1919 * because both ANSI C and C++ allow castless assignment from
1920 * any pointer type to void*, and deal with argument conversions
1921 * as though doing an assignment.
1923 return (void *) realloc( (char *) ptr, size );
1926 #ifdef YY_USE_PROTOS
1927 static void yy_flex_free( void *ptr )
1929 static void yy_flex_free( ptr )
1943 #line 230 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"