blob: 7e2191b692f2140d8e5963a037bb864b84c7f671 [file] [log] [blame]
Chris Lattner00950542001-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 Lattner09083092001-07-08 04:57:15 +0000311#define YY_NUM_RULES 59
312#define YY_END_OF_BUFFER 60
313static yyconst short int yy_acclist[114] =
Chris Lattner00950542001-06-06 20:29:01 +0000314 { 0,
Chris Lattner09083092001-07-08 04:57:15 +0000315 60, 58, 59, 57, 58, 59, 57, 59, 58, 59,
316 58, 59, 58, 59, 8, 58, 59, 53, 58, 59,
317 1, 58, 59, 58, 59, 58, 59, 58, 59, 58,
318 59, 58, 59, 58, 59, 58, 59, 58, 59, 58,
319 59, 58, 59, 58, 59, 58, 59, 58, 59, 58,
320 59, 58, 59, 58, 59, 58, 59, 51, 50, 55,
321 54, 53, 1, 9, 41, 26, 52, 50, 56, 29,
322 32, 3, 16, 31, 24, 27, 33, 40, 30, 11,
323 28, 25, 45, 46, 18, 4, 22, 17, 10, 2,
324 5, 20, 23, 12, 35, 39, 37, 38, 36, 34,
Chris Lattner00950542001-06-06 20:29:01 +0000325
Chris Lattner09083092001-07-08 04:57:15 +0000326 14, 47, 13, 19, 44, 21, 43, 42, 15, 6,
327 48, 49, 7
Chris Lattner00950542001-06-06 20:29:01 +0000328 } ;
329
Chris Lattner09083092001-07-08 04:57:15 +0000330static yyconst short int yy_accept[200] =
Chris Lattner00950542001-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,
335 58, 58, 59, 60, 60, 61, 62, 63, 64, 64,
336 64, 65, 65, 65, 66, 66, 66, 66, 66, 66,
337 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
338 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
Chris Lattner09083092001-07-08 04:57:15 +0000339 67, 67, 67, 67, 67, 67, 67, 67, 68, 69,
340 70, 71, 71, 71, 71, 71, 71, 71, 72, 72,
341 73, 73, 73, 73, 73, 73, 74, 74, 74, 74,
Chris Lattner00950542001-06-06 20:29:01 +0000342
343 74, 75, 76, 77, 77, 78, 79, 79, 79, 79,
344 79, 80, 80, 80, 80, 80, 80, 80, 80, 80,
Chris Lattner09083092001-07-08 04:57:15 +0000345 80, 80, 81, 82, 83, 83, 83, 83, 83, 84,
346 84, 84, 84, 85, 86, 86, 86, 86, 86, 86,
347 86, 86, 86, 86, 86, 87, 88, 88, 89, 89,
348 89, 90, 90, 91, 91, 91, 92, 93, 93, 93,
349 94, 94, 94, 95, 96, 97, 98, 99, 100, 101,
350 102, 103, 103, 104, 105, 105, 106, 106, 107, 107,
351 107, 108, 108, 109, 110, 111, 111, 111, 111, 112,
352 112, 113, 113, 113, 113, 113, 113, 114, 114
Chris Lattner00950542001-06-06 20:29:01 +0000353
354 } ;
355
356static yyconst int yy_ec[256] =
357 { 0,
358 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
359 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
360 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
361 1, 2, 1, 4, 1, 5, 6, 1, 1, 1,
362 1, 1, 1, 1, 7, 5, 1, 8, 8, 8,
363 8, 8, 8, 8, 8, 8, 8, 9, 10, 1,
364 1, 1, 1, 1, 5, 5, 5, 5, 5, 5,
365 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
366 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
367 1, 1, 1, 1, 5, 1, 11, 12, 13, 14,
368
369 15, 16, 17, 18, 19, 5, 5, 20, 21, 22,
370 23, 24, 25, 26, 27, 28, 29, 30, 31, 5,
371 32, 5, 1, 1, 1, 1, 1, 1, 1, 1,
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, 1, 1, 1, 1, 1,
378 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
379
380 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
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
386 } ;
387
388static yyconst int yy_meta[33] =
389 { 0,
390 1, 1, 2, 3, 4, 1, 5, 4, 6, 1,
391 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
392 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
393 4, 4
394 } ;
395
Chris Lattner09083092001-07-08 04:57:15 +0000396static yyconst short int yy_base[204] =
Chris Lattner00950542001-06-06 20:29:01 +0000397 { 0,
Chris Lattner09083092001-07-08 04:57:15 +0000398 0, 0, 391, 392, 392, 392, 0, 381, 26, 381,
Chris Lattner00950542001-06-06 20:29:01 +0000399 27, 0, 28, 40, 29, 35, 34, 42, 30, 38,
Chris Lattner09083092001-07-08 04:57:15 +0000400 56, 60, 52, 55, 61, 81, 65, 104, 63, 384,
401 378, 392, 0, 378, 377, 376, 69, 0, 32, 72,
402 374, 78, 71, 373, 91, 89, 73, 76, 92, 95,
403 98, 99, 108, 110, 111, 113, 118, 117, 121, 119,
404 123, 124, 129, 126, 134, 136, 137, 139, 135, 372,
405 140, 144, 146, 152, 147, 154, 156, 392, 0, 372,
406 370, 157, 158, 162, 164, 155, 167, 369, 176, 368,
407 170, 180, 177, 184, 181, 367, 187, 185, 186, 189,
Chris Lattner00950542001-06-06 20:29:01 +0000408
Chris Lattner09083092001-07-08 04:57:15 +0000409 366, 365, 364, 195, 363, 362, 196, 216, 197, 201,
410 361, 198, 199, 203, 204, 206, 207, 212, 208, 228,
411 221, 360, 359, 358, 231, 219, 235, 236, 357, 237,
412 238, 239, 356, 355, 240, 242, 243, 245, 251, 253,
413 256, 246, 258, 263, 354, 353, 260, 352, 268, 269,
414 351, 271, 350, 274, 275, 349, 348, 277, 278, 347,
415 280, 279, 346, 345, 344, 339, 334, 329, 324, 323,
416 321, 287, 320, 319, 282, 317, 288, 315, 289, 292,
417 314, 293, 312, 248, 211, 297, 295, 305, 210, 299,
418 172, 307, 303, 306, 311, 313, 74, 392, 335, 338,
Chris Lattner00950542001-06-06 20:29:01 +0000419
Chris Lattner09083092001-07-08 04:57:15 +0000420 341, 346, 53
Chris Lattner00950542001-06-06 20:29:01 +0000421 } ;
422
Chris Lattner09083092001-07-08 04:57:15 +0000423static yyconst short int yy_def[204] =
Chris Lattner00950542001-06-06 20:29:01 +0000424 { 0,
Chris Lattner09083092001-07-08 04:57:15 +0000425 198, 1, 198, 198, 198, 198, 199, 200, 201, 198,
426 200, 202, 200, 200, 200, 200, 200, 200, 200, 200,
427 200, 200, 200, 200, 200, 200, 200, 200, 200, 199,
428 200, 198, 203, 198, 198, 198, 200, 202, 200, 200,
429 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
430 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
431 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
432 200, 200, 200, 200, 200, 200, 200, 198, 203, 198,
433 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
434 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
Chris Lattner00950542001-06-06 20:29:01 +0000435
Chris Lattner09083092001-07-08 04:57:15 +0000436 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
437 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
438 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
439 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
440 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
441 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
442 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
443 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
444 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
445 200, 200, 200, 200, 200, 200, 200, 0, 198, 198,
Chris Lattner00950542001-06-06 20:29:01 +0000446
Chris Lattner09083092001-07-08 04:57:15 +0000447 198, 198, 198
Chris Lattner00950542001-06-06 20:29:01 +0000448 } ;
449
Chris Lattner09083092001-07-08 04:57:15 +0000450static yyconst short int yy_nxt[425] =
Chris Lattner00950542001-06-06 20:29:01 +0000451 { 0,
452 4, 5, 6, 7, 8, 9, 10, 11, 4, 12,
453 13, 14, 15, 16, 17, 18, 19, 8, 20, 21,
454 22, 23, 8, 24, 8, 25, 26, 27, 28, 29,
455 8, 8, 34, 35, 37, 32, 32, 32, 32, 45,
456 32, 39, 32, 32, 53, 81, 32, 40, 32, 46,
457 32, 41, 50, 47, 42, 49, 79, 48, 54, 55,
Chris Lattner09083092001-07-08 04:57:15 +0000458 32, 51, 43, 32, 32, 44, 56, 52, 32, 32,
459 58, 32, 61, 32, 60, 63, 37, 32, 57, 32,
460 32, 32, 32, 62, 32, 77, 32, 70, 59, 32,
461 71, 82, 64, 84, 83, 65, 72, 32, 66, 32,
Chris Lattner00950542001-06-06 20:29:01 +0000462
Chris Lattner09083092001-07-08 04:57:15 +0000463 32, 87, 88, 32, 89, 90, 32, 32, 67, 68,
464 85, 69, 32, 93, 91, 73, 32, 86, 32, 32,
465 92, 32, 74, 75, 97, 32, 32, 32, 98, 32,
466 76, 32, 32, 95, 32, 94, 100, 32, 96, 99,
467 101, 103, 32, 32, 32, 32, 102, 32, 32, 105,
468 111, 104, 32, 112, 32, 32, 106, 107, 109, 110,
469 32, 108, 32, 32, 32, 32, 32, 114, 113, 117,
470 32, 118, 32, 116, 119, 32, 121, 115, 32, 120,
471 32, 122, 124, 123, 32, 32, 125, 126, 32, 32,
472 128, 129, 32, 32, 32, 32, 127, 32, 133, 130,
Chris Lattner00950542001-06-06 20:29:01 +0000473
Chris Lattner09083092001-07-08 04:57:15 +0000474 131, 132, 134, 32, 32, 32, 32, 32, 135, 32,
475 136, 32, 32, 145, 32, 32, 32, 146, 32, 32,
476 32, 151, 142, 137, 32, 144, 143, 32, 149, 32,
477 138, 147, 139, 148, 150, 140, 32, 141, 155, 32,
478 152, 154, 153, 32, 32, 32, 32, 32, 32, 156,
479 32, 32, 159, 32, 32, 158, 32, 163, 160, 32,
480 162, 32, 161, 157, 32, 165, 32, 167, 32, 164,
481 169, 32, 171, 170, 173, 172, 32, 32, 166, 32,
482 168, 176, 32, 32, 174, 32, 32, 32, 32, 178,
483 32, 179, 181, 182, 175, 32, 32, 32, 180, 177,
Chris Lattner00950542001-06-06 20:29:01 +0000484
Chris Lattner09083092001-07-08 04:57:15 +0000485 32, 32, 185, 32, 183, 32, 187, 32, 186, 184,
486 189, 32, 188, 32, 32, 32, 190, 193, 191, 32,
487 32, 32, 32, 32, 195, 32, 192, 32, 32, 32,
488 194, 32, 32, 196, 197, 30, 30, 32, 30, 30,
489 30, 31, 32, 31, 33, 33, 38, 32, 38, 38,
490 38, 38, 32, 32, 32, 32, 32, 32, 32, 32,
Chris Lattner00950542001-06-06 20:29:01 +0000491 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
Chris Lattner09083092001-07-08 04:57:15 +0000492 32, 32, 32, 32, 32, 32, 32, 32, 32, 80,
493 32, 32, 32, 36, 35, 80, 32, 78, 36, 32,
494 198, 3, 198, 198, 198, 198, 198, 198, 198, 198,
Chris Lattner00950542001-06-06 20:29:01 +0000495
Chris Lattner09083092001-07-08 04:57:15 +0000496 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
497 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
498 198, 198, 198, 198
Chris Lattner00950542001-06-06 20:29:01 +0000499 } ;
500
Chris Lattner09083092001-07-08 04:57:15 +0000501static yyconst short int yy_chk[425] =
Chris Lattner00950542001-06-06 20:29:01 +0000502 { 0,
503 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
504 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
505 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
506 1, 1, 9, 9, 11, 11, 13, 15, 19, 15,
507 39, 13, 17, 16, 19, 39, 20, 13, 14, 16,
Chris Lattner09083092001-07-08 04:57:15 +0000508 18, 14, 18, 16, 14, 17, 203, 16, 20, 20,
509 23, 18, 14, 24, 21, 14, 21, 18, 22, 25,
510 22, 29, 24, 27, 23, 25, 37, 37, 21, 43,
511 40, 47, 197, 24, 48, 29, 42, 27, 22, 26,
512 27, 40, 26, 43, 42, 26, 27, 46, 26, 45,
Chris Lattner00950542001-06-06 20:29:01 +0000513
Chris Lattner09083092001-07-08 04:57:15 +0000514 49, 46, 47, 50, 48, 49, 51, 52, 26, 26,
515 45, 26, 28, 52, 50, 28, 53, 45, 54, 55,
516 51, 56, 28, 28, 56, 58, 57, 60, 57, 59,
517 28, 61, 62, 54, 64, 53, 58, 63, 55, 57,
518 59, 61, 65, 69, 66, 67, 60, 68, 71, 63,
519 68, 62, 72, 69, 73, 75, 63, 64, 66, 67,
520 74, 65, 76, 86, 77, 82, 83, 72, 71, 75,
521 84, 76, 85, 74, 77, 87, 83, 73, 91, 82,
522 191, 84, 86, 85, 89, 93, 87, 89, 92, 95,
523 92, 93, 94, 98, 99, 97, 91, 100, 98, 94,
Chris Lattner00950542001-06-06 20:29:01 +0000524
Chris Lattner09083092001-07-08 04:57:15 +0000525 95, 97, 99, 104, 107, 109, 112, 113, 100, 110,
526 104, 114, 115, 113, 116, 117, 119, 114, 189, 185,
527 118, 119, 109, 107, 108, 112, 110, 126, 117, 121,
528 108, 115, 108, 116, 118, 108, 120, 108, 126, 125,
529 120, 125, 121, 127, 128, 130, 131, 132, 135, 127,
530 136, 137, 131, 138, 142, 130, 184, 137, 132, 139,
531 136, 140, 135, 128, 141, 139, 143, 140, 147, 138,
532 141, 144, 143, 142, 147, 144, 149, 150, 139, 152,
533 140, 152, 154, 155, 149, 158, 159, 162, 161, 155,
534 175, 158, 161, 162, 150, 172, 177, 179, 159, 154,
Chris Lattner00950542001-06-06 20:29:01 +0000535
Chris Lattner09083092001-07-08 04:57:15 +0000536 180, 182, 177, 187, 172, 186, 180, 190, 179, 175,
537 186, 193, 182, 188, 194, 192, 187, 192, 188, 195,
538 183, 196, 181, 178, 194, 176, 190, 174, 173, 171,
539 193, 170, 169, 195, 196, 199, 199, 168, 199, 199,
540 199, 200, 167, 200, 201, 201, 202, 166, 202, 202,
541 202, 202, 165, 164, 163, 160, 157, 156, 153, 151,
542 148, 146, 145, 134, 133, 129, 124, 123, 122, 111,
543 106, 105, 103, 102, 101, 96, 90, 88, 81, 80,
544 70, 44, 41, 36, 35, 34, 31, 30, 10, 8,
545 3, 198, 198, 198, 198, 198, 198, 198, 198, 198,
Chris Lattner00950542001-06-06 20:29:01 +0000546
Chris Lattner09083092001-07-08 04:57:15 +0000547 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
548 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
549 198, 198, 198, 198
Chris Lattner00950542001-06-06 20:29:01 +0000550 } ;
551
552static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
553static char *yy_full_match;
554static int yy_lp;
555#define REJECT \
556{ \
557*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
558yy_cp = yy_full_match; /* restore poss. backed-over text */ \
559++yy_lp; \
560goto find_rule; \
561}
562#define yymore() yymore_used_but_not_detected
563#define YY_MORE_ADJ 0
564#define YY_RESTORE_YY_MORE_OFFSET
565char *yytext;
566#line 1 "Lexer.l"
567#define INITIAL 0
568/*===-- Lexer.l - Scanner for llvm assembly files ----------------*- C++ -*--=//
569//
570// This file implements the flex scanner for LLVM assembly languages files.
571//
572//===------------------------------------------------------------------------=*/
573#define YY_NEVER_INTERACTIVE 1
574#line 21 "Lexer.l"
575#include "ParserInternals.h"
576#include "llvm/BasicBlock.h"
577#include "llvm/Method.h"
578#include "llvm/Module.h"
579#include <list>
580#include "llvmAsmParser.h"
581
582#define RET_TOK(type, Enum, sym) \
583 llvmAsmlval.type = Instruction::Enum; return sym
584
585
586// TODO: All of the static identifiers are figured out by the lexer,
587// these should be hashed.
588
589
590// atoull - Convert an ascii string of decimal digits into the unsigned long
591// long representation... this does not have to do input error checking,
592// because we know that the input will be matched by a suitable regex...
593//
594uint64_t atoull(const char *Buffer) {
595 uint64_t Result = 0;
596 for (; *Buffer; Buffer++) {
597 uint64_t OldRes = Result;
598 Result *= 10;
599 Result += *Buffer-'0';
600 if (Result < OldRes) { // Uh, oh, overflow detected!!!
601 ThrowException("constant bigger than 64 bits detected!");
602 }
603 }
604 return Result;
605}
606
607
608#define YY_NEVER_INTERACTIVE 1
609/* Comments start with a ; and go till end of line */
610/* Variable(Def) identifiers start with a % sign */
611/* Label identifiers end with a colon */
612/* Quoted names can contain any character except " and \ */
613/* [PN]Integer: match positive and negative literal integer values that
614 * are preceeded by a '%' character. These represent unnamed variable slots.
615 */
616/* E[PN]Integer: match positive and negative literal integer values */
617#line 618 "Lexer.cpp"
618
619/* Macros after this point can all be overridden by user definitions in
620 * section 1.
621 */
622
623#ifndef YY_SKIP_YYWRAP
624#ifdef __cplusplus
625extern "C" int yywrap YY_PROTO(( void ));
626#else
627extern int yywrap YY_PROTO(( void ));
628#endif
629#endif
630
631#ifndef YY_NO_UNPUT
632static inline void yyunput YY_PROTO(( int c, char *buf_ptr ));
633#endif
634
635#ifndef yytext_ptr
636static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
637#endif
638
639#ifdef YY_NEED_STRLEN
640static int yy_flex_strlen YY_PROTO(( yyconst char * ));
641#endif
642
643#ifndef YY_NO_INPUT
644#ifdef __cplusplus
645static int yyinput YY_PROTO(( void ));
646#else
647static int input YY_PROTO(( void ));
648#endif
649#endif
650
651#if YY_STACK_USED
652static int yy_start_stack_ptr = 0;
653static int yy_start_stack_depth = 0;
654static int *yy_start_stack = 0;
655#ifndef YY_NO_PUSH_STATE
656static void yy_push_state YY_PROTO(( int new_state ));
657#endif
658#ifndef YY_NO_POP_STATE
659static void yy_pop_state YY_PROTO(( void ));
660#endif
661#ifndef YY_NO_TOP_STATE
662static int yy_top_state YY_PROTO(( void ));
663#endif
664
665#else
666#define YY_NO_PUSH_STATE 1
667#define YY_NO_POP_STATE 1
668#define YY_NO_TOP_STATE 1
669#endif
670
671#ifdef YY_MALLOC_DECL
672YY_MALLOC_DECL
673#else
674#if __STDC__
675#ifndef __cplusplus
676#include <stdlib.h>
677#endif
678#else
679/* Just try to get by without declaring the routines. This will fail
680 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
681 * or sizeof(void*) != sizeof(int).
682 */
683#endif
684#endif
685
686/* Amount of stuff to slurp up with each read. */
687#ifndef YY_READ_BUF_SIZE
688#define YY_READ_BUF_SIZE 8192
689#endif
690
691/* Copy whatever the last rule matched to the standard output. */
692
693#ifndef ECHO
694/* This used to be an fputs(), but since the string might contain NUL's,
695 * we now use fwrite().
696 */
697#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
698#endif
699
700/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
701 * is returned in "result".
702 */
703#ifndef YY_INPUT
704#define YY_INPUT(buf,result,max_size) \
705 if ( yy_current_buffer->yy_is_interactive ) \
706 { \
707 int c = '*', n; \
708 for ( n = 0; n < max_size && \
709 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
710 buf[n] = (char) c; \
711 if ( c == '\n' ) \
712 buf[n++] = (char) c; \
713 if ( c == EOF && ferror( yyin ) ) \
714 YY_FATAL_ERROR( "input in flex scanner failed" ); \
715 result = n; \
716 } \
717 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
718 && ferror( yyin ) ) \
719 YY_FATAL_ERROR( "input in flex scanner failed" );
720#endif
721
722/* No semi-colon after return; correct usage is to write "yyterminate();" -
723 * we don't want an extra ';' after the "return" because that will cause
724 * some compilers to complain about unreachable statements.
725 */
726#ifndef yyterminate
727#define yyterminate() return YY_NULL
728#endif
729
730/* Number of entries by which start-condition stack grows. */
731#ifndef YY_START_STACK_INCR
732#define YY_START_STACK_INCR 25
733#endif
734
735/* Report a fatal error. */
736#ifndef YY_FATAL_ERROR
737#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
738#endif
739
740/* Default declaration of generated scanner - a define so the user can
741 * easily add parameters.
742 */
743#ifndef YY_DECL
744#define YY_DECL int yylex YY_PROTO(( void ))
745#endif
746
747/* Code executed at the beginning of each rule, after yytext and yyleng
748 * have been set up.
749 */
750#ifndef YY_USER_ACTION
751#define YY_USER_ACTION
752#endif
753
754/* Code executed at the end of each rule. */
755#ifndef YY_BREAK
756#define YY_BREAK break;
757#endif
758
759#define YY_RULE_SETUP \
760 YY_USER_ACTION
761
762YY_DECL
763 {
764 register yy_state_type yy_current_state;
765 register char *yy_cp, *yy_bp;
766 register int yy_act;
767
768#line 83 "Lexer.l"
769
770
771#line 772 "Lexer.cpp"
772
773 if ( yy_init )
774 {
775 yy_init = 0;
776
777#ifdef YY_USER_INIT
778 YY_USER_INIT;
779#endif
780
781 if ( ! yy_start )
782 yy_start = 1; /* first start state */
783
784 if ( ! yyin )
785 yyin = stdin;
786
787 if ( ! yyout )
788 yyout = stdout;
789
790 if ( ! yy_current_buffer )
791 yy_current_buffer =
792 yy_create_buffer( yyin, YY_BUF_SIZE );
793
794 yy_load_buffer_state();
795 }
796
797 while ( 1 ) /* loops until end-of-file is reached */
798 {
799 yy_cp = yy_c_buf_p;
800
801 /* Support of yytext. */
802 *yy_cp = yy_hold_char;
803
804 /* yy_bp points to the position in yy_ch_buf of the start of
805 * the current run.
806 */
807 yy_bp = yy_cp;
808
809 yy_current_state = yy_start;
810 yy_state_ptr = yy_state_buf;
811 *yy_state_ptr++ = yy_current_state;
812yy_match:
813 do
814 {
815 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
816 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
817 {
818 yy_current_state = (int) yy_def[yy_current_state];
Chris Lattner09083092001-07-08 04:57:15 +0000819 if ( yy_current_state >= 199 )
Chris Lattner00950542001-06-06 20:29:01 +0000820 yy_c = yy_meta[(unsigned int) yy_c];
821 }
822 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
823 *yy_state_ptr++ = yy_current_state;
824 ++yy_cp;
825 }
Chris Lattner09083092001-07-08 04:57:15 +0000826 while ( yy_current_state != 198 );
Chris Lattner00950542001-06-06 20:29:01 +0000827
828yy_find_action:
829 yy_current_state = *--yy_state_ptr;
830 yy_lp = yy_accept[yy_current_state];
831 for ( ; ; ) /* until we find what rule we matched */
832 {
833 if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
834 {
835 yy_act = yy_acclist[yy_lp];
836 {
837 yy_full_match = yy_cp;
838 break;
839 }
840 }
841 --yy_cp;
842 yy_current_state = *--yy_state_ptr;
843 yy_lp = yy_accept[yy_current_state];
844 }
845
846 YY_DO_BEFORE_ACTION;
847
848 if ( yy_act != YY_END_OF_BUFFER )
849 {
850 int yyl;
851 for ( yyl = 0; yyl < yyleng; ++yyl )
852 if ( yytext[yyl] == '\n' )
853 ++yylineno;
854 }
855
856do_action: /* This label is used only to access EOF actions. */
857
858
859 switch ( yy_act )
860 { /* beginning of action switch */
861case 1:
862YY_RULE_SETUP
863#line 85 "Lexer.l"
864{ /* Ignore comments for now */ }
865 YY_BREAK
866case 2:
867YY_RULE_SETUP
868#line 87 "Lexer.l"
869{ return BEGINTOK; }
870 YY_BREAK
871case 3:
872YY_RULE_SETUP
873#line 88 "Lexer.l"
874{ return END; }
875 YY_BREAK
876case 4:
877YY_RULE_SETUP
878#line 89 "Lexer.l"
879{ return TRUE; }
880 YY_BREAK
881case 5:
882YY_RULE_SETUP
883#line 90 "Lexer.l"
884{ return FALSE; }
885 YY_BREAK
886case 6:
887YY_RULE_SETUP
888#line 91 "Lexer.l"
889{ return DECLARE; }
890 YY_BREAK
891case 7:
892YY_RULE_SETUP
893#line 92 "Lexer.l"
894{ return IMPLEMENTATION; }
895 YY_BREAK
896case 8:
897YY_RULE_SETUP
898#line 94 "Lexer.l"
899{ cerr << "deprecated argument '-' used!\n"; return '-'; }
900 YY_BREAK
901case 9:
902YY_RULE_SETUP
903#line 95 "Lexer.l"
904{ cerr << "deprecated type 'bb' used!\n"; llvmAsmlval.TypeVal = Type::LabelTy; return LABEL;}
905 YY_BREAK
906case 10:
907YY_RULE_SETUP
908#line 97 "Lexer.l"
909{ llvmAsmlval.TypeVal = Type::VoidTy ; return VOID; }
910 YY_BREAK
911case 11:
912YY_RULE_SETUP
913#line 98 "Lexer.l"
914{ llvmAsmlval.TypeVal = Type::BoolTy ; return BOOL; }
915 YY_BREAK
916case 12:
917YY_RULE_SETUP
918#line 99 "Lexer.l"
919{ llvmAsmlval.TypeVal = Type::SByteTy ; return SBYTE; }
920 YY_BREAK
921case 13:
922YY_RULE_SETUP
923#line 100 "Lexer.l"
924{ llvmAsmlval.TypeVal = Type::UByteTy ; return UBYTE; }
925 YY_BREAK
926case 14:
927YY_RULE_SETUP
928#line 101 "Lexer.l"
929{ llvmAsmlval.TypeVal = Type::ShortTy ; return SHORT; }
930 YY_BREAK
931case 15:
932YY_RULE_SETUP
933#line 102 "Lexer.l"
934{ llvmAsmlval.TypeVal = Type::UShortTy; return USHORT; }
935 YY_BREAK
936case 16:
937YY_RULE_SETUP
938#line 103 "Lexer.l"
939{ llvmAsmlval.TypeVal = Type::IntTy ; return INT; }
940 YY_BREAK
941case 17:
942YY_RULE_SETUP
943#line 104 "Lexer.l"
944{ llvmAsmlval.TypeVal = Type::UIntTy ; return UINT; }
945 YY_BREAK
946case 18:
947YY_RULE_SETUP
948#line 105 "Lexer.l"
949{ llvmAsmlval.TypeVal = Type::LongTy ; return LONG; }
950 YY_BREAK
951case 19:
952YY_RULE_SETUP
953#line 106 "Lexer.l"
954{ llvmAsmlval.TypeVal = Type::ULongTy ; return ULONG; }
955 YY_BREAK
956case 20:
957YY_RULE_SETUP
958#line 107 "Lexer.l"
959{ llvmAsmlval.TypeVal = Type::FloatTy ; return FLOAT; }
960 YY_BREAK
961case 21:
962YY_RULE_SETUP
963#line 108 "Lexer.l"
964{ llvmAsmlval.TypeVal = Type::DoubleTy; return DOUBLE; }
965 YY_BREAK
966case 22:
967YY_RULE_SETUP
968#line 110 "Lexer.l"
969{ llvmAsmlval.TypeVal = Type::TypeTy ; return TYPE; }
970 YY_BREAK
971case 23:
972YY_RULE_SETUP
973#line 112 "Lexer.l"
974{ llvmAsmlval.TypeVal = Type::LabelTy ; return LABEL; }
975 YY_BREAK
976case 24:
977YY_RULE_SETUP
978#line 114 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +0000979{ RET_TOK(UnaryOpVal, Not, NOT); }
Chris Lattner00950542001-06-06 20:29:01 +0000980 YY_BREAK
981case 25:
982YY_RULE_SETUP
983#line 115 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +0000984{ RET_TOK(UnaryOpVal, Cast, CAST); }
Chris Lattner00950542001-06-06 20:29:01 +0000985 YY_BREAK
986case 26:
987YY_RULE_SETUP
988#line 117 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +0000989{ return TO; }
Chris Lattner00950542001-06-06 20:29:01 +0000990 YY_BREAK
991case 27:
992YY_RULE_SETUP
993#line 118 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +0000994{ return PHI; }
Chris Lattner00950542001-06-06 20:29:01 +0000995 YY_BREAK
996case 28:
997YY_RULE_SETUP
998#line 119 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +0000999{ return CALL; }
Chris Lattner00950542001-06-06 20:29:01 +00001000 YY_BREAK
1001case 29:
1002YY_RULE_SETUP
1003#line 120 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +00001004{ RET_TOK(BinaryOpVal, Add, ADD); }
Chris Lattner00950542001-06-06 20:29:01 +00001005 YY_BREAK
1006case 30:
1007YY_RULE_SETUP
1008#line 121 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +00001009{ RET_TOK(BinaryOpVal, Sub, SUB); }
Chris Lattner00950542001-06-06 20:29:01 +00001010 YY_BREAK
1011case 31:
1012YY_RULE_SETUP
1013#line 122 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +00001014{ RET_TOK(BinaryOpVal, Mul, MUL); }
Chris Lattner00950542001-06-06 20:29:01 +00001015 YY_BREAK
1016case 32:
1017YY_RULE_SETUP
1018#line 123 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +00001019{ RET_TOK(BinaryOpVal, Div, DIV); }
Chris Lattner00950542001-06-06 20:29:01 +00001020 YY_BREAK
1021case 33:
1022YY_RULE_SETUP
1023#line 124 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +00001024{ RET_TOK(BinaryOpVal, Rem, REM); }
Chris Lattner00950542001-06-06 20:29:01 +00001025 YY_BREAK
1026case 34:
1027YY_RULE_SETUP
1028#line 125 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +00001029{ RET_TOK(BinaryOpVal, SetNE, SETNE); }
Chris Lattner00950542001-06-06 20:29:01 +00001030 YY_BREAK
1031case 35:
1032YY_RULE_SETUP
1033#line 126 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +00001034{ RET_TOK(BinaryOpVal, SetEQ, SETEQ); }
Chris Lattner00950542001-06-06 20:29:01 +00001035 YY_BREAK
1036case 36:
1037YY_RULE_SETUP
1038#line 127 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +00001039{ RET_TOK(BinaryOpVal, SetLT, SETLT); }
Chris Lattner00950542001-06-06 20:29:01 +00001040 YY_BREAK
1041case 37:
1042YY_RULE_SETUP
1043#line 128 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +00001044{ RET_TOK(BinaryOpVal, SetGT, SETGT); }
Chris Lattner00950542001-06-06 20:29:01 +00001045 YY_BREAK
1046case 38:
1047YY_RULE_SETUP
1048#line 129 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +00001049{ RET_TOK(BinaryOpVal, SetLE, SETLE); }
Chris Lattner00950542001-06-06 20:29:01 +00001050 YY_BREAK
1051case 39:
1052YY_RULE_SETUP
Chris Lattner09083092001-07-08 04:57:15 +00001053#line 130 "Lexer.l"
1054{ RET_TOK(BinaryOpVal, SetGE, SETGE); }
Chris Lattner00950542001-06-06 20:29:01 +00001055 YY_BREAK
1056case 40:
1057YY_RULE_SETUP
1058#line 132 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +00001059{ RET_TOK(TermOpVal, Ret, RET); }
Chris Lattner00950542001-06-06 20:29:01 +00001060 YY_BREAK
1061case 41:
1062YY_RULE_SETUP
1063#line 133 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +00001064{ RET_TOK(TermOpVal, Br, BR); }
Chris Lattner00950542001-06-06 20:29:01 +00001065 YY_BREAK
1066case 42:
1067YY_RULE_SETUP
Chris Lattner09083092001-07-08 04:57:15 +00001068#line 134 "Lexer.l"
1069{ RET_TOK(TermOpVal, Switch, SWITCH); }
Chris Lattner00950542001-06-06 20:29:01 +00001070 YY_BREAK
1071case 43:
1072YY_RULE_SETUP
1073#line 137 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +00001074{ RET_TOK(MemOpVal, Malloc, MALLOC); }
Chris Lattner00950542001-06-06 20:29:01 +00001075 YY_BREAK
1076case 44:
1077YY_RULE_SETUP
1078#line 138 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +00001079{ RET_TOK(MemOpVal, Alloca, ALLOCA); }
Chris Lattner00950542001-06-06 20:29:01 +00001080 YY_BREAK
1081case 45:
1082YY_RULE_SETUP
1083#line 139 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +00001084{ RET_TOK(MemOpVal, Free, FREE); }
Chris Lattner00950542001-06-06 20:29:01 +00001085 YY_BREAK
1086case 46:
1087YY_RULE_SETUP
1088#line 140 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +00001089{ RET_TOK(MemOpVal, Load, LOAD); }
Chris Lattner00950542001-06-06 20:29:01 +00001090 YY_BREAK
1091case 47:
1092YY_RULE_SETUP
1093#line 141 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +00001094{ RET_TOK(MemOpVal, Store, STORE); }
Chris Lattner00950542001-06-06 20:29:01 +00001095 YY_BREAK
1096case 48:
1097YY_RULE_SETUP
1098#line 142 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +00001099{ RET_TOK(MemOpVal, GetField, GETFIELD); }
Chris Lattner00950542001-06-06 20:29:01 +00001100 YY_BREAK
1101case 49:
1102YY_RULE_SETUP
Chris Lattner09083092001-07-08 04:57:15 +00001103#line 143 "Lexer.l"
1104{ RET_TOK(MemOpVal, PutField, PUTFIELD); }
Chris Lattner00950542001-06-06 20:29:01 +00001105 YY_BREAK
1106case 50:
1107YY_RULE_SETUP
1108#line 146 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +00001109{ llvmAsmlval.StrVal = strdup(yytext+1); return VAR_ID; }
1110 YY_BREAK
1111case 51:
1112YY_RULE_SETUP
1113#line 147 "Lexer.l"
Chris Lattner00950542001-06-06 20:29:01 +00001114{
1115 yytext[strlen(yytext)-1] = 0; // nuke colon
1116 llvmAsmlval.StrVal = strdup(yytext);
1117 return LABELSTR;
1118 }
1119 YY_BREAK
Chris Lattner09083092001-07-08 04:57:15 +00001120case 52:
Chris Lattner00950542001-06-06 20:29:01 +00001121YY_RULE_SETUP
Chris Lattner09083092001-07-08 04:57:15 +00001122#line 153 "Lexer.l"
Chris Lattner00950542001-06-06 20:29:01 +00001123{
1124 yytext[strlen(yytext)-1] = 0; // nuke end quote
1125 llvmAsmlval.StrVal = strdup(yytext+1); // Nuke start quote
1126 return STRINGCONSTANT;
1127 }
1128 YY_BREAK
Chris Lattner00950542001-06-06 20:29:01 +00001129case 53:
1130YY_RULE_SETUP
1131#line 160 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +00001132{ llvmAsmlval.UInt64Val = atoull(yytext); return EUINT64VAL; }
1133 YY_BREAK
1134case 54:
1135YY_RULE_SETUP
1136#line 161 "Lexer.l"
Chris Lattner00950542001-06-06 20:29:01 +00001137{
1138 uint64_t Val = atoull(yytext+1);
1139 // +1: we have bigger negative range
1140 if (Val > (uint64_t)INT64_MAX+1)
1141 ThrowException("Constant too large for signed 64 bits!");
1142 llvmAsmlval.SInt64Val = -Val;
1143 return ESINT64VAL;
1144 }
1145 YY_BREAK
Chris Lattner00950542001-06-06 20:29:01 +00001146case 55:
1147YY_RULE_SETUP
1148#line 171 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +00001149{ llvmAsmlval.UIntVal = atoull(yytext+1); return UINTVAL; }
1150 YY_BREAK
1151case 56:
1152YY_RULE_SETUP
1153#line 172 "Lexer.l"
Chris Lattner00950542001-06-06 20:29:01 +00001154{
1155 uint64_t Val = atoull(yytext+2);
1156 // +1: we have bigger negative range
1157 if (Val > (uint64_t)INT32_MAX+1)
1158 ThrowException("Constant too large for signed 32 bits!");
1159 llvmAsmlval.SIntVal = -Val;
1160 return SINTVAL;
1161 }
1162 YY_BREAK
Chris Lattner00950542001-06-06 20:29:01 +00001163case 57:
1164YY_RULE_SETUP
1165#line 182 "Lexer.l"
Chris Lattner09083092001-07-08 04:57:15 +00001166{ /* Ignore whitespace */ }
Chris Lattner00950542001-06-06 20:29:01 +00001167 YY_BREAK
1168case 58:
1169YY_RULE_SETUP
Chris Lattner09083092001-07-08 04:57:15 +00001170#line 183 "Lexer.l"
1171{ /*printf("'%s'", yytext);*/ return yytext[0]; }
1172 YY_BREAK
1173case 59:
1174YY_RULE_SETUP
1175#line 185 "Lexer.l"
Chris Lattner00950542001-06-06 20:29:01 +00001176YY_FATAL_ERROR( "flex scanner jammed" );
1177 YY_BREAK
Chris Lattner09083092001-07-08 04:57:15 +00001178#line 1180 "Lexer.cpp"
Chris Lattner00950542001-06-06 20:29:01 +00001179 case YY_STATE_EOF(INITIAL):
1180 yyterminate();
1181
1182 case YY_END_OF_BUFFER:
1183 {
1184 /* Amount of text matched not including the EOB char. */
1185 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1186
1187 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1188 *yy_cp = yy_hold_char;
1189 YY_RESTORE_YY_MORE_OFFSET
1190
1191 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1192 {
1193 /* We're scanning a new file or input source. It's
1194 * possible that this happened because the user
1195 * just pointed yyin at a new source and called
1196 * yylex(). If so, then we have to assure
1197 * consistency between yy_current_buffer and our
1198 * globals. Here is the right place to do so, because
1199 * this is the first action (other than possibly a
1200 * back-up) that will match for the new input source.
1201 */
1202 yy_n_chars = yy_current_buffer->yy_n_chars;
1203 yy_current_buffer->yy_input_file = yyin;
1204 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1205 }
1206
1207 /* Note that here we test for yy_c_buf_p "<=" to the position
1208 * of the first EOB in the buffer, since yy_c_buf_p will
1209 * already have been incremented past the NUL character
1210 * (since all states make transitions on EOB to the
1211 * end-of-buffer state). Contrast this with the test
1212 * in input().
1213 */
1214 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1215 { /* This was really a NUL. */
1216 yy_state_type yy_next_state;
1217
1218 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1219
1220 yy_current_state = yy_get_previous_state();
1221
1222 /* Okay, we're now positioned to make the NUL
1223 * transition. We couldn't have
1224 * yy_get_previous_state() go ahead and do it
1225 * for us because it doesn't know how to deal
1226 * with the possibility of jamming (and we don't
1227 * want to build jamming into it because then it
1228 * will run more slowly).
1229 */
1230
1231 yy_next_state = yy_try_NUL_trans( yy_current_state );
1232
1233 yy_bp = yytext_ptr + YY_MORE_ADJ;
1234
1235 if ( yy_next_state )
1236 {
1237 /* Consume the NUL. */
1238 yy_cp = ++yy_c_buf_p;
1239 yy_current_state = yy_next_state;
1240 goto yy_match;
1241 }
1242
1243 else
1244 {
1245 yy_cp = yy_c_buf_p;
1246 goto yy_find_action;
1247 }
1248 }
1249
1250 else switch ( yy_get_next_buffer() )
1251 {
1252 case EOB_ACT_END_OF_FILE:
1253 {
1254 yy_did_buffer_switch_on_eof = 0;
1255
1256 if ( yywrap() )
1257 {
1258 /* Note: because we've taken care in
1259 * yy_get_next_buffer() to have set up
1260 * yytext, we can now set up
1261 * yy_c_buf_p so that if some total
1262 * hoser (like flex itself) wants to
1263 * call the scanner after we return the
1264 * YY_NULL, it'll still work - another
1265 * YY_NULL will get returned.
1266 */
1267 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1268
1269 yy_act = YY_STATE_EOF(YY_START);
1270 goto do_action;
1271 }
1272
1273 else
1274 {
1275 if ( ! yy_did_buffer_switch_on_eof )
1276 YY_NEW_FILE;
1277 }
1278 break;
1279 }
1280
1281 case EOB_ACT_CONTINUE_SCAN:
1282 yy_c_buf_p =
1283 yytext_ptr + yy_amount_of_matched_text;
1284
1285 yy_current_state = yy_get_previous_state();
1286
1287 yy_cp = yy_c_buf_p;
1288 yy_bp = yytext_ptr + YY_MORE_ADJ;
1289 goto yy_match;
1290
1291 case EOB_ACT_LAST_MATCH:
1292 yy_c_buf_p =
1293 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1294
1295 yy_current_state = yy_get_previous_state();
1296
1297 yy_cp = yy_c_buf_p;
1298 yy_bp = yytext_ptr + YY_MORE_ADJ;
1299 goto yy_find_action;
1300 }
1301 break;
1302 }
1303
1304 default:
1305 YY_FATAL_ERROR(
1306 "fatal flex scanner internal error--no action found" );
1307 } /* end of action switch */
1308 } /* end of scanning one token */
1309 } /* end of yylex */
1310
1311
1312/* yy_get_next_buffer - try to read in a new buffer
1313 *
1314 * Returns a code representing an action:
1315 * EOB_ACT_LAST_MATCH -
1316 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1317 * EOB_ACT_END_OF_FILE - end of file
1318 */
1319
1320static int yy_get_next_buffer()
1321 {
1322 register char *dest = yy_current_buffer->yy_ch_buf;
1323 register char *source = yytext_ptr;
1324 register int number_to_move, i;
1325 int ret_val;
1326
1327 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1328 YY_FATAL_ERROR(
1329 "fatal flex scanner internal error--end of buffer missed" );
1330
1331 if ( yy_current_buffer->yy_fill_buffer == 0 )
1332 { /* Don't try to fill the buffer, so this is an EOF. */
1333 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1334 {
1335 /* We matched a single character, the EOB, so
1336 * treat this as a final EOF.
1337 */
1338 return EOB_ACT_END_OF_FILE;
1339 }
1340
1341 else
1342 {
1343 /* We matched some text prior to the EOB, first
1344 * process it.
1345 */
1346 return EOB_ACT_LAST_MATCH;
1347 }
1348 }
1349
1350 /* Try to read more data. */
1351
1352 /* First move last chars to start of buffer. */
1353 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1354
1355 for ( i = 0; i < number_to_move; ++i )
1356 *(dest++) = *(source++);
1357
1358 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1359 /* don't do the read, it's not guaranteed to return an EOF,
1360 * just force an EOF
1361 */
1362 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1363
1364 else
1365 {
1366 int num_to_read =
1367 yy_current_buffer->yy_buf_size - number_to_move - 1;
1368
1369 while ( num_to_read <= 0 )
1370 { /* Not enough room in the buffer - grow it. */
1371#ifdef YY_USES_REJECT
1372 YY_FATAL_ERROR(
1373"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1374#else
1375
1376 /* just a shorter name for the current buffer */
1377 YY_BUFFER_STATE b = yy_current_buffer;
1378
1379 int yy_c_buf_p_offset =
1380 (int) (yy_c_buf_p - b->yy_ch_buf);
1381
1382 if ( b->yy_is_our_buffer )
1383 {
1384 int new_size = b->yy_buf_size * 2;
1385
1386 if ( new_size <= 0 )
1387 b->yy_buf_size += b->yy_buf_size / 8;
1388 else
1389 b->yy_buf_size *= 2;
1390
1391 b->yy_ch_buf = (char *)
1392 /* Include room in for 2 EOB chars. */
1393 yy_flex_realloc( (void *) b->yy_ch_buf,
1394 b->yy_buf_size + 2 );
1395 }
1396 else
1397 /* Can't grow it, we don't own it. */
1398 b->yy_ch_buf = 0;
1399
1400 if ( ! b->yy_ch_buf )
1401 YY_FATAL_ERROR(
1402 "fatal error - scanner input buffer overflow" );
1403
1404 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1405
1406 num_to_read = yy_current_buffer->yy_buf_size -
1407 number_to_move - 1;
1408#endif
1409 }
1410
1411 if ( num_to_read > YY_READ_BUF_SIZE )
1412 num_to_read = YY_READ_BUF_SIZE;
1413
1414 /* Read in more data. */
1415 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1416 yy_n_chars, num_to_read );
1417
1418 yy_current_buffer->yy_n_chars = yy_n_chars;
1419 }
1420
1421 if ( yy_n_chars == 0 )
1422 {
1423 if ( number_to_move == YY_MORE_ADJ )
1424 {
1425 ret_val = EOB_ACT_END_OF_FILE;
1426 yyrestart( yyin );
1427 }
1428
1429 else
1430 {
1431 ret_val = EOB_ACT_LAST_MATCH;
1432 yy_current_buffer->yy_buffer_status =
1433 YY_BUFFER_EOF_PENDING;
1434 }
1435 }
1436
1437 else
1438 ret_val = EOB_ACT_CONTINUE_SCAN;
1439
1440 yy_n_chars += number_to_move;
1441 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1442 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1443
1444 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1445
1446 return ret_val;
1447 }
1448
1449
1450/* yy_get_previous_state - get the state just before the EOB char was reached */
1451
1452static yy_state_type yy_get_previous_state()
1453 {
1454 register yy_state_type yy_current_state;
1455 register char *yy_cp;
1456
1457 yy_current_state = yy_start;
1458 yy_state_ptr = yy_state_buf;
1459 *yy_state_ptr++ = yy_current_state;
1460
1461 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1462 {
1463 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1464 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1465 {
1466 yy_current_state = (int) yy_def[yy_current_state];
Chris Lattner09083092001-07-08 04:57:15 +00001467 if ( yy_current_state >= 199 )
Chris Lattner00950542001-06-06 20:29:01 +00001468 yy_c = yy_meta[(unsigned int) yy_c];
1469 }
1470 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1471 *yy_state_ptr++ = yy_current_state;
1472 }
1473
1474 return yy_current_state;
1475 }
1476
1477
1478/* yy_try_NUL_trans - try to make a transition on the NUL character
1479 *
1480 * synopsis
1481 * next_state = yy_try_NUL_trans( current_state );
1482 */
1483
1484#ifdef YY_USE_PROTOS
1485static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1486#else
1487static yy_state_type yy_try_NUL_trans( yy_current_state )
1488yy_state_type yy_current_state;
1489#endif
1490 {
1491 register int yy_is_jam;
1492
1493 register YY_CHAR yy_c = 1;
1494 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1495 {
1496 yy_current_state = (int) yy_def[yy_current_state];
Chris Lattner09083092001-07-08 04:57:15 +00001497 if ( yy_current_state >= 199 )
Chris Lattner00950542001-06-06 20:29:01 +00001498 yy_c = yy_meta[(unsigned int) yy_c];
1499 }
1500 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
Chris Lattner09083092001-07-08 04:57:15 +00001501 yy_is_jam = (yy_current_state == 198);
Chris Lattner00950542001-06-06 20:29:01 +00001502 if ( ! yy_is_jam )
1503 *yy_state_ptr++ = yy_current_state;
1504
1505 return yy_is_jam ? 0 : yy_current_state;
1506 }
1507
1508
1509#ifndef YY_NO_UNPUT
1510#ifdef YY_USE_PROTOS
1511static inline void yyunput( int c, register char *yy_bp )
1512#else
1513static inline void yyunput( c, yy_bp )
1514int c;
1515register char *yy_bp;
1516#endif
1517 {
1518 register char *yy_cp = yy_c_buf_p;
1519
1520 /* undo effects of setting up yytext */
1521 *yy_cp = yy_hold_char;
1522
1523 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1524 { /* need to shift things up to make room */
1525 /* +2 for EOB chars. */
1526 register int number_to_move = yy_n_chars + 2;
1527 register char *dest = &yy_current_buffer->yy_ch_buf[
1528 yy_current_buffer->yy_buf_size + 2];
1529 register char *source =
1530 &yy_current_buffer->yy_ch_buf[number_to_move];
1531
1532 while ( source > yy_current_buffer->yy_ch_buf )
1533 *--dest = *--source;
1534
1535 yy_cp += (int) (dest - source);
1536 yy_bp += (int) (dest - source);
1537 yy_current_buffer->yy_n_chars =
1538 yy_n_chars = yy_current_buffer->yy_buf_size;
1539
1540 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1541 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1542 }
1543
1544 *--yy_cp = (char) c;
1545
1546 if ( c == '\n' )
1547 --yylineno;
1548
1549 yytext_ptr = yy_bp;
1550 yy_hold_char = *yy_cp;
1551 yy_c_buf_p = yy_cp;
1552 }
1553#endif /* ifndef YY_NO_UNPUT */
1554
1555
1556#ifdef __cplusplus
1557static int yyinput()
1558#else
1559static int input()
1560#endif
1561 {
1562 int c;
1563
1564 *yy_c_buf_p = yy_hold_char;
1565
1566 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1567 {
1568 /* yy_c_buf_p now points to the character we want to return.
1569 * If this occurs *before* the EOB characters, then it's a
1570 * valid NUL; if not, then we've hit the end of the buffer.
1571 */
1572 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1573 /* This was really a NUL. */
1574 *yy_c_buf_p = '\0';
1575
1576 else
1577 { /* need more input */
1578 int offset = yy_c_buf_p - yytext_ptr;
1579 ++yy_c_buf_p;
1580
1581 switch ( yy_get_next_buffer() )
1582 {
1583 case EOB_ACT_LAST_MATCH:
1584 /* This happens because yy_g_n_b()
1585 * sees that we've accumulated a
1586 * token and flags that we need to
1587 * try matching the token before
1588 * proceeding. But for input(),
1589 * there's no matching to consider.
1590 * So convert the EOB_ACT_LAST_MATCH
1591 * to EOB_ACT_END_OF_FILE.
1592 */
1593
1594 /* Reset buffer status. */
1595 yyrestart( yyin );
1596
1597 /* fall through */
1598
1599 case EOB_ACT_END_OF_FILE:
1600 {
1601 if ( yywrap() )
1602 return EOF;
1603
1604 if ( ! yy_did_buffer_switch_on_eof )
1605 YY_NEW_FILE;
1606#ifdef __cplusplus
1607 return yyinput();
1608#else
1609 return input();
1610#endif
1611 }
1612
1613 case EOB_ACT_CONTINUE_SCAN:
1614 yy_c_buf_p = yytext_ptr + offset;
1615 break;
1616 }
1617 }
1618 }
1619
1620 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1621 *yy_c_buf_p = '\0'; /* preserve yytext */
1622 yy_hold_char = *++yy_c_buf_p;
1623
1624 if ( c == '\n' )
1625 ++yylineno;
1626
1627 return c;
1628 }
1629
1630
1631#ifdef YY_USE_PROTOS
1632void yyrestart( FILE *input_file )
1633#else
1634void yyrestart( input_file )
1635FILE *input_file;
1636#endif
1637 {
1638 if ( ! yy_current_buffer )
1639 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1640
1641 yy_init_buffer( yy_current_buffer, input_file );
1642 yy_load_buffer_state();
1643 }
1644
1645
1646#ifdef YY_USE_PROTOS
1647void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1648#else
1649void yy_switch_to_buffer( new_buffer )
1650YY_BUFFER_STATE new_buffer;
1651#endif
1652 {
1653 if ( yy_current_buffer == new_buffer )
1654 return;
1655
1656 if ( yy_current_buffer )
1657 {
1658 /* Flush out information for old buffer. */
1659 *yy_c_buf_p = yy_hold_char;
1660 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1661 yy_current_buffer->yy_n_chars = yy_n_chars;
1662 }
1663
1664 yy_current_buffer = new_buffer;
1665 yy_load_buffer_state();
1666
1667 /* We don't actually know whether we did this switch during
1668 * EOF (yywrap()) processing, but the only time this flag
1669 * is looked at is after yywrap() is called, so it's safe
1670 * to go ahead and always set it.
1671 */
1672 yy_did_buffer_switch_on_eof = 1;
1673 }
1674
1675
1676#ifdef YY_USE_PROTOS
1677void yy_load_buffer_state( void )
1678#else
1679void yy_load_buffer_state()
1680#endif
1681 {
1682 yy_n_chars = yy_current_buffer->yy_n_chars;
1683 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1684 yyin = yy_current_buffer->yy_input_file;
1685 yy_hold_char = *yy_c_buf_p;
1686 }
1687
1688
1689#ifdef YY_USE_PROTOS
1690YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1691#else
1692YY_BUFFER_STATE yy_create_buffer( file, size )
1693FILE *file;
1694int size;
1695#endif
1696 {
1697 YY_BUFFER_STATE b;
1698
1699 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1700 if ( ! b )
1701 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1702
1703 b->yy_buf_size = size;
1704
1705 /* yy_ch_buf has to be 2 characters longer than the size given because
1706 * we need to put in 2 end-of-buffer characters.
1707 */
1708 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1709 if ( ! b->yy_ch_buf )
1710 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1711
1712 b->yy_is_our_buffer = 1;
1713
1714 yy_init_buffer( b, file );
1715
1716 return b;
1717 }
1718
1719
1720#ifdef YY_USE_PROTOS
1721void yy_delete_buffer( YY_BUFFER_STATE b )
1722#else
1723void yy_delete_buffer( b )
1724YY_BUFFER_STATE b;
1725#endif
1726 {
1727 if ( ! b )
1728 return;
1729
1730 if ( b == yy_current_buffer )
1731 yy_current_buffer = (YY_BUFFER_STATE) 0;
1732
1733 if ( b->yy_is_our_buffer )
1734 yy_flex_free( (void *) b->yy_ch_buf );
1735
1736 yy_flex_free( (void *) b );
1737 }
1738
1739
1740#ifndef YY_ALWAYS_INTERACTIVE
1741#ifndef YY_NEVER_INTERACTIVE
1742extern int isatty YY_PROTO(( int ));
1743#endif
1744#endif
1745
1746#ifdef YY_USE_PROTOS
1747void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1748#else
1749void yy_init_buffer( b, file )
1750YY_BUFFER_STATE b;
1751FILE *file;
1752#endif
1753
1754
1755 {
1756 yy_flush_buffer( b );
1757
1758 b->yy_input_file = file;
1759 b->yy_fill_buffer = 1;
1760
1761#if YY_ALWAYS_INTERACTIVE
1762 b->yy_is_interactive = 1;
1763#else
1764#if YY_NEVER_INTERACTIVE
1765 b->yy_is_interactive = 0;
1766#else
1767 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1768#endif
1769#endif
1770 }
1771
1772
1773#ifdef YY_USE_PROTOS
1774void yy_flush_buffer( YY_BUFFER_STATE b )
1775#else
1776void yy_flush_buffer( b )
1777YY_BUFFER_STATE b;
1778#endif
1779
1780 {
1781 if ( ! b )
1782 return;
1783
1784 b->yy_n_chars = 0;
1785
1786 /* We always need two end-of-buffer characters. The first causes
1787 * a transition to the end-of-buffer state. The second causes
1788 * a jam in that state.
1789 */
1790 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1791 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1792
1793 b->yy_buf_pos = &b->yy_ch_buf[0];
1794
1795 b->yy_at_bol = 1;
1796 b->yy_buffer_status = YY_BUFFER_NEW;
1797
1798 if ( b == yy_current_buffer )
1799 yy_load_buffer_state();
1800 }
1801
1802
1803#ifndef YY_NO_SCAN_BUFFER
1804#ifdef YY_USE_PROTOS
1805YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1806#else
1807YY_BUFFER_STATE yy_scan_buffer( base, size )
1808char *base;
1809yy_size_t size;
1810#endif
1811 {
1812 YY_BUFFER_STATE b;
1813
1814 if ( size < 2 ||
1815 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1816 base[size-1] != YY_END_OF_BUFFER_CHAR )
1817 /* They forgot to leave room for the EOB's. */
1818 return 0;
1819
1820 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1821 if ( ! b )
1822 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1823
1824 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1825 b->yy_buf_pos = b->yy_ch_buf = base;
1826 b->yy_is_our_buffer = 0;
1827 b->yy_input_file = 0;
1828 b->yy_n_chars = b->yy_buf_size;
1829 b->yy_is_interactive = 0;
1830 b->yy_at_bol = 1;
1831 b->yy_fill_buffer = 0;
1832 b->yy_buffer_status = YY_BUFFER_NEW;
1833
1834 yy_switch_to_buffer( b );
1835
1836 return b;
1837 }
1838#endif
1839
1840
1841#ifndef YY_NO_SCAN_STRING
1842#ifdef YY_USE_PROTOS
1843YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1844#else
1845YY_BUFFER_STATE yy_scan_string( yy_str )
1846yyconst char *yy_str;
1847#endif
1848 {
1849 int len;
1850 for ( len = 0; yy_str[len]; ++len )
1851 ;
1852
1853 return yy_scan_bytes( yy_str, len );
1854 }
1855#endif
1856
1857
1858#ifndef YY_NO_SCAN_BYTES
1859#ifdef YY_USE_PROTOS
1860YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1861#else
1862YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1863yyconst char *bytes;
1864int len;
1865#endif
1866 {
1867 YY_BUFFER_STATE b;
1868 char *buf;
1869 yy_size_t n;
1870 int i;
1871
1872 /* Get memory for full buffer, including space for trailing EOB's. */
1873 n = len + 2;
1874 buf = (char *) yy_flex_alloc( n );
1875 if ( ! buf )
1876 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1877
1878 for ( i = 0; i < len; ++i )
1879 buf[i] = bytes[i];
1880
1881 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1882
1883 b = yy_scan_buffer( buf, n );
1884 if ( ! b )
1885 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1886
1887 /* It's okay to grow etc. this buffer, and we should throw it
1888 * away when we're done.
1889 */
1890 b->yy_is_our_buffer = 1;
1891
1892 return b;
1893 }
1894#endif
1895
1896
1897#ifndef YY_NO_PUSH_STATE
1898#ifdef YY_USE_PROTOS
1899static void yy_push_state( int new_state )
1900#else
1901static void yy_push_state( new_state )
1902int new_state;
1903#endif
1904 {
1905 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1906 {
1907 yy_size_t new_size;
1908
1909 yy_start_stack_depth += YY_START_STACK_INCR;
1910 new_size = yy_start_stack_depth * sizeof( int );
1911
1912 if ( ! yy_start_stack )
1913 yy_start_stack = (int *) yy_flex_alloc( new_size );
1914
1915 else
1916 yy_start_stack = (int *) yy_flex_realloc(
1917 (void *) yy_start_stack, new_size );
1918
1919 if ( ! yy_start_stack )
1920 YY_FATAL_ERROR(
1921 "out of memory expanding start-condition stack" );
1922 }
1923
1924 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1925
1926 BEGIN(new_state);
1927 }
1928#endif
1929
1930
1931#ifndef YY_NO_POP_STATE
1932static void yy_pop_state()
1933 {
1934 if ( --yy_start_stack_ptr < 0 )
1935 YY_FATAL_ERROR( "start-condition stack underflow" );
1936
1937 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1938 }
1939#endif
1940
1941
1942#ifndef YY_NO_TOP_STATE
1943static int yy_top_state()
1944 {
1945 return yy_start_stack[yy_start_stack_ptr - 1];
1946 }
1947#endif
1948
1949#ifndef YY_EXIT_FAILURE
1950#define YY_EXIT_FAILURE 2
1951#endif
1952
1953#ifdef YY_USE_PROTOS
1954static void yy_fatal_error( yyconst char msg[] )
1955#else
1956static void yy_fatal_error( msg )
1957char msg[];
1958#endif
1959 {
1960 (void) fprintf( stderr, "%s\n", msg );
1961 exit( YY_EXIT_FAILURE );
1962 }
1963
1964
1965
1966/* Redefine yyless() so it works in section 3 code. */
1967
1968#undef yyless
1969#define yyless(n) \
1970 do \
1971 { \
1972 /* Undo effects of setting up yytext. */ \
1973 yytext[yyleng] = yy_hold_char; \
1974 yy_c_buf_p = yytext + n; \
1975 yy_hold_char = *yy_c_buf_p; \
1976 *yy_c_buf_p = '\0'; \
1977 yyleng = n; \
1978 } \
1979 while ( 0 )
1980
1981
1982/* Internal utility routines. */
1983
1984#ifndef yytext_ptr
1985#ifdef YY_USE_PROTOS
1986static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1987#else
1988static void yy_flex_strncpy( s1, s2, n )
1989char *s1;
1990yyconst char *s2;
1991int n;
1992#endif
1993 {
1994 register int i;
1995 for ( i = 0; i < n; ++i )
1996 s1[i] = s2[i];
1997 }
1998#endif
1999
2000#ifdef YY_NEED_STRLEN
2001#ifdef YY_USE_PROTOS
2002static int yy_flex_strlen( yyconst char *s )
2003#else
2004static int yy_flex_strlen( s )
2005yyconst char *s;
2006#endif
2007 {
2008 register int n;
2009 for ( n = 0; s[n]; ++n )
2010 ;
2011
2012 return n;
2013 }
2014#endif
2015
2016
2017#ifdef YY_USE_PROTOS
2018static void *yy_flex_alloc( yy_size_t size )
2019#else
2020static void *yy_flex_alloc( size )
2021yy_size_t size;
2022#endif
2023 {
2024 return (void *) malloc( size );
2025 }
2026
2027#ifdef YY_USE_PROTOS
2028static inline void *yy_flex_realloc( void *ptr, yy_size_t size )
2029#else
2030static inline void *yy_flex_realloc( ptr, size )
2031void *ptr;
2032yy_size_t size;
2033#endif
2034 {
2035 /* The cast to (char *) in the following accommodates both
2036 * implementations that use char* generic pointers, and those
2037 * that use void* generic pointers. It works with the latter
2038 * because both ANSI C and C++ allow castless assignment from
2039 * any pointer type to void*, and deal with argument conversions
2040 * as though doing an assignment.
2041 */
2042 return (void *) realloc( (char *) ptr, size );
2043 }
2044
2045#ifdef YY_USE_PROTOS
2046static void yy_flex_free( void *ptr )
2047#else
2048static void yy_flex_free( ptr )
2049void *ptr;
2050#endif
2051 {
2052 free( ptr );
2053 }
2054
2055#if YY_MAIN
2056int main()
2057 {
2058 yylex();
2059 return 0;
2060 }
2061#endif
Chris Lattner09083092001-07-08 04:57:15 +00002062#line 185 "Lexer.l"
Chris Lattner00950542001-06-06 20:29:01 +00002063