1 #define yy_create_buffer File_create_buffer
2 #define yy_delete_buffer File_delete_buffer
3 #define yy_scan_buffer File_scan_buffer
4 #define yy_scan_string File_scan_string
5 #define yy_scan_bytes File_scan_bytes
6 #define yy_flex_debug File_flex_debug
7 #define yy_init_buffer File_init_buffer
8 #define yy_flush_buffer File_flush_buffer
9 #define yy_load_buffer_state File_load_buffer_state
10 #define yy_switch_to_buffer File_switch_to_buffer
12 #define yyleng Fileleng
15 #define yyrestart Filerestart
16 #define yytext Filetext
17 #define yylineno Filelineno
18 #define yywrap Filewrap
21 /* A lexical scanner generated by flex */
23 /* Scanner skeleton version:
24 * $Header: /cvs/root/flex/flex/skel.c,v 1.2 2004/05/07 00:28:17 jkh Exp $
28 #define YY_FLEX_MAJOR_VERSION 2
29 #define YY_FLEX_MINOR_VERSION 5
34 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
47 /* Use prototypes in function declarations. */
50 /* The "const" storage-class-modifier is valid. */
53 #else /* ! __cplusplus */
61 #endif /* ! __cplusplus */
80 #define YY_PROTO(proto) proto
82 #define YY_PROTO(proto) ()
85 /* Returned upon end-of-file. */
88 /* Promotes a possibly negative, possibly signed char to an unsigned
89 * integer for use as an array index. If the signed char is negative,
90 * we want to instead treat it as an 8-bit unsigned char, hence the
93 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
95 /* Enter a start condition. This macro really ought to take a parameter,
96 * but we do it the disgusting crufty way forced on us by the ()-less
97 * definition of BEGIN.
99 #define BEGIN yy_start = 1 + 2 *
101 /* Translate the current start state into a value that can be later handed
102 * to BEGIN to return to the state. The YYSTATE alias is for lex
105 #define YY_START ((yy_start - 1) / 2)
106 #define YYSTATE YY_START
108 /* Action number for EOF rule of a given start state. */
109 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
111 /* Special action meaning "start processing a new file". */
112 #define YY_NEW_FILE yyrestart( yyin )
114 #define YY_END_OF_BUFFER_CHAR 0
116 /* Size of default input buffer. */
117 #define YY_BUF_SIZE (16384*64)
119 typedef struct yy_buffer_state *YY_BUFFER_STATE;
122 extern FILE *yyin, *yyout;
124 #define EOB_ACT_CONTINUE_SCAN 0
125 #define EOB_ACT_END_OF_FILE 1
126 #define EOB_ACT_LAST_MATCH 2
128 /* The funky do-while in the following #define is used to turn the definition
129 * int a single C statement (which needs a semi-colon terminator). This
130 * avoids problems with code like:
132 * if ( condition_holds )
135 * do_something_else();
137 * Prior to using the do-while the compiler would get upset at the
138 * "else" because it interpreted the "if" statement as being all
139 * done when it reached the ';' after the yyless() call.
142 /* Return all but the first 'n' matched characters back to the input stream. */
147 /* Undo effects of setting up yytext. */ \
148 *yy_cp = yy_hold_char; \
149 YY_RESTORE_YY_MORE_OFFSET \
150 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
151 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
155 #define unput(c) yyunput( c, yytext_ptr )
157 /* The following is because we cannot portably get our hands on size_t
158 * (without autoconf's help, which isn't available because we want
159 * flex-generated scanners to compile on their own).
161 typedef unsigned int yy_size_t;
164 struct yy_buffer_state
168 char *yy_ch_buf; /* input buffer */
169 char *yy_buf_pos; /* current position in input buffer */
171 /* Size of input buffer in bytes, not including room for EOB
174 yy_size_t yy_buf_size;
176 /* Number of characters read into yy_ch_buf, not including EOB
181 /* Whether we "own" the buffer - i.e., we know we created it,
182 * and can realloc() it to grow it, and should free() it to
185 int yy_is_our_buffer;
187 /* Whether this is an "interactive" input source; if so, and
188 * if we're using stdio for input, then we want to use getc()
189 * instead of fread(), to make sure we stop fetching input after
192 int yy_is_interactive;
194 /* Whether we're considered to be at the beginning of a line.
195 * If so, '^' rules will be active on the next match, otherwise
200 /* Whether to try to fill the input buffer when we reach the
205 int yy_buffer_status;
206 #define YY_BUFFER_NEW 0
207 #define YY_BUFFER_NORMAL 1
208 /* When an EOF's been seen but there's still some text to process
209 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
210 * shouldn't try reading from the input source any more. We might
211 * still have a bunch of tokens to match, though, because of
212 * possible backing-up.
214 * When we actually see the EOF, we change the status to "new"
215 * (via yyrestart()), so that the user can continue scanning by
216 * just pointing yyin at a new input file.
218 #define YY_BUFFER_EOF_PENDING 2
221 static YY_BUFFER_STATE yy_current_buffer = 0;
223 /* We provide macros for accessing buffer states in case in the
224 * future we want to put the buffer states in a more general
227 #define YY_CURRENT_BUFFER yy_current_buffer
230 /* yy_hold_char holds the character lost when yytext is formed. */
231 static char yy_hold_char;
233 static int yy_n_chars; /* number of characters read into yy_ch_buf */
238 /* Points to current character in buffer. */
239 static char *yy_c_buf_p = (char *) 0;
240 static int yy_init = 1; /* whether we need to initialize */
241 static int yy_start = 0; /* start state number */
243 /* Flag which is used to allow yywrap()'s to do buffer switches
244 * instead of setting up a fresh yyin. A bit of a hack ...
246 static int yy_did_buffer_switch_on_eof;
248 void yyrestart YY_PROTO(( FILE *input_file ));
250 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
251 void yy_load_buffer_state YY_PROTO(( void ));
252 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
253 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
254 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
255 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
256 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
258 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
259 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
260 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, 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 35
310 #define YY_END_OF_BUFFER 36
311 static yyconst short int yy_acclist[146] =
313 29, 29, 36, 34, 35, 27, 34, 35, 27, 35,
314 34, 35, 34, 35, 34, 35, 34, 35, 34, 35,
315 26, 34, 35, 26, 34, 35, 23, 34, 35, 34,
316 35, 23, 34, 35, 23, 34, 35, 23, 34, 35,
317 23, 34, 35, 23, 34, 35, 23, 34, 35, 23,
318 34, 35, 23, 34, 35, 29, 35, 30, 35, 32,
319 35, 27, 25, 24, 26, 28, 1, 23, 23, 23,
320 23, 23, 23, 23, 17, 23, 23, 23, 23, 23,
321 29, 30, 30, 33, 32, 31, 32, 24, 1, 26,
322 26, 5, 23, 23, 23, 10, 23, 12, 23, 23,
324 23, 4, 23, 16, 23, 23, 23, 23, 18, 21,
325 19, 20, 3, 6, 23, 23, 9, 23, 13, 23,
326 23, 23, 8, 23, 23, 23, 11, 23, 15, 23,
327 23, 23, 23, 23, 23, 7, 23, 23, 23, 23,
331 static yyconst short int yy_accept[123] =
333 1, 1, 1, 2, 3, 4, 6, 9, 11, 13,
334 15, 17, 19, 21, 24, 27, 30, 32, 35, 38,
335 41, 44, 47, 50, 53, 56, 58, 60, 62, 63,
336 63, 63, 63, 64, 65, 66, 67, 68, 68, 68,
337 69, 69, 70, 71, 72, 73, 74, 75, 77, 78,
338 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
339 88, 88, 88, 88, 89, 90, 91, 92, 92, 92,
340 94, 95, 96, 98, 100, 101, 102, 104, 106, 107,
341 108, 109, 110, 111, 112, 113, 113, 113, 114, 116,
342 117, 119, 121, 122, 123, 125, 126, 127, 127, 129,
344 131, 132, 133, 134, 134, 135, 136, 138, 138, 139,
345 140, 140, 140, 141, 141, 141, 142, 143, 143, 144,
349 static yyconst int yy_ec[256] =
351 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
352 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
353 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
354 1, 2, 5, 6, 1, 7, 1, 1, 1, 1,
355 1, 8, 9, 1, 9, 1, 10, 11, 12, 13,
356 13, 13, 13, 13, 13, 13, 13, 1, 1, 1,
357 1, 1, 1, 1, 14, 14, 14, 14, 14, 14,
358 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
359 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
360 16, 1, 17, 1, 15, 1, 18, 19, 20, 21,
362 22, 23, 24, 25, 26, 15, 15, 27, 28, 29,
363 30, 15, 15, 31, 32, 33, 34, 15, 15, 35,
364 15, 15, 36, 1, 37, 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,
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,
373 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
374 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
375 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
376 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
377 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
381 static yyconst int yy_meta[38] =
383 1, 1, 2, 1, 1, 1, 1, 3, 1, 3,
384 4, 4, 4, 5, 6, 1, 1, 5, 5, 5,
385 5, 5, 5, 6, 6, 6, 6, 6, 6, 6,
389 static yyconst short int yy_base[135] =
391 0, 0, 30, 31, 221, 222, 40, 43, 28, 214,
392 0, 38, 44, 44, 53, 0, 183, 192, 31, 49,
393 191, 187, 46, 181, 181, 0, 65, 66, 78, 183,
394 52, 206, 222, 0, 75, 222, 0, 58, 0, 0,
395 174, 177, 191, 187, 183, 183, 183, 58, 171, 171,
396 175, 170, 0, 82, 85, 222, 86, 222, 89, 171,
397 172, 35, 167, 0, 0, 89, 0, 160, 179, 163,
398 162, 171, 0, 164, 164, 163, 0, 0, 156, 155,
399 161, 222, 222, 222, 222, 166, 148, 222, 0, 152,
400 0, 0, 162, 148, 0, 155, 151, 149, 0, 0,
402 157, 157, 152, 146, 152, 146, 0, 128, 100, 110,
403 89, 102, 74, 65, 83, 52, 222, 53, 222, 0,
404 222, 108, 114, 116, 119, 125, 131, 137, 140, 146,
408 static yyconst short int yy_def[135] =
410 121, 1, 122, 122, 121, 121, 121, 121, 121, 123,
411 124, 121, 121, 121, 121, 125, 121, 125, 125, 125,
412 125, 125, 125, 125, 125, 126, 127, 128, 121, 121,
413 121, 123, 121, 129, 121, 121, 130, 121, 131, 125,
414 132, 125, 125, 125, 125, 125, 125, 125, 125, 125,
415 125, 125, 126, 127, 127, 121, 128, 121, 128, 121,
416 121, 121, 121, 129, 130, 121, 131, 132, 133, 125,
417 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
418 125, 121, 121, 121, 121, 121, 132, 121, 125, 125,
419 125, 125, 125, 125, 125, 125, 125, 121, 125, 125,
421 125, 125, 125, 121, 125, 125, 125, 121, 125, 125,
422 121, 121, 125, 121, 134, 125, 121, 134, 121, 125,
423 0, 121, 121, 121, 121, 121, 121, 121, 121, 121,
427 static yyconst short int yy_nxt[260] =
429 6, 7, 8, 7, 9, 10, 11, 6, 12, 13,
430 14, 15, 15, 16, 16, 17, 6, 16, 18, 19,
431 20, 16, 21, 16, 16, 22, 23, 24, 16, 16,
432 16, 25, 16, 16, 16, 6, 6, 27, 27, 28,
433 28, 29, 29, 29, 29, 29, 29, 30, 35, 35,
434 35, 36, 84, 37, 35, 35, 35, 43, 119, 31,
435 44, 85, 38, 35, 35, 35, 45, 49, 66, 66,
436 46, 50, 55, 58, 56, 59, 61, 76, 39, 29,
437 29, 29, 62, 120, 63, 35, 35, 35, 119, 121,
438 77, 121, 55, 121, 56, 121, 121, 117, 59, 66,
440 66, 112, 112, 112, 112, 116, 114, 115, 26, 26,
441 26, 26, 26, 26, 32, 32, 32, 32, 32, 32,
442 34, 34, 40, 40, 40, 53, 53, 113, 53, 53,
443 53, 54, 54, 54, 54, 54, 54, 57, 57, 57,
444 57, 57, 57, 64, 64, 64, 65, 111, 65, 65,
445 65, 65, 67, 67, 68, 68, 68, 68, 68, 68,
446 87, 87, 87, 87, 87, 87, 118, 118, 118, 118,
447 118, 118, 110, 109, 108, 107, 106, 105, 104, 103,
448 102, 101, 100, 99, 69, 98, 97, 96, 95, 94,
449 93, 92, 91, 90, 89, 88, 69, 86, 83, 82,
451 81, 80, 79, 78, 75, 74, 73, 72, 71, 70,
452 69, 33, 60, 52, 51, 48, 47, 42, 41, 33,
453 121, 5, 121, 121, 121, 121, 121, 121, 121, 121,
454 121, 121, 121, 121, 121, 121, 121, 121, 121, 121,
455 121, 121, 121, 121, 121, 121, 121, 121, 121, 121,
456 121, 121, 121, 121, 121, 121, 121, 121, 121
459 static yyconst short int yy_chk[260] =
461 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
462 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
463 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
464 1, 1, 1, 1, 1, 1, 1, 3, 4, 3,
465 4, 7, 7, 7, 8, 8, 8, 9, 12, 12,
466 12, 13, 62, 13, 14, 14, 14, 19, 118, 9,
467 19, 62, 14, 15, 15, 15, 20, 23, 38, 38,
468 20, 23, 27, 28, 27, 28, 31, 48, 14, 29,
469 29, 29, 31, 116, 31, 35, 35, 35, 115, 54,
470 48, 54, 55, 57, 55, 57, 59, 114, 59, 66,
472 66, 109, 109, 112, 112, 113, 111, 112, 122, 122,
473 122, 122, 122, 122, 123, 123, 123, 123, 123, 123,
474 124, 124, 125, 125, 125, 126, 126, 110, 126, 126,
475 126, 127, 127, 127, 127, 127, 127, 128, 128, 128,
476 128, 128, 128, 129, 129, 129, 130, 108, 130, 130,
477 130, 130, 131, 131, 132, 132, 132, 132, 132, 132,
478 133, 133, 133, 133, 133, 133, 134, 134, 134, 134,
479 134, 134, 106, 105, 104, 103, 102, 101, 98, 97,
480 96, 94, 93, 90, 87, 86, 81, 80, 79, 76,
481 75, 74, 72, 71, 70, 69, 68, 63, 61, 60,
483 52, 51, 50, 49, 47, 46, 45, 44, 43, 42,
484 41, 32, 30, 25, 24, 22, 21, 18, 17, 10,
485 5, 121, 121, 121, 121, 121, 121, 121, 121, 121,
486 121, 121, 121, 121, 121, 121, 121, 121, 121, 121,
487 121, 121, 121, 121, 121, 121, 121, 121, 121, 121,
488 121, 121, 121, 121, 121, 121, 121, 121, 121
491 static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
492 static char *yy_full_match;
496 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
497 yy_cp = yy_full_match; /* restore poss. backed-over text */ \
501 #define yymore() yymore_used_but_not_detected
502 #define YY_MORE_ADJ 0
503 #define YY_RESTORE_YY_MORE_OFFSET
505 #line 1 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
507 /*===-- FileLexer.l - Scanner for TableGen Files ----------------*- C++ -*-===//
509 // The LLVM Compiler Infrastructure
511 // This file was developed by the LLVM research group and is distributed under
512 // the University of Illinois Open Source License. See LICENSE.TXT for details.
514 //===----------------------------------------------------------------------===//
516 // This file defines a simple flex scanner for TableGen files. This is pretty
517 // straight-forward, except for the magic to handle file inclusion.
519 //===----------------------------------------------------------------------===*/
520 #define YY_NEVER_INTERACTIVE 1
523 #line 30 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
524 #include "llvm/Config/config.h"
525 #include "llvm/Support/Streams.h"
527 typedef std::pair<llvm::Record*, std::vector<llvm::Init*>*> SubClassRefTy;
528 #include "FileParser.h"
534 // Global variable recording the location of the include directory
535 std::vector<std::string> IncludeDirectories;
537 /// ParseInt - This has to handle the special case of binary numbers 0b0101
539 static int ParseInt(const char *Str) {
540 if (Str[0] == '0' && Str[1] == 'b')
541 return strtoll(Str+2, 0, 2);
542 return strtoll(Str, 0, 0);
545 static int CommentDepth = 0;
548 std::string Filename;
551 YY_BUFFER_STATE Buffer;
553 IncludeRec(const std::string &FN, FILE *F)
554 : Filename(FN), File(F), LineNo(0){
558 static std::vector<IncludeRec> IncludeStack;
560 std::ostream &err() {
561 if (IncludeStack.empty()) {
562 cerr << "At end of input: ";
563 return *cerr.stream();
566 for (unsigned i = 0, e = IncludeStack.size()-1; i != e; ++i)
567 cerr << "Included from " << IncludeStack[i].Filename << ":"
568 << IncludeStack[i].LineNo << ":\n";
569 cerr << "Parsing " << IncludeStack.back().Filename << ":"
570 << Filelineno << ": ";
571 return *cerr.stream();
574 /// ParseFile - this function begins the parsing of the specified tablegen file.
576 void ParseFile(const std::string &Filename,
577 const std::vector<std::string> &IncludeDirs) {
579 if (Filename != "-") {
580 F = fopen(Filename.c_str(), "r");
583 cerr << "Could not open input file '" + Filename + "'!\n";
586 IncludeStack.push_back(IncludeRec(Filename, F));
588 IncludeStack.push_back(IncludeRec("<stdin>", stdin));
591 // Record the location of the include directory so that the lexer can find
593 IncludeDirectories = IncludeDirs;
601 /// HandleInclude - This function is called when an include directive is
602 /// encountered in the input stream...
604 static void HandleInclude(const char *Buffer) {
605 unsigned Length = yyleng;
606 assert(Buffer[Length-1] == '"');
607 Buffer += strlen("include ");
608 Length -= strlen("include ");
609 while (*Buffer != '"') {
613 assert(Length >= 2 && "Double quotes not found?");
614 std::string Filename(Buffer+1, Buffer+Length-1);
615 //cerr << "Filename = '" << Filename << "'\n";
617 // Save the line number and lex buffer of the includer...
618 IncludeStack.back().LineNo = Filelineno;
619 IncludeStack.back().Buffer = YY_CURRENT_BUFFER;
621 // Open the new input file...
622 yyin = fopen(Filename.c_str(), "r");
624 // If we couldn't find the file in the current directory, look for it in
625 // the include directories.
627 std::string NextFilename;
628 for (unsigned i = 0, e = IncludeDirectories.size(); i != e; ++i) {
629 NextFilename = IncludeDirectories[i] + "/" + Filename;
630 if ((yyin = fopen(NextFilename.c_str(), "r")))
635 err() << "Could not find include file '" << Filename << "'!\n";
638 Filename = NextFilename;
641 // Add the file to our include stack...
642 IncludeStack.push_back(IncludeRec(Filename, yyin));
643 Filelineno = 1; // Reset line numbering...
644 //yyrestart(yyin); // Start lexing the new file...
646 yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
649 /// yywrap - This is called when the lexer runs out of input in one of the
650 /// files. Switch back to an includer if an includee has run out of input.
654 if (IncludeStack.back().File != stdin)
655 fclose(IncludeStack.back().File);
656 IncludeStack.pop_back();
657 if (IncludeStack.empty()) return 1; // Top-level file is done.
659 // Otherwise, we need to switch back to a file which included the current one.
660 Filelineno = IncludeStack.back().LineNo; // Restore current line number
661 yy_switch_to_buffer(IncludeStack.back().Buffer);
665 } // End llvm namespace
667 using namespace llvm;
669 #line 670 "Lexer.cpp"
671 /* Macros after this point can all be overridden by user definitions in
675 #ifndef YY_SKIP_YYWRAP
677 extern "C" int yywrap YY_PROTO(( void ));
679 extern int yywrap YY_PROTO(( void ));
684 static inline void yyunput YY_PROTO(( int c, char *buf_ptr ));
688 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
691 #ifdef YY_NEED_STRLEN
692 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
697 static int yyinput YY_PROTO(( void ));
699 static int input YY_PROTO(( void ));
704 static int yy_start_stack_ptr = 0;
705 static int yy_start_stack_depth = 0;
706 static int *yy_start_stack = 0;
707 #ifndef YY_NO_PUSH_STATE
708 static void yy_push_state YY_PROTO(( int new_state ));
710 #ifndef YY_NO_POP_STATE
711 static void yy_pop_state YY_PROTO(( void ));
713 #ifndef YY_NO_TOP_STATE
714 static int yy_top_state YY_PROTO(( void ));
718 #define YY_NO_PUSH_STATE 1
719 #define YY_NO_POP_STATE 1
720 #define YY_NO_TOP_STATE 1
723 #ifdef YY_MALLOC_DECL
731 /* Just try to get by without declaring the routines. This will fail
732 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
733 * or sizeof(void*) != sizeof(int).
738 /* Amount of stuff to slurp up with each read. */
739 #ifndef YY_READ_BUF_SIZE
740 #define YY_READ_BUF_SIZE 8192
743 /* Copy whatever the last rule matched to the standard output. */
746 /* This used to be an fputs(), but since the string might contain NUL's,
747 * we now use fwrite().
749 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
752 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
753 * is returned in "result".
756 #define YY_INPUT(buf,result,max_size) \
757 if ( yy_current_buffer->yy_is_interactive ) \
760 for ( n = 0; n < max_size && \
761 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
764 buf[n++] = (char) c; \
765 if ( c == EOF && ferror( yyin ) ) \
766 YY_FATAL_ERROR( "input in flex scanner failed" ); \
769 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
770 && ferror( yyin ) ) \
771 YY_FATAL_ERROR( "input in flex scanner failed" );
774 /* No semi-colon after return; correct usage is to write "yyterminate();" -
775 * we don't want an extra ';' after the "return" because that will cause
776 * some compilers to complain about unreachable statements.
779 #define yyterminate() return YY_NULL
782 /* Number of entries by which start-condition stack grows. */
783 #ifndef YY_START_STACK_INCR
784 #define YY_START_STACK_INCR 25
787 /* Report a fatal error. */
788 #ifndef YY_FATAL_ERROR
789 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
792 /* Default declaration of generated scanner - a define so the user can
793 * easily add parameters.
796 #define YY_DECL int yylex YY_PROTO(( void ))
799 /* Code executed at the beginning of each rule, after yytext and yyleng
802 #ifndef YY_USER_ACTION
803 #define YY_USER_ACTION
806 /* Code executed at the end of each rule. */
808 #define YY_BREAK break;
811 #define YY_RULE_SETUP \
816 register yy_state_type yy_current_state;
817 register char *yy_cp, *yy_bp;
820 #line 185 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
823 #line 824 "Lexer.cpp"
834 yy_start = 1; /* first start state */
842 if ( ! yy_current_buffer )
844 yy_create_buffer( yyin, YY_BUF_SIZE );
846 yy_load_buffer_state();
849 while ( 1 ) /* loops until end-of-file is reached */
853 /* Support of yytext. */
854 *yy_cp = yy_hold_char;
856 /* yy_bp points to the position in yy_ch_buf of the start of
861 yy_current_state = yy_start;
862 yy_state_ptr = yy_state_buf;
863 *yy_state_ptr++ = yy_current_state;
867 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
868 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
870 yy_current_state = (int) yy_def[yy_current_state];
871 if ( yy_current_state >= 122 )
872 yy_c = yy_meta[(unsigned int) yy_c];
874 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
875 *yy_state_ptr++ = yy_current_state;
878 while ( yy_current_state != 121 );
881 yy_current_state = *--yy_state_ptr;
882 yy_lp = yy_accept[yy_current_state];
883 find_rule: /* we branch to this label when backing up */
884 for ( ; ; ) /* until we find what rule we matched */
886 if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
888 yy_act = yy_acclist[yy_lp];
890 yy_full_match = yy_cp;
895 yy_current_state = *--yy_state_ptr;
896 yy_lp = yy_accept[yy_current_state];
901 if ( yy_act != YY_END_OF_BUFFER )
904 for ( yyl = 0; yyl < yyleng; ++yyl )
905 if ( yytext[yyl] == '\n' )
909 do_action: /* This label is used only to access EOF actions. */
913 { /* beginning of action switch */
916 #line 187 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
917 { /* Ignore comments */ }
921 #line 189 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
922 { HandleInclude(yytext); }
926 #line 190 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
927 { Filelval.StrVal = new std::string(yytext+2, yytext+yyleng-2);
928 return CODEFRAGMENT; }
932 #line 193 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
937 #line 194 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
942 #line 195 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
947 #line 196 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
952 #line 197 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
957 #line 198 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
962 #line 199 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
967 #line 201 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
972 #line 202 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
977 #line 203 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
982 #line 204 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
983 { return MULTICLASS; }
987 #line 205 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
992 #line 206 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
997 #line 207 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1002 #line 209 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1003 { return CONCATTOK; }
1007 #line 210 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1012 #line 211 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1017 #line 212 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1022 #line 213 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1023 { return STRCONCATTOK; }
1027 #line 216 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1028 { Filelval.StrVal = new std::string(yytext, yytext+yyleng);
1033 #line 218 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1034 { Filelval.StrVal = new std::string(yytext+1, yytext+yyleng);
1039 #line 221 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1040 { Filelval.StrVal = new std::string(yytext+1, yytext+yyleng-1);
1045 #line 224 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1046 { Filelval.IntVal = ParseInt(Filetext); return INTVAL; }
1050 #line 226 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1051 { /* Ignore whitespace */ }
1055 #line 229 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1056 { BEGIN(comment); CommentDepth++; }
1060 #line 230 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1061 {} /* eat anything that's not a '*' or '/' */
1065 #line 231 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1066 {} /* eat up '*'s not followed by '/'s */
1070 #line 232 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1075 #line 233 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1076 {} /* eat up /'s not followed by *'s */
1080 #line 234 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1081 { if (!--CommentDepth) { BEGIN(INITIAL); } }
1083 case YY_STATE_EOF(comment):
1084 #line 235 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1085 { err() << "Unterminated comment!\n"; exit(1); }
1089 #line 237 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1090 { return Filetext[0]; }
1094 #line 239 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
1095 YY_FATAL_ERROR( "flex scanner jammed" );
1097 #line 1098 "Lexer.cpp"
1098 case YY_STATE_EOF(INITIAL):
1101 case YY_END_OF_BUFFER:
1103 /* Amount of text matched not including the EOB char. */
1104 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1106 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1107 *yy_cp = yy_hold_char;
1108 YY_RESTORE_YY_MORE_OFFSET
1110 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1112 /* We're scanning a new file or input source. It's
1113 * possible that this happened because the user
1114 * just pointed yyin at a new source and called
1115 * yylex(). If so, then we have to assure
1116 * consistency between yy_current_buffer and our
1117 * globals. Here is the right place to do so, because
1118 * this is the first action (other than possibly a
1119 * back-up) that will match for the new input source.
1121 yy_n_chars = yy_current_buffer->yy_n_chars;
1122 yy_current_buffer->yy_input_file = yyin;
1123 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1126 /* Note that here we test for yy_c_buf_p "<=" to the position
1127 * of the first EOB in the buffer, since yy_c_buf_p will
1128 * already have been incremented past the NUL character
1129 * (since all states make transitions on EOB to the
1130 * end-of-buffer state). Contrast this with the test
1133 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1134 { /* This was really a NUL. */
1135 yy_state_type yy_next_state;
1137 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1139 yy_current_state = yy_get_previous_state();
1141 /* Okay, we're now positioned to make the NUL
1142 * transition. We couldn't have
1143 * yy_get_previous_state() go ahead and do it
1144 * for us because it doesn't know how to deal
1145 * with the possibility of jamming (and we don't
1146 * want to build jamming into it because then it
1147 * will run more slowly).
1150 yy_next_state = yy_try_NUL_trans( yy_current_state );
1152 yy_bp = yytext_ptr + YY_MORE_ADJ;
1154 if ( yy_next_state )
1156 /* Consume the NUL. */
1157 yy_cp = ++yy_c_buf_p;
1158 yy_current_state = yy_next_state;
1165 goto yy_find_action;
1169 else switch ( yy_get_next_buffer() )
1171 case EOB_ACT_END_OF_FILE:
1173 yy_did_buffer_switch_on_eof = 0;
1177 /* Note: because we've taken care in
1178 * yy_get_next_buffer() to have set up
1179 * yytext, we can now set up
1180 * yy_c_buf_p so that if some total
1181 * hoser (like flex itself) wants to
1182 * call the scanner after we return the
1183 * YY_NULL, it'll still work - another
1184 * YY_NULL will get returned.
1186 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1188 yy_act = YY_STATE_EOF(YY_START);
1194 if ( ! yy_did_buffer_switch_on_eof )
1200 case EOB_ACT_CONTINUE_SCAN:
1202 yytext_ptr + yy_amount_of_matched_text;
1204 yy_current_state = yy_get_previous_state();
1207 yy_bp = yytext_ptr + YY_MORE_ADJ;
1210 case EOB_ACT_LAST_MATCH:
1212 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1214 yy_current_state = yy_get_previous_state();
1217 yy_bp = yytext_ptr + YY_MORE_ADJ;
1218 goto yy_find_action;
1225 "fatal flex scanner internal error--no action found" );
1226 } /* end of action switch */
1227 } /* end of scanning one token */
1228 } /* end of yylex */
1231 /* yy_get_next_buffer - try to read in a new buffer
1233 * Returns a code representing an action:
1234 * EOB_ACT_LAST_MATCH -
1235 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1236 * EOB_ACT_END_OF_FILE - end of file
1239 static int yy_get_next_buffer()
1241 register char *dest = yy_current_buffer->yy_ch_buf;
1242 register char *source = yytext_ptr;
1243 register int number_to_move, i;
1246 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1248 "fatal flex scanner internal error--end of buffer missed" );
1250 if ( yy_current_buffer->yy_fill_buffer == 0 )
1251 { /* Don't try to fill the buffer, so this is an EOF. */
1252 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1254 /* We matched a single character, the EOB, so
1255 * treat this as a final EOF.
1257 return EOB_ACT_END_OF_FILE;
1262 /* We matched some text prior to the EOB, first
1265 return EOB_ACT_LAST_MATCH;
1269 /* Try to read more data. */
1271 /* First move last chars to start of buffer. */
1272 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1274 for ( i = 0; i < number_to_move; ++i )
1275 *(dest++) = *(source++);
1277 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1278 /* don't do the read, it's not guaranteed to return an EOF,
1281 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1286 yy_current_buffer->yy_buf_size - number_to_move - 1;
1288 while ( num_to_read <= 0 )
1289 { /* Not enough room in the buffer - grow it. */
1290 #ifdef YY_USES_REJECT
1292 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1295 /* just a shorter name for the current buffer */
1296 YY_BUFFER_STATE b = yy_current_buffer;
1298 int yy_c_buf_p_offset =
1299 (int) (yy_c_buf_p - b->yy_ch_buf);
1301 if ( b->yy_is_our_buffer )
1303 int new_size = b->yy_buf_size * 2;
1305 if ( new_size <= 0 )
1306 b->yy_buf_size += b->yy_buf_size / 8;
1308 b->yy_buf_size *= 2;
1310 b->yy_ch_buf = (char *)
1311 /* Include room in for 2 EOB chars. */
1312 yy_flex_realloc( (void *) b->yy_ch_buf,
1313 b->yy_buf_size + 2 );
1316 /* Can't grow it, we don't own it. */
1319 if ( ! b->yy_ch_buf )
1321 "fatal error - scanner input buffer overflow" );
1323 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1325 num_to_read = yy_current_buffer->yy_buf_size -
1330 if ( num_to_read > YY_READ_BUF_SIZE )
1331 num_to_read = YY_READ_BUF_SIZE;
1333 /* Read in more data. */
1334 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1335 yy_n_chars, num_to_read );
1337 yy_current_buffer->yy_n_chars = yy_n_chars;
1340 if ( yy_n_chars == 0 )
1342 if ( number_to_move == YY_MORE_ADJ )
1344 ret_val = EOB_ACT_END_OF_FILE;
1350 ret_val = EOB_ACT_LAST_MATCH;
1351 yy_current_buffer->yy_buffer_status =
1352 YY_BUFFER_EOF_PENDING;
1357 ret_val = EOB_ACT_CONTINUE_SCAN;
1359 yy_n_chars += number_to_move;
1360 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1361 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1363 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1369 /* yy_get_previous_state - get the state just before the EOB char was reached */
1371 static yy_state_type yy_get_previous_state()
1373 register yy_state_type yy_current_state;
1374 register char *yy_cp;
1376 yy_current_state = yy_start;
1377 yy_state_ptr = yy_state_buf;
1378 *yy_state_ptr++ = yy_current_state;
1380 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1382 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 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 >= 122 )
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_state_ptr++ = yy_current_state;
1393 return yy_current_state;
1397 /* yy_try_NUL_trans - try to make a transition on the NUL character
1400 * next_state = yy_try_NUL_trans( current_state );
1403 #ifdef YY_USE_PROTOS
1404 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1406 static yy_state_type yy_try_NUL_trans( yy_current_state )
1407 yy_state_type yy_current_state;
1410 register int yy_is_jam;
1412 register YY_CHAR yy_c = 1;
1413 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1415 yy_current_state = (int) yy_def[yy_current_state];
1416 if ( yy_current_state >= 122 )
1417 yy_c = yy_meta[(unsigned int) yy_c];
1419 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1420 yy_is_jam = (yy_current_state == 121);
1422 *yy_state_ptr++ = yy_current_state;
1424 return yy_is_jam ? 0 : yy_current_state;
1429 #ifdef YY_USE_PROTOS
1430 static inline void yyunput( int c, register char *yy_bp )
1432 static inline void yyunput( c, yy_bp )
1434 register char *yy_bp;
1437 register char *yy_cp = yy_c_buf_p;
1439 /* undo effects of setting up yytext */
1440 *yy_cp = yy_hold_char;
1442 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1443 { /* need to shift things up to make room */
1444 /* +2 for EOB chars. */
1445 register int number_to_move = yy_n_chars + 2;
1446 register char *dest = &yy_current_buffer->yy_ch_buf[
1447 yy_current_buffer->yy_buf_size + 2];
1448 register char *source =
1449 &yy_current_buffer->yy_ch_buf[number_to_move];
1451 while ( source > yy_current_buffer->yy_ch_buf )
1452 *--dest = *--source;
1454 yy_cp += (int) (dest - source);
1455 yy_bp += (int) (dest - source);
1456 yy_current_buffer->yy_n_chars =
1457 yy_n_chars = yy_current_buffer->yy_buf_size;
1459 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1460 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1463 *--yy_cp = (char) c;
1469 yy_hold_char = *yy_cp;
1472 #endif /* ifndef YY_NO_UNPUT */
1476 static int yyinput()
1483 *yy_c_buf_p = yy_hold_char;
1485 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1487 /* yy_c_buf_p now points to the character we want to return.
1488 * If this occurs *before* the EOB characters, then it's a
1489 * valid NUL; if not, then we've hit the end of the buffer.
1491 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1492 /* This was really a NUL. */
1496 { /* need more input */
1497 int offset = yy_c_buf_p - yytext_ptr;
1500 switch ( yy_get_next_buffer() )
1502 case EOB_ACT_LAST_MATCH:
1503 /* This happens because yy_g_n_b()
1504 * sees that we've accumulated a
1505 * token and flags that we need to
1506 * try matching the token before
1507 * proceeding. But for input(),
1508 * there's no matching to consider.
1509 * So convert the EOB_ACT_LAST_MATCH
1510 * to EOB_ACT_END_OF_FILE.
1513 /* Reset buffer status. */
1518 case EOB_ACT_END_OF_FILE:
1523 if ( ! yy_did_buffer_switch_on_eof )
1532 case EOB_ACT_CONTINUE_SCAN:
1533 yy_c_buf_p = yytext_ptr + offset;
1539 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1540 *yy_c_buf_p = '\0'; /* preserve yytext */
1541 yy_hold_char = *++yy_c_buf_p;
1550 #ifdef YY_USE_PROTOS
1551 void yyrestart( FILE *input_file )
1553 void yyrestart( input_file )
1557 if ( ! yy_current_buffer )
1558 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1560 yy_init_buffer( yy_current_buffer, input_file );
1561 yy_load_buffer_state();
1565 #ifdef YY_USE_PROTOS
1566 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1568 void yy_switch_to_buffer( new_buffer )
1569 YY_BUFFER_STATE new_buffer;
1572 if ( yy_current_buffer == new_buffer )
1575 if ( yy_current_buffer )
1577 /* Flush out information for old buffer. */
1578 *yy_c_buf_p = yy_hold_char;
1579 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1580 yy_current_buffer->yy_n_chars = yy_n_chars;
1583 yy_current_buffer = new_buffer;
1584 yy_load_buffer_state();
1586 /* We don't actually know whether we did this switch during
1587 * EOF (yywrap()) processing, but the only time this flag
1588 * is looked at is after yywrap() is called, so it's safe
1589 * to go ahead and always set it.
1591 yy_did_buffer_switch_on_eof = 1;
1595 #ifdef YY_USE_PROTOS
1596 void yy_load_buffer_state( void )
1598 void yy_load_buffer_state()
1601 yy_n_chars = yy_current_buffer->yy_n_chars;
1602 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1603 yyin = yy_current_buffer->yy_input_file;
1604 yy_hold_char = *yy_c_buf_p;
1608 #ifdef YY_USE_PROTOS
1609 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1611 YY_BUFFER_STATE yy_create_buffer( file, size )
1618 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1620 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1622 b->yy_buf_size = size;
1624 /* yy_ch_buf has to be 2 characters longer than the size given because
1625 * we need to put in 2 end-of-buffer characters.
1627 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1628 if ( ! b->yy_ch_buf )
1629 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1631 b->yy_is_our_buffer = 1;
1633 yy_init_buffer( b, file );
1639 #ifdef YY_USE_PROTOS
1640 void yy_delete_buffer( YY_BUFFER_STATE b )
1642 void yy_delete_buffer( b )
1649 if ( b == yy_current_buffer )
1650 yy_current_buffer = (YY_BUFFER_STATE) 0;
1652 if ( b->yy_is_our_buffer )
1653 yy_flex_free( (void *) b->yy_ch_buf );
1655 yy_flex_free( (void *) b );
1659 #ifndef YY_ALWAYS_INTERACTIVE
1660 #ifndef YY_NEVER_INTERACTIVE
1661 extern int isatty YY_PROTO(( int ));
1665 #ifdef YY_USE_PROTOS
1666 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1668 void yy_init_buffer( b, file )
1675 yy_flush_buffer( b );
1677 b->yy_input_file = file;
1678 b->yy_fill_buffer = 1;
1680 #if YY_ALWAYS_INTERACTIVE
1681 b->yy_is_interactive = 1;
1683 #if YY_NEVER_INTERACTIVE
1684 b->yy_is_interactive = 0;
1686 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1692 #ifdef YY_USE_PROTOS
1693 void yy_flush_buffer( YY_BUFFER_STATE b )
1695 void yy_flush_buffer( b )
1705 /* We always need two end-of-buffer characters. The first causes
1706 * a transition to the end-of-buffer state. The second causes
1707 * a jam in that state.
1709 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1710 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1712 b->yy_buf_pos = &b->yy_ch_buf[0];
1715 b->yy_buffer_status = YY_BUFFER_NEW;
1717 if ( b == yy_current_buffer )
1718 yy_load_buffer_state();
1722 #ifndef YY_NO_SCAN_BUFFER
1723 #ifdef YY_USE_PROTOS
1724 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1726 YY_BUFFER_STATE yy_scan_buffer( base, size )
1734 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1735 base[size-1] != YY_END_OF_BUFFER_CHAR )
1736 /* They forgot to leave room for the EOB's. */
1739 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1741 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1743 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1744 b->yy_buf_pos = b->yy_ch_buf = base;
1745 b->yy_is_our_buffer = 0;
1746 b->yy_input_file = 0;
1747 b->yy_n_chars = b->yy_buf_size;
1748 b->yy_is_interactive = 0;
1750 b->yy_fill_buffer = 0;
1751 b->yy_buffer_status = YY_BUFFER_NEW;
1753 yy_switch_to_buffer( b );
1760 #ifndef YY_NO_SCAN_STRING
1761 #ifdef YY_USE_PROTOS
1762 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1764 YY_BUFFER_STATE yy_scan_string( yy_str )
1765 yyconst char *yy_str;
1769 for ( len = 0; yy_str[len]; ++len )
1772 return yy_scan_bytes( yy_str, len );
1777 #ifndef YY_NO_SCAN_BYTES
1778 #ifdef YY_USE_PROTOS
1779 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1781 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1782 yyconst char *bytes;
1791 /* Get memory for full buffer, including space for trailing EOB's. */
1793 buf = (char *) yy_flex_alloc( n );
1795 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1797 for ( i = 0; i < len; ++i )
1800 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1802 b = yy_scan_buffer( buf, n );
1804 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1806 /* It's okay to grow etc. this buffer, and we should throw it
1807 * away when we're done.
1809 b->yy_is_our_buffer = 1;
1816 #ifndef YY_NO_PUSH_STATE
1817 #ifdef YY_USE_PROTOS
1818 static void yy_push_state( int new_state )
1820 static void yy_push_state( new_state )
1824 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1828 yy_start_stack_depth += YY_START_STACK_INCR;
1829 new_size = yy_start_stack_depth * sizeof( int );
1831 if ( ! yy_start_stack )
1832 yy_start_stack = (int *) yy_flex_alloc( new_size );
1835 yy_start_stack = (int *) yy_flex_realloc(
1836 (void *) yy_start_stack, new_size );
1838 if ( ! yy_start_stack )
1840 "out of memory expanding start-condition stack" );
1843 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1850 #ifndef YY_NO_POP_STATE
1851 static void yy_pop_state()
1853 if ( --yy_start_stack_ptr < 0 )
1854 YY_FATAL_ERROR( "start-condition stack underflow" );
1856 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1861 #ifndef YY_NO_TOP_STATE
1862 static int yy_top_state()
1864 return yy_start_stack[yy_start_stack_ptr - 1];
1868 #ifndef YY_EXIT_FAILURE
1869 #define YY_EXIT_FAILURE 2
1872 #ifdef YY_USE_PROTOS
1873 static void yy_fatal_error( yyconst char msg[] )
1875 static void yy_fatal_error( msg )
1879 (void) fprintf( stderr, "%s\n", msg );
1880 exit( YY_EXIT_FAILURE );
1885 /* Redefine yyless() so it works in section 3 code. */
1891 /* Undo effects of setting up yytext. */ \
1892 yytext[yyleng] = yy_hold_char; \
1893 yy_c_buf_p = yytext + n; \
1894 yy_hold_char = *yy_c_buf_p; \
1895 *yy_c_buf_p = '\0'; \
1901 /* Internal utility routines. */
1904 #ifdef YY_USE_PROTOS
1905 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1907 static void yy_flex_strncpy( s1, s2, n )
1914 for ( i = 0; i < n; ++i )
1919 #ifdef YY_NEED_STRLEN
1920 #ifdef YY_USE_PROTOS
1921 static int yy_flex_strlen( yyconst char *s )
1923 static int yy_flex_strlen( s )
1928 for ( n = 0; s[n]; ++n )
1936 #ifdef YY_USE_PROTOS
1937 static void *yy_flex_alloc( yy_size_t size )
1939 static void *yy_flex_alloc( size )
1943 return (void *) malloc( size );
1946 #ifdef YY_USE_PROTOS
1947 static inline void *yy_flex_realloc( void *ptr, yy_size_t size )
1949 static inline void *yy_flex_realloc( ptr, size )
1954 /* The cast to (char *) in the following accommodates both
1955 * implementations that use char* generic pointers, and those
1956 * that use void* generic pointers. It works with the latter
1957 * because both ANSI C and C++ allow castless assignment from
1958 * any pointer type to void*, and deal with argument conversions
1959 * as though doing an assignment.
1961 return (void *) realloc( (char *) ptr, size );
1964 #ifdef YY_USE_PROTOS
1965 static void yy_flex_free( void *ptr )
1967 static void yy_flex_free( ptr )
1981 #line 239 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"