blob: be356517ffe5bd2abec232d8593c33ea21038045 [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:
Neil Boothe3d936a2007-11-02 15:10:05 +000024 * $NetBSD: flex.skl,v 1.22 2005/08/08 01:28:08 christos Exp $
Reid Spencer68a24bd2005-08-27 18:50:39 +000025 */
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 ));
Neil Boothe3d936a2007-11-02 15:10:05 +0000260YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, yy_size_t len ));
261#ifdef __cplusplus
262YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, int size ));
Reid Spencer68a24bd2005-08-27 18:50:39 +0000263YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
Neil Boothe3d936a2007-11-02 15:10:05 +0000264#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000265
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
Neil Boothe3d936a2007-11-02 15:10:05 +0000294static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
295static inline void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ))
296#ifdef __GNUC__
297 __attribute__((__unused__))
298#endif
299;
300static void yy_flex_free YY_PROTO(( void * ));
301
Reid Spencer68a24bd2005-08-27 18:50:39 +0000302static yy_state_type yy_get_previous_state YY_PROTO(( void ));
303static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
304static int yy_get_next_buffer YY_PROTO(( void ));
305static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
306
307/* Done after the current pattern has been matched and before the
308 * corresponding action - sets up yytext.
309 */
310#define YY_DO_BEFORE_ACTION \
311 yytext_ptr = yy_bp; \
312 yyleng = (int) (yy_cp - yy_bp); \
313 yy_hold_char = *yy_cp; \
314 *yy_cp = '\0'; \
315 yy_c_buf_p = yy_cp;
316
Evan Cheng30d157572007-05-15 01:23:24 +0000317#define YY_NUM_RULES 35
318#define YY_END_OF_BUFFER 36
319static yyconst short int yy_acclist[146] =
Reid Spencer68a24bd2005-08-27 18:50:39 +0000320 { 0,
Evan Cheng30d157572007-05-15 01:23:24 +0000321 29, 29, 36, 34, 35, 27, 34, 35, 27, 35,
322 34, 35, 34, 35, 34, 35, 34, 35, 34, 35,
323 26, 34, 35, 26, 34, 35, 23, 34, 35, 34,
324 35, 23, 34, 35, 23, 34, 35, 23, 34, 35,
325 23, 34, 35, 23, 34, 35, 23, 34, 35, 23,
326 34, 35, 23, 34, 35, 29, 35, 30, 35, 32,
327 35, 27, 25, 24, 26, 28, 1, 23, 23, 23,
328 23, 23, 23, 23, 17, 23, 23, 23, 23, 23,
329 29, 30, 30, 33, 32, 31, 32, 24, 1, 26,
330 26, 5, 23, 23, 23, 10, 23, 12, 23, 23,
Reid Spencer68a24bd2005-08-27 18:50:39 +0000331
Evan Cheng30d157572007-05-15 01:23:24 +0000332 23, 4, 23, 16, 23, 23, 23, 23, 18, 21,
333 19, 20, 3, 6, 23, 23, 9, 23, 13, 23,
334 23, 23, 8, 23, 23, 23, 11, 23, 15, 23,
335 23, 23, 23, 23, 23, 7, 23, 23, 23, 23,
336 23, 22, 2, 14, 23
Reid Spencer68a24bd2005-08-27 18:50:39 +0000337 } ;
338
Evan Cheng30d157572007-05-15 01:23:24 +0000339static yyconst short int yy_accept[123] =
Reid Spencer68a24bd2005-08-27 18:50:39 +0000340 { 0,
341 1, 1, 1, 2, 3, 4, 6, 9, 11, 13,
Jim Laskey01ba6ad2007-02-06 18:20:07 +0000342 15, 17, 19, 21, 24, 27, 30, 32, 35, 38,
343 41, 44, 47, 50, 53, 56, 58, 60, 62, 63,
Evan Cheng30d157572007-05-15 01:23:24 +0000344 63, 63, 63, 64, 65, 66, 67, 68, 68, 68,
345 69, 69, 70, 71, 72, 73, 74, 75, 77, 78,
346 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
347 88, 88, 88, 88, 89, 90, 91, 92, 92, 92,
348 94, 95, 96, 98, 100, 101, 102, 104, 106, 107,
349 108, 109, 110, 111, 112, 113, 113, 113, 114, 116,
350 117, 119, 121, 122, 123, 125, 126, 127, 127, 129,
Reid Spencer68a24bd2005-08-27 18:50:39 +0000351
Evan Cheng30d157572007-05-15 01:23:24 +0000352 131, 132, 133, 134, 134, 135, 136, 138, 138, 139,
353 140, 140, 140, 141, 141, 141, 142, 143, 143, 144,
354 146, 146
Reid Spencer68a24bd2005-08-27 18:50:39 +0000355 } ;
356
357static yyconst int yy_ec[256] =
358 { 0,
359 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
360 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
361 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
362 1, 2, 5, 6, 1, 7, 1, 1, 1, 1,
Jim Laskey01ba6ad2007-02-06 18:20:07 +0000363 1, 8, 9, 1, 9, 1, 10, 11, 12, 13,
364 13, 13, 13, 13, 13, 13, 13, 1, 1, 1,
365 1, 1, 1, 1, 14, 14, 14, 14, 14, 14,
366 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
367 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
368 16, 1, 17, 1, 15, 1, 18, 19, 20, 21,
Reid Spencer68a24bd2005-08-27 18:50:39 +0000369
Jim Laskey01ba6ad2007-02-06 18:20:07 +0000370 22, 23, 24, 25, 26, 15, 15, 27, 28, 29,
371 30, 15, 15, 31, 32, 33, 34, 15, 15, 35,
372 15, 15, 36, 1, 37, 1, 1, 1, 1, 1,
Reid Spencer68a24bd2005-08-27 18:50:39 +0000373 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, 1, 1, 1, 1, 1,
379 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
380
381 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
382 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
383 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
384 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
385 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
386 1, 1, 1, 1, 1
387 } ;
388
Jim Laskey01ba6ad2007-02-06 18:20:07 +0000389static yyconst int yy_meta[38] =
Reid Spencer68a24bd2005-08-27 18:50:39 +0000390 { 0,
Jim Laskey01ba6ad2007-02-06 18:20:07 +0000391 1, 1, 2, 1, 1, 1, 1, 3, 1, 3,
392 4, 4, 4, 5, 6, 1, 1, 5, 5, 5,
393 5, 5, 5, 6, 6, 6, 6, 6, 6, 6,
394 6, 6, 6, 6, 6, 1, 1
Reid Spencer68a24bd2005-08-27 18:50:39 +0000395 } ;
396
Evan Cheng30d157572007-05-15 01:23:24 +0000397static yyconst short int yy_base[135] =
Reid Spencer68a24bd2005-08-27 18:50:39 +0000398 { 0,
Evan Cheng30d157572007-05-15 01:23:24 +0000399 0, 0, 30, 31, 221, 222, 40, 43, 28, 214,
400 0, 38, 44, 44, 53, 0, 183, 192, 31, 49,
401 191, 187, 46, 181, 181, 0, 65, 66, 78, 183,
402 52, 206, 222, 0, 75, 222, 0, 58, 0, 0,
403 174, 177, 191, 187, 183, 183, 183, 58, 171, 171,
404 175, 170, 0, 82, 85, 222, 86, 222, 89, 171,
405 172, 35, 167, 0, 0, 89, 0, 160, 179, 163,
406 162, 171, 0, 164, 164, 163, 0, 0, 156, 155,
407 161, 222, 222, 222, 222, 166, 148, 222, 0, 152,
408 0, 0, 162, 148, 0, 155, 151, 149, 0, 0,
Reid Spencer68a24bd2005-08-27 18:50:39 +0000409
Evan Cheng30d157572007-05-15 01:23:24 +0000410 157, 157, 152, 146, 152, 146, 0, 128, 100, 110,
411 89, 102, 74, 65, 83, 52, 222, 53, 222, 0,
412 222, 108, 114, 116, 119, 125, 131, 137, 140, 146,
413 149, 154, 160, 166
Reid Spencer68a24bd2005-08-27 18:50:39 +0000414 } ;
415
Evan Cheng30d157572007-05-15 01:23:24 +0000416static yyconst short int yy_def[135] =
Reid Spencer68a24bd2005-08-27 18:50:39 +0000417 { 0,
Evan Cheng30d157572007-05-15 01:23:24 +0000418 121, 1, 122, 122, 121, 121, 121, 121, 121, 123,
419 124, 121, 121, 121, 121, 125, 121, 125, 125, 125,
420 125, 125, 125, 125, 125, 126, 127, 128, 121, 121,
421 121, 123, 121, 129, 121, 121, 130, 121, 131, 125,
422 132, 125, 125, 125, 125, 125, 125, 125, 125, 125,
423 125, 125, 126, 127, 127, 121, 128, 121, 128, 121,
424 121, 121, 121, 129, 130, 121, 131, 132, 133, 125,
425 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
426 125, 121, 121, 121, 121, 121, 132, 121, 125, 125,
427 125, 125, 125, 125, 125, 125, 125, 121, 125, 125,
Reid Spencer68a24bd2005-08-27 18:50:39 +0000428
Evan Cheng30d157572007-05-15 01:23:24 +0000429 125, 125, 125, 121, 125, 125, 125, 121, 125, 125,
430 121, 121, 125, 121, 134, 125, 121, 134, 121, 125,
431 0, 121, 121, 121, 121, 121, 121, 121, 121, 121,
432 121, 121, 121, 121
Reid Spencer68a24bd2005-08-27 18:50:39 +0000433 } ;
434
Evan Cheng30d157572007-05-15 01:23:24 +0000435static yyconst short int yy_nxt[260] =
Reid Spencer68a24bd2005-08-27 18:50:39 +0000436 { 0,
437 6, 7, 8, 7, 9, 10, 11, 6, 12, 13,
Jim Laskey01ba6ad2007-02-06 18:20:07 +0000438 14, 15, 15, 16, 16, 17, 6, 16, 18, 19,
439 20, 16, 21, 16, 16, 22, 23, 24, 16, 16,
440 16, 25, 16, 16, 16, 6, 6, 27, 27, 28,
Evan Cheng30d157572007-05-15 01:23:24 +0000441 28, 29, 29, 29, 29, 29, 29, 30, 35, 35,
442 35, 36, 84, 37, 35, 35, 35, 43, 119, 31,
443 44, 85, 38, 35, 35, 35, 45, 49, 66, 66,
444 46, 50, 55, 58, 56, 59, 61, 76, 39, 29,
445 29, 29, 62, 120, 63, 35, 35, 35, 119, 121,
446 77, 121, 55, 121, 56, 121, 121, 117, 59, 66,
Reid Spencer68a24bd2005-08-27 18:50:39 +0000447
Evan Cheng30d157572007-05-15 01:23:24 +0000448 66, 112, 112, 112, 112, 116, 114, 115, 26, 26,
449 26, 26, 26, 26, 32, 32, 32, 32, 32, 32,
450 34, 34, 40, 40, 40, 53, 53, 113, 53, 53,
451 53, 54, 54, 54, 54, 54, 54, 57, 57, 57,
452 57, 57, 57, 64, 64, 64, 65, 111, 65, 65,
453 65, 65, 67, 67, 68, 68, 68, 68, 68, 68,
454 87, 87, 87, 87, 87, 87, 118, 118, 118, 118,
455 118, 118, 110, 109, 108, 107, 106, 105, 104, 103,
456 102, 101, 100, 99, 69, 98, 97, 96, 95, 94,
457 93, 92, 91, 90, 89, 88, 69, 86, 83, 82,
Reid Spencer68a24bd2005-08-27 18:50:39 +0000458
Evan Cheng30d157572007-05-15 01:23:24 +0000459 81, 80, 79, 78, 75, 74, 73, 72, 71, 70,
460 69, 33, 60, 52, 51, 48, 47, 42, 41, 33,
461 121, 5, 121, 121, 121, 121, 121, 121, 121, 121,
462 121, 121, 121, 121, 121, 121, 121, 121, 121, 121,
463 121, 121, 121, 121, 121, 121, 121, 121, 121, 121,
464 121, 121, 121, 121, 121, 121, 121, 121, 121
Reid Spencer68a24bd2005-08-27 18:50:39 +0000465 } ;
466
Evan Cheng30d157572007-05-15 01:23:24 +0000467static yyconst short int yy_chk[260] =
Reid Spencer68a24bd2005-08-27 18:50:39 +0000468 { 0,
469 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
470 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
471 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Jim Laskey01ba6ad2007-02-06 18:20:07 +0000472 1, 1, 1, 1, 1, 1, 1, 3, 4, 3,
Evan Cheng30d157572007-05-15 01:23:24 +0000473 4, 7, 7, 7, 8, 8, 8, 9, 12, 12,
474 12, 13, 62, 13, 14, 14, 14, 19, 118, 9,
475 19, 62, 14, 15, 15, 15, 20, 23, 38, 38,
476 20, 23, 27, 28, 27, 28, 31, 48, 14, 29,
477 29, 29, 31, 116, 31, 35, 35, 35, 115, 54,
478 48, 54, 55, 57, 55, 57, 59, 114, 59, 66,
Reid Spencer68a24bd2005-08-27 18:50:39 +0000479
Evan Cheng30d157572007-05-15 01:23:24 +0000480 66, 109, 109, 112, 112, 113, 111, 112, 122, 122,
481 122, 122, 122, 122, 123, 123, 123, 123, 123, 123,
482 124, 124, 125, 125, 125, 126, 126, 110, 126, 126,
483 126, 127, 127, 127, 127, 127, 127, 128, 128, 128,
484 128, 128, 128, 129, 129, 129, 130, 108, 130, 130,
485 130, 130, 131, 131, 132, 132, 132, 132, 132, 132,
486 133, 133, 133, 133, 133, 133, 134, 134, 134, 134,
487 134, 134, 106, 105, 104, 103, 102, 101, 98, 97,
488 96, 94, 93, 90, 87, 86, 81, 80, 79, 76,
489 75, 74, 72, 71, 70, 69, 68, 63, 61, 60,
Reid Spencer68a24bd2005-08-27 18:50:39 +0000490
Evan Cheng30d157572007-05-15 01:23:24 +0000491 52, 51, 50, 49, 47, 46, 45, 44, 43, 42,
492 41, 32, 30, 25, 24, 22, 21, 18, 17, 10,
493 5, 121, 121, 121, 121, 121, 121, 121, 121, 121,
494 121, 121, 121, 121, 121, 121, 121, 121, 121, 121,
495 121, 121, 121, 121, 121, 121, 121, 121, 121, 121,
496 121, 121, 121, 121, 121, 121, 121, 121, 121
Reid Spencer68a24bd2005-08-27 18:50:39 +0000497 } ;
498
499static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
500static char *yy_full_match;
501static int yy_lp;
502#define REJECT \
503{ \
504*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
505yy_cp = yy_full_match; /* restore poss. backed-over text */ \
506++yy_lp; \
507goto find_rule; \
508}
509#define yymore() yymore_used_but_not_detected
510#define YY_MORE_ADJ 0
511#define YY_RESTORE_YY_MORE_OFFSET
512char *yytext;
Neil Boothe3d936a2007-11-02 15:10:05 +0000513#line 1 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000514#define INITIAL 0
515/*===-- FileLexer.l - Scanner for TableGen Files ----------------*- C++ -*-===//
516//
517// The LLVM Compiler Infrastructure
518//
519// This file was developed by the LLVM research group and is distributed under
520// the University of Illinois Open Source License. See LICENSE.TXT for details.
521//
522//===----------------------------------------------------------------------===//
523//
524// This file defines a simple flex scanner for TableGen files. This is pretty
525// straight-forward, except for the magic to handle file inclusion.
526//
527//===----------------------------------------------------------------------===*/
528#define YY_NEVER_INTERACTIVE 1
Neil Boothe3d936a2007-11-02 15:10:05 +0000529#define in_comment 1
Reid Spencer68a24bd2005-08-27 18:50:39 +0000530
Neil Boothe3d936a2007-11-02 15:10:05 +0000531#line 30 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Chris Lattner5fa39df2006-11-05 23:28:58 +0000532#include "llvm/Config/config.h"
Bill Wendlingf5da1332006-12-07 22:21:48 +0000533#include "llvm/Support/Streams.h"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000534#include "Record.h"
535typedef std::pair<llvm::Record*, std::vector<llvm::Init*>*> SubClassRefTy;
536#include "FileParser.h"
537
538int Fileparse();
539
540namespace llvm {
541
542// Global variable recording the location of the include directory
Chris Lattnerc1d6e4e2006-03-03 01:47:37 +0000543std::vector<std::string> IncludeDirectories;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000544
545/// ParseInt - This has to handle the special case of binary numbers 0b0101
546///
547static int ParseInt(const char *Str) {
548 if (Str[0] == '0' && Str[1] == 'b')
Chris Lattnera4503de2006-09-18 22:28:27 +0000549 return strtoll(Str+2, 0, 2);
550 return strtoll(Str, 0, 0);
Reid Spencer68a24bd2005-08-27 18:50:39 +0000551}
552
553static int CommentDepth = 0;
554
555struct IncludeRec {
556 std::string Filename;
557 FILE *File;
558 unsigned LineNo;
559 YY_BUFFER_STATE Buffer;
560
561 IncludeRec(const std::string &FN, FILE *F)
562 : Filename(FN), File(F), LineNo(0){
563 }
564};
565
566static std::vector<IncludeRec> IncludeStack;
567
568std::ostream &err() {
Bill Wendlingf5da1332006-12-07 22:21:48 +0000569 if (IncludeStack.empty()) {
570 cerr << "At end of input: ";
571 return *cerr.stream();
572 }
Reid Spencer68a24bd2005-08-27 18:50:39 +0000573
574 for (unsigned i = 0, e = IncludeStack.size()-1; i != e; ++i)
Bill Wendlingf5da1332006-12-07 22:21:48 +0000575 cerr << "Included from " << IncludeStack[i].Filename << ":"
576 << IncludeStack[i].LineNo << ":\n";
577 cerr << "Parsing " << IncludeStack.back().Filename << ":"
578 << Filelineno << ": ";
579 return *cerr.stream();
Reid Spencer68a24bd2005-08-27 18:50:39 +0000580}
581
582/// ParseFile - this function begins the parsing of the specified tablegen file.
583///
Chris Lattnerc1d6e4e2006-03-03 01:47:37 +0000584void ParseFile(const std::string &Filename,
585 const std::vector<std::string> &IncludeDirs) {
Reid Spencer68a24bd2005-08-27 18:50:39 +0000586 FILE *F = stdin;
587 if (Filename != "-") {
588 F = fopen(Filename.c_str(), "r");
589
590 if (F == 0) {
Bill Wendlingf5da1332006-12-07 22:21:48 +0000591 cerr << "Could not open input file '" + Filename + "'!\n";
Reid Spencer68a24bd2005-08-27 18:50:39 +0000592 exit (1);
593 }
594 IncludeStack.push_back(IncludeRec(Filename, F));
595 } else {
596 IncludeStack.push_back(IncludeRec("<stdin>", stdin));
597 }
598
599 // Record the location of the include directory so that the lexer can find
600 // it later.
Chris Lattnerc1d6e4e2006-03-03 01:47:37 +0000601 IncludeDirectories = IncludeDirs;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000602
603 Filein = F;
604 Filelineno = 1;
605 Fileparse();
606 Filein = stdin;
607}
608
609/// HandleInclude - This function is called when an include directive is
610/// encountered in the input stream...
611///
612static void HandleInclude(const char *Buffer) {
613 unsigned Length = yyleng;
614 assert(Buffer[Length-1] == '"');
615 Buffer += strlen("include ");
616 Length -= strlen("include ");
617 while (*Buffer != '"') {
618 ++Buffer;
619 --Length;
620 }
621 assert(Length >= 2 && "Double quotes not found?");
622 std::string Filename(Buffer+1, Buffer+Length-1);
Bill Wendlingf5da1332006-12-07 22:21:48 +0000623 //cerr << "Filename = '" << Filename << "'\n";
Reid Spencer68a24bd2005-08-27 18:50:39 +0000624
625 // Save the line number and lex buffer of the includer...
626 IncludeStack.back().LineNo = Filelineno;
627 IncludeStack.back().Buffer = YY_CURRENT_BUFFER;
628
629 // Open the new input file...
630 yyin = fopen(Filename.c_str(), "r");
631 if (yyin == 0) {
632 // If we couldn't find the file in the current directory, look for it in
633 // the include directories.
634 //
Chris Lattnerc1d6e4e2006-03-03 01:47:37 +0000635 std::string NextFilename;
636 for (unsigned i = 0, e = IncludeDirectories.size(); i != e; ++i) {
637 NextFilename = IncludeDirectories[i] + "/" + Filename;
Chris Lattner56879b22006-03-03 19:34:28 +0000638 if ((yyin = fopen(NextFilename.c_str(), "r")))
Chris Lattnerc1d6e4e2006-03-03 01:47:37 +0000639 break;
640 }
641
Reid Spencer68a24bd2005-08-27 18:50:39 +0000642 if (yyin == 0) {
643 err() << "Could not find include file '" << Filename << "'!\n";
644 exit(1);
645 }
646 Filename = NextFilename;
647 }
648
649 // Add the file to our include stack...
650 IncludeStack.push_back(IncludeRec(Filename, yyin));
651 Filelineno = 1; // Reset line numbering...
652 //yyrestart(yyin); // Start lexing the new file...
653
654 yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
655}
656
657/// yywrap - This is called when the lexer runs out of input in one of the
658/// files. Switch back to an includer if an includee has run out of input.
659///
660extern "C"
661int yywrap(void) {
662 if (IncludeStack.back().File != stdin)
663 fclose(IncludeStack.back().File);
664 IncludeStack.pop_back();
665 if (IncludeStack.empty()) return 1; // Top-level file is done.
666
667 // Otherwise, we need to switch back to a file which included the current one.
668 Filelineno = IncludeStack.back().LineNo; // Restore current line number
669 yy_switch_to_buffer(IncludeStack.back().Buffer);
670 return 0;
671}
672
673} // End llvm namespace
674
675using namespace llvm;
676
Neil Boothe3d936a2007-11-02 15:10:05 +0000677#line 678 "Lexer.cpp"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000678
679/* Macros after this point can all be overridden by user definitions in
680 * section 1.
681 */
682
683#ifndef YY_SKIP_YYWRAP
684#ifdef __cplusplus
685extern "C" int yywrap YY_PROTO(( void ));
686#else
687extern int yywrap YY_PROTO(( void ));
688#endif
689#endif
690
691#ifndef YY_NO_UNPUT
Neil Boothe3d936a2007-11-02 15:10:05 +0000692static inline void yyunput YY_PROTO(( int c, char *buf_ptr ))
693#ifdef __GNUC__
694 __attribute__((__unused__))
695#endif
696;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000697#endif
698
699#ifndef yytext_ptr
Neil Boothe3d936a2007-11-02 15:10:05 +0000700static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, yy_size_t ));
Reid Spencer68a24bd2005-08-27 18:50:39 +0000701#endif
702
703#ifdef YY_NEED_STRLEN
Neil Boothe3d936a2007-11-02 15:10:05 +0000704static yy_size_t yy_flex_strlen YY_PROTO(( yyconst char * ));
Reid Spencer68a24bd2005-08-27 18:50:39 +0000705#endif
706
707#ifndef YY_NO_INPUT
708#ifdef __cplusplus
709static int yyinput YY_PROTO(( void ));
710#else
711static int input YY_PROTO(( void ));
712#endif
713#endif
714
715#if YY_STACK_USED
716static int yy_start_stack_ptr = 0;
717static int yy_start_stack_depth = 0;
718static int *yy_start_stack = 0;
719#ifndef YY_NO_PUSH_STATE
720static void yy_push_state YY_PROTO(( int new_state ));
721#endif
722#ifndef YY_NO_POP_STATE
723static void yy_pop_state YY_PROTO(( void ));
724#endif
725#ifndef YY_NO_TOP_STATE
726static int yy_top_state YY_PROTO(( void ));
727#endif
728
729#else
730#define YY_NO_PUSH_STATE 1
731#define YY_NO_POP_STATE 1
732#define YY_NO_TOP_STATE 1
733#endif
734
735#ifdef YY_MALLOC_DECL
736YY_MALLOC_DECL
737#else
738#if __STDC__
739#ifndef __cplusplus
740#include <stdlib.h>
741#endif
742#else
743/* Just try to get by without declaring the routines. This will fail
744 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
745 * or sizeof(void*) != sizeof(int).
746 */
747#endif
748#endif
749
750/* Amount of stuff to slurp up with each read. */
751#ifndef YY_READ_BUF_SIZE
752#define YY_READ_BUF_SIZE 8192
753#endif
754
755/* Copy whatever the last rule matched to the standard output. */
756
757#ifndef ECHO
758/* This used to be an fputs(), but since the string might contain NUL's,
759 * we now use fwrite().
760 */
Neil Boothe3d936a2007-11-02 15:10:05 +0000761#define ECHO (void) fwrite( yytext, (size_t)yyleng, 1, yyout )
Reid Spencer68a24bd2005-08-27 18:50:39 +0000762#endif
763
764/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
765 * is returned in "result".
766 */
767#ifndef YY_INPUT
768#define YY_INPUT(buf,result,max_size) \
769 if ( yy_current_buffer->yy_is_interactive ) \
770 { \
771 int c = '*', n; \
772 for ( n = 0; n < max_size && \
773 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
774 buf[n] = (char) c; \
775 if ( c == '\n' ) \
776 buf[n++] = (char) c; \
777 if ( c == EOF && ferror( yyin ) ) \
778 YY_FATAL_ERROR( "input in flex scanner failed" ); \
779 result = n; \
780 } \
Neil Boothe3d936a2007-11-02 15:10:05 +0000781 else if ( ((result = fread( buf, 1, (size_t)max_size, yyin )) == 0) \
Reid Spencer68a24bd2005-08-27 18:50:39 +0000782 && ferror( yyin ) ) \
783 YY_FATAL_ERROR( "input in flex scanner failed" );
784#endif
785
786/* No semi-colon after return; correct usage is to write "yyterminate();" -
787 * we don't want an extra ';' after the "return" because that will cause
788 * some compilers to complain about unreachable statements.
789 */
790#ifndef yyterminate
791#define yyterminate() return YY_NULL
792#endif
793
794/* Number of entries by which start-condition stack grows. */
795#ifndef YY_START_STACK_INCR
796#define YY_START_STACK_INCR 25
797#endif
798
799/* Report a fatal error. */
800#ifndef YY_FATAL_ERROR
801#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
802#endif
803
804/* Default declaration of generated scanner - a define so the user can
805 * easily add parameters.
806 */
807#ifndef YY_DECL
808#define YY_DECL int yylex YY_PROTO(( void ))
809#endif
810
811/* Code executed at the beginning of each rule, after yytext and yyleng
812 * have been set up.
813 */
814#ifndef YY_USER_ACTION
815#define YY_USER_ACTION
816#endif
817
818/* Code executed at the end of each rule. */
819#ifndef YY_BREAK
Neil Boothe3d936a2007-11-02 15:10:05 +0000820#define YY_BREAK /*LINTED*/break;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000821#endif
822
823#define YY_RULE_SETUP \
824 YY_USER_ACTION
825
826YY_DECL
827 {
828 register yy_state_type yy_current_state;
Chris Lattnere8242b12006-02-14 05:13:13 +0000829 register char *yy_cp, *yy_bp;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000830 register int yy_act;
831
Neil Boothe3d936a2007-11-02 15:10:05 +0000832#line 185 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000833
834
Neil Boothe3d936a2007-11-02 15:10:05 +0000835#line 836 "Lexer.cpp"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000836
Neil Boothe3d936a2007-11-02 15:10:05 +0000837#if defined(YY_USES_REJECT) && (defined(__GNUC__) || defined(lint))
838 /* XXX: shut up `unused label' warning with %options yylineno */
839 if (/*CONSTCOND*/0 && yy_full_match)
840 goto find_rule;
841#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000842 if ( yy_init )
843 {
844 yy_init = 0;
845
846#ifdef YY_USER_INIT
847 YY_USER_INIT;
848#endif
849
850 if ( ! yy_start )
851 yy_start = 1; /* first start state */
852
853 if ( ! yyin )
854 yyin = stdin;
855
856 if ( ! yyout )
857 yyout = stdout;
858
859 if ( ! yy_current_buffer )
860 yy_current_buffer =
861 yy_create_buffer( yyin, YY_BUF_SIZE );
862
863 yy_load_buffer_state();
864 }
865
Neil Boothe3d936a2007-11-02 15:10:05 +0000866 while (/*CONSTCOND*/ 1 ) /* loops until end-of-file is reached */
Reid Spencer68a24bd2005-08-27 18:50:39 +0000867 {
868 yy_cp = yy_c_buf_p;
869
870 /* Support of yytext. */
871 *yy_cp = yy_hold_char;
872
873 /* yy_bp points to the position in yy_ch_buf of the start of
874 * the current run.
875 */
876 yy_bp = yy_cp;
877
878 yy_current_state = yy_start;
879 yy_state_ptr = yy_state_buf;
880 *yy_state_ptr++ = yy_current_state;
881yy_match:
882 do
883 {
884 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
885 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
886 {
887 yy_current_state = (int) yy_def[yy_current_state];
Evan Cheng30d157572007-05-15 01:23:24 +0000888 if ( yy_current_state >= 122 )
Reid Spencer68a24bd2005-08-27 18:50:39 +0000889 yy_c = yy_meta[(unsigned int) yy_c];
890 }
891 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
892 *yy_state_ptr++ = yy_current_state;
893 ++yy_cp;
894 }
Evan Cheng30d157572007-05-15 01:23:24 +0000895 while ( yy_current_state != 121 );
Reid Spencer68a24bd2005-08-27 18:50:39 +0000896
897yy_find_action:
898 yy_current_state = *--yy_state_ptr;
899 yy_lp = yy_accept[yy_current_state];
900find_rule: /* we branch to this label when backing up */
901 for ( ; ; ) /* until we find what rule we matched */
902 {
903 if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
904 {
905 yy_act = yy_acclist[yy_lp];
906 {
907 yy_full_match = yy_cp;
908 break;
909 }
910 }
911 --yy_cp;
912 yy_current_state = *--yy_state_ptr;
913 yy_lp = yy_accept[yy_current_state];
914 }
915
916 YY_DO_BEFORE_ACTION;
917
918 if ( yy_act != YY_END_OF_BUFFER )
919 {
920 int yyl;
921 for ( yyl = 0; yyl < yyleng; ++yyl )
922 if ( yytext[yyl] == '\n' )
923 ++yylineno;
924 }
925
926do_action: /* This label is used only to access EOF actions. */
927
928
929 switch ( yy_act )
930 { /* beginning of action switch */
931case 1:
932YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +0000933#line 187 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000934{ /* Ignore comments */ }
935 YY_BREAK
936case 2:
937YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +0000938#line 189 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000939{ HandleInclude(yytext); }
940 YY_BREAK
941case 3:
942YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +0000943#line 190 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000944{ Filelval.StrVal = new std::string(yytext+2, yytext+yyleng-2);
945 return CODEFRAGMENT; }
946 YY_BREAK
947case 4:
948YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +0000949#line 193 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000950{ return INT; }
951 YY_BREAK
952case 5:
953YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +0000954#line 194 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000955{ return BIT; }
956 YY_BREAK
957case 6:
958YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +0000959#line 195 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000960{ return BITS; }
961 YY_BREAK
962case 7:
963YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +0000964#line 196 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000965{ return STRING; }
966 YY_BREAK
967case 8:
968YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +0000969#line 197 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000970{ return LIST; }
971 YY_BREAK
972case 9:
973YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +0000974#line 198 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000975{ return CODE; }
976 YY_BREAK
977case 10:
978YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +0000979#line 199 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000980{ return DAG; }
981 YY_BREAK
982case 11:
983YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +0000984#line 201 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000985{ return CLASS; }
986 YY_BREAK
987case 12:
988YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +0000989#line 202 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +0000990{ return DEF; }
991 YY_BREAK
992case 13:
993YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +0000994#line 203 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +0000995{ return DEFM; }
Reid Spencer68a24bd2005-08-27 18:50:39 +0000996 YY_BREAK
997case 14:
998YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +0000999#line 204 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +00001000{ return MULTICLASS; }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001001 YY_BREAK
1002case 15:
1003YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +00001004#line 205 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +00001005{ return FIELD; }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001006 YY_BREAK
1007case 16:
1008YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +00001009#line 206 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +00001010{ return LET; }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001011 YY_BREAK
1012case 17:
1013YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +00001014#line 207 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Chris Lattner27627382006-09-01 21:14:42 +00001015{ return IN; }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001016 YY_BREAK
1017case 18:
1018YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +00001019#line 209 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Evan Cheng30d157572007-05-15 01:23:24 +00001020{ return CONCATTOK; }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001021 YY_BREAK
1022case 19:
1023YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +00001024#line 210 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Evan Cheng30d157572007-05-15 01:23:24 +00001025{ return SRATOK; }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001026 YY_BREAK
1027case 20:
1028YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +00001029#line 211 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Evan Cheng30d157572007-05-15 01:23:24 +00001030{ return SRLTOK; }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001031 YY_BREAK
1032case 21:
1033YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +00001034#line 212 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Evan Cheng30d157572007-05-15 01:23:24 +00001035{ return SHLTOK; }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001036 YY_BREAK
1037case 22:
1038YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +00001039#line 213 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Evan Cheng30d157572007-05-15 01:23:24 +00001040{ return STRCONCATTOK; }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001041 YY_BREAK
1042case 23:
1043YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +00001044#line 216 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Evan Cheng30d157572007-05-15 01:23:24 +00001045{ Filelval.StrVal = new std::string(yytext, yytext+yyleng);
1046 return ID; }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001047 YY_BREAK
1048case 24:
1049YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +00001050#line 218 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Evan Cheng30d157572007-05-15 01:23:24 +00001051{ Filelval.StrVal = new std::string(yytext+1, yytext+yyleng);
1052 return VARNAME; }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001053 YY_BREAK
1054case 25:
1055YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +00001056#line 221 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Evan Cheng30d157572007-05-15 01:23:24 +00001057{ Filelval.StrVal = new std::string(yytext+1, yytext+yyleng-1);
1058 return STRVAL; }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001059 YY_BREAK
1060case 26:
1061YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +00001062#line 224 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Evan Cheng30d157572007-05-15 01:23:24 +00001063{ Filelval.IntVal = ParseInt(Filetext); return INTVAL; }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001064 YY_BREAK
1065case 27:
1066YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +00001067#line 226 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Evan Cheng30d157572007-05-15 01:23:24 +00001068{ /* Ignore whitespace */ }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001069 YY_BREAK
1070case 28:
1071YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +00001072#line 229 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
1073{ BEGIN(in_comment); CommentDepth++; }
Reid Spencer68a24bd2005-08-27 18:50:39 +00001074 YY_BREAK
1075case 29:
1076YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +00001077#line 230 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Evan Cheng30d157572007-05-15 01:23:24 +00001078{} /* eat anything that's not a '*' or '/' */
Reid Spencer68a24bd2005-08-27 18:50:39 +00001079 YY_BREAK
1080case 30:
1081YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +00001082#line 231 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Evan Cheng30d157572007-05-15 01:23:24 +00001083{} /* eat up '*'s not followed by '/'s */
Reid Spencer68a24bd2005-08-27 18:50:39 +00001084 YY_BREAK
1085case 31:
1086YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +00001087#line 232 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Evan Cheng30d157572007-05-15 01:23:24 +00001088{ ++CommentDepth; }
Chris Lattnerb8316912006-03-31 21:54:11 +00001089 YY_BREAK
1090case 32:
1091YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +00001092#line 233 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Evan Cheng30d157572007-05-15 01:23:24 +00001093{} /* eat up /'s not followed by *'s */
Chris Lattner27627382006-09-01 21:14:42 +00001094 YY_BREAK
1095case 33:
1096YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +00001097#line 234 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Evan Cheng30d157572007-05-15 01:23:24 +00001098{ if (!--CommentDepth) { BEGIN(INITIAL); } }
1099 YY_BREAK
Neil Boothe3d936a2007-11-02 15:10:05 +00001100case YY_STATE_EOF(in_comment):
1101#line 235 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Evan Cheng30d157572007-05-15 01:23:24 +00001102{ err() << "Unterminated comment!\n"; exit(1); }
Chris Lattner27627382006-09-01 21:14:42 +00001103 YY_BREAK
1104case 34:
1105YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +00001106#line 237 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Evan Cheng30d157572007-05-15 01:23:24 +00001107{ return Filetext[0]; }
1108 YY_BREAK
1109case 35:
1110YY_RULE_SETUP
Neil Boothe3d936a2007-11-02 15:10:05 +00001111#line 239 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Reid Spencer68a24bd2005-08-27 18:50:39 +00001112YY_FATAL_ERROR( "flex scanner jammed" );
1113 YY_BREAK
Neil Boothe3d936a2007-11-02 15:10:05 +00001114#line 1115 "Lexer.cpp"
Reid Spencer68a24bd2005-08-27 18:50:39 +00001115 case YY_STATE_EOF(INITIAL):
1116 yyterminate();
1117
1118 case YY_END_OF_BUFFER:
1119 {
1120 /* Amount of text matched not including the EOB char. */
1121 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1122
1123 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1124 *yy_cp = yy_hold_char;
1125 YY_RESTORE_YY_MORE_OFFSET
1126
1127 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1128 {
1129 /* We're scanning a new file or input source. It's
1130 * possible that this happened because the user
1131 * just pointed yyin at a new source and called
1132 * yylex(). If so, then we have to assure
1133 * consistency between yy_current_buffer and our
1134 * globals. Here is the right place to do so, because
1135 * this is the first action (other than possibly a
1136 * back-up) that will match for the new input source.
1137 */
1138 yy_n_chars = yy_current_buffer->yy_n_chars;
1139 yy_current_buffer->yy_input_file = yyin;
1140 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1141 }
1142
1143 /* Note that here we test for yy_c_buf_p "<=" to the position
1144 * of the first EOB in the buffer, since yy_c_buf_p will
1145 * already have been incremented past the NUL character
1146 * (since all states make transitions on EOB to the
1147 * end-of-buffer state). Contrast this with the test
1148 * in input().
1149 */
1150 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1151 { /* This was really a NUL. */
1152 yy_state_type yy_next_state;
1153
1154 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1155
1156 yy_current_state = yy_get_previous_state();
1157
1158 /* Okay, we're now positioned to make the NUL
1159 * transition. We couldn't have
1160 * yy_get_previous_state() go ahead and do it
1161 * for us because it doesn't know how to deal
1162 * with the possibility of jamming (and we don't
1163 * want to build jamming into it because then it
1164 * will run more slowly).
1165 */
1166
1167 yy_next_state = yy_try_NUL_trans( yy_current_state );
1168
1169 yy_bp = yytext_ptr + YY_MORE_ADJ;
1170
1171 if ( yy_next_state )
1172 {
1173 /* Consume the NUL. */
1174 yy_cp = ++yy_c_buf_p;
1175 yy_current_state = yy_next_state;
1176 goto yy_match;
1177 }
1178
1179 else
1180 {
1181 yy_cp = yy_c_buf_p;
1182 goto yy_find_action;
1183 }
1184 }
1185
1186 else switch ( yy_get_next_buffer() )
1187 {
1188 case EOB_ACT_END_OF_FILE:
1189 {
1190 yy_did_buffer_switch_on_eof = 0;
1191
1192 if ( yywrap() )
1193 {
1194 /* Note: because we've taken care in
1195 * yy_get_next_buffer() to have set up
1196 * yytext, we can now set up
1197 * yy_c_buf_p so that if some total
1198 * hoser (like flex itself) wants to
1199 * call the scanner after we return the
1200 * YY_NULL, it'll still work - another
1201 * YY_NULL will get returned.
1202 */
1203 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1204
1205 yy_act = YY_STATE_EOF(YY_START);
1206 goto do_action;
1207 }
1208
1209 else
1210 {
1211 if ( ! yy_did_buffer_switch_on_eof )
1212 YY_NEW_FILE;
1213 }
1214 break;
1215 }
1216
1217 case EOB_ACT_CONTINUE_SCAN:
1218 yy_c_buf_p =
1219 yytext_ptr + yy_amount_of_matched_text;
1220
1221 yy_current_state = yy_get_previous_state();
1222
1223 yy_cp = yy_c_buf_p;
1224 yy_bp = yytext_ptr + YY_MORE_ADJ;
1225 goto yy_match;
1226
1227 case EOB_ACT_LAST_MATCH:
1228 yy_c_buf_p =
1229 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1230
1231 yy_current_state = yy_get_previous_state();
1232
1233 yy_cp = yy_c_buf_p;
1234 yy_bp = yytext_ptr + YY_MORE_ADJ;
1235 goto yy_find_action;
1236 }
1237 break;
1238 }
1239
1240 default:
1241 YY_FATAL_ERROR(
1242 "fatal flex scanner internal error--no action found" );
1243 } /* end of action switch */
1244 } /* end of scanning one token */
1245 } /* end of yylex */
1246
1247
1248/* yy_get_next_buffer - try to read in a new buffer
1249 *
1250 * Returns a code representing an action:
1251 * EOB_ACT_LAST_MATCH -
1252 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1253 * EOB_ACT_END_OF_FILE - end of file
1254 */
1255
1256static int yy_get_next_buffer()
1257 {
1258 register char *dest = yy_current_buffer->yy_ch_buf;
1259 register char *source = yytext_ptr;
1260 register int number_to_move, i;
1261 int ret_val;
1262
1263 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1264 YY_FATAL_ERROR(
1265 "fatal flex scanner internal error--end of buffer missed" );
1266
1267 if ( yy_current_buffer->yy_fill_buffer == 0 )
1268 { /* Don't try to fill the buffer, so this is an EOF. */
1269 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1270 {
1271 /* We matched a single character, the EOB, so
1272 * treat this as a final EOF.
1273 */
1274 return EOB_ACT_END_OF_FILE;
1275 }
1276
1277 else
1278 {
1279 /* We matched some text prior to the EOB, first
1280 * process it.
1281 */
1282 return EOB_ACT_LAST_MATCH;
1283 }
1284 }
1285
1286 /* Try to read more data. */
1287
1288 /* First move last chars to start of buffer. */
1289 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1290
1291 for ( i = 0; i < number_to_move; ++i )
1292 *(dest++) = *(source++);
1293
1294 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1295 /* don't do the read, it's not guaranteed to return an EOF,
1296 * just force an EOF
1297 */
1298 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1299
1300 else
1301 {
1302 int num_to_read =
1303 yy_current_buffer->yy_buf_size - number_to_move - 1;
1304
1305 while ( num_to_read <= 0 )
1306 { /* Not enough room in the buffer - grow it. */
1307#ifdef YY_USES_REJECT
1308 YY_FATAL_ERROR(
1309"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1310#else
1311
1312 /* just a shorter name for the current buffer */
1313 YY_BUFFER_STATE b = yy_current_buffer;
1314
1315 int yy_c_buf_p_offset =
1316 (int) (yy_c_buf_p - b->yy_ch_buf);
1317
1318 if ( b->yy_is_our_buffer )
1319 {
1320 int new_size = b->yy_buf_size * 2;
1321
1322 if ( new_size <= 0 )
1323 b->yy_buf_size += b->yy_buf_size / 8;
1324 else
1325 b->yy_buf_size *= 2;
1326
1327 b->yy_ch_buf = (char *)
1328 /* Include room in for 2 EOB chars. */
1329 yy_flex_realloc( (void *) b->yy_ch_buf,
1330 b->yy_buf_size + 2 );
1331 }
1332 else
1333 /* Can't grow it, we don't own it. */
1334 b->yy_ch_buf = 0;
1335
1336 if ( ! b->yy_ch_buf )
1337 YY_FATAL_ERROR(
1338 "fatal error - scanner input buffer overflow" );
1339
1340 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1341
1342 num_to_read = yy_current_buffer->yy_buf_size -
1343 number_to_move - 1;
1344#endif
1345 }
1346
1347 if ( num_to_read > YY_READ_BUF_SIZE )
1348 num_to_read = YY_READ_BUF_SIZE;
1349
1350 /* Read in more data. */
1351 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1352 yy_n_chars, num_to_read );
1353
1354 yy_current_buffer->yy_n_chars = yy_n_chars;
1355 }
1356
1357 if ( yy_n_chars == 0 )
1358 {
1359 if ( number_to_move == YY_MORE_ADJ )
1360 {
1361 ret_val = EOB_ACT_END_OF_FILE;
1362 yyrestart( yyin );
1363 }
1364
1365 else
1366 {
1367 ret_val = EOB_ACT_LAST_MATCH;
1368 yy_current_buffer->yy_buffer_status =
1369 YY_BUFFER_EOF_PENDING;
1370 }
1371 }
1372
1373 else
1374 ret_val = EOB_ACT_CONTINUE_SCAN;
1375
1376 yy_n_chars += number_to_move;
1377 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1378 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1379
1380 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1381
1382 return ret_val;
1383 }
1384
1385
1386/* yy_get_previous_state - get the state just before the EOB char was reached */
1387
1388static yy_state_type yy_get_previous_state()
1389 {
1390 register yy_state_type yy_current_state;
1391 register char *yy_cp;
1392
1393 yy_current_state = yy_start;
1394 yy_state_ptr = yy_state_buf;
1395 *yy_state_ptr++ = yy_current_state;
1396
1397 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1398 {
1399 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1400 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1401 {
1402 yy_current_state = (int) yy_def[yy_current_state];
Evan Cheng30d157572007-05-15 01:23:24 +00001403 if ( yy_current_state >= 122 )
Reid Spencer68a24bd2005-08-27 18:50:39 +00001404 yy_c = yy_meta[(unsigned int) yy_c];
1405 }
1406 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1407 *yy_state_ptr++ = yy_current_state;
1408 }
1409
1410 return yy_current_state;
1411 }
1412
1413
1414/* yy_try_NUL_trans - try to make a transition on the NUL character
1415 *
1416 * synopsis
1417 * next_state = yy_try_NUL_trans( current_state );
1418 */
1419
1420#ifdef YY_USE_PROTOS
1421static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1422#else
1423static yy_state_type yy_try_NUL_trans( yy_current_state )
1424yy_state_type yy_current_state;
1425#endif
1426 {
1427 register int yy_is_jam;
1428
1429 register YY_CHAR yy_c = 1;
1430 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1431 {
1432 yy_current_state = (int) yy_def[yy_current_state];
Evan Cheng30d157572007-05-15 01:23:24 +00001433 if ( yy_current_state >= 122 )
Reid Spencer68a24bd2005-08-27 18:50:39 +00001434 yy_c = yy_meta[(unsigned int) yy_c];
1435 }
1436 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
Evan Cheng30d157572007-05-15 01:23:24 +00001437 yy_is_jam = (yy_current_state == 121);
Reid Spencer68a24bd2005-08-27 18:50:39 +00001438 if ( ! yy_is_jam )
1439 *yy_state_ptr++ = yy_current_state;
1440
1441 return yy_is_jam ? 0 : yy_current_state;
1442 }
1443
1444
1445#ifndef YY_NO_UNPUT
1446#ifdef YY_USE_PROTOS
1447static inline void yyunput( int c, register char *yy_bp )
1448#else
1449static inline void yyunput( c, yy_bp )
1450int c;
1451register char *yy_bp;
1452#endif
1453 {
1454 register char *yy_cp = yy_c_buf_p;
1455
1456 /* undo effects of setting up yytext */
1457 *yy_cp = yy_hold_char;
1458
1459 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1460 { /* need to shift things up to make room */
1461 /* +2 for EOB chars. */
1462 register int number_to_move = yy_n_chars + 2;
1463 register char *dest = &yy_current_buffer->yy_ch_buf[
1464 yy_current_buffer->yy_buf_size + 2];
1465 register char *source =
1466 &yy_current_buffer->yy_ch_buf[number_to_move];
1467
1468 while ( source > yy_current_buffer->yy_ch_buf )
1469 *--dest = *--source;
1470
1471 yy_cp += (int) (dest - source);
1472 yy_bp += (int) (dest - source);
1473 yy_current_buffer->yy_n_chars =
1474 yy_n_chars = yy_current_buffer->yy_buf_size;
1475
1476 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1477 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1478 }
1479
1480 *--yy_cp = (char) c;
1481
1482 if ( c == '\n' )
1483 --yylineno;
1484
1485 yytext_ptr = yy_bp;
1486 yy_hold_char = *yy_cp;
1487 yy_c_buf_p = yy_cp;
1488 }
1489#endif /* ifndef YY_NO_UNPUT */
1490
1491
Reid Spencer68a24bd2005-08-27 18:50:39 +00001492#ifdef __cplusplus
1493static int yyinput()
1494#else
1495static int input()
1496#endif
1497 {
1498 int c;
1499
1500 *yy_c_buf_p = yy_hold_char;
1501
1502 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1503 {
1504 /* yy_c_buf_p now points to the character we want to return.
1505 * If this occurs *before* the EOB characters, then it's a
1506 * valid NUL; if not, then we've hit the end of the buffer.
1507 */
1508 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1509 /* This was really a NUL. */
1510 *yy_c_buf_p = '\0';
1511
1512 else
1513 { /* need more input */
1514 int offset = yy_c_buf_p - yytext_ptr;
1515 ++yy_c_buf_p;
1516
1517 switch ( yy_get_next_buffer() )
1518 {
1519 case EOB_ACT_LAST_MATCH:
1520 /* This happens because yy_g_n_b()
1521 * sees that we've accumulated a
1522 * token and flags that we need to
1523 * try matching the token before
1524 * proceeding. But for input(),
1525 * there's no matching to consider.
1526 * So convert the EOB_ACT_LAST_MATCH
1527 * to EOB_ACT_END_OF_FILE.
1528 */
1529
1530 /* Reset buffer status. */
1531 yyrestart( yyin );
1532
Neil Boothe3d936a2007-11-02 15:10:05 +00001533 /*FALLTHROUGH*/
Reid Spencer68a24bd2005-08-27 18:50:39 +00001534
1535 case EOB_ACT_END_OF_FILE:
1536 {
1537 if ( yywrap() )
Jim Laskey251e3c62007-02-06 18:03:31 +00001538 return EOF;
Reid Spencer68a24bd2005-08-27 18:50:39 +00001539
1540 if ( ! yy_did_buffer_switch_on_eof )
1541 YY_NEW_FILE;
1542#ifdef __cplusplus
1543 return yyinput();
1544#else
1545 return input();
1546#endif
1547 }
1548
1549 case EOB_ACT_CONTINUE_SCAN:
1550 yy_c_buf_p = yytext_ptr + offset;
1551 break;
1552 }
1553 }
1554 }
1555
1556 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1557 *yy_c_buf_p = '\0'; /* preserve yytext */
1558 yy_hold_char = *++yy_c_buf_p;
1559
1560 if ( c == '\n' )
1561 ++yylineno;
1562
1563 return c;
1564 }
Chris Lattnere8242b12006-02-14 05:13:13 +00001565
Reid Spencer68a24bd2005-08-27 18:50:39 +00001566
1567#ifdef YY_USE_PROTOS
1568void yyrestart( FILE *input_file )
1569#else
1570void yyrestart( input_file )
1571FILE *input_file;
1572#endif
1573 {
1574 if ( ! yy_current_buffer )
1575 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1576
1577 yy_init_buffer( yy_current_buffer, input_file );
1578 yy_load_buffer_state();
1579 }
1580
1581
1582#ifdef YY_USE_PROTOS
1583void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1584#else
1585void yy_switch_to_buffer( new_buffer )
1586YY_BUFFER_STATE new_buffer;
1587#endif
1588 {
1589 if ( yy_current_buffer == new_buffer )
1590 return;
1591
1592 if ( yy_current_buffer )
1593 {
1594 /* Flush out information for old buffer. */
1595 *yy_c_buf_p = yy_hold_char;
1596 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1597 yy_current_buffer->yy_n_chars = yy_n_chars;
1598 }
1599
1600 yy_current_buffer = new_buffer;
1601 yy_load_buffer_state();
1602
1603 /* We don't actually know whether we did this switch during
1604 * EOF (yywrap()) processing, but the only time this flag
1605 * is looked at is after yywrap() is called, so it's safe
1606 * to go ahead and always set it.
1607 */
1608 yy_did_buffer_switch_on_eof = 1;
1609 }
1610
1611
1612#ifdef YY_USE_PROTOS
1613void yy_load_buffer_state( void )
1614#else
1615void yy_load_buffer_state()
1616#endif
1617 {
1618 yy_n_chars = yy_current_buffer->yy_n_chars;
1619 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1620 yyin = yy_current_buffer->yy_input_file;
1621 yy_hold_char = *yy_c_buf_p;
1622 }
1623
1624
1625#ifdef YY_USE_PROTOS
1626YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1627#else
1628YY_BUFFER_STATE yy_create_buffer( file, size )
1629FILE *file;
1630int size;
1631#endif
1632 {
1633 YY_BUFFER_STATE b;
1634
1635 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1636 if ( ! b )
1637 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1638
1639 b->yy_buf_size = size;
1640
1641 /* yy_ch_buf has to be 2 characters longer than the size given because
1642 * we need to put in 2 end-of-buffer characters.
1643 */
1644 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1645 if ( ! b->yy_ch_buf )
1646 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1647
1648 b->yy_is_our_buffer = 1;
1649
1650 yy_init_buffer( b, file );
1651
1652 return b;
1653 }
1654
1655
1656#ifdef YY_USE_PROTOS
1657void yy_delete_buffer( YY_BUFFER_STATE b )
1658#else
1659void yy_delete_buffer( b )
1660YY_BUFFER_STATE b;
1661#endif
1662 {
1663 if ( ! b )
1664 return;
1665
1666 if ( b == yy_current_buffer )
1667 yy_current_buffer = (YY_BUFFER_STATE) 0;
1668
1669 if ( b->yy_is_our_buffer )
1670 yy_flex_free( (void *) b->yy_ch_buf );
1671
1672 yy_flex_free( (void *) b );
1673 }
1674
1675
Chris Lattnere8242b12006-02-14 05:13:13 +00001676#ifndef YY_ALWAYS_INTERACTIVE
1677#ifndef YY_NEVER_INTERACTIVE
Neil Boothe3d936a2007-11-02 15:10:05 +00001678#include <unistd.h>
Chris Lattnere8242b12006-02-14 05:13:13 +00001679#endif
1680#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +00001681
1682#ifdef YY_USE_PROTOS
1683void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1684#else
1685void yy_init_buffer( b, file )
1686YY_BUFFER_STATE b;
1687FILE *file;
1688#endif
1689
1690
1691 {
1692 yy_flush_buffer( b );
1693
1694 b->yy_input_file = file;
1695 b->yy_fill_buffer = 1;
1696
1697#if YY_ALWAYS_INTERACTIVE
1698 b->yy_is_interactive = 1;
1699#else
1700#if YY_NEVER_INTERACTIVE
1701 b->yy_is_interactive = 0;
1702#else
1703 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1704#endif
1705#endif
1706 }
1707
1708
1709#ifdef YY_USE_PROTOS
1710void yy_flush_buffer( YY_BUFFER_STATE b )
1711#else
1712void yy_flush_buffer( b )
1713YY_BUFFER_STATE b;
1714#endif
1715
1716 {
1717 if ( ! b )
1718 return;
1719
1720 b->yy_n_chars = 0;
1721
1722 /* We always need two end-of-buffer characters. The first causes
1723 * a transition to the end-of-buffer state. The second causes
1724 * a jam in that state.
1725 */
1726 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1727 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1728
1729 b->yy_buf_pos = &b->yy_ch_buf[0];
1730
1731 b->yy_at_bol = 1;
1732 b->yy_buffer_status = YY_BUFFER_NEW;
1733
1734 if ( b == yy_current_buffer )
1735 yy_load_buffer_state();
1736 }
1737
1738
1739#ifndef YY_NO_SCAN_BUFFER
1740#ifdef YY_USE_PROTOS
1741YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1742#else
1743YY_BUFFER_STATE yy_scan_buffer( base, size )
1744char *base;
1745yy_size_t size;
1746#endif
1747 {
1748 YY_BUFFER_STATE b;
1749
1750 if ( size < 2 ||
1751 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1752 base[size-1] != YY_END_OF_BUFFER_CHAR )
1753 /* They forgot to leave room for the EOB's. */
1754 return 0;
1755
1756 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1757 if ( ! b )
1758 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1759
1760 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1761 b->yy_buf_pos = b->yy_ch_buf = base;
1762 b->yy_is_our_buffer = 0;
1763 b->yy_input_file = 0;
1764 b->yy_n_chars = b->yy_buf_size;
1765 b->yy_is_interactive = 0;
1766 b->yy_at_bol = 1;
1767 b->yy_fill_buffer = 0;
1768 b->yy_buffer_status = YY_BUFFER_NEW;
1769
1770 yy_switch_to_buffer( b );
1771
1772 return b;
1773 }
Neil Boothe3d936a2007-11-02 15:10:05 +00001774#ifdef __cplusplus
1775YY_BUFFER_STATE yy_scan_buffer( char *base, int size )
1776 {
1777 return yy_scan_buffer(base, (yy_size_t) size);
1778 }
1779#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +00001780#endif
1781
1782
1783#ifndef YY_NO_SCAN_STRING
1784#ifdef YY_USE_PROTOS
1785YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1786#else
1787YY_BUFFER_STATE yy_scan_string( yy_str )
1788yyconst char *yy_str;
1789#endif
1790 {
Neil Boothe3d936a2007-11-02 15:10:05 +00001791 yy_size_t len;
Reid Spencer68a24bd2005-08-27 18:50:39 +00001792 for ( len = 0; yy_str[len]; ++len )
1793 ;
1794
1795 return yy_scan_bytes( yy_str, len );
1796 }
1797#endif
1798
1799
1800#ifndef YY_NO_SCAN_BYTES
1801#ifdef YY_USE_PROTOS
Neil Boothe3d936a2007-11-02 15:10:05 +00001802YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, yy_size_t len )
Reid Spencer68a24bd2005-08-27 18:50:39 +00001803#else
1804YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1805yyconst char *bytes;
Neil Boothe3d936a2007-11-02 15:10:05 +00001806yy_size_t len;
Reid Spencer68a24bd2005-08-27 18:50:39 +00001807#endif
1808 {
1809 YY_BUFFER_STATE b;
1810 char *buf;
Neil Boothe3d936a2007-11-02 15:10:05 +00001811 yy_size_t n, i;
Reid Spencer68a24bd2005-08-27 18:50:39 +00001812
1813 /* Get memory for full buffer, including space for trailing EOB's. */
1814 n = len + 2;
1815 buf = (char *) yy_flex_alloc( n );
1816 if ( ! buf )
1817 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1818
1819 for ( i = 0; i < len; ++i )
1820 buf[i] = bytes[i];
1821
1822 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1823
1824 b = yy_scan_buffer( buf, n );
1825 if ( ! b )
1826 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1827
1828 /* It's okay to grow etc. this buffer, and we should throw it
1829 * away when we're done.
1830 */
1831 b->yy_is_our_buffer = 1;
1832
1833 return b;
1834 }
Neil Boothe3d936a2007-11-02 15:10:05 +00001835#ifdef __cplusplus
1836YY_BUFFER_STATE yy_scan_bytes( yyconst char *base, int size )
1837 {
1838 return yy_scan_bytes(base, (yy_size_t) size);
1839 }
1840#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +00001841#endif
1842
1843
1844#ifndef YY_NO_PUSH_STATE
1845#ifdef YY_USE_PROTOS
1846static void yy_push_state( int new_state )
1847#else
1848static void yy_push_state( new_state )
1849int new_state;
1850#endif
1851 {
1852 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1853 {
1854 yy_size_t new_size;
1855
1856 yy_start_stack_depth += YY_START_STACK_INCR;
1857 new_size = yy_start_stack_depth * sizeof( int );
1858
1859 if ( ! yy_start_stack )
1860 yy_start_stack = (int *) yy_flex_alloc( new_size );
1861
1862 else
1863 yy_start_stack = (int *) yy_flex_realloc(
1864 (void *) yy_start_stack, new_size );
1865
1866 if ( ! yy_start_stack )
1867 YY_FATAL_ERROR(
1868 "out of memory expanding start-condition stack" );
1869 }
1870
1871 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1872
1873 BEGIN(new_state);
1874 }
1875#endif
1876
1877
1878#ifndef YY_NO_POP_STATE
1879static void yy_pop_state()
1880 {
1881 if ( --yy_start_stack_ptr < 0 )
1882 YY_FATAL_ERROR( "start-condition stack underflow" );
1883
1884 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1885 }
1886#endif
1887
1888
1889#ifndef YY_NO_TOP_STATE
1890static int yy_top_state()
1891 {
1892 return yy_start_stack[yy_start_stack_ptr - 1];
1893 }
1894#endif
1895
1896#ifndef YY_EXIT_FAILURE
1897#define YY_EXIT_FAILURE 2
1898#endif
1899
1900#ifdef YY_USE_PROTOS
1901static void yy_fatal_error( yyconst char msg[] )
1902#else
1903static void yy_fatal_error( msg )
1904char msg[];
1905#endif
1906 {
1907 (void) fprintf( stderr, "%s\n", msg );
1908 exit( YY_EXIT_FAILURE );
1909 }
1910
1911
1912
1913/* Redefine yyless() so it works in section 3 code. */
1914
1915#undef yyless
1916#define yyless(n) \
1917 do \
1918 { \
1919 /* Undo effects of setting up yytext. */ \
1920 yytext[yyleng] = yy_hold_char; \
1921 yy_c_buf_p = yytext + n; \
1922 yy_hold_char = *yy_c_buf_p; \
1923 *yy_c_buf_p = '\0'; \
1924 yyleng = n; \
1925 } \
1926 while ( 0 )
1927
1928
1929/* Internal utility routines. */
1930
1931#ifndef yytext_ptr
1932#ifdef YY_USE_PROTOS
Neil Boothe3d936a2007-11-02 15:10:05 +00001933static void yy_flex_strncpy( char *s1, yyconst char *s2, yy_size_t n )
Reid Spencer68a24bd2005-08-27 18:50:39 +00001934#else
1935static void yy_flex_strncpy( s1, s2, n )
1936char *s1;
1937yyconst char *s2;
Neil Boothe3d936a2007-11-02 15:10:05 +00001938yy_size_t n;
Reid Spencer68a24bd2005-08-27 18:50:39 +00001939#endif
1940 {
Neil Boothe3d936a2007-11-02 15:10:05 +00001941 register yy_size_t i;
Reid Spencer68a24bd2005-08-27 18:50:39 +00001942 for ( i = 0; i < n; ++i )
1943 s1[i] = s2[i];
1944 }
1945#endif
1946
1947#ifdef YY_NEED_STRLEN
1948#ifdef YY_USE_PROTOS
Neil Boothe3d936a2007-11-02 15:10:05 +00001949static yy_size_t yy_flex_strlen( yyconst char *s )
Reid Spencer68a24bd2005-08-27 18:50:39 +00001950#else
Neil Boothe3d936a2007-11-02 15:10:05 +00001951static yy_size_t yy_flex_strlen( s )
Reid Spencer68a24bd2005-08-27 18:50:39 +00001952yyconst char *s;
1953#endif
1954 {
Neil Boothe3d936a2007-11-02 15:10:05 +00001955 register yy_size_t n;
Reid Spencer68a24bd2005-08-27 18:50:39 +00001956 for ( n = 0; s[n]; ++n )
1957 ;
1958
1959 return n;
1960 }
1961#endif
1962
1963
1964#ifdef YY_USE_PROTOS
1965static void *yy_flex_alloc( yy_size_t size )
1966#else
1967static void *yy_flex_alloc( size )
1968yy_size_t size;
1969#endif
1970 {
1971 return (void *) malloc( size );
1972 }
1973
1974#ifdef YY_USE_PROTOS
1975static inline void *yy_flex_realloc( void *ptr, yy_size_t size )
1976#else
1977static inline void *yy_flex_realloc( ptr, size )
1978void *ptr;
1979yy_size_t size;
1980#endif
1981 {
1982 /* The cast to (char *) in the following accommodates both
1983 * implementations that use char* generic pointers, and those
1984 * that use void* generic pointers. It works with the latter
1985 * because both ANSI C and C++ allow castless assignment from
1986 * any pointer type to void*, and deal with argument conversions
1987 * as though doing an assignment.
1988 */
1989 return (void *) realloc( (char *) ptr, size );
1990 }
1991
1992#ifdef YY_USE_PROTOS
1993static void yy_flex_free( void *ptr )
1994#else
1995static void yy_flex_free( ptr )
1996void *ptr;
1997#endif
1998 {
1999 free( ptr );
2000 }
2001
2002#if YY_MAIN
2003int main()
2004 {
2005 yylex();
2006 return 0;
2007 }
2008#endif
Neil Boothe3d936a2007-11-02 15:10:05 +00002009#line 239 "/home/neil/src/nobackup/llvm/utils/TableGen/FileLexer.l"
Chris Lattnere8242b12006-02-14 05:13:13 +00002010
Reid Spencer68a24bd2005-08-27 18:50:39 +00002011