blob: 98928f38105a653c21cef6dacfc3404e17a720a0 [file] [log] [blame]
Chris Lattner2f7c9632001-06-06 20:29:01 +00001#define yy_create_buffer llvmAsm_create_buffer
2#define yy_delete_buffer llvmAsm_delete_buffer
3#define yy_scan_buffer llvmAsm_scan_buffer
4#define yy_scan_string llvmAsm_scan_string
5#define yy_scan_bytes llvmAsm_scan_bytes
6#define yy_flex_debug llvmAsm_flex_debug
7#define yy_init_buffer llvmAsm_init_buffer
8#define yy_flush_buffer llvmAsm_flush_buffer
9#define yy_load_buffer_state llvmAsm_load_buffer_state
10#define yy_switch_to_buffer llvmAsm_switch_to_buffer
11#define yyin llvmAsmin
12#define yyleng llvmAsmleng
13#define yylex llvmAsmlex
14#define yyout llvmAsmout
15#define yyrestart llvmAsmrestart
16#define yytext llvmAsmtext
17#define yylineno llvmAsmlineno
18
19#line 20 "Lexer.cpp"
20/* A lexical scanner generated by flex */
21
22/* Scanner skeleton version:
23 * $Header$
24 */
25
26#define FLEX_SCANNER
27#define YY_FLEX_MAJOR_VERSION 2
28#define YY_FLEX_MINOR_VERSION 5
29
30#include <stdio.h>
31
32
33/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
34#ifdef c_plusplus
35#ifndef __cplusplus
36#define __cplusplus
37#endif
38#endif
39
40
41#ifdef __cplusplus
42
43#include <stdlib.h>
44#include <unistd.h>
45
46/* Use prototypes in function declarations. */
47#define YY_USE_PROTOS
48
49/* The "const" storage-class-modifier is valid. */
50#define YY_USE_CONST
51
52#else /* ! __cplusplus */
53
54#if __STDC__
55
56#define YY_USE_PROTOS
57#define YY_USE_CONST
58
59#endif /* __STDC__ */
60#endif /* ! __cplusplus */
61
62#ifdef __TURBOC__
63 #pragma warn -rch
64 #pragma warn -use
65#include <io.h>
66#include <stdlib.h>
67#define YY_USE_CONST
68#define YY_USE_PROTOS
69#endif
70
71#ifdef YY_USE_CONST
72#define yyconst const
73#else
74#define yyconst
75#endif
76
77
78#ifdef YY_USE_PROTOS
79#define YY_PROTO(proto) proto
80#else
81#define YY_PROTO(proto) ()
82#endif
83
84/* Returned upon end-of-file. */
85#define YY_NULL 0
86
87/* Promotes a possibly negative, possibly signed char to an unsigned
88 * integer for use as an array index. If the signed char is negative,
89 * we want to instead treat it as an 8-bit unsigned char, hence the
90 * double cast.
91 */
92#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
93
94/* Enter a start condition. This macro really ought to take a parameter,
95 * but we do it the disgusting crufty way forced on us by the ()-less
96 * definition of BEGIN.
97 */
98#define BEGIN yy_start = 1 + 2 *
99
100/* Translate the current start state into a value that can be later handed
101 * to BEGIN to return to the state. The YYSTATE alias is for lex
102 * compatibility.
103 */
104#define YY_START ((yy_start - 1) / 2)
105#define YYSTATE YY_START
106
107/* Action number for EOF rule of a given start state. */
108#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
109
110/* Special action meaning "start processing a new file". */
111#define YY_NEW_FILE yyrestart( yyin )
112
113#define YY_END_OF_BUFFER_CHAR 0
114
115/* Size of default input buffer. */
116#define YY_BUF_SIZE 16384
117
118typedef struct yy_buffer_state *YY_BUFFER_STATE;
119
120extern int yyleng;
121extern FILE *yyin, *yyout;
122
123#define EOB_ACT_CONTINUE_SCAN 0
124#define EOB_ACT_END_OF_FILE 1
125#define EOB_ACT_LAST_MATCH 2
126
127/* The funky do-while in the following #define is used to turn the definition
128 * int a single C statement (which needs a semi-colon terminator). This
129 * avoids problems with code like:
130 *
131 * if ( condition_holds )
132 * yyless( 5 );
133 * else
134 * do_something_else();
135 *
136 * Prior to using the do-while the compiler would get upset at the
137 * "else" because it interpreted the "if" statement as being all
138 * done when it reached the ';' after the yyless() call.
139 */
140
141/* Return all but the first 'n' matched characters back to the input stream. */
142
143#define yyless(n) \
144 do \
145 { \
146 /* Undo effects of setting up yytext. */ \
147 *yy_cp = yy_hold_char; \
148 YY_RESTORE_YY_MORE_OFFSET \
149 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
150 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
151 } \
152 while ( 0 )
153
154#define unput(c) yyunput( c, yytext_ptr )
155
156/* The following is because we cannot portably get our hands on size_t
157 * (without autoconf's help, which isn't available because we want
158 * flex-generated scanners to compile on their own).
159 */
160typedef unsigned int yy_size_t;
161
162
163struct yy_buffer_state
164 {
165 FILE *yy_input_file;
166
167 char *yy_ch_buf; /* input buffer */
168 char *yy_buf_pos; /* current position in input buffer */
169
170 /* Size of input buffer in bytes, not including room for EOB
171 * characters.
172 */
173 yy_size_t yy_buf_size;
174
175 /* Number of characters read into yy_ch_buf, not including EOB
176 * characters.
177 */
178 int yy_n_chars;
179
180 /* Whether we "own" the buffer - i.e., we know we created it,
181 * and can realloc() it to grow it, and should free() it to
182 * delete it.
183 */
184 int yy_is_our_buffer;
185
186 /* Whether this is an "interactive" input source; if so, and
187 * if we're using stdio for input, then we want to use getc()
188 * instead of fread(), to make sure we stop fetching input after
189 * each newline.
190 */
191 int yy_is_interactive;
192
193 /* Whether we're considered to be at the beginning of a line.
194 * If so, '^' rules will be active on the next match, otherwise
195 * not.
196 */
197 int yy_at_bol;
198
199 /* Whether to try to fill the input buffer when we reach the
200 * end of it.
201 */
202 int yy_fill_buffer;
203
204 int yy_buffer_status;
205#define YY_BUFFER_NEW 0
206#define YY_BUFFER_NORMAL 1
207 /* When an EOF's been seen but there's still some text to process
208 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
209 * shouldn't try reading from the input source any more. We might
210 * still have a bunch of tokens to match, though, because of
211 * possible backing-up.
212 *
213 * When we actually see the EOF, we change the status to "new"
214 * (via yyrestart()), so that the user can continue scanning by
215 * just pointing yyin at a new input file.
216 */
217#define YY_BUFFER_EOF_PENDING 2
218 };
219
220static YY_BUFFER_STATE yy_current_buffer = 0;
221
222/* We provide macros for accessing buffer states in case in the
223 * future we want to put the buffer states in a more general
224 * "scanner state".
225 */
226#define YY_CURRENT_BUFFER yy_current_buffer
227
228
229/* yy_hold_char holds the character lost when yytext is formed. */
230static char yy_hold_char;
231
232static int yy_n_chars; /* number of characters read into yy_ch_buf */
233
234
235int yyleng;
236
237/* Points to current character in buffer. */
238static char *yy_c_buf_p = (char *) 0;
239static int yy_init = 1; /* whether we need to initialize */
240static int yy_start = 0; /* start state number */
241
242/* Flag which is used to allow yywrap()'s to do buffer switches
243 * instead of setting up a fresh yyin. A bit of a hack ...
244 */
245static int yy_did_buffer_switch_on_eof;
246
247void yyrestart YY_PROTO(( FILE *input_file ));
248
249void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
250void yy_load_buffer_state YY_PROTO(( void ));
251YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
252void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
253void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
254void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
255#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
256
257YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
258YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
259YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
260
261static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
262static inline void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
263static void yy_flex_free YY_PROTO(( void * ));
264
265#define yy_new_buffer yy_create_buffer
266
267#define yy_set_interactive(is_interactive) \
268 { \
269 if ( ! yy_current_buffer ) \
270 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
271 yy_current_buffer->yy_is_interactive = is_interactive; \
272 }
273
274#define yy_set_bol(at_bol) \
275 { \
276 if ( ! yy_current_buffer ) \
277 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
278 yy_current_buffer->yy_at_bol = at_bol; \
279 }
280
281#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
282
283
284#define YY_USES_REJECT
285
286#define yywrap() 1
287#define YY_SKIP_YYWRAP
288typedef unsigned char YY_CHAR;
289FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
290typedef int yy_state_type;
291extern int yylineno;
292int yylineno = 1;
293extern char *yytext;
294#define yytext_ptr yytext
295
296static yy_state_type yy_get_previous_state YY_PROTO(( void ));
297static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
298static int yy_get_next_buffer YY_PROTO(( void ));
299static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
300
301/* Done after the current pattern has been matched and before the
302 * corresponding action - sets up yytext.
303 */
304#define YY_DO_BEFORE_ACTION \
305 yytext_ptr = yy_bp; \
306 yyleng = (int) (yy_cp - yy_bp); \
307 yy_hold_char = *yy_cp; \
308 *yy_cp = '\0'; \
309 yy_c_buf_p = yy_cp;
310
Chris Lattner212f70d2001-07-15 00:17:01 +0000311#define YY_NUM_RULES 61
312#define YY_END_OF_BUFFER 62
313static yyconst short int yy_acclist[117] =
Chris Lattner2f7c9632001-06-06 20:29:01 +0000314 { 0,
Chris Lattner212f70d2001-07-15 00:17:01 +0000315 62, 60, 61, 59, 60, 61, 59, 61, 60, 61,
316 60, 61, 60, 61, 8, 60, 61, 54, 60, 61,
317 1, 60, 61, 60, 61, 60, 61, 60, 61, 60,
318 61, 60, 61, 60, 61, 60, 61, 60, 61, 60,
319 61, 60, 61, 60, 61, 60, 61, 60, 61, 60,
320 61, 60, 61, 60, 61, 60, 61, 52, 51, 56,
321 55, 58, 54, 1, 9, 43, 36, 53, 51, 57,
322 58, 25, 28, 3, 16, 27, 24, 37, 29, 42,
323 40, 41, 26, 11, 38, 39, 47, 48, 18, 4,
324 22, 17, 10, 2, 5, 20, 23, 12, 31, 35,
Chris Lattner2f7c9632001-06-06 20:29:01 +0000325
Chris Lattner212f70d2001-07-15 00:17:01 +0000326 33, 34, 32, 30, 14, 49, 13, 19, 46, 21,
327 45, 44, 15, 6, 50, 7
Chris Lattner2f7c9632001-06-06 20:29:01 +0000328 } ;
329
Chris Lattner212f70d2001-07-15 00:17:01 +0000330static yyconst short int yy_accept[202] =
Chris Lattner2f7c9632001-06-06 20:29:01 +0000331 { 0,
332 1, 1, 1, 2, 4, 7, 9, 11, 13, 15,
333 18, 21, 24, 26, 28, 30, 32, 34, 36, 38,
334 40, 42, 44, 46, 48, 50, 52, 54, 56, 58,
Chris Lattner212f70d2001-07-15 00:17:01 +0000335 58, 58, 59, 60, 60, 61, 62, 63, 64, 65,
336 65, 65, 66, 66, 66, 67, 67, 67, 67, 67,
337 67, 67, 67, 67, 67, 67, 67, 67, 67, 67,
338 67, 67, 67, 67, 67, 67, 67, 67, 67, 67,
339 68, 68, 68, 68, 68, 68, 68, 68, 69, 70,
340 71, 72, 73, 73, 73, 73, 73, 73, 73, 74,
341 74, 75, 75, 75, 75, 75, 75, 76, 76, 76,
Chris Lattner2f7c9632001-06-06 20:29:01 +0000342
Chris Lattner212f70d2001-07-15 00:17:01 +0000343 76, 76, 77, 78, 79, 80, 81, 81, 81, 82,
344 82, 83, 83, 84, 84, 84, 84, 84, 84, 84,
345 84, 84, 84, 84, 85, 86, 87, 87, 87, 87,
346 87, 88, 88, 88, 88, 89, 90, 90, 90, 90,
347 90, 90, 90, 90, 90, 90, 91, 92, 92, 93,
348 93, 93, 94, 94, 95, 95, 95, 96, 97, 97,
349 97, 98, 98, 99, 100, 101, 102, 103, 104, 105,
350 106, 107, 107, 108, 109, 109, 110, 110, 111, 111,
351 111, 112, 113, 114, 115, 115, 115, 115, 115, 115,
352 115, 115, 115, 115, 115, 115, 115, 116, 116, 117,
Chris Lattner2f7c9632001-06-06 20:29:01 +0000353
Chris Lattner212f70d2001-07-15 00:17:01 +0000354 117
Chris Lattner2f7c9632001-06-06 20:29:01 +0000355 } ;
356
357static yyconst int yy_ec[256] =
358 { 0,
359 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
360 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
361 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
362 1, 2, 1, 4, 1, 5, 6, 1, 1, 1,
Chris Lattner212f70d2001-07-15 00:17:01 +0000363 1, 1, 1, 1, 7, 8, 1, 9, 9, 9,
364 9, 9, 9, 9, 9, 9, 9, 10, 11, 1,
Chris Lattner2f7c9632001-06-06 20:29:01 +0000365 1, 1, 1, 1, 5, 5, 5, 5, 5, 5,
366 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
367 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
Chris Lattner212f70d2001-07-15 00:17:01 +0000368 1, 1, 1, 1, 5, 1, 12, 13, 14, 15,
Chris Lattner2f7c9632001-06-06 20:29:01 +0000369
Chris Lattner212f70d2001-07-15 00:17:01 +0000370 16, 17, 18, 19, 20, 5, 5, 21, 22, 23,
371 24, 25, 26, 27, 28, 29, 30, 31, 32, 5,
372 33, 5, 1, 1, 1, 1, 1, 1, 1, 1,
Chris Lattner2f7c9632001-06-06 20:29:01 +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
Chris Lattner212f70d2001-07-15 00:17:01 +0000389static yyconst int yy_meta[34] =
Chris Lattner2f7c9632001-06-06 20:29:01 +0000390 { 0,
Chris Lattner212f70d2001-07-15 00:17:01 +0000391 1, 1, 2, 3, 4, 1, 5, 4, 4, 6,
392 1, 4, 4, 4, 4, 4, 4, 4, 4, 4,
Chris Lattner2f7c9632001-06-06 20:29:01 +0000393 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
Chris Lattner212f70d2001-07-15 00:17:01 +0000394 4, 4, 4
Chris Lattner2f7c9632001-06-06 20:29:01 +0000395 } ;
396
Chris Lattner212f70d2001-07-15 00:17:01 +0000397static yyconst short int yy_base[206] =
Chris Lattner2f7c9632001-06-06 20:29:01 +0000398 { 0,
Chris Lattner212f70d2001-07-15 00:17:01 +0000399 0, 0, 398, 399, 399, 399, 0, 387, 27, 387,
400 29, 0, 25, 37, 31, 32, 34, 39, 49, 45,
401 59, 60, 52, 35, 63, 81, 53, 104, 64, 391,
402 384, 399, 0, 384, 383, 382, 72, 93, 0, 74,
403 75, 380, 77, 68, 379, 88, 94, 89, 96, 97,
404 108, 95, 105, 112, 113, 117, 118, 124, 123, 127,
405 120, 125, 129, 130, 132, 133, 140, 142, 146, 378,
406 143, 149, 152, 155, 157, 158, 159, 399, 0, 378,
407 161, 376, 162, 170, 166, 172, 165, 174, 375, 178,
408 374, 65, 186, 173, 187, 189, 373, 190, 192, 191,
Chris Lattner2f7c9632001-06-06 20:29:01 +0000409
Chris Lattner212f70d2001-07-15 00:17:01 +0000410 194, 372, 371, 370, 369, 368, 182, 206, 367, 198,
411 366, 203, 365, 202, 204, 207, 208, 209, 211, 216,
412 218, 222, 225, 364, 363, 362, 229, 232, 233, 234,
413 361, 235, 236, 237, 360, 359, 240, 241, 244, 245,
414 249, 250, 252, 257, 258, 358, 357, 259, 356, 261,
415 266, 355, 270, 354, 267, 273, 353, 352, 274, 275,
416 351, 277, 350, 349, 348, 347, 346, 345, 340, 335,
417 330, 276, 326, 325, 278, 320, 282, 319, 286, 289,
418 318, 317, 311, 310, 290, 291, 292, 293, 294, 299,
419 300, 302, 303, 306, 307, 309, 308, 314, 195, 399,
Chris Lattner2f7c9632001-06-06 20:29:01 +0000420
Chris Lattner212f70d2001-07-15 00:17:01 +0000421 337, 340, 343, 348, 54
Chris Lattner2f7c9632001-06-06 20:29:01 +0000422 } ;
423
Chris Lattner212f70d2001-07-15 00:17:01 +0000424static yyconst short int yy_def[206] =
Chris Lattner2f7c9632001-06-06 20:29:01 +0000425 { 0,
Chris Lattner212f70d2001-07-15 00:17:01 +0000426 200, 1, 200, 200, 200, 200, 201, 202, 203, 200,
427 202, 204, 202, 202, 202, 202, 202, 202, 202, 202,
428 202, 202, 202, 202, 202, 202, 202, 202, 202, 201,
429 202, 200, 205, 200, 200, 200, 202, 202, 204, 202,
430 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
431 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
432 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
433 202, 202, 202, 202, 202, 202, 202, 200, 205, 200,
434 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
435 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
Chris Lattner2f7c9632001-06-06 20:29:01 +0000436
Chris Lattner212f70d2001-07-15 00:17:01 +0000437 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
438 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
439 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
440 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
441 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
442 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
443 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
444 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
445 202, 202, 202, 202, 202, 202, 202, 202, 202, 202,
446 202, 202, 202, 202, 202, 202, 202, 202, 202, 0,
Chris Lattner2f7c9632001-06-06 20:29:01 +0000447
Chris Lattner212f70d2001-07-15 00:17:01 +0000448 200, 200, 200, 200, 200
Chris Lattner2f7c9632001-06-06 20:29:01 +0000449 } ;
450
Chris Lattner212f70d2001-07-15 00:17:01 +0000451static yyconst short int yy_nxt[433] =
Chris Lattner2f7c9632001-06-06 20:29:01 +0000452 { 0,
Chris Lattner212f70d2001-07-15 00:17:01 +0000453 4, 5, 6, 7, 8, 9, 10, 8, 11, 4,
454 12, 13, 14, 15, 16, 17, 18, 19, 8, 20,
455 21, 22, 23, 8, 24, 8, 25, 26, 27, 28,
456 29, 8, 8, 34, 32, 35, 37, 38, 32, 40,
457 32, 32, 46, 32, 32, 41, 32, 47, 32, 42,
458 51, 48, 43, 62, 32, 49, 50, 79, 32, 52,
459 44, 32, 32, 45, 54, 53, 55, 56, 32, 32,
460 57, 59, 32, 32, 32, 61, 70, 32, 63, 71,
461 81, 32, 58, 32, 32, 72, 32, 77, 82, 60,
462 32, 85, 129, 64, 84, 83, 65, 32, 32, 66,
Chris Lattner2f7c9632001-06-06 20:29:01 +0000463
Chris Lattner212f70d2001-07-15 00:17:01 +0000464 37, 38, 32, 32, 32, 32, 32, 88, 86, 67,
465 68, 91, 69, 32, 32, 87, 73, 32, 93, 89,
466 94, 32, 32, 74, 75, 90, 32, 32, 92, 32,
467 98, 76, 32, 32, 32, 99, 32, 96, 32, 32,
468 95, 32, 32, 101, 104, 97, 100, 102, 103, 32,
469 105, 32, 32, 109, 113, 32, 110, 106, 32, 111,
470 108, 32, 107, 112, 32, 114, 32, 32, 32, 81,
471 32, 32, 115, 116, 32, 32, 120, 118, 121, 32,
472 119, 32, 32, 32, 117, 122, 124, 32, 131, 123,
473 128, 32, 125, 126, 127, 32, 32, 130, 32, 32,
Chris Lattner2f7c9632001-06-06 20:29:01 +0000474
Chris Lattner212f70d2001-07-15 00:17:01 +0000475 32, 32, 132, 32, 32, 134, 135, 32, 136, 133,
476 138, 32, 32, 32, 137, 32, 32, 32, 32, 146,
477 32, 139, 147, 140, 143, 32, 141, 32, 142, 144,
478 145, 32, 152, 150, 32, 153, 148, 149, 32, 151,
479 155, 32, 32, 32, 32, 32, 32, 154, 157, 32,
480 32, 160, 156, 32, 32, 159, 163, 161, 32, 32,
481 165, 32, 158, 162, 167, 169, 32, 32, 32, 164,
482 32, 172, 171, 166, 173, 32, 32, 168, 174, 32,
483 170, 176, 32, 32, 32, 32, 32, 32, 178, 179,
484 181, 32, 175, 177, 182, 32, 180, 184, 32, 32,
Chris Lattner2f7c9632001-06-06 20:29:01 +0000485
Chris Lattner212f70d2001-07-15 00:17:01 +0000486 32, 32, 32, 32, 186, 187, 183, 185, 32, 32,
487 192, 32, 32, 188, 189, 32, 32, 32, 32, 32,
488 32, 190, 191, 32, 193, 196, 32, 32, 32, 32,
489 194, 195, 198, 197, 32, 32, 199, 30, 30, 32,
490 30, 30, 30, 31, 32, 31, 33, 33, 39, 32,
491 39, 39, 39, 39, 32, 32, 32, 32, 32, 32,
Chris Lattner2f7c9632001-06-06 20:29:01 +0000492 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
Chris Lattnerd8bebcd2001-07-08 21:10:27 +0000493 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
Chris Lattner212f70d2001-07-15 00:17:01 +0000494 32, 32, 32, 32, 32, 32, 80, 32, 32, 32,
495 36, 35, 80, 32, 78, 36, 32, 200, 3, 200,
Chris Lattner2f7c9632001-06-06 20:29:01 +0000496
Chris Lattner212f70d2001-07-15 00:17:01 +0000497 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
498 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
499 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
500 200, 200
Chris Lattner2f7c9632001-06-06 20:29:01 +0000501 } ;
502
Chris Lattner212f70d2001-07-15 00:17:01 +0000503static yyconst short int yy_chk[433] =
Chris Lattner2f7c9632001-06-06 20:29:01 +0000504 { 0,
505 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
506 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
507 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Chris Lattner212f70d2001-07-15 00:17:01 +0000508 1, 1, 1, 9, 13, 9, 11, 11, 11, 13,
509 15, 16, 15, 17, 24, 13, 14, 16, 18, 14,
510 18, 16, 14, 24, 20, 16, 17, 205, 19, 18,
511 14, 23, 27, 14, 19, 18, 20, 20, 21, 22,
512 21, 22, 25, 29, 92, 23, 27, 44, 25, 27,
513 37, 37, 21, 40, 41, 27, 43, 29, 40, 22,
514 26, 44, 92, 26, 43, 41, 26, 46, 48, 26,
Chris Lattner2f7c9632001-06-06 20:29:01 +0000515
Chris Lattner212f70d2001-07-15 00:17:01 +0000516 38, 38, 38, 47, 52, 49, 50, 47, 46, 26,
517 26, 50, 26, 28, 53, 46, 28, 51, 52, 48,
518 53, 54, 55, 28, 28, 49, 56, 57, 51, 61,
519 57, 28, 59, 58, 62, 58, 60, 55, 63, 64,
520 54, 65, 66, 59, 62, 56, 58, 60, 61, 67,
521 63, 68, 71, 66, 68, 69, 66, 63, 72, 66,
522 65, 73, 64, 67, 74, 69, 75, 76, 77, 81,
523 81, 83, 71, 72, 87, 85, 76, 74, 77, 84,
524 75, 86, 94, 88, 73, 83, 85, 90, 94, 84,
525 90, 107, 86, 87, 88, 93, 95, 93, 96, 98,
Chris Lattner2f7c9632001-06-06 20:29:01 +0000526
Chris Lattner212f70d2001-07-15 00:17:01 +0000527 100, 99, 95, 101, 199, 98, 99, 110, 100, 96,
528 107, 114, 112, 115, 101, 108, 116, 117, 118, 115,
529 119, 108, 116, 108, 110, 120, 108, 121, 108, 112,
530 114, 122, 121, 119, 123, 122, 117, 118, 127, 120,
531 127, 128, 129, 130, 132, 133, 134, 123, 129, 137,
532 138, 133, 128, 139, 140, 132, 138, 134, 141, 142,
533 140, 143, 130, 137, 141, 142, 144, 145, 148, 139,
534 150, 145, 144, 140, 148, 151, 155, 141, 150, 153,
535 143, 153, 156, 159, 160, 172, 162, 175, 156, 159,
536 162, 177, 151, 155, 172, 179, 160, 177, 180, 185,
Chris Lattner2f7c9632001-06-06 20:29:01 +0000537
Chris Lattner212f70d2001-07-15 00:17:01 +0000538 186, 187, 188, 189, 180, 185, 175, 179, 190, 191,
539 190, 192, 193, 186, 187, 194, 195, 197, 196, 184,
540 183, 188, 189, 198, 191, 194, 182, 181, 178, 176,
541 192, 193, 196, 195, 174, 173, 198, 201, 201, 171,
542 201, 201, 201, 202, 170, 202, 203, 203, 204, 169,
543 204, 204, 204, 204, 168, 167, 166, 165, 164, 163,
544 161, 158, 157, 154, 152, 149, 147, 146, 136, 135,
545 131, 126, 125, 124, 113, 111, 109, 106, 105, 104,
546 103, 102, 97, 91, 89, 82, 80, 70, 45, 42,
547 36, 35, 34, 31, 30, 10, 8, 3, 200, 200,
Chris Lattner2f7c9632001-06-06 20:29:01 +0000548
Chris Lattner212f70d2001-07-15 00:17:01 +0000549 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
550 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
551 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
552 200, 200
Chris Lattner2f7c9632001-06-06 20:29:01 +0000553 } ;
554
555static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
556static char *yy_full_match;
557static int yy_lp;
558#define REJECT \
559{ \
560*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
561yy_cp = yy_full_match; /* restore poss. backed-over text */ \
562++yy_lp; \
563goto find_rule; \
564}
565#define yymore() yymore_used_but_not_detected
566#define YY_MORE_ADJ 0
567#define YY_RESTORE_YY_MORE_OFFSET
568char *yytext;
569#line 1 "Lexer.l"
570#define INITIAL 0
571/*===-- Lexer.l - Scanner for llvm assembly files ----------------*- C++ -*--=//
572//
573// This file implements the flex scanner for LLVM assembly languages files.
574//
575//===------------------------------------------------------------------------=*/
576#define YY_NEVER_INTERACTIVE 1
577#line 21 "Lexer.l"
578#include "ParserInternals.h"
579#include "llvm/BasicBlock.h"
580#include "llvm/Method.h"
581#include "llvm/Module.h"
582#include <list>
583#include "llvmAsmParser.h"
584
585#define RET_TOK(type, Enum, sym) \
586 llvmAsmlval.type = Instruction::Enum; return sym
587
588
589// TODO: All of the static identifiers are figured out by the lexer,
590// these should be hashed.
591
592
593// atoull - Convert an ascii string of decimal digits into the unsigned long
594// long representation... this does not have to do input error checking,
595// because we know that the input will be matched by a suitable regex...
596//
597uint64_t atoull(const char *Buffer) {
598 uint64_t Result = 0;
599 for (; *Buffer; Buffer++) {
600 uint64_t OldRes = Result;
601 Result *= 10;
602 Result += *Buffer-'0';
603 if (Result < OldRes) { // Uh, oh, overflow detected!!!
604 ThrowException("constant bigger than 64 bits detected!");
605 }
606 }
607 return Result;
608}
609
610
611#define YY_NEVER_INTERACTIVE 1
612/* Comments start with a ; and go till end of line */
613/* Variable(Def) identifiers start with a % sign */
614/* Label identifiers end with a colon */
615/* Quoted names can contain any character except " and \ */
616/* [PN]Integer: match positive and negative literal integer values that
617 * are preceeded by a '%' character. These represent unnamed variable slots.
618 */
619/* E[PN]Integer: match positive and negative literal integer values */
Chris Lattner212f70d2001-07-15 00:17:01 +0000620/* FPConstant - A Floating point constant.
621 TODO: Expand lexer to support 10e50 FP constant notation */
622#line 623 "Lexer.cpp"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000623
624/* Macros after this point can all be overridden by user definitions in
625 * section 1.
626 */
627
628#ifndef YY_SKIP_YYWRAP
629#ifdef __cplusplus
630extern "C" int yywrap YY_PROTO(( void ));
631#else
632extern int yywrap YY_PROTO(( void ));
633#endif
634#endif
635
636#ifndef YY_NO_UNPUT
637static inline void yyunput YY_PROTO(( int c, char *buf_ptr ));
638#endif
639
640#ifndef yytext_ptr
641static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
642#endif
643
644#ifdef YY_NEED_STRLEN
645static int yy_flex_strlen YY_PROTO(( yyconst char * ));
646#endif
647
648#ifndef YY_NO_INPUT
649#ifdef __cplusplus
650static int yyinput YY_PROTO(( void ));
651#else
652static int input YY_PROTO(( void ));
653#endif
654#endif
655
656#if YY_STACK_USED
657static int yy_start_stack_ptr = 0;
658static int yy_start_stack_depth = 0;
659static int *yy_start_stack = 0;
660#ifndef YY_NO_PUSH_STATE
661static void yy_push_state YY_PROTO(( int new_state ));
662#endif
663#ifndef YY_NO_POP_STATE
664static void yy_pop_state YY_PROTO(( void ));
665#endif
666#ifndef YY_NO_TOP_STATE
667static int yy_top_state YY_PROTO(( void ));
668#endif
669
670#else
671#define YY_NO_PUSH_STATE 1
672#define YY_NO_POP_STATE 1
673#define YY_NO_TOP_STATE 1
674#endif
675
676#ifdef YY_MALLOC_DECL
677YY_MALLOC_DECL
678#else
679#if __STDC__
680#ifndef __cplusplus
681#include <stdlib.h>
682#endif
683#else
684/* Just try to get by without declaring the routines. This will fail
685 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
686 * or sizeof(void*) != sizeof(int).
687 */
688#endif
689#endif
690
691/* Amount of stuff to slurp up with each read. */
692#ifndef YY_READ_BUF_SIZE
693#define YY_READ_BUF_SIZE 8192
694#endif
695
696/* Copy whatever the last rule matched to the standard output. */
697
698#ifndef ECHO
699/* This used to be an fputs(), but since the string might contain NUL's,
700 * we now use fwrite().
701 */
702#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
703#endif
704
705/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
706 * is returned in "result".
707 */
708#ifndef YY_INPUT
709#define YY_INPUT(buf,result,max_size) \
710 if ( yy_current_buffer->yy_is_interactive ) \
711 { \
712 int c = '*', n; \
713 for ( n = 0; n < max_size && \
714 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
715 buf[n] = (char) c; \
716 if ( c == '\n' ) \
717 buf[n++] = (char) c; \
718 if ( c == EOF && ferror( yyin ) ) \
719 YY_FATAL_ERROR( "input in flex scanner failed" ); \
720 result = n; \
721 } \
722 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
723 && ferror( yyin ) ) \
724 YY_FATAL_ERROR( "input in flex scanner failed" );
725#endif
726
727/* No semi-colon after return; correct usage is to write "yyterminate();" -
728 * we don't want an extra ';' after the "return" because that will cause
729 * some compilers to complain about unreachable statements.
730 */
731#ifndef yyterminate
732#define yyterminate() return YY_NULL
733#endif
734
735/* Number of entries by which start-condition stack grows. */
736#ifndef YY_START_STACK_INCR
737#define YY_START_STACK_INCR 25
738#endif
739
740/* Report a fatal error. */
741#ifndef YY_FATAL_ERROR
742#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
743#endif
744
745/* Default declaration of generated scanner - a define so the user can
746 * easily add parameters.
747 */
748#ifndef YY_DECL
749#define YY_DECL int yylex YY_PROTO(( void ))
750#endif
751
752/* Code executed at the beginning of each rule, after yytext and yyleng
753 * have been set up.
754 */
755#ifndef YY_USER_ACTION
756#define YY_USER_ACTION
757#endif
758
759/* Code executed at the end of each rule. */
760#ifndef YY_BREAK
761#define YY_BREAK break;
762#endif
763
764#define YY_RULE_SETUP \
765 YY_USER_ACTION
766
767YY_DECL
768 {
769 register yy_state_type yy_current_state;
770 register char *yy_cp, *yy_bp;
771 register int yy_act;
772
Chris Lattner212f70d2001-07-15 00:17:01 +0000773#line 87 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000774
775
Chris Lattner212f70d2001-07-15 00:17:01 +0000776#line 777 "Lexer.cpp"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000777
778 if ( yy_init )
779 {
780 yy_init = 0;
781
782#ifdef YY_USER_INIT
783 YY_USER_INIT;
784#endif
785
786 if ( ! yy_start )
787 yy_start = 1; /* first start state */
788
789 if ( ! yyin )
790 yyin = stdin;
791
792 if ( ! yyout )
793 yyout = stdout;
794
795 if ( ! yy_current_buffer )
796 yy_current_buffer =
797 yy_create_buffer( yyin, YY_BUF_SIZE );
798
799 yy_load_buffer_state();
800 }
801
802 while ( 1 ) /* loops until end-of-file is reached */
803 {
804 yy_cp = yy_c_buf_p;
805
806 /* Support of yytext. */
807 *yy_cp = yy_hold_char;
808
809 /* yy_bp points to the position in yy_ch_buf of the start of
810 * the current run.
811 */
812 yy_bp = yy_cp;
813
814 yy_current_state = yy_start;
815 yy_state_ptr = yy_state_buf;
816 *yy_state_ptr++ = yy_current_state;
817yy_match:
818 do
819 {
820 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
821 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
822 {
823 yy_current_state = (int) yy_def[yy_current_state];
Chris Lattner212f70d2001-07-15 00:17:01 +0000824 if ( yy_current_state >= 201 )
Chris Lattner2f7c9632001-06-06 20:29:01 +0000825 yy_c = yy_meta[(unsigned int) yy_c];
826 }
827 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
828 *yy_state_ptr++ = yy_current_state;
829 ++yy_cp;
830 }
Chris Lattner212f70d2001-07-15 00:17:01 +0000831 while ( yy_current_state != 200 );
Chris Lattner2f7c9632001-06-06 20:29:01 +0000832
833yy_find_action:
834 yy_current_state = *--yy_state_ptr;
835 yy_lp = yy_accept[yy_current_state];
836 for ( ; ; ) /* until we find what rule we matched */
837 {
838 if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
839 {
840 yy_act = yy_acclist[yy_lp];
841 {
842 yy_full_match = yy_cp;
843 break;
844 }
845 }
846 --yy_cp;
847 yy_current_state = *--yy_state_ptr;
848 yy_lp = yy_accept[yy_current_state];
849 }
850
851 YY_DO_BEFORE_ACTION;
852
853 if ( yy_act != YY_END_OF_BUFFER )
854 {
855 int yyl;
856 for ( yyl = 0; yyl < yyleng; ++yyl )
857 if ( yytext[yyl] == '\n' )
858 ++yylineno;
859 }
860
861do_action: /* This label is used only to access EOF actions. */
862
863
864 switch ( yy_act )
865 { /* beginning of action switch */
866case 1:
867YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000868#line 89 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000869{ /* Ignore comments for now */ }
870 YY_BREAK
871case 2:
872YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000873#line 91 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000874{ return BEGINTOK; }
875 YY_BREAK
876case 3:
877YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000878#line 92 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000879{ return END; }
880 YY_BREAK
881case 4:
882YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000883#line 93 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000884{ return TRUE; }
885 YY_BREAK
886case 5:
887YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000888#line 94 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000889{ return FALSE; }
890 YY_BREAK
891case 6:
892YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000893#line 95 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000894{ return DECLARE; }
895 YY_BREAK
896case 7:
897YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000898#line 96 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000899{ return IMPLEMENTATION; }
900 YY_BREAK
901case 8:
902YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000903#line 98 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000904{ cerr << "deprecated argument '-' used!\n"; return '-'; }
905 YY_BREAK
906case 9:
907YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000908#line 99 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000909{ cerr << "deprecated type 'bb' used!\n"; llvmAsmlval.TypeVal = Type::LabelTy; return LABEL;}
910 YY_BREAK
911case 10:
912YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000913#line 101 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000914{ llvmAsmlval.TypeVal = Type::VoidTy ; return VOID; }
915 YY_BREAK
916case 11:
917YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000918#line 102 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000919{ llvmAsmlval.TypeVal = Type::BoolTy ; return BOOL; }
920 YY_BREAK
921case 12:
922YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000923#line 103 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000924{ llvmAsmlval.TypeVal = Type::SByteTy ; return SBYTE; }
925 YY_BREAK
926case 13:
927YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000928#line 104 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000929{ llvmAsmlval.TypeVal = Type::UByteTy ; return UBYTE; }
930 YY_BREAK
931case 14:
932YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000933#line 105 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000934{ llvmAsmlval.TypeVal = Type::ShortTy ; return SHORT; }
935 YY_BREAK
936case 15:
937YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000938#line 106 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000939{ llvmAsmlval.TypeVal = Type::UShortTy; return USHORT; }
940 YY_BREAK
941case 16:
942YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000943#line 107 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000944{ llvmAsmlval.TypeVal = Type::IntTy ; return INT; }
945 YY_BREAK
946case 17:
947YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000948#line 108 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000949{ llvmAsmlval.TypeVal = Type::UIntTy ; return UINT; }
950 YY_BREAK
951case 18:
952YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000953#line 109 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000954{ llvmAsmlval.TypeVal = Type::LongTy ; return LONG; }
955 YY_BREAK
956case 19:
957YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000958#line 110 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000959{ llvmAsmlval.TypeVal = Type::ULongTy ; return ULONG; }
960 YY_BREAK
961case 20:
962YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000963#line 111 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000964{ llvmAsmlval.TypeVal = Type::FloatTy ; return FLOAT; }
965 YY_BREAK
966case 21:
967YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000968#line 112 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000969{ llvmAsmlval.TypeVal = Type::DoubleTy; return DOUBLE; }
970 YY_BREAK
971case 22:
972YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000973#line 114 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000974{ llvmAsmlval.TypeVal = Type::TypeTy ; return TYPE; }
975 YY_BREAK
976case 23:
977YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000978#line 116 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +0000979{ llvmAsmlval.TypeVal = Type::LabelTy ; return LABEL; }
980 YY_BREAK
981case 24:
982YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000983#line 119 "Lexer.l"
Chris Lattnera6821822001-07-08 04:57:15 +0000984{ RET_TOK(UnaryOpVal, Not, NOT); }
Chris Lattner2f7c9632001-06-06 20:29:01 +0000985 YY_BREAK
986case 25:
987YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000988#line 121 "Lexer.l"
Chris Lattnerd8bebcd2001-07-08 21:10:27 +0000989{ RET_TOK(BinaryOpVal, Add, ADD); }
Chris Lattner2f7c9632001-06-06 20:29:01 +0000990 YY_BREAK
991case 26:
992YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000993#line 122 "Lexer.l"
Chris Lattnerd8bebcd2001-07-08 21:10:27 +0000994{ RET_TOK(BinaryOpVal, Sub, SUB); }
Chris Lattner2f7c9632001-06-06 20:29:01 +0000995 YY_BREAK
996case 27:
997YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +0000998#line 123 "Lexer.l"
Chris Lattnerd8bebcd2001-07-08 21:10:27 +0000999{ RET_TOK(BinaryOpVal, Mul, MUL); }
Chris Lattner2f7c9632001-06-06 20:29:01 +00001000 YY_BREAK
1001case 28:
1002YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001003#line 124 "Lexer.l"
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001004{ RET_TOK(BinaryOpVal, Div, DIV); }
Chris Lattner2f7c9632001-06-06 20:29:01 +00001005 YY_BREAK
1006case 29:
1007YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001008#line 125 "Lexer.l"
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001009{ RET_TOK(BinaryOpVal, Rem, REM); }
Chris Lattner2f7c9632001-06-06 20:29:01 +00001010 YY_BREAK
1011case 30:
1012YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001013#line 126 "Lexer.l"
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001014{ RET_TOK(BinaryOpVal, SetNE, SETNE); }
Chris Lattner2f7c9632001-06-06 20:29:01 +00001015 YY_BREAK
1016case 31:
1017YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001018#line 127 "Lexer.l"
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001019{ RET_TOK(BinaryOpVal, SetEQ, SETEQ); }
Chris Lattner2f7c9632001-06-06 20:29:01 +00001020 YY_BREAK
1021case 32:
1022YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001023#line 128 "Lexer.l"
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001024{ RET_TOK(BinaryOpVal, SetLT, SETLT); }
Chris Lattner2f7c9632001-06-06 20:29:01 +00001025 YY_BREAK
1026case 33:
1027YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001028#line 129 "Lexer.l"
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001029{ RET_TOK(BinaryOpVal, SetGT, SETGT); }
Chris Lattner2f7c9632001-06-06 20:29:01 +00001030 YY_BREAK
1031case 34:
1032YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001033#line 130 "Lexer.l"
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001034{ RET_TOK(BinaryOpVal, SetLE, SETLE); }
Chris Lattner2f7c9632001-06-06 20:29:01 +00001035 YY_BREAK
1036case 35:
1037YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001038#line 131 "Lexer.l"
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001039{ RET_TOK(BinaryOpVal, SetGE, SETGE); }
Chris Lattner2f7c9632001-06-06 20:29:01 +00001040 YY_BREAK
1041case 36:
1042YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001043#line 133 "Lexer.l"
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001044{ return TO; }
Chris Lattner2f7c9632001-06-06 20:29:01 +00001045 YY_BREAK
1046case 37:
1047YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001048#line 134 "Lexer.l"
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001049{ RET_TOK(OtherOpVal, PHINode, PHI); }
Chris Lattner2f7c9632001-06-06 20:29:01 +00001050 YY_BREAK
1051case 38:
1052YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001053#line 135 "Lexer.l"
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001054{ RET_TOK(OtherOpVal, Call, CALL); }
Chris Lattner2f7c9632001-06-06 20:29:01 +00001055 YY_BREAK
1056case 39:
1057YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001058#line 136 "Lexer.l"
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001059{ RET_TOK(OtherOpVal, Cast, CAST); }
Chris Lattner2f7c9632001-06-06 20:29:01 +00001060 YY_BREAK
1061case 40:
1062YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001063#line 137 "Lexer.l"
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001064{ RET_TOK(OtherOpVal, Shl, SHL); }
Chris Lattner2f7c9632001-06-06 20:29:01 +00001065 YY_BREAK
1066case 41:
1067YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001068#line 138 "Lexer.l"
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001069{ RET_TOK(OtherOpVal, Shr, SHR); }
Chris Lattner2f7c9632001-06-06 20:29:01 +00001070 YY_BREAK
1071case 42:
1072YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001073#line 140 "Lexer.l"
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001074{ RET_TOK(TermOpVal, Ret, RET); }
Chris Lattner2f7c9632001-06-06 20:29:01 +00001075 YY_BREAK
1076case 43:
1077YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001078#line 141 "Lexer.l"
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001079{ RET_TOK(TermOpVal, Br, BR); }
Chris Lattner2f7c9632001-06-06 20:29:01 +00001080 YY_BREAK
1081case 44:
1082YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001083#line 142 "Lexer.l"
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001084{ RET_TOK(TermOpVal, Switch, SWITCH); }
Chris Lattner2f7c9632001-06-06 20:29:01 +00001085 YY_BREAK
1086case 45:
1087YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001088#line 145 "Lexer.l"
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001089{ RET_TOK(MemOpVal, Malloc, MALLOC); }
Chris Lattner2f7c9632001-06-06 20:29:01 +00001090 YY_BREAK
1091case 46:
1092YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001093#line 146 "Lexer.l"
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001094{ RET_TOK(MemOpVal, Alloca, ALLOCA); }
Chris Lattner2f7c9632001-06-06 20:29:01 +00001095 YY_BREAK
1096case 47:
1097YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001098#line 147 "Lexer.l"
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001099{ RET_TOK(MemOpVal, Free, FREE); }
Chris Lattner2f7c9632001-06-06 20:29:01 +00001100 YY_BREAK
1101case 48:
1102YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001103#line 148 "Lexer.l"
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001104{ RET_TOK(MemOpVal, Load, LOAD); }
Chris Lattner2f7c9632001-06-06 20:29:01 +00001105 YY_BREAK
1106case 49:
1107YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001108#line 149 "Lexer.l"
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001109{ RET_TOK(MemOpVal, Store, STORE); }
Chris Lattner2f7c9632001-06-06 20:29:01 +00001110 YY_BREAK
1111case 50:
1112YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001113#line 150 "Lexer.l"
Chris Lattner62ecb4a2001-07-08 23:22:50 +00001114{ RET_TOK(MemOpVal, GetElementPtr, GETELEMENTPTR); }
Chris Lattnera6821822001-07-08 04:57:15 +00001115 YY_BREAK
1116case 51:
1117YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001118#line 153 "Lexer.l"
Chris Lattner62ecb4a2001-07-08 23:22:50 +00001119{ llvmAsmlval.StrVal = strdup(yytext+1); return VAR_ID; }
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001120 YY_BREAK
1121case 52:
1122YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001123#line 154 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +00001124{
1125 yytext[strlen(yytext)-1] = 0; // nuke colon
1126 llvmAsmlval.StrVal = strdup(yytext);
1127 return LABELSTR;
1128 }
1129 YY_BREAK
Chris Lattner62ecb4a2001-07-08 23:22:50 +00001130case 53:
Chris Lattner2f7c9632001-06-06 20:29:01 +00001131YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001132#line 160 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +00001133{
1134 yytext[strlen(yytext)-1] = 0; // nuke end quote
1135 llvmAsmlval.StrVal = strdup(yytext+1); // Nuke start quote
1136 return STRINGCONSTANT;
1137 }
1138 YY_BREAK
Chris Lattner62ecb4a2001-07-08 23:22:50 +00001139case 54:
1140YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001141#line 167 "Lexer.l"
Chris Lattner62ecb4a2001-07-08 23:22:50 +00001142{ llvmAsmlval.UInt64Val = atoull(yytext); return EUINT64VAL; }
1143 YY_BREAK
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001144case 55:
Chris Lattner2f7c9632001-06-06 20:29:01 +00001145YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001146#line 168 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +00001147{
1148 uint64_t Val = atoull(yytext+1);
1149 // +1: we have bigger negative range
1150 if (Val > (uint64_t)INT64_MAX+1)
1151 ThrowException("Constant too large for signed 64 bits!");
1152 llvmAsmlval.SInt64Val = -Val;
1153 return ESINT64VAL;
1154 }
1155 YY_BREAK
Chris Lattner62ecb4a2001-07-08 23:22:50 +00001156case 56:
1157YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001158#line 178 "Lexer.l"
Chris Lattner62ecb4a2001-07-08 23:22:50 +00001159{ llvmAsmlval.UIntVal = atoull(yytext+1); return UINTVAL; }
1160 YY_BREAK
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001161case 57:
Chris Lattner2f7c9632001-06-06 20:29:01 +00001162YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001163#line 179 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +00001164{
1165 uint64_t Val = atoull(yytext+2);
1166 // +1: we have bigger negative range
1167 if (Val > (uint64_t)INT32_MAX+1)
1168 ThrowException("Constant too large for signed 32 bits!");
1169 llvmAsmlval.SIntVal = -Val;
1170 return SINTVAL;
1171 }
1172 YY_BREAK
Chris Lattner62ecb4a2001-07-08 23:22:50 +00001173case 58:
1174YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001175#line 188 "Lexer.l"
1176{ llvmAsmlval.FPVal = atof(yytext); return FPVAL; }
Chris Lattner62ecb4a2001-07-08 23:22:50 +00001177 YY_BREAK
Chris Lattnera6821822001-07-08 04:57:15 +00001178case 59:
1179YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001180#line 190 "Lexer.l"
1181{ /* Ignore whitespace */ }
Chris Lattnerd8bebcd2001-07-08 21:10:27 +00001182 YY_BREAK
1183case 60:
1184YY_RULE_SETUP
Chris Lattner212f70d2001-07-15 00:17:01 +00001185#line 191 "Lexer.l"
1186{ /*printf("'%s'", yytext);*/ return yytext[0]; }
1187 YY_BREAK
1188case 61:
1189YY_RULE_SETUP
1190#line 193 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +00001191YY_FATAL_ERROR( "flex scanner jammed" );
1192 YY_BREAK
Chris Lattner212f70d2001-07-15 00:17:01 +00001193#line 1195 "Lexer.cpp"
Chris Lattner2f7c9632001-06-06 20:29:01 +00001194 case YY_STATE_EOF(INITIAL):
1195 yyterminate();
1196
1197 case YY_END_OF_BUFFER:
1198 {
1199 /* Amount of text matched not including the EOB char. */
1200 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1201
1202 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1203 *yy_cp = yy_hold_char;
1204 YY_RESTORE_YY_MORE_OFFSET
1205
1206 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1207 {
1208 /* We're scanning a new file or input source. It's
1209 * possible that this happened because the user
1210 * just pointed yyin at a new source and called
1211 * yylex(). If so, then we have to assure
1212 * consistency between yy_current_buffer and our
1213 * globals. Here is the right place to do so, because
1214 * this is the first action (other than possibly a
1215 * back-up) that will match for the new input source.
1216 */
1217 yy_n_chars = yy_current_buffer->yy_n_chars;
1218 yy_current_buffer->yy_input_file = yyin;
1219 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1220 }
1221
1222 /* Note that here we test for yy_c_buf_p "<=" to the position
1223 * of the first EOB in the buffer, since yy_c_buf_p will
1224 * already have been incremented past the NUL character
1225 * (since all states make transitions on EOB to the
1226 * end-of-buffer state). Contrast this with the test
1227 * in input().
1228 */
1229 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1230 { /* This was really a NUL. */
1231 yy_state_type yy_next_state;
1232
1233 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1234
1235 yy_current_state = yy_get_previous_state();
1236
1237 /* Okay, we're now positioned to make the NUL
1238 * transition. We couldn't have
1239 * yy_get_previous_state() go ahead and do it
1240 * for us because it doesn't know how to deal
1241 * with the possibility of jamming (and we don't
1242 * want to build jamming into it because then it
1243 * will run more slowly).
1244 */
1245
1246 yy_next_state = yy_try_NUL_trans( yy_current_state );
1247
1248 yy_bp = yytext_ptr + YY_MORE_ADJ;
1249
1250 if ( yy_next_state )
1251 {
1252 /* Consume the NUL. */
1253 yy_cp = ++yy_c_buf_p;
1254 yy_current_state = yy_next_state;
1255 goto yy_match;
1256 }
1257
1258 else
1259 {
1260 yy_cp = yy_c_buf_p;
1261 goto yy_find_action;
1262 }
1263 }
1264
1265 else switch ( yy_get_next_buffer() )
1266 {
1267 case EOB_ACT_END_OF_FILE:
1268 {
1269 yy_did_buffer_switch_on_eof = 0;
1270
1271 if ( yywrap() )
1272 {
1273 /* Note: because we've taken care in
1274 * yy_get_next_buffer() to have set up
1275 * yytext, we can now set up
1276 * yy_c_buf_p so that if some total
1277 * hoser (like flex itself) wants to
1278 * call the scanner after we return the
1279 * YY_NULL, it'll still work - another
1280 * YY_NULL will get returned.
1281 */
1282 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1283
1284 yy_act = YY_STATE_EOF(YY_START);
1285 goto do_action;
1286 }
1287
1288 else
1289 {
1290 if ( ! yy_did_buffer_switch_on_eof )
1291 YY_NEW_FILE;
1292 }
1293 break;
1294 }
1295
1296 case EOB_ACT_CONTINUE_SCAN:
1297 yy_c_buf_p =
1298 yytext_ptr + yy_amount_of_matched_text;
1299
1300 yy_current_state = yy_get_previous_state();
1301
1302 yy_cp = yy_c_buf_p;
1303 yy_bp = yytext_ptr + YY_MORE_ADJ;
1304 goto yy_match;
1305
1306 case EOB_ACT_LAST_MATCH:
1307 yy_c_buf_p =
1308 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1309
1310 yy_current_state = yy_get_previous_state();
1311
1312 yy_cp = yy_c_buf_p;
1313 yy_bp = yytext_ptr + YY_MORE_ADJ;
1314 goto yy_find_action;
1315 }
1316 break;
1317 }
1318
1319 default:
1320 YY_FATAL_ERROR(
1321 "fatal flex scanner internal error--no action found" );
1322 } /* end of action switch */
1323 } /* end of scanning one token */
1324 } /* end of yylex */
1325
1326
1327/* yy_get_next_buffer - try to read in a new buffer
1328 *
1329 * Returns a code representing an action:
1330 * EOB_ACT_LAST_MATCH -
1331 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1332 * EOB_ACT_END_OF_FILE - end of file
1333 */
1334
1335static int yy_get_next_buffer()
1336 {
1337 register char *dest = yy_current_buffer->yy_ch_buf;
1338 register char *source = yytext_ptr;
1339 register int number_to_move, i;
1340 int ret_val;
1341
1342 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1343 YY_FATAL_ERROR(
1344 "fatal flex scanner internal error--end of buffer missed" );
1345
1346 if ( yy_current_buffer->yy_fill_buffer == 0 )
1347 { /* Don't try to fill the buffer, so this is an EOF. */
1348 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1349 {
1350 /* We matched a single character, the EOB, so
1351 * treat this as a final EOF.
1352 */
1353 return EOB_ACT_END_OF_FILE;
1354 }
1355
1356 else
1357 {
1358 /* We matched some text prior to the EOB, first
1359 * process it.
1360 */
1361 return EOB_ACT_LAST_MATCH;
1362 }
1363 }
1364
1365 /* Try to read more data. */
1366
1367 /* First move last chars to start of buffer. */
1368 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1369
1370 for ( i = 0; i < number_to_move; ++i )
1371 *(dest++) = *(source++);
1372
1373 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1374 /* don't do the read, it's not guaranteed to return an EOF,
1375 * just force an EOF
1376 */
1377 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1378
1379 else
1380 {
1381 int num_to_read =
1382 yy_current_buffer->yy_buf_size - number_to_move - 1;
1383
1384 while ( num_to_read <= 0 )
1385 { /* Not enough room in the buffer - grow it. */
1386#ifdef YY_USES_REJECT
1387 YY_FATAL_ERROR(
1388"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1389#else
1390
1391 /* just a shorter name for the current buffer */
1392 YY_BUFFER_STATE b = yy_current_buffer;
1393
1394 int yy_c_buf_p_offset =
1395 (int) (yy_c_buf_p - b->yy_ch_buf);
1396
1397 if ( b->yy_is_our_buffer )
1398 {
1399 int new_size = b->yy_buf_size * 2;
1400
1401 if ( new_size <= 0 )
1402 b->yy_buf_size += b->yy_buf_size / 8;
1403 else
1404 b->yy_buf_size *= 2;
1405
1406 b->yy_ch_buf = (char *)
1407 /* Include room in for 2 EOB chars. */
1408 yy_flex_realloc( (void *) b->yy_ch_buf,
1409 b->yy_buf_size + 2 );
1410 }
1411 else
1412 /* Can't grow it, we don't own it. */
1413 b->yy_ch_buf = 0;
1414
1415 if ( ! b->yy_ch_buf )
1416 YY_FATAL_ERROR(
1417 "fatal error - scanner input buffer overflow" );
1418
1419 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1420
1421 num_to_read = yy_current_buffer->yy_buf_size -
1422 number_to_move - 1;
1423#endif
1424 }
1425
1426 if ( num_to_read > YY_READ_BUF_SIZE )
1427 num_to_read = YY_READ_BUF_SIZE;
1428
1429 /* Read in more data. */
1430 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1431 yy_n_chars, num_to_read );
1432
1433 yy_current_buffer->yy_n_chars = yy_n_chars;
1434 }
1435
1436 if ( yy_n_chars == 0 )
1437 {
1438 if ( number_to_move == YY_MORE_ADJ )
1439 {
1440 ret_val = EOB_ACT_END_OF_FILE;
1441 yyrestart( yyin );
1442 }
1443
1444 else
1445 {
1446 ret_val = EOB_ACT_LAST_MATCH;
1447 yy_current_buffer->yy_buffer_status =
1448 YY_BUFFER_EOF_PENDING;
1449 }
1450 }
1451
1452 else
1453 ret_val = EOB_ACT_CONTINUE_SCAN;
1454
1455 yy_n_chars += number_to_move;
1456 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1457 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1458
1459 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1460
1461 return ret_val;
1462 }
1463
1464
1465/* yy_get_previous_state - get the state just before the EOB char was reached */
1466
1467static yy_state_type yy_get_previous_state()
1468 {
1469 register yy_state_type yy_current_state;
1470 register char *yy_cp;
1471
1472 yy_current_state = yy_start;
1473 yy_state_ptr = yy_state_buf;
1474 *yy_state_ptr++ = yy_current_state;
1475
1476 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1477 {
1478 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1479 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1480 {
1481 yy_current_state = (int) yy_def[yy_current_state];
Chris Lattner212f70d2001-07-15 00:17:01 +00001482 if ( yy_current_state >= 201 )
Chris Lattner2f7c9632001-06-06 20:29:01 +00001483 yy_c = yy_meta[(unsigned int) yy_c];
1484 }
1485 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1486 *yy_state_ptr++ = yy_current_state;
1487 }
1488
1489 return yy_current_state;
1490 }
1491
1492
1493/* yy_try_NUL_trans - try to make a transition on the NUL character
1494 *
1495 * synopsis
1496 * next_state = yy_try_NUL_trans( current_state );
1497 */
1498
1499#ifdef YY_USE_PROTOS
1500static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1501#else
1502static yy_state_type yy_try_NUL_trans( yy_current_state )
1503yy_state_type yy_current_state;
1504#endif
1505 {
1506 register int yy_is_jam;
1507
1508 register YY_CHAR yy_c = 1;
1509 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1510 {
1511 yy_current_state = (int) yy_def[yy_current_state];
Chris Lattner212f70d2001-07-15 00:17:01 +00001512 if ( yy_current_state >= 201 )
Chris Lattner2f7c9632001-06-06 20:29:01 +00001513 yy_c = yy_meta[(unsigned int) yy_c];
1514 }
1515 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
Chris Lattner212f70d2001-07-15 00:17:01 +00001516 yy_is_jam = (yy_current_state == 200);
Chris Lattner2f7c9632001-06-06 20:29:01 +00001517 if ( ! yy_is_jam )
1518 *yy_state_ptr++ = yy_current_state;
1519
1520 return yy_is_jam ? 0 : yy_current_state;
1521 }
1522
1523
1524#ifndef YY_NO_UNPUT
1525#ifdef YY_USE_PROTOS
1526static inline void yyunput( int c, register char *yy_bp )
1527#else
1528static inline void yyunput( c, yy_bp )
1529int c;
1530register char *yy_bp;
1531#endif
1532 {
1533 register char *yy_cp = yy_c_buf_p;
1534
1535 /* undo effects of setting up yytext */
1536 *yy_cp = yy_hold_char;
1537
1538 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1539 { /* need to shift things up to make room */
1540 /* +2 for EOB chars. */
1541 register int number_to_move = yy_n_chars + 2;
1542 register char *dest = &yy_current_buffer->yy_ch_buf[
1543 yy_current_buffer->yy_buf_size + 2];
1544 register char *source =
1545 &yy_current_buffer->yy_ch_buf[number_to_move];
1546
1547 while ( source > yy_current_buffer->yy_ch_buf )
1548 *--dest = *--source;
1549
1550 yy_cp += (int) (dest - source);
1551 yy_bp += (int) (dest - source);
1552 yy_current_buffer->yy_n_chars =
1553 yy_n_chars = yy_current_buffer->yy_buf_size;
1554
1555 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1556 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1557 }
1558
1559 *--yy_cp = (char) c;
1560
1561 if ( c == '\n' )
1562 --yylineno;
1563
1564 yytext_ptr = yy_bp;
1565 yy_hold_char = *yy_cp;
1566 yy_c_buf_p = yy_cp;
1567 }
1568#endif /* ifndef YY_NO_UNPUT */
1569
1570
1571#ifdef __cplusplus
1572static int yyinput()
1573#else
1574static int input()
1575#endif
1576 {
1577 int c;
1578
1579 *yy_c_buf_p = yy_hold_char;
1580
1581 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1582 {
1583 /* yy_c_buf_p now points to the character we want to return.
1584 * If this occurs *before* the EOB characters, then it's a
1585 * valid NUL; if not, then we've hit the end of the buffer.
1586 */
1587 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1588 /* This was really a NUL. */
1589 *yy_c_buf_p = '\0';
1590
1591 else
1592 { /* need more input */
1593 int offset = yy_c_buf_p - yytext_ptr;
1594 ++yy_c_buf_p;
1595
1596 switch ( yy_get_next_buffer() )
1597 {
1598 case EOB_ACT_LAST_MATCH:
1599 /* This happens because yy_g_n_b()
1600 * sees that we've accumulated a
1601 * token and flags that we need to
1602 * try matching the token before
1603 * proceeding. But for input(),
1604 * there's no matching to consider.
1605 * So convert the EOB_ACT_LAST_MATCH
1606 * to EOB_ACT_END_OF_FILE.
1607 */
1608
1609 /* Reset buffer status. */
1610 yyrestart( yyin );
1611
1612 /* fall through */
1613
1614 case EOB_ACT_END_OF_FILE:
1615 {
1616 if ( yywrap() )
1617 return EOF;
1618
1619 if ( ! yy_did_buffer_switch_on_eof )
1620 YY_NEW_FILE;
1621#ifdef __cplusplus
1622 return yyinput();
1623#else
1624 return input();
1625#endif
1626 }
1627
1628 case EOB_ACT_CONTINUE_SCAN:
1629 yy_c_buf_p = yytext_ptr + offset;
1630 break;
1631 }
1632 }
1633 }
1634
1635 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1636 *yy_c_buf_p = '\0'; /* preserve yytext */
1637 yy_hold_char = *++yy_c_buf_p;
1638
1639 if ( c == '\n' )
1640 ++yylineno;
1641
1642 return c;
1643 }
1644
1645
1646#ifdef YY_USE_PROTOS
1647void yyrestart( FILE *input_file )
1648#else
1649void yyrestart( input_file )
1650FILE *input_file;
1651#endif
1652 {
1653 if ( ! yy_current_buffer )
1654 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1655
1656 yy_init_buffer( yy_current_buffer, input_file );
1657 yy_load_buffer_state();
1658 }
1659
1660
1661#ifdef YY_USE_PROTOS
1662void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1663#else
1664void yy_switch_to_buffer( new_buffer )
1665YY_BUFFER_STATE new_buffer;
1666#endif
1667 {
1668 if ( yy_current_buffer == new_buffer )
1669 return;
1670
1671 if ( yy_current_buffer )
1672 {
1673 /* Flush out information for old buffer. */
1674 *yy_c_buf_p = yy_hold_char;
1675 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1676 yy_current_buffer->yy_n_chars = yy_n_chars;
1677 }
1678
1679 yy_current_buffer = new_buffer;
1680 yy_load_buffer_state();
1681
1682 /* We don't actually know whether we did this switch during
1683 * EOF (yywrap()) processing, but the only time this flag
1684 * is looked at is after yywrap() is called, so it's safe
1685 * to go ahead and always set it.
1686 */
1687 yy_did_buffer_switch_on_eof = 1;
1688 }
1689
1690
1691#ifdef YY_USE_PROTOS
1692void yy_load_buffer_state( void )
1693#else
1694void yy_load_buffer_state()
1695#endif
1696 {
1697 yy_n_chars = yy_current_buffer->yy_n_chars;
1698 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1699 yyin = yy_current_buffer->yy_input_file;
1700 yy_hold_char = *yy_c_buf_p;
1701 }
1702
1703
1704#ifdef YY_USE_PROTOS
1705YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1706#else
1707YY_BUFFER_STATE yy_create_buffer( file, size )
1708FILE *file;
1709int size;
1710#endif
1711 {
1712 YY_BUFFER_STATE b;
1713
1714 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1715 if ( ! b )
1716 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1717
1718 b->yy_buf_size = size;
1719
1720 /* yy_ch_buf has to be 2 characters longer than the size given because
1721 * we need to put in 2 end-of-buffer characters.
1722 */
1723 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1724 if ( ! b->yy_ch_buf )
1725 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1726
1727 b->yy_is_our_buffer = 1;
1728
1729 yy_init_buffer( b, file );
1730
1731 return b;
1732 }
1733
1734
1735#ifdef YY_USE_PROTOS
1736void yy_delete_buffer( YY_BUFFER_STATE b )
1737#else
1738void yy_delete_buffer( b )
1739YY_BUFFER_STATE b;
1740#endif
1741 {
1742 if ( ! b )
1743 return;
1744
1745 if ( b == yy_current_buffer )
1746 yy_current_buffer = (YY_BUFFER_STATE) 0;
1747
1748 if ( b->yy_is_our_buffer )
1749 yy_flex_free( (void *) b->yy_ch_buf );
1750
1751 yy_flex_free( (void *) b );
1752 }
1753
1754
1755#ifndef YY_ALWAYS_INTERACTIVE
1756#ifndef YY_NEVER_INTERACTIVE
1757extern int isatty YY_PROTO(( int ));
1758#endif
1759#endif
1760
1761#ifdef YY_USE_PROTOS
1762void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1763#else
1764void yy_init_buffer( b, file )
1765YY_BUFFER_STATE b;
1766FILE *file;
1767#endif
1768
1769
1770 {
1771 yy_flush_buffer( b );
1772
1773 b->yy_input_file = file;
1774 b->yy_fill_buffer = 1;
1775
1776#if YY_ALWAYS_INTERACTIVE
1777 b->yy_is_interactive = 1;
1778#else
1779#if YY_NEVER_INTERACTIVE
1780 b->yy_is_interactive = 0;
1781#else
1782 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1783#endif
1784#endif
1785 }
1786
1787
1788#ifdef YY_USE_PROTOS
1789void yy_flush_buffer( YY_BUFFER_STATE b )
1790#else
1791void yy_flush_buffer( b )
1792YY_BUFFER_STATE b;
1793#endif
1794
1795 {
1796 if ( ! b )
1797 return;
1798
1799 b->yy_n_chars = 0;
1800
1801 /* We always need two end-of-buffer characters. The first causes
1802 * a transition to the end-of-buffer state. The second causes
1803 * a jam in that state.
1804 */
1805 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1806 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1807
1808 b->yy_buf_pos = &b->yy_ch_buf[0];
1809
1810 b->yy_at_bol = 1;
1811 b->yy_buffer_status = YY_BUFFER_NEW;
1812
1813 if ( b == yy_current_buffer )
1814 yy_load_buffer_state();
1815 }
1816
1817
1818#ifndef YY_NO_SCAN_BUFFER
1819#ifdef YY_USE_PROTOS
1820YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1821#else
1822YY_BUFFER_STATE yy_scan_buffer( base, size )
1823char *base;
1824yy_size_t size;
1825#endif
1826 {
1827 YY_BUFFER_STATE b;
1828
1829 if ( size < 2 ||
1830 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1831 base[size-1] != YY_END_OF_BUFFER_CHAR )
1832 /* They forgot to leave room for the EOB's. */
1833 return 0;
1834
1835 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1836 if ( ! b )
1837 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1838
1839 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1840 b->yy_buf_pos = b->yy_ch_buf = base;
1841 b->yy_is_our_buffer = 0;
1842 b->yy_input_file = 0;
1843 b->yy_n_chars = b->yy_buf_size;
1844 b->yy_is_interactive = 0;
1845 b->yy_at_bol = 1;
1846 b->yy_fill_buffer = 0;
1847 b->yy_buffer_status = YY_BUFFER_NEW;
1848
1849 yy_switch_to_buffer( b );
1850
1851 return b;
1852 }
1853#endif
1854
1855
1856#ifndef YY_NO_SCAN_STRING
1857#ifdef YY_USE_PROTOS
1858YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1859#else
1860YY_BUFFER_STATE yy_scan_string( yy_str )
1861yyconst char *yy_str;
1862#endif
1863 {
1864 int len;
1865 for ( len = 0; yy_str[len]; ++len )
1866 ;
1867
1868 return yy_scan_bytes( yy_str, len );
1869 }
1870#endif
1871
1872
1873#ifndef YY_NO_SCAN_BYTES
1874#ifdef YY_USE_PROTOS
1875YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1876#else
1877YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1878yyconst char *bytes;
1879int len;
1880#endif
1881 {
1882 YY_BUFFER_STATE b;
1883 char *buf;
1884 yy_size_t n;
1885 int i;
1886
1887 /* Get memory for full buffer, including space for trailing EOB's. */
1888 n = len + 2;
1889 buf = (char *) yy_flex_alloc( n );
1890 if ( ! buf )
1891 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1892
1893 for ( i = 0; i < len; ++i )
1894 buf[i] = bytes[i];
1895
1896 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1897
1898 b = yy_scan_buffer( buf, n );
1899 if ( ! b )
1900 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1901
1902 /* It's okay to grow etc. this buffer, and we should throw it
1903 * away when we're done.
1904 */
1905 b->yy_is_our_buffer = 1;
1906
1907 return b;
1908 }
1909#endif
1910
1911
1912#ifndef YY_NO_PUSH_STATE
1913#ifdef YY_USE_PROTOS
1914static void yy_push_state( int new_state )
1915#else
1916static void yy_push_state( new_state )
1917int new_state;
1918#endif
1919 {
1920 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1921 {
1922 yy_size_t new_size;
1923
1924 yy_start_stack_depth += YY_START_STACK_INCR;
1925 new_size = yy_start_stack_depth * sizeof( int );
1926
1927 if ( ! yy_start_stack )
1928 yy_start_stack = (int *) yy_flex_alloc( new_size );
1929
1930 else
1931 yy_start_stack = (int *) yy_flex_realloc(
1932 (void *) yy_start_stack, new_size );
1933
1934 if ( ! yy_start_stack )
1935 YY_FATAL_ERROR(
1936 "out of memory expanding start-condition stack" );
1937 }
1938
1939 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1940
1941 BEGIN(new_state);
1942 }
1943#endif
1944
1945
1946#ifndef YY_NO_POP_STATE
1947static void yy_pop_state()
1948 {
1949 if ( --yy_start_stack_ptr < 0 )
1950 YY_FATAL_ERROR( "start-condition stack underflow" );
1951
1952 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1953 }
1954#endif
1955
1956
1957#ifndef YY_NO_TOP_STATE
1958static int yy_top_state()
1959 {
1960 return yy_start_stack[yy_start_stack_ptr - 1];
1961 }
1962#endif
1963
1964#ifndef YY_EXIT_FAILURE
1965#define YY_EXIT_FAILURE 2
1966#endif
1967
1968#ifdef YY_USE_PROTOS
1969static void yy_fatal_error( yyconst char msg[] )
1970#else
1971static void yy_fatal_error( msg )
1972char msg[];
1973#endif
1974 {
1975 (void) fprintf( stderr, "%s\n", msg );
1976 exit( YY_EXIT_FAILURE );
1977 }
1978
1979
1980
1981/* Redefine yyless() so it works in section 3 code. */
1982
1983#undef yyless
1984#define yyless(n) \
1985 do \
1986 { \
1987 /* Undo effects of setting up yytext. */ \
1988 yytext[yyleng] = yy_hold_char; \
1989 yy_c_buf_p = yytext + n; \
1990 yy_hold_char = *yy_c_buf_p; \
1991 *yy_c_buf_p = '\0'; \
1992 yyleng = n; \
1993 } \
1994 while ( 0 )
1995
1996
1997/* Internal utility routines. */
1998
1999#ifndef yytext_ptr
2000#ifdef YY_USE_PROTOS
2001static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
2002#else
2003static void yy_flex_strncpy( s1, s2, n )
2004char *s1;
2005yyconst char *s2;
2006int n;
2007#endif
2008 {
2009 register int i;
2010 for ( i = 0; i < n; ++i )
2011 s1[i] = s2[i];
2012 }
2013#endif
2014
2015#ifdef YY_NEED_STRLEN
2016#ifdef YY_USE_PROTOS
2017static int yy_flex_strlen( yyconst char *s )
2018#else
2019static int yy_flex_strlen( s )
2020yyconst char *s;
2021#endif
2022 {
2023 register int n;
2024 for ( n = 0; s[n]; ++n )
2025 ;
2026
2027 return n;
2028 }
2029#endif
2030
2031
2032#ifdef YY_USE_PROTOS
2033static void *yy_flex_alloc( yy_size_t size )
2034#else
2035static void *yy_flex_alloc( size )
2036yy_size_t size;
2037#endif
2038 {
2039 return (void *) malloc( size );
2040 }
2041
2042#ifdef YY_USE_PROTOS
2043static inline void *yy_flex_realloc( void *ptr, yy_size_t size )
2044#else
2045static inline void *yy_flex_realloc( ptr, size )
2046void *ptr;
2047yy_size_t size;
2048#endif
2049 {
2050 /* The cast to (char *) in the following accommodates both
2051 * implementations that use char* generic pointers, and those
2052 * that use void* generic pointers. It works with the latter
2053 * because both ANSI C and C++ allow castless assignment from
2054 * any pointer type to void*, and deal with argument conversions
2055 * as though doing an assignment.
2056 */
2057 return (void *) realloc( (char *) ptr, size );
2058 }
2059
2060#ifdef YY_USE_PROTOS
2061static void yy_flex_free( void *ptr )
2062#else
2063static void yy_flex_free( ptr )
2064void *ptr;
2065#endif
2066 {
2067 free( ptr );
2068 }
2069
2070#if YY_MAIN
2071int main()
2072 {
2073 yylex();
2074 return 0;
2075 }
2076#endif
Chris Lattner212f70d2001-07-15 00:17:01 +00002077#line 193 "Lexer.l"
Chris Lattner2f7c9632001-06-06 20:29:01 +00002078