blob: e017fa319a283aec05dea0c973eb393a5bcdfab9 [file] [log] [blame]
Reid Spencer68a24bd2005-08-27 18:50:39 +00001#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
11#define yyin Filein
12#define yyleng Fileleng
13#define yylex Filelex
14#define yyout Fileout
15#define yyrestart Filerestart
16#define yytext Filetext
17#define yylineno Filelineno
18#define yywrap Filewrap
19
20#line 21 "Lexer.cpp"
21/* A lexical scanner generated by flex */
22
23/* Scanner skeleton version:
24 * $Header$
25 */
26
27#define FLEX_SCANNER
28#define YY_FLEX_MAJOR_VERSION 2
29#define YY_FLEX_MINOR_VERSION 5
30
31#include <stdio.h>
Reid Spencer68a24bd2005-08-27 18:50:39 +000032
33
34/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
35#ifdef c_plusplus
36#ifndef __cplusplus
37#define __cplusplus
38#endif
39#endif
40
41
42#ifdef __cplusplus
43
44#include <stdlib.h>
Chris Lattnere8242b12006-02-14 05:13:13 +000045#include <unistd.h>
Reid Spencer68a24bd2005-08-27 18:50:39 +000046
47/* Use prototypes in function declarations. */
48#define YY_USE_PROTOS
49
50/* The "const" storage-class-modifier is valid. */
51#define YY_USE_CONST
52
53#else /* ! __cplusplus */
54
55#if __STDC__
56
57#define YY_USE_PROTOS
58#define YY_USE_CONST
59
60#endif /* __STDC__ */
61#endif /* ! __cplusplus */
62
63#ifdef __TURBOC__
64 #pragma warn -rch
65 #pragma warn -use
66#include <io.h>
67#include <stdlib.h>
68#define YY_USE_CONST
69#define YY_USE_PROTOS
70#endif
71
72#ifdef YY_USE_CONST
73#define yyconst const
74#else
75#define yyconst
76#endif
77
78
79#ifdef YY_USE_PROTOS
80#define YY_PROTO(proto) proto
81#else
82#define YY_PROTO(proto) ()
83#endif
84
85/* Returned upon end-of-file. */
86#define YY_NULL 0
87
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
91 * double cast.
92 */
93#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
94
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.
98 */
99#define BEGIN yy_start = 1 + 2 *
100
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
103 * compatibility.
104 */
105#define YY_START ((yy_start - 1) / 2)
106#define YYSTATE YY_START
107
108/* Action number for EOF rule of a given start state. */
109#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
110
111/* Special action meaning "start processing a new file". */
112#define YY_NEW_FILE yyrestart( yyin )
113
114#define YY_END_OF_BUFFER_CHAR 0
115
116/* Size of default input buffer. */
117#define YY_BUF_SIZE (16384*64)
118
119typedef struct yy_buffer_state *YY_BUFFER_STATE;
120
121extern int yyleng;
122extern FILE *yyin, *yyout;
123
124#define EOB_ACT_CONTINUE_SCAN 0
125#define EOB_ACT_END_OF_FILE 1
126#define EOB_ACT_LAST_MATCH 2
127
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:
131 *
132 * if ( condition_holds )
133 * yyless( 5 );
134 * else
135 * do_something_else();
136 *
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.
140 */
141
142/* Return all but the first 'n' matched characters back to the input stream. */
143
144#define yyless(n) \
145 do \
146 { \
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 */ \
152 } \
153 while ( 0 )
154
155#define unput(c) yyunput( c, yytext_ptr )
156
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).
160 */
161typedef unsigned int yy_size_t;
162
163
164struct yy_buffer_state
165 {
166 FILE *yy_input_file;
167
168 char *yy_ch_buf; /* input buffer */
169 char *yy_buf_pos; /* current position in input buffer */
170
171 /* Size of input buffer in bytes, not including room for EOB
172 * characters.
173 */
174 yy_size_t yy_buf_size;
175
176 /* Number of characters read into yy_ch_buf, not including EOB
177 * characters.
178 */
179 int yy_n_chars;
180
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
183 * delete it.
184 */
185 int yy_is_our_buffer;
186
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
190 * each newline.
191 */
192 int yy_is_interactive;
193
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
196 * not.
197 */
198 int yy_at_bol;
199
200 /* Whether to try to fill the input buffer when we reach the
201 * end of it.
202 */
203 int yy_fill_buffer;
204
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.
213 *
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.
217 */
218#define YY_BUFFER_EOF_PENDING 2
219 };
220
221static YY_BUFFER_STATE yy_current_buffer = 0;
222
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
225 * "scanner state".
226 */
227#define YY_CURRENT_BUFFER yy_current_buffer
228
229
230/* yy_hold_char holds the character lost when yytext is formed. */
231static char yy_hold_char;
232
233static int yy_n_chars; /* number of characters read into yy_ch_buf */
234
235
236int yyleng;
237
238/* Points to current character in buffer. */
239static char *yy_c_buf_p = (char *) 0;
240static int yy_init = 1; /* whether we need to initialize */
241static int yy_start = 0; /* start state number */
242
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 ...
245 */
246static int yy_did_buffer_switch_on_eof;
247
248void yyrestart YY_PROTO(( FILE *input_file ));
249
250void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
251void yy_load_buffer_state YY_PROTO(( void ));
252YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
253void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
254void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
255void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
256#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
257
258YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
259YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
260YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
261
262static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
263static inline void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
264static void yy_flex_free YY_PROTO(( void * ));
265
266#define yy_new_buffer yy_create_buffer
267
268#define yy_set_interactive(is_interactive) \
269 { \
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; \
273 }
274
275#define yy_set_bol(at_bol) \
276 { \
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; \
280 }
281
282#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
283
284
285#define YY_USES_REJECT
286typedef unsigned char YY_CHAR;
287FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
288typedef int yy_state_type;
289extern int yylineno;
290int yylineno = 1;
291extern char *yytext;
292#define yytext_ptr yytext
293
294static yy_state_type yy_get_previous_state YY_PROTO(( void ));
295static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
296static int yy_get_next_buffer YY_PROTO(( void ));
297static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
298
299/* Done after the current pattern has been matched and before the
300 * corresponding action - sets up yytext.
301 */
302#define YY_DO_BEFORE_ACTION \
303 yytext_ptr = yy_bp; \
304 yyleng = (int) (yy_cp - yy_bp); \
305 yy_hold_char = *yy_cp; \
306 *yy_cp = '\0'; \
307 yy_c_buf_p = yy_cp;
308
Chris Lattner27627382006-09-01 21:14:42 +0000309#define YY_NUM_RULES 34
310#define YY_END_OF_BUFFER 35
Jim Laskey251e3c62007-02-06 18:03:31 +0000311static yyconst short int yy_acclist[149] =
Reid Spencer68a24bd2005-08-27 18:50:39 +0000312 { 0,
Chris Lattner27627382006-09-01 21:14:42 +0000313 28, 28, 35, 33, 34, 26, 33, 34, 26, 34,
314 33, 34, 33, 34, 33, 34, 33, 34, 33, 34,
Jim Laskey251e3c62007-02-06 18:03:31 +0000315 33, 34, 25, 33, 34, 25, 33, 34, 22, 33,
316 34, 33, 34, 22, 33, 34, 22, 33, 34, 22,
317 33, 34, 22, 33, 34, 22, 33, 34, 22, 33,
318 34, 22, 33, 34, 22, 33, 34, 28, 34, 29,
319 34, 31, 34, 26, 24, 23, 25, 27, 1, 22,
320 22, 22, 22, 22, 22, 22, 17, 22, 22, 22,
321 22, 22, 28, 29, 29, 32, 31, 30, 31, 23,
322 22, 1, 25, 25, 5, 22, 22, 22, 10, 22,
Reid Spencer68a24bd2005-08-27 18:50:39 +0000323
Jim Laskey251e3c62007-02-06 18:03:31 +0000324 12, 22, 22, 22, 4, 22, 16, 22, 22, 22,
325 22, 20, 18, 19, 23, 3, 6, 22, 22, 9,
326 22, 13, 22, 22, 22, 8, 22, 22, 22, 11,
327 22, 15, 22, 22, 22, 22, 22, 22, 7, 22,
328 22, 22, 22, 22, 21, 2, 14, 22
Reid Spencer68a24bd2005-08-27 18:50:39 +0000329 } ;
330
Jim Laskey251e3c62007-02-06 18:03:31 +0000331static yyconst short int yy_accept[126] =
Reid Spencer68a24bd2005-08-27 18:50:39 +0000332 { 0,
333 1, 1, 1, 2, 3, 4, 6, 9, 11, 13,
Jim Laskey251e3c62007-02-06 18:03:31 +0000334 15, 17, 19, 21, 23, 26, 29, 32, 34, 37,
335 40, 43, 46, 49, 52, 55, 58, 60, 62, 64,
336 65, 65, 65, 66, 66, 67, 68, 68, 69, 70,
337 70, 70, 71, 71, 72, 73, 74, 75, 76, 77,
338 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
339 89, 90, 90, 90, 90, 90, 91, 92, 93, 94,
340 95, 95, 95, 97, 98, 99, 101, 103, 104, 105,
341 107, 109, 110, 111, 112, 113, 114, 115, 115, 116,
342 116, 117, 119, 120, 122, 124, 125, 126, 128, 129,
Reid Spencer68a24bd2005-08-27 18:50:39 +0000343
Jim Laskey251e3c62007-02-06 18:03:31 +0000344 130, 130, 132, 134, 135, 136, 137, 137, 138, 139,
345 141, 141, 142, 143, 143, 143, 144, 144, 144, 145,
346 146, 146, 147, 149, 149
Reid Spencer68a24bd2005-08-27 18:50:39 +0000347 } ;
348
349static yyconst int yy_ec[256] =
350 { 0,
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,
Jim Laskey251e3c62007-02-06 18:03:31 +0000355 1, 8, 9, 1, 9, 10, 11, 12, 13, 14,
356 14, 14, 14, 14, 14, 14, 14, 1, 1, 1,
357 1, 1, 1, 1, 15, 15, 15, 15, 15, 15,
358 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
359 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
360 17, 1, 18, 1, 16, 1, 19, 20, 21, 22,
Reid Spencer68a24bd2005-08-27 18:50:39 +0000361
Jim Laskey251e3c62007-02-06 18:03:31 +0000362 23, 24, 25, 26, 27, 16, 16, 28, 29, 30,
363 31, 16, 16, 32, 33, 34, 35, 16, 16, 36,
364 16, 16, 37, 1, 38, 1, 1, 1, 1, 1,
Reid Spencer68a24bd2005-08-27 18:50:39 +0000365 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,
372
373 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
374 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
375 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
376 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
377 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
378 1, 1, 1, 1, 1
379 } ;
380
Jim Laskey251e3c62007-02-06 18:03:31 +0000381static yyconst int yy_meta[39] =
Reid Spencer68a24bd2005-08-27 18:50:39 +0000382 { 0,
Jim Laskey251e3c62007-02-06 18:03:31 +0000383 1, 1, 2, 1, 1, 1, 1, 3, 1, 4,
384 3, 5, 5, 5, 6, 7, 1, 1, 6, 6,
385 6, 6, 6, 6, 7, 7, 7, 7, 7, 7,
386 7, 7, 7, 7, 7, 7, 1, 1
Reid Spencer68a24bd2005-08-27 18:50:39 +0000387 } ;
388
Jim Laskey251e3c62007-02-06 18:03:31 +0000389static yyconst short int yy_base[138] =
Reid Spencer68a24bd2005-08-27 18:50:39 +0000390 { 0,
Jim Laskey251e3c62007-02-06 18:03:31 +0000391 0, 0, 31, 32, 234, 235, 42, 45, 200, 226,
392 221, 38, 220, 45, 45, 48, 0, 192, 201, 35,
393 45, 200, 196, 44, 190, 190, 0, 61, 62, 72,
394 51, 217, 235, 212, 0, 66, 211, 235, 0, 42,
395 0, 0, 182, 185, 199, 195, 191, 191, 191, 61,
396 179, 179, 183, 178, 0, 76, 78, 235, 80, 235,
397 82, 181, 73, 176, 197, 0, 235, 0, 84, 0,
398 168, 187, 171, 170, 179, 0, 172, 172, 171, 0,
399 0, 164, 163, 169, 235, 235, 235, 174, 235, 156,
400 235, 0, 160, 0, 0, 170, 156, 0, 163, 159,
Reid Spencer68a24bd2005-08-27 18:50:39 +0000401
Jim Laskey251e3c62007-02-06 18:03:31 +0000402 157, 0, 0, 165, 165, 160, 154, 160, 154, 0,
403 132, 96, 111, 103, 100, 72, 70, 94, 61, 235,
404 35, 235, 0, 235, 106, 113, 117, 120, 127, 134,
405 141, 144, 151, 154, 160, 167, 174
Reid Spencer68a24bd2005-08-27 18:50:39 +0000406 } ;
407
Jim Laskey251e3c62007-02-06 18:03:31 +0000408static yyconst short int yy_def[138] =
Reid Spencer68a24bd2005-08-27 18:50:39 +0000409 { 0,
Jim Laskey251e3c62007-02-06 18:03:31 +0000410 124, 1, 125, 125, 124, 124, 124, 124, 124, 126,
411 127, 124, 124, 124, 124, 124, 128, 124, 128, 128,
412 128, 128, 128, 128, 128, 128, 129, 130, 131, 124,
413 124, 126, 124, 124, 132, 124, 124, 124, 133, 124,
414 134, 128, 135, 128, 128, 128, 128, 128, 128, 128,
415 128, 128, 128, 128, 129, 130, 130, 124, 131, 124,
416 131, 124, 124, 124, 124, 132, 124, 133, 124, 134,
417 135, 136, 128, 128, 128, 128, 128, 128, 128, 128,
418 128, 128, 128, 128, 124, 124, 124, 124, 124, 135,
419 124, 128, 128, 128, 128, 128, 128, 128, 128, 128,
Reid Spencer68a24bd2005-08-27 18:50:39 +0000420
Jim Laskey251e3c62007-02-06 18:03:31 +0000421 124, 128, 128, 128, 128, 128, 124, 128, 128, 128,
422 124, 128, 128, 124, 124, 128, 124, 137, 128, 124,
423 137, 124, 128, 0, 124, 124, 124, 124, 124, 124,
424 124, 124, 124, 124, 124, 124, 124
Reid Spencer68a24bd2005-08-27 18:50:39 +0000425 } ;
426
Jim Laskey251e3c62007-02-06 18:03:31 +0000427static yyconst short int yy_nxt[274] =
Reid Spencer68a24bd2005-08-27 18:50:39 +0000428 { 0,
429 6, 7, 8, 7, 9, 10, 11, 6, 12, 13,
Jim Laskey251e3c62007-02-06 18:03:31 +0000430 14, 15, 16, 16, 17, 17, 18, 6, 17, 19,
431 20, 21, 17, 22, 17, 17, 23, 24, 25, 17,
432 17, 17, 26, 17, 17, 17, 6, 6, 28, 28,
433 122, 29, 29, 30, 30, 30, 30, 30, 30, 36,
434 36, 36, 38, 69, 69, 39, 36, 36, 36, 36,
435 36, 36, 45, 47, 40, 46, 51, 48, 57, 60,
436 52, 58, 61, 30, 30, 30, 62, 36, 36, 36,
437 41, 79, 63, 124, 64, 57, 124, 124, 58, 124,
438 124, 86, 61, 123, 80, 69, 69, 115, 115, 122,
Reid Spencer68a24bd2005-08-27 18:50:39 +0000439
Jim Laskey251e3c62007-02-06 18:03:31 +0000440 87, 115, 115, 120, 119, 118, 27, 27, 27, 27,
441 27, 27, 27, 32, 32, 32, 32, 32, 32, 32,
442 35, 117, 35, 35, 42, 42, 42, 55, 55, 116,
443 55, 55, 55, 55, 56, 56, 56, 56, 56, 56,
444 56, 59, 59, 59, 59, 59, 59, 59, 66, 66,
445 66, 68, 114, 68, 68, 68, 68, 68, 70, 70,
446 71, 71, 71, 71, 71, 71, 71, 90, 90, 90,
447 90, 90, 90, 90, 121, 121, 121, 121, 121, 121,
448 121, 113, 112, 111, 110, 109, 108, 107, 106, 105,
449 104, 103, 102, 72, 101, 100, 99, 98, 97, 96,
Reid Spencer68a24bd2005-08-27 18:50:39 +0000450
Jim Laskey251e3c62007-02-06 18:03:31 +0000451 95, 94, 93, 92, 91, 72, 89, 88, 85, 84,
452 83, 82, 81, 78, 77, 76, 75, 74, 73, 72,
453 67, 65, 33, 54, 53, 50, 49, 44, 43, 37,
454 34, 33, 31, 124, 5, 124, 124, 124, 124, 124,
455 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
456 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
457 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
458 124, 124, 124
Reid Spencer68a24bd2005-08-27 18:50:39 +0000459 } ;
460
Jim Laskey251e3c62007-02-06 18:03:31 +0000461static yyconst short int yy_chk[274] =
Reid Spencer68a24bd2005-08-27 18:50:39 +0000462 { 0,
463 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
464 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
465 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Jim Laskey251e3c62007-02-06 18:03:31 +0000466 1, 1, 1, 1, 1, 1, 1, 1, 3, 4,
467 121, 3, 4, 7, 7, 7, 8, 8, 8, 12,
468 12, 12, 14, 40, 40, 14, 15, 15, 15, 16,
469 16, 16, 20, 21, 15, 20, 24, 21, 28, 29,
470 24, 28, 29, 30, 30, 30, 31, 36, 36, 36,
471 15, 50, 31, 56, 31, 57, 56, 59, 57, 61,
472 59, 63, 61, 119, 50, 69, 69, 112, 112, 118,
Reid Spencer68a24bd2005-08-27 18:50:39 +0000473
Jim Laskey251e3c62007-02-06 18:03:31 +0000474 63, 115, 115, 117, 116, 115, 125, 125, 125, 125,
475 125, 125, 125, 126, 126, 126, 126, 126, 126, 126,
476 127, 114, 127, 127, 128, 128, 128, 129, 129, 113,
477 129, 129, 129, 129, 130, 130, 130, 130, 130, 130,
478 130, 131, 131, 131, 131, 131, 131, 131, 132, 132,
479 132, 133, 111, 133, 133, 133, 133, 133, 134, 134,
480 135, 135, 135, 135, 135, 135, 135, 136, 136, 136,
481 136, 136, 136, 136, 137, 137, 137, 137, 137, 137,
482 137, 109, 108, 107, 106, 105, 104, 101, 100, 99,
483 97, 96, 93, 90, 88, 84, 83, 82, 79, 78,
Reid Spencer68a24bd2005-08-27 18:50:39 +0000484
Jim Laskey251e3c62007-02-06 18:03:31 +0000485 77, 75, 74, 73, 72, 71, 65, 64, 62, 54,
486 53, 52, 51, 49, 48, 47, 46, 45, 44, 43,
487 37, 34, 32, 26, 25, 23, 22, 19, 18, 13,
488 11, 10, 9, 5, 124, 124, 124, 124, 124, 124,
489 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
490 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
491 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
492 124, 124, 124
Reid Spencer68a24bd2005-08-27 18:50:39 +0000493 } ;
494
495static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
496static char *yy_full_match;
497static int yy_lp;
498#define REJECT \
499{ \
500*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
501yy_cp = yy_full_match; /* restore poss. backed-over text */ \
502++yy_lp; \
503goto find_rule; \
504}
505#define yymore() yymore_used_but_not_detected
506#define YY_MORE_ADJ 0
507#define YY_RESTORE_YY_MORE_OFFSET
508char *yytext;
Jim Laskey251e3c62007-02-06 18:03:31 +0000509#line 1 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000510#define INITIAL 0
511/*===-- FileLexer.l - Scanner for TableGen Files ----------------*- C++ -*-===//
512//
513// The LLVM Compiler Infrastructure
514//
515// This file was developed by the LLVM research group and is distributed under
516// the University of Illinois Open Source License. See LICENSE.TXT for details.
517//
518//===----------------------------------------------------------------------===//
519//
520// This file defines a simple flex scanner for TableGen files. This is pretty
521// straight-forward, except for the magic to handle file inclusion.
522//
523//===----------------------------------------------------------------------===*/
524#define YY_NEVER_INTERACTIVE 1
525#define comment 1
526
Jim Laskey251e3c62007-02-06 18:03:31 +0000527#line 30 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Chris Lattner5fa39df2006-11-05 23:28:58 +0000528#include "llvm/Config/config.h"
Bill Wendlingf5da1332006-12-07 22:21:48 +0000529#include "llvm/Support/Streams.h"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000530#include "Record.h"
531typedef std::pair<llvm::Record*, std::vector<llvm::Init*>*> SubClassRefTy;
532#include "FileParser.h"
533
534int Fileparse();
535
536namespace llvm {
537
538// Global variable recording the location of the include directory
Chris Lattnerc1d6e4e2006-03-03 01:47:37 +0000539std::vector<std::string> IncludeDirectories;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000540
541/// ParseInt - This has to handle the special case of binary numbers 0b0101
542///
543static int ParseInt(const char *Str) {
544 if (Str[0] == '0' && Str[1] == 'b')
Chris Lattnera4503de2006-09-18 22:28:27 +0000545 return strtoll(Str+2, 0, 2);
546 return strtoll(Str, 0, 0);
Reid Spencer68a24bd2005-08-27 18:50:39 +0000547}
548
549static int CommentDepth = 0;
550
551struct IncludeRec {
552 std::string Filename;
553 FILE *File;
554 unsigned LineNo;
555 YY_BUFFER_STATE Buffer;
556
557 IncludeRec(const std::string &FN, FILE *F)
558 : Filename(FN), File(F), LineNo(0){
559 }
560};
561
562static std::vector<IncludeRec> IncludeStack;
563
564std::ostream &err() {
Bill Wendlingf5da1332006-12-07 22:21:48 +0000565 if (IncludeStack.empty()) {
566 cerr << "At end of input: ";
567 return *cerr.stream();
568 }
Reid Spencer68a24bd2005-08-27 18:50:39 +0000569
570 for (unsigned i = 0, e = IncludeStack.size()-1; i != e; ++i)
Bill Wendlingf5da1332006-12-07 22:21:48 +0000571 cerr << "Included from " << IncludeStack[i].Filename << ":"
572 << IncludeStack[i].LineNo << ":\n";
573 cerr << "Parsing " << IncludeStack.back().Filename << ":"
574 << Filelineno << ": ";
575 return *cerr.stream();
Reid Spencer68a24bd2005-08-27 18:50:39 +0000576}
577
578/// ParseFile - this function begins the parsing of the specified tablegen file.
579///
Chris Lattnerc1d6e4e2006-03-03 01:47:37 +0000580void ParseFile(const std::string &Filename,
581 const std::vector<std::string> &IncludeDirs) {
Reid Spencer68a24bd2005-08-27 18:50:39 +0000582 FILE *F = stdin;
583 if (Filename != "-") {
584 F = fopen(Filename.c_str(), "r");
585
586 if (F == 0) {
Bill Wendlingf5da1332006-12-07 22:21:48 +0000587 cerr << "Could not open input file '" + Filename + "'!\n";
Reid Spencer68a24bd2005-08-27 18:50:39 +0000588 exit (1);
589 }
590 IncludeStack.push_back(IncludeRec(Filename, F));
591 } else {
592 IncludeStack.push_back(IncludeRec("<stdin>", stdin));
593 }
594
595 // Record the location of the include directory so that the lexer can find
596 // it later.
Chris Lattnerc1d6e4e2006-03-03 01:47:37 +0000597 IncludeDirectories = IncludeDirs;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000598
599 Filein = F;
600 Filelineno = 1;
601 Fileparse();
602 Filein = stdin;
603}
604
605/// HandleInclude - This function is called when an include directive is
606/// encountered in the input stream...
607///
608static void HandleInclude(const char *Buffer) {
609 unsigned Length = yyleng;
610 assert(Buffer[Length-1] == '"');
611 Buffer += strlen("include ");
612 Length -= strlen("include ");
613 while (*Buffer != '"') {
614 ++Buffer;
615 --Length;
616 }
617 assert(Length >= 2 && "Double quotes not found?");
618 std::string Filename(Buffer+1, Buffer+Length-1);
Bill Wendlingf5da1332006-12-07 22:21:48 +0000619 //cerr << "Filename = '" << Filename << "'\n";
Reid Spencer68a24bd2005-08-27 18:50:39 +0000620
621 // Save the line number and lex buffer of the includer...
622 IncludeStack.back().LineNo = Filelineno;
623 IncludeStack.back().Buffer = YY_CURRENT_BUFFER;
624
625 // Open the new input file...
626 yyin = fopen(Filename.c_str(), "r");
627 if (yyin == 0) {
628 // If we couldn't find the file in the current directory, look for it in
629 // the include directories.
630 //
Chris Lattnerc1d6e4e2006-03-03 01:47:37 +0000631 std::string NextFilename;
632 for (unsigned i = 0, e = IncludeDirectories.size(); i != e; ++i) {
633 NextFilename = IncludeDirectories[i] + "/" + Filename;
Chris Lattner56879b22006-03-03 19:34:28 +0000634 if ((yyin = fopen(NextFilename.c_str(), "r")))
Chris Lattnerc1d6e4e2006-03-03 01:47:37 +0000635 break;
636 }
637
Reid Spencer68a24bd2005-08-27 18:50:39 +0000638 if (yyin == 0) {
639 err() << "Could not find include file '" << Filename << "'!\n";
640 exit(1);
641 }
642 Filename = NextFilename;
643 }
644
645 // Add the file to our include stack...
646 IncludeStack.push_back(IncludeRec(Filename, yyin));
647 Filelineno = 1; // Reset line numbering...
648 //yyrestart(yyin); // Start lexing the new file...
649
650 yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
651}
652
653/// yywrap - This is called when the lexer runs out of input in one of the
654/// files. Switch back to an includer if an includee has run out of input.
655///
656extern "C"
657int yywrap(void) {
658 if (IncludeStack.back().File != stdin)
659 fclose(IncludeStack.back().File);
660 IncludeStack.pop_back();
661 if (IncludeStack.empty()) return 1; // Top-level file is done.
662
663 // Otherwise, we need to switch back to a file which included the current one.
664 Filelineno = IncludeStack.back().LineNo; // Restore current line number
665 yy_switch_to_buffer(IncludeStack.back().Buffer);
666 return 0;
667}
668
669} // End llvm namespace
670
671using namespace llvm;
672
Jim Laskey251e3c62007-02-06 18:03:31 +0000673#line 674 "Lexer.cpp"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000674
675/* Macros after this point can all be overridden by user definitions in
676 * section 1.
677 */
678
679#ifndef YY_SKIP_YYWRAP
680#ifdef __cplusplus
681extern "C" int yywrap YY_PROTO(( void ));
682#else
683extern int yywrap YY_PROTO(( void ));
684#endif
685#endif
686
687#ifndef YY_NO_UNPUT
688static inline void yyunput YY_PROTO(( int c, char *buf_ptr ));
689#endif
690
691#ifndef yytext_ptr
692static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
693#endif
694
695#ifdef YY_NEED_STRLEN
696static int yy_flex_strlen YY_PROTO(( yyconst char * ));
697#endif
698
699#ifndef YY_NO_INPUT
700#ifdef __cplusplus
701static int yyinput YY_PROTO(( void ));
702#else
703static int input YY_PROTO(( void ));
704#endif
705#endif
706
707#if YY_STACK_USED
708static int yy_start_stack_ptr = 0;
709static int yy_start_stack_depth = 0;
710static int *yy_start_stack = 0;
711#ifndef YY_NO_PUSH_STATE
712static void yy_push_state YY_PROTO(( int new_state ));
713#endif
714#ifndef YY_NO_POP_STATE
715static void yy_pop_state YY_PROTO(( void ));
716#endif
717#ifndef YY_NO_TOP_STATE
718static int yy_top_state YY_PROTO(( void ));
719#endif
720
721#else
722#define YY_NO_PUSH_STATE 1
723#define YY_NO_POP_STATE 1
724#define YY_NO_TOP_STATE 1
725#endif
726
727#ifdef YY_MALLOC_DECL
728YY_MALLOC_DECL
729#else
730#if __STDC__
731#ifndef __cplusplus
732#include <stdlib.h>
733#endif
734#else
735/* Just try to get by without declaring the routines. This will fail
736 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
737 * or sizeof(void*) != sizeof(int).
738 */
739#endif
740#endif
741
742/* Amount of stuff to slurp up with each read. */
743#ifndef YY_READ_BUF_SIZE
744#define YY_READ_BUF_SIZE 8192
745#endif
746
747/* Copy whatever the last rule matched to the standard output. */
748
749#ifndef ECHO
750/* This used to be an fputs(), but since the string might contain NUL's,
751 * we now use fwrite().
752 */
753#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
754#endif
755
756/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
757 * is returned in "result".
758 */
759#ifndef YY_INPUT
760#define YY_INPUT(buf,result,max_size) \
761 if ( yy_current_buffer->yy_is_interactive ) \
762 { \
763 int c = '*', n; \
764 for ( n = 0; n < max_size && \
765 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
766 buf[n] = (char) c; \
767 if ( c == '\n' ) \
768 buf[n++] = (char) c; \
769 if ( c == EOF && ferror( yyin ) ) \
770 YY_FATAL_ERROR( "input in flex scanner failed" ); \
771 result = n; \
772 } \
773 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
774 && ferror( yyin ) ) \
775 YY_FATAL_ERROR( "input in flex scanner failed" );
776#endif
777
778/* No semi-colon after return; correct usage is to write "yyterminate();" -
779 * we don't want an extra ';' after the "return" because that will cause
780 * some compilers to complain about unreachable statements.
781 */
782#ifndef yyterminate
783#define yyterminate() return YY_NULL
784#endif
785
786/* Number of entries by which start-condition stack grows. */
787#ifndef YY_START_STACK_INCR
788#define YY_START_STACK_INCR 25
789#endif
790
791/* Report a fatal error. */
792#ifndef YY_FATAL_ERROR
793#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
794#endif
795
796/* Default declaration of generated scanner - a define so the user can
797 * easily add parameters.
798 */
799#ifndef YY_DECL
800#define YY_DECL int yylex YY_PROTO(( void ))
801#endif
802
803/* Code executed at the beginning of each rule, after yytext and yyleng
804 * have been set up.
805 */
806#ifndef YY_USER_ACTION
807#define YY_USER_ACTION
808#endif
809
810/* Code executed at the end of each rule. */
811#ifndef YY_BREAK
812#define YY_BREAK break;
813#endif
814
815#define YY_RULE_SETUP \
816 YY_USER_ACTION
817
818YY_DECL
819 {
820 register yy_state_type yy_current_state;
Chris Lattnere8242b12006-02-14 05:13:13 +0000821 register char *yy_cp, *yy_bp;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000822 register int yy_act;
823
Jim Laskey251e3c62007-02-06 18:03:31 +0000824#line 185 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000825
826
Jim Laskey251e3c62007-02-06 18:03:31 +0000827#line 828 "Lexer.cpp"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000828
829 if ( yy_init )
830 {
831 yy_init = 0;
832
833#ifdef YY_USER_INIT
834 YY_USER_INIT;
835#endif
836
837 if ( ! yy_start )
838 yy_start = 1; /* first start state */
839
840 if ( ! yyin )
841 yyin = stdin;
842
843 if ( ! yyout )
844 yyout = stdout;
845
846 if ( ! yy_current_buffer )
847 yy_current_buffer =
848 yy_create_buffer( yyin, YY_BUF_SIZE );
849
850 yy_load_buffer_state();
851 }
852
853 while ( 1 ) /* loops until end-of-file is reached */
854 {
855 yy_cp = yy_c_buf_p;
856
857 /* Support of yytext. */
858 *yy_cp = yy_hold_char;
859
860 /* yy_bp points to the position in yy_ch_buf of the start of
861 * the current run.
862 */
863 yy_bp = yy_cp;
864
865 yy_current_state = yy_start;
866 yy_state_ptr = yy_state_buf;
867 *yy_state_ptr++ = yy_current_state;
868yy_match:
869 do
870 {
871 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
872 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
873 {
874 yy_current_state = (int) yy_def[yy_current_state];
Jim Laskey251e3c62007-02-06 18:03:31 +0000875 if ( yy_current_state >= 125 )
Reid Spencer68a24bd2005-08-27 18:50:39 +0000876 yy_c = yy_meta[(unsigned int) yy_c];
877 }
878 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
879 *yy_state_ptr++ = yy_current_state;
880 ++yy_cp;
881 }
Jim Laskey251e3c62007-02-06 18:03:31 +0000882 while ( yy_current_state != 124 );
Reid Spencer68a24bd2005-08-27 18:50:39 +0000883
884yy_find_action:
885 yy_current_state = *--yy_state_ptr;
886 yy_lp = yy_accept[yy_current_state];
887find_rule: /* we branch to this label when backing up */
888 for ( ; ; ) /* until we find what rule we matched */
889 {
890 if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
891 {
892 yy_act = yy_acclist[yy_lp];
893 {
894 yy_full_match = yy_cp;
895 break;
896 }
897 }
898 --yy_cp;
899 yy_current_state = *--yy_state_ptr;
900 yy_lp = yy_accept[yy_current_state];
901 }
902
903 YY_DO_BEFORE_ACTION;
904
905 if ( yy_act != YY_END_OF_BUFFER )
906 {
907 int yyl;
908 for ( yyl = 0; yyl < yyleng; ++yyl )
909 if ( yytext[yyl] == '\n' )
910 ++yylineno;
911 }
912
913do_action: /* This label is used only to access EOF actions. */
914
915
916 switch ( yy_act )
917 { /* beginning of action switch */
918case 1:
919YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +0000920#line 187 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000921{ /* Ignore comments */ }
922 YY_BREAK
923case 2:
924YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +0000925#line 189 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000926{ HandleInclude(yytext); }
927 YY_BREAK
928case 3:
929YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +0000930#line 190 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000931{ Filelval.StrVal = new std::string(yytext+2, yytext+yyleng-2);
932 return CODEFRAGMENT; }
933 YY_BREAK
934case 4:
935YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +0000936#line 193 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000937{ return INT; }
938 YY_BREAK
939case 5:
940YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +0000941#line 194 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000942{ return BIT; }
943 YY_BREAK
944case 6:
945YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +0000946#line 195 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000947{ return BITS; }
948 YY_BREAK
949case 7:
950YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +0000951#line 196 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000952{ return STRING; }
953 YY_BREAK
954case 8:
955YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +0000956#line 197 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000957{ return LIST; }
958 YY_BREAK
959case 9:
960YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +0000961#line 198 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000962{ return CODE; }
963 YY_BREAK
964case 10:
965YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +0000966#line 199 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000967{ return DAG; }
968 YY_BREAK
969case 11:
970YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +0000971#line 201 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000972{ return CLASS; }
973 YY_BREAK
974case 12:
975YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +0000976#line 202 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000977{ return DEF; }
978 YY_BREAK
979case 13:
980YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +0000981#line 203 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +0000982{ return DEFM; }
Reid Spencer68a24bd2005-08-27 18:50:39 +0000983 YY_BREAK
984case 14:
985YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +0000986#line 204 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +0000987{ return MULTICLASS; }
Reid Spencer68a24bd2005-08-27 18:50:39 +0000988 YY_BREAK
989case 15:
990YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +0000991#line 205 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +0000992{ return FIELD; }
Reid Spencer68a24bd2005-08-27 18:50:39 +0000993 YY_BREAK
994case 16:
995YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +0000996#line 206 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +0000997{ return LET; }
Reid Spencer68a24bd2005-08-27 18:50:39 +0000998 YY_BREAK
999case 17:
1000YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +00001001#line 207 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +00001002{ return IN; }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001003 YY_BREAK
1004case 18:
1005YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +00001006#line 209 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +00001007{ return SRATOK; }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001008 YY_BREAK
1009case 19:
1010YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +00001011#line 210 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +00001012{ return SRLTOK; }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001013 YY_BREAK
1014case 20:
1015YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +00001016#line 211 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +00001017{ return SHLTOK; }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001018 YY_BREAK
1019case 21:
1020YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +00001021#line 212 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +00001022{ return STRCONCATTOK; }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001023 YY_BREAK
1024case 22:
1025YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +00001026#line 215 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +00001027{ Filelval.StrVal = new std::string(yytext, yytext+yyleng);
1028 return ID; }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001029 YY_BREAK
1030case 23:
1031YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +00001032#line 217 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +00001033{ Filelval.StrVal = new std::string(yytext+1, yytext+yyleng);
1034 return VARNAME; }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001035 YY_BREAK
1036case 24:
1037YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +00001038#line 220 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +00001039{ Filelval.StrVal = new std::string(yytext+1, yytext+yyleng-1);
1040 return STRVAL; }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001041 YY_BREAK
1042case 25:
1043YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +00001044#line 223 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +00001045{ Filelval.IntVal = ParseInt(Filetext); return INTVAL; }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001046 YY_BREAK
1047case 26:
1048YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +00001049#line 225 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +00001050{ /* Ignore whitespace */ }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001051 YY_BREAK
1052case 27:
1053YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +00001054#line 228 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +00001055{ BEGIN(comment); CommentDepth++; }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001056 YY_BREAK
1057case 28:
1058YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +00001059#line 229 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +00001060{} /* eat anything that's not a '*' or '/' */
Reid Spencer68a24bd2005-08-27 18:50:39 +00001061 YY_BREAK
1062case 29:
1063YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +00001064#line 230 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +00001065{} /* eat up '*'s not followed by '/'s */
Reid Spencer68a24bd2005-08-27 18:50:39 +00001066 YY_BREAK
1067case 30:
1068YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +00001069#line 231 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +00001070{ ++CommentDepth; }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001071 YY_BREAK
1072case 31:
1073YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +00001074#line 232 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +00001075{} /* eat up /'s not followed by *'s */
Chris Lattnerb8316912006-03-31 21:54:11 +00001076 YY_BREAK
1077case 32:
1078YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +00001079#line 233 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +00001080{ if (!--CommentDepth) { BEGIN(INITIAL); } }
1081 YY_BREAK
1082case YY_STATE_EOF(comment):
Jim Laskey251e3c62007-02-06 18:03:31 +00001083#line 234 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +00001084{ err() << "Unterminated comment!\n"; exit(1); }
1085 YY_BREAK
1086case 33:
1087YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +00001088#line 236 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +00001089{ return Filetext[0]; }
1090 YY_BREAK
1091case 34:
1092YY_RULE_SETUP
Jim Laskey251e3c62007-02-06 18:03:31 +00001093#line 238 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +00001094YY_FATAL_ERROR( "flex scanner jammed" );
1095 YY_BREAK
Jim Laskey251e3c62007-02-06 18:03:31 +00001096#line 1097 "Lexer.cpp"
Reid Spencer68a24bd2005-08-27 18:50:39 +00001097 case YY_STATE_EOF(INITIAL):
1098 yyterminate();
1099
1100 case YY_END_OF_BUFFER:
1101 {
1102 /* Amount of text matched not including the EOB char. */
1103 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1104
1105 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1106 *yy_cp = yy_hold_char;
1107 YY_RESTORE_YY_MORE_OFFSET
1108
1109 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1110 {
1111 /* We're scanning a new file or input source. It's
1112 * possible that this happened because the user
1113 * just pointed yyin at a new source and called
1114 * yylex(). If so, then we have to assure
1115 * consistency between yy_current_buffer and our
1116 * globals. Here is the right place to do so, because
1117 * this is the first action (other than possibly a
1118 * back-up) that will match for the new input source.
1119 */
1120 yy_n_chars = yy_current_buffer->yy_n_chars;
1121 yy_current_buffer->yy_input_file = yyin;
1122 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1123 }
1124
1125 /* Note that here we test for yy_c_buf_p "<=" to the position
1126 * of the first EOB in the buffer, since yy_c_buf_p will
1127 * already have been incremented past the NUL character
1128 * (since all states make transitions on EOB to the
1129 * end-of-buffer state). Contrast this with the test
1130 * in input().
1131 */
1132 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1133 { /* This was really a NUL. */
1134 yy_state_type yy_next_state;
1135
1136 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1137
1138 yy_current_state = yy_get_previous_state();
1139
1140 /* Okay, we're now positioned to make the NUL
1141 * transition. We couldn't have
1142 * yy_get_previous_state() go ahead and do it
1143 * for us because it doesn't know how to deal
1144 * with the possibility of jamming (and we don't
1145 * want to build jamming into it because then it
1146 * will run more slowly).
1147 */
1148
1149 yy_next_state = yy_try_NUL_trans( yy_current_state );
1150
1151 yy_bp = yytext_ptr + YY_MORE_ADJ;
1152
1153 if ( yy_next_state )
1154 {
1155 /* Consume the NUL. */
1156 yy_cp = ++yy_c_buf_p;
1157 yy_current_state = yy_next_state;
1158 goto yy_match;
1159 }
1160
1161 else
1162 {
1163 yy_cp = yy_c_buf_p;
1164 goto yy_find_action;
1165 }
1166 }
1167
1168 else switch ( yy_get_next_buffer() )
1169 {
1170 case EOB_ACT_END_OF_FILE:
1171 {
1172 yy_did_buffer_switch_on_eof = 0;
1173
1174 if ( yywrap() )
1175 {
1176 /* Note: because we've taken care in
1177 * yy_get_next_buffer() to have set up
1178 * yytext, we can now set up
1179 * yy_c_buf_p so that if some total
1180 * hoser (like flex itself) wants to
1181 * call the scanner after we return the
1182 * YY_NULL, it'll still work - another
1183 * YY_NULL will get returned.
1184 */
1185 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1186
1187 yy_act = YY_STATE_EOF(YY_START);
1188 goto do_action;
1189 }
1190
1191 else
1192 {
1193 if ( ! yy_did_buffer_switch_on_eof )
1194 YY_NEW_FILE;
1195 }
1196 break;
1197 }
1198
1199 case EOB_ACT_CONTINUE_SCAN:
1200 yy_c_buf_p =
1201 yytext_ptr + yy_amount_of_matched_text;
1202
1203 yy_current_state = yy_get_previous_state();
1204
1205 yy_cp = yy_c_buf_p;
1206 yy_bp = yytext_ptr + YY_MORE_ADJ;
1207 goto yy_match;
1208
1209 case EOB_ACT_LAST_MATCH:
1210 yy_c_buf_p =
1211 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1212
1213 yy_current_state = yy_get_previous_state();
1214
1215 yy_cp = yy_c_buf_p;
1216 yy_bp = yytext_ptr + YY_MORE_ADJ;
1217 goto yy_find_action;
1218 }
1219 break;
1220 }
1221
1222 default:
1223 YY_FATAL_ERROR(
1224 "fatal flex scanner internal error--no action found" );
1225 } /* end of action switch */
1226 } /* end of scanning one token */
1227 } /* end of yylex */
1228
1229
1230/* yy_get_next_buffer - try to read in a new buffer
1231 *
1232 * Returns a code representing an action:
1233 * EOB_ACT_LAST_MATCH -
1234 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1235 * EOB_ACT_END_OF_FILE - end of file
1236 */
1237
1238static int yy_get_next_buffer()
1239 {
1240 register char *dest = yy_current_buffer->yy_ch_buf;
1241 register char *source = yytext_ptr;
1242 register int number_to_move, i;
1243 int ret_val;
1244
1245 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1246 YY_FATAL_ERROR(
1247 "fatal flex scanner internal error--end of buffer missed" );
1248
1249 if ( yy_current_buffer->yy_fill_buffer == 0 )
1250 { /* Don't try to fill the buffer, so this is an EOF. */
1251 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1252 {
1253 /* We matched a single character, the EOB, so
1254 * treat this as a final EOF.
1255 */
1256 return EOB_ACT_END_OF_FILE;
1257 }
1258
1259 else
1260 {
1261 /* We matched some text prior to the EOB, first
1262 * process it.
1263 */
1264 return EOB_ACT_LAST_MATCH;
1265 }
1266 }
1267
1268 /* Try to read more data. */
1269
1270 /* First move last chars to start of buffer. */
1271 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1272
1273 for ( i = 0; i < number_to_move; ++i )
1274 *(dest++) = *(source++);
1275
1276 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1277 /* don't do the read, it's not guaranteed to return an EOF,
1278 * just force an EOF
1279 */
1280 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1281
1282 else
1283 {
1284 int num_to_read =
1285 yy_current_buffer->yy_buf_size - number_to_move - 1;
1286
1287 while ( num_to_read <= 0 )
1288 { /* Not enough room in the buffer - grow it. */
1289#ifdef YY_USES_REJECT
1290 YY_FATAL_ERROR(
1291"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1292#else
1293
1294 /* just a shorter name for the current buffer */
1295 YY_BUFFER_STATE b = yy_current_buffer;
1296
1297 int yy_c_buf_p_offset =
1298 (int) (yy_c_buf_p - b->yy_ch_buf);
1299
1300 if ( b->yy_is_our_buffer )
1301 {
1302 int new_size = b->yy_buf_size * 2;
1303
1304 if ( new_size <= 0 )
1305 b->yy_buf_size += b->yy_buf_size / 8;
1306 else
1307 b->yy_buf_size *= 2;
1308
1309 b->yy_ch_buf = (char *)
1310 /* Include room in for 2 EOB chars. */
1311 yy_flex_realloc( (void *) b->yy_ch_buf,
1312 b->yy_buf_size + 2 );
1313 }
1314 else
1315 /* Can't grow it, we don't own it. */
1316 b->yy_ch_buf = 0;
1317
1318 if ( ! b->yy_ch_buf )
1319 YY_FATAL_ERROR(
1320 "fatal error - scanner input buffer overflow" );
1321
1322 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1323
1324 num_to_read = yy_current_buffer->yy_buf_size -
1325 number_to_move - 1;
1326#endif
1327 }
1328
1329 if ( num_to_read > YY_READ_BUF_SIZE )
1330 num_to_read = YY_READ_BUF_SIZE;
1331
1332 /* Read in more data. */
1333 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1334 yy_n_chars, num_to_read );
1335
1336 yy_current_buffer->yy_n_chars = yy_n_chars;
1337 }
1338
1339 if ( yy_n_chars == 0 )
1340 {
1341 if ( number_to_move == YY_MORE_ADJ )
1342 {
1343 ret_val = EOB_ACT_END_OF_FILE;
1344 yyrestart( yyin );
1345 }
1346
1347 else
1348 {
1349 ret_val = EOB_ACT_LAST_MATCH;
1350 yy_current_buffer->yy_buffer_status =
1351 YY_BUFFER_EOF_PENDING;
1352 }
1353 }
1354
1355 else
1356 ret_val = EOB_ACT_CONTINUE_SCAN;
1357
1358 yy_n_chars += number_to_move;
1359 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1360 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1361
1362 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1363
1364 return ret_val;
1365 }
1366
1367
1368/* yy_get_previous_state - get the state just before the EOB char was reached */
1369
1370static yy_state_type yy_get_previous_state()
1371 {
1372 register yy_state_type yy_current_state;
1373 register char *yy_cp;
1374
1375 yy_current_state = yy_start;
1376 yy_state_ptr = yy_state_buf;
1377 *yy_state_ptr++ = yy_current_state;
1378
1379 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1380 {
1381 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1382 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1383 {
1384 yy_current_state = (int) yy_def[yy_current_state];
Jim Laskey251e3c62007-02-06 18:03:31 +00001385 if ( yy_current_state >= 125 )
Reid Spencer68a24bd2005-08-27 18:50:39 +00001386 yy_c = yy_meta[(unsigned int) yy_c];
1387 }
1388 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1389 *yy_state_ptr++ = yy_current_state;
1390 }
1391
1392 return yy_current_state;
1393 }
1394
1395
1396/* yy_try_NUL_trans - try to make a transition on the NUL character
1397 *
1398 * synopsis
1399 * next_state = yy_try_NUL_trans( current_state );
1400 */
1401
1402#ifdef YY_USE_PROTOS
1403static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1404#else
1405static yy_state_type yy_try_NUL_trans( yy_current_state )
1406yy_state_type yy_current_state;
1407#endif
1408 {
1409 register int yy_is_jam;
1410
1411 register YY_CHAR yy_c = 1;
1412 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1413 {
1414 yy_current_state = (int) yy_def[yy_current_state];
Jim Laskey251e3c62007-02-06 18:03:31 +00001415 if ( yy_current_state >= 125 )
Reid Spencer68a24bd2005-08-27 18:50:39 +00001416 yy_c = yy_meta[(unsigned int) yy_c];
1417 }
1418 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
Jim Laskey251e3c62007-02-06 18:03:31 +00001419 yy_is_jam = (yy_current_state == 124);
Reid Spencer68a24bd2005-08-27 18:50:39 +00001420 if ( ! yy_is_jam )
1421 *yy_state_ptr++ = yy_current_state;
1422
1423 return yy_is_jam ? 0 : yy_current_state;
1424 }
1425
1426
1427#ifndef YY_NO_UNPUT
1428#ifdef YY_USE_PROTOS
1429static inline void yyunput( int c, register char *yy_bp )
1430#else
1431static inline void yyunput( c, yy_bp )
1432int c;
1433register char *yy_bp;
1434#endif
1435 {
1436 register char *yy_cp = yy_c_buf_p;
1437
1438 /* undo effects of setting up yytext */
1439 *yy_cp = yy_hold_char;
1440
1441 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1442 { /* need to shift things up to make room */
1443 /* +2 for EOB chars. */
1444 register int number_to_move = yy_n_chars + 2;
1445 register char *dest = &yy_current_buffer->yy_ch_buf[
1446 yy_current_buffer->yy_buf_size + 2];
1447 register char *source =
1448 &yy_current_buffer->yy_ch_buf[number_to_move];
1449
1450 while ( source > yy_current_buffer->yy_ch_buf )
1451 *--dest = *--source;
1452
1453 yy_cp += (int) (dest - source);
1454 yy_bp += (int) (dest - source);
1455 yy_current_buffer->yy_n_chars =
1456 yy_n_chars = yy_current_buffer->yy_buf_size;
1457
1458 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1459 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1460 }
1461
1462 *--yy_cp = (char) c;
1463
1464 if ( c == '\n' )
1465 --yylineno;
1466
1467 yytext_ptr = yy_bp;
1468 yy_hold_char = *yy_cp;
1469 yy_c_buf_p = yy_cp;
1470 }
1471#endif /* ifndef YY_NO_UNPUT */
1472
1473
Reid Spencer68a24bd2005-08-27 18:50:39 +00001474#ifdef __cplusplus
1475static int yyinput()
1476#else
1477static int input()
1478#endif
1479 {
1480 int c;
1481
1482 *yy_c_buf_p = yy_hold_char;
1483
1484 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1485 {
1486 /* yy_c_buf_p now points to the character we want to return.
1487 * If this occurs *before* the EOB characters, then it's a
1488 * valid NUL; if not, then we've hit the end of the buffer.
1489 */
1490 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1491 /* This was really a NUL. */
1492 *yy_c_buf_p = '\0';
1493
1494 else
1495 { /* need more input */
1496 int offset = yy_c_buf_p - yytext_ptr;
1497 ++yy_c_buf_p;
1498
1499 switch ( yy_get_next_buffer() )
1500 {
1501 case EOB_ACT_LAST_MATCH:
1502 /* This happens because yy_g_n_b()
1503 * sees that we've accumulated a
1504 * token and flags that we need to
1505 * try matching the token before
1506 * proceeding. But for input(),
1507 * there's no matching to consider.
1508 * So convert the EOB_ACT_LAST_MATCH
1509 * to EOB_ACT_END_OF_FILE.
1510 */
1511
1512 /* Reset buffer status. */
1513 yyrestart( yyin );
1514
1515 /* fall through */
1516
1517 case EOB_ACT_END_OF_FILE:
1518 {
1519 if ( yywrap() )
Jim Laskey251e3c62007-02-06 18:03:31 +00001520 return EOF;
Reid Spencer68a24bd2005-08-27 18:50:39 +00001521
1522 if ( ! yy_did_buffer_switch_on_eof )
1523 YY_NEW_FILE;
1524#ifdef __cplusplus
1525 return yyinput();
1526#else
1527 return input();
1528#endif
1529 }
1530
1531 case EOB_ACT_CONTINUE_SCAN:
1532 yy_c_buf_p = yytext_ptr + offset;
1533 break;
1534 }
1535 }
1536 }
1537
1538 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1539 *yy_c_buf_p = '\0'; /* preserve yytext */
1540 yy_hold_char = *++yy_c_buf_p;
1541
1542 if ( c == '\n' )
1543 ++yylineno;
1544
1545 return c;
1546 }
Chris Lattnere8242b12006-02-14 05:13:13 +00001547
Reid Spencer68a24bd2005-08-27 18:50:39 +00001548
1549#ifdef YY_USE_PROTOS
1550void yyrestart( FILE *input_file )
1551#else
1552void yyrestart( input_file )
1553FILE *input_file;
1554#endif
1555 {
1556 if ( ! yy_current_buffer )
1557 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1558
1559 yy_init_buffer( yy_current_buffer, input_file );
1560 yy_load_buffer_state();
1561 }
1562
1563
1564#ifdef YY_USE_PROTOS
1565void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1566#else
1567void yy_switch_to_buffer( new_buffer )
1568YY_BUFFER_STATE new_buffer;
1569#endif
1570 {
1571 if ( yy_current_buffer == new_buffer )
1572 return;
1573
1574 if ( yy_current_buffer )
1575 {
1576 /* Flush out information for old buffer. */
1577 *yy_c_buf_p = yy_hold_char;
1578 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1579 yy_current_buffer->yy_n_chars = yy_n_chars;
1580 }
1581
1582 yy_current_buffer = new_buffer;
1583 yy_load_buffer_state();
1584
1585 /* We don't actually know whether we did this switch during
1586 * EOF (yywrap()) processing, but the only time this flag
1587 * is looked at is after yywrap() is called, so it's safe
1588 * to go ahead and always set it.
1589 */
1590 yy_did_buffer_switch_on_eof = 1;
1591 }
1592
1593
1594#ifdef YY_USE_PROTOS
1595void yy_load_buffer_state( void )
1596#else
1597void yy_load_buffer_state()
1598#endif
1599 {
1600 yy_n_chars = yy_current_buffer->yy_n_chars;
1601 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1602 yyin = yy_current_buffer->yy_input_file;
1603 yy_hold_char = *yy_c_buf_p;
1604 }
1605
1606
1607#ifdef YY_USE_PROTOS
1608YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1609#else
1610YY_BUFFER_STATE yy_create_buffer( file, size )
1611FILE *file;
1612int size;
1613#endif
1614 {
1615 YY_BUFFER_STATE b;
1616
1617 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1618 if ( ! b )
1619 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1620
1621 b->yy_buf_size = size;
1622
1623 /* yy_ch_buf has to be 2 characters longer than the size given because
1624 * we need to put in 2 end-of-buffer characters.
1625 */
1626 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1627 if ( ! b->yy_ch_buf )
1628 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1629
1630 b->yy_is_our_buffer = 1;
1631
1632 yy_init_buffer( b, file );
1633
1634 return b;
1635 }
1636
1637
1638#ifdef YY_USE_PROTOS
1639void yy_delete_buffer( YY_BUFFER_STATE b )
1640#else
1641void yy_delete_buffer( b )
1642YY_BUFFER_STATE b;
1643#endif
1644 {
1645 if ( ! b )
1646 return;
1647
1648 if ( b == yy_current_buffer )
1649 yy_current_buffer = (YY_BUFFER_STATE) 0;
1650
1651 if ( b->yy_is_our_buffer )
1652 yy_flex_free( (void *) b->yy_ch_buf );
1653
1654 yy_flex_free( (void *) b );
1655 }
1656
1657
Chris Lattnere8242b12006-02-14 05:13:13 +00001658#ifndef YY_ALWAYS_INTERACTIVE
1659#ifndef YY_NEVER_INTERACTIVE
1660extern int isatty YY_PROTO(( int ));
1661#endif
1662#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +00001663
1664#ifdef YY_USE_PROTOS
1665void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1666#else
1667void yy_init_buffer( b, file )
1668YY_BUFFER_STATE b;
1669FILE *file;
1670#endif
1671
1672
1673 {
1674 yy_flush_buffer( b );
1675
1676 b->yy_input_file = file;
1677 b->yy_fill_buffer = 1;
1678
1679#if YY_ALWAYS_INTERACTIVE
1680 b->yy_is_interactive = 1;
1681#else
1682#if YY_NEVER_INTERACTIVE
1683 b->yy_is_interactive = 0;
1684#else
1685 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1686#endif
1687#endif
1688 }
1689
1690
1691#ifdef YY_USE_PROTOS
1692void yy_flush_buffer( YY_BUFFER_STATE b )
1693#else
1694void yy_flush_buffer( b )
1695YY_BUFFER_STATE b;
1696#endif
1697
1698 {
1699 if ( ! b )
1700 return;
1701
1702 b->yy_n_chars = 0;
1703
1704 /* We always need two end-of-buffer characters. The first causes
1705 * a transition to the end-of-buffer state. The second causes
1706 * a jam in that state.
1707 */
1708 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1709 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1710
1711 b->yy_buf_pos = &b->yy_ch_buf[0];
1712
1713 b->yy_at_bol = 1;
1714 b->yy_buffer_status = YY_BUFFER_NEW;
1715
1716 if ( b == yy_current_buffer )
1717 yy_load_buffer_state();
1718 }
1719
1720
1721#ifndef YY_NO_SCAN_BUFFER
1722#ifdef YY_USE_PROTOS
1723YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1724#else
1725YY_BUFFER_STATE yy_scan_buffer( base, size )
1726char *base;
1727yy_size_t size;
1728#endif
1729 {
1730 YY_BUFFER_STATE b;
1731
1732 if ( size < 2 ||
1733 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1734 base[size-1] != YY_END_OF_BUFFER_CHAR )
1735 /* They forgot to leave room for the EOB's. */
1736 return 0;
1737
1738 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1739 if ( ! b )
1740 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1741
1742 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1743 b->yy_buf_pos = b->yy_ch_buf = base;
1744 b->yy_is_our_buffer = 0;
1745 b->yy_input_file = 0;
1746 b->yy_n_chars = b->yy_buf_size;
1747 b->yy_is_interactive = 0;
1748 b->yy_at_bol = 1;
1749 b->yy_fill_buffer = 0;
1750 b->yy_buffer_status = YY_BUFFER_NEW;
1751
1752 yy_switch_to_buffer( b );
1753
1754 return b;
1755 }
1756#endif
1757
1758
1759#ifndef YY_NO_SCAN_STRING
1760#ifdef YY_USE_PROTOS
1761YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1762#else
1763YY_BUFFER_STATE yy_scan_string( yy_str )
1764yyconst char *yy_str;
1765#endif
1766 {
1767 int len;
1768 for ( len = 0; yy_str[len]; ++len )
1769 ;
1770
1771 return yy_scan_bytes( yy_str, len );
1772 }
1773#endif
1774
1775
1776#ifndef YY_NO_SCAN_BYTES
1777#ifdef YY_USE_PROTOS
1778YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1779#else
1780YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1781yyconst char *bytes;
1782int len;
1783#endif
1784 {
1785 YY_BUFFER_STATE b;
1786 char *buf;
1787 yy_size_t n;
1788 int i;
1789
1790 /* Get memory for full buffer, including space for trailing EOB's. */
1791 n = len + 2;
1792 buf = (char *) yy_flex_alloc( n );
1793 if ( ! buf )
1794 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1795
1796 for ( i = 0; i < len; ++i )
1797 buf[i] = bytes[i];
1798
1799 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1800
1801 b = yy_scan_buffer( buf, n );
1802 if ( ! b )
1803 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1804
1805 /* It's okay to grow etc. this buffer, and we should throw it
1806 * away when we're done.
1807 */
1808 b->yy_is_our_buffer = 1;
1809
1810 return b;
1811 }
1812#endif
1813
1814
1815#ifndef YY_NO_PUSH_STATE
1816#ifdef YY_USE_PROTOS
1817static void yy_push_state( int new_state )
1818#else
1819static void yy_push_state( new_state )
1820int new_state;
1821#endif
1822 {
1823 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1824 {
1825 yy_size_t new_size;
1826
1827 yy_start_stack_depth += YY_START_STACK_INCR;
1828 new_size = yy_start_stack_depth * sizeof( int );
1829
1830 if ( ! yy_start_stack )
1831 yy_start_stack = (int *) yy_flex_alloc( new_size );
1832
1833 else
1834 yy_start_stack = (int *) yy_flex_realloc(
1835 (void *) yy_start_stack, new_size );
1836
1837 if ( ! yy_start_stack )
1838 YY_FATAL_ERROR(
1839 "out of memory expanding start-condition stack" );
1840 }
1841
1842 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1843
1844 BEGIN(new_state);
1845 }
1846#endif
1847
1848
1849#ifndef YY_NO_POP_STATE
1850static void yy_pop_state()
1851 {
1852 if ( --yy_start_stack_ptr < 0 )
1853 YY_FATAL_ERROR( "start-condition stack underflow" );
1854
1855 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1856 }
1857#endif
1858
1859
1860#ifndef YY_NO_TOP_STATE
1861static int yy_top_state()
1862 {
1863 return yy_start_stack[yy_start_stack_ptr - 1];
1864 }
1865#endif
1866
1867#ifndef YY_EXIT_FAILURE
1868#define YY_EXIT_FAILURE 2
1869#endif
1870
1871#ifdef YY_USE_PROTOS
1872static void yy_fatal_error( yyconst char msg[] )
1873#else
1874static void yy_fatal_error( msg )
1875char msg[];
1876#endif
1877 {
1878 (void) fprintf( stderr, "%s\n", msg );
1879 exit( YY_EXIT_FAILURE );
1880 }
1881
1882
1883
1884/* Redefine yyless() so it works in section 3 code. */
1885
1886#undef yyless
1887#define yyless(n) \
1888 do \
1889 { \
1890 /* Undo effects of setting up yytext. */ \
1891 yytext[yyleng] = yy_hold_char; \
1892 yy_c_buf_p = yytext + n; \
1893 yy_hold_char = *yy_c_buf_p; \
1894 *yy_c_buf_p = '\0'; \
1895 yyleng = n; \
1896 } \
1897 while ( 0 )
1898
1899
1900/* Internal utility routines. */
1901
1902#ifndef yytext_ptr
1903#ifdef YY_USE_PROTOS
1904static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1905#else
1906static void yy_flex_strncpy( s1, s2, n )
1907char *s1;
1908yyconst char *s2;
1909int n;
1910#endif
1911 {
1912 register int i;
1913 for ( i = 0; i < n; ++i )
1914 s1[i] = s2[i];
1915 }
1916#endif
1917
1918#ifdef YY_NEED_STRLEN
1919#ifdef YY_USE_PROTOS
1920static int yy_flex_strlen( yyconst char *s )
1921#else
1922static int yy_flex_strlen( s )
1923yyconst char *s;
1924#endif
1925 {
1926 register int n;
1927 for ( n = 0; s[n]; ++n )
1928 ;
1929
1930 return n;
1931 }
1932#endif
1933
1934
1935#ifdef YY_USE_PROTOS
1936static void *yy_flex_alloc( yy_size_t size )
1937#else
1938static void *yy_flex_alloc( size )
1939yy_size_t size;
1940#endif
1941 {
1942 return (void *) malloc( size );
1943 }
1944
1945#ifdef YY_USE_PROTOS
1946static inline void *yy_flex_realloc( void *ptr, yy_size_t size )
1947#else
1948static inline void *yy_flex_realloc( ptr, size )
1949void *ptr;
1950yy_size_t size;
1951#endif
1952 {
1953 /* The cast to (char *) in the following accommodates both
1954 * implementations that use char* generic pointers, and those
1955 * that use void* generic pointers. It works with the latter
1956 * because both ANSI C and C++ allow castless assignment from
1957 * any pointer type to void*, and deal with argument conversions
1958 * as though doing an assignment.
1959 */
1960 return (void *) realloc( (char *) ptr, size );
1961 }
1962
1963#ifdef YY_USE_PROTOS
1964static void yy_flex_free( void *ptr )
1965#else
1966static void yy_flex_free( ptr )
1967void *ptr;
1968#endif
1969 {
1970 free( ptr );
1971 }
1972
1973#if YY_MAIN
1974int main()
1975 {
1976 yylex();
1977 return 0;
1978 }
1979#endif
Jim Laskey251e3c62007-02-06 18:03:31 +00001980#line 238 "/Volumes/Big2/llvm/llvm/utils/TableGen/FileLexer.l"
Chris Lattnere8242b12006-02-14 05:13:13 +00001981
Reid Spencer68a24bd2005-08-27 18:50:39 +00001982