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