Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1 | #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 | |
| 118 | typedef struct yy_buffer_state *YY_BUFFER_STATE; |
| 119 | |
| 120 | extern int yyleng; |
| 121 | extern 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 | */ |
| 160 | typedef unsigned int yy_size_t; |
| 161 | |
| 162 | |
| 163 | struct 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 | |
| 220 | static 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. */ |
| 230 | static char yy_hold_char; |
| 231 | |
| 232 | static int yy_n_chars; /* number of characters read into yy_ch_buf */ |
| 233 | |
| 234 | |
| 235 | int yyleng; |
| 236 | |
| 237 | /* Points to current character in buffer. */ |
| 238 | static char *yy_c_buf_p = (char *) 0; |
| 239 | static int yy_init = 1; /* whether we need to initialize */ |
| 240 | static 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 | */ |
| 245 | static int yy_did_buffer_switch_on_eof; |
| 246 | |
| 247 | void yyrestart YY_PROTO(( FILE *input_file )); |
| 248 | |
| 249 | void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); |
| 250 | void yy_load_buffer_state YY_PROTO(( void )); |
| 251 | YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); |
| 252 | void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); |
| 253 | void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); |
| 254 | void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); |
| 255 | #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) |
| 256 | |
| 257 | YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); |
| 258 | YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); |
| 259 | YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); |
| 260 | |
| 261 | static void *yy_flex_alloc YY_PROTO(( yy_size_t )); |
| 262 | static inline void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); |
| 263 | static 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 |
| 288 | typedef unsigned char YY_CHAR; |
| 289 | FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; |
| 290 | typedef int yy_state_type; |
| 291 | extern int yylineno; |
| 292 | int yylineno = 1; |
| 293 | extern char *yytext; |
| 294 | #define yytext_ptr yytext |
| 295 | |
| 296 | static yy_state_type yy_get_previous_state YY_PROTO(( void )); |
| 297 | static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); |
| 298 | static int yy_get_next_buffer YY_PROTO(( void )); |
| 299 | static 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 Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 311 | #define YY_NUM_RULES 60 |
| 312 | #define YY_END_OF_BUFFER 61 |
| 313 | static yyconst short int yy_acclist[115] = |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 314 | { 0, |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 315 | 61, 59, 60, 58, 59, 60, 58, 60, 59, 60, |
| 316 | 59, 60, 59, 60, 8, 59, 60, 54, 59, 60, |
| 317 | 1, 59, 60, 59, 60, 59, 60, 59, 60, 59, |
| 318 | 60, 59, 60, 59, 60, 59, 60, 59, 60, 59, |
| 319 | 60, 59, 60, 59, 60, 59, 60, 59, 60, 59, |
| 320 | 60, 59, 60, 59, 60, 59, 60, 52, 51, 56, |
| 321 | 55, 54, 1, 9, 43, 36, 53, 51, 57, 25, |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 322 | 28, 3, 16, 27, 24, 37, 29, 42, 40, 41, |
| 323 | 26, 11, 38, 39, 47, 48, 18, 4, 22, 17, |
| 324 | 10, 2, 5, 20, 23, 12, 31, 35, 33, 34, |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 325 | |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 326 | 32, 30, 14, 49, 13, 19, 46, 21, 45, 44, |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 327 | 15, 6, 50, 7 |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 328 | } ; |
| 329 | |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 330 | static yyconst short int yy_accept[200] = |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 331 | { 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, |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 338 | 66, 66, 66, 66, 66, 66, 66, 66, 66, 67, |
| 339 | 67, 67, 67, 67, 67, 67, 67, 68, 69, 70, |
| 340 | 71, 71, 71, 71, 71, 71, 71, 72, 72, 73, |
| 341 | 73, 73, 73, 73, 73, 74, 74, 74, 74, 74, |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 342 | |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 343 | 75, 76, 77, 78, 79, 79, 79, 80, 80, 81, |
| 344 | 81, 82, 82, 82, 82, 82, 82, 82, 82, 82, |
| 345 | 82, 82, 83, 84, 85, 85, 85, 85, 85, 86, |
| 346 | 86, 86, 86, 87, 88, 88, 88, 88, 88, 88, |
| 347 | 88, 88, 88, 88, 89, 90, 90, 91, 91, 91, |
| 348 | 92, 92, 93, 93, 93, 94, 95, 95, 95, 96, |
| 349 | 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, |
| 350 | 105, 106, 107, 107, 108, 108, 109, 109, 109, 110, |
| 351 | 111, 112, 113, 113, 113, 113, 113, 113, 113, 113, |
| 352 | 113, 113, 113, 113, 113, 114, 114, 115, 115 |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 353 | |
| 354 | } ; |
| 355 | |
| 356 | static 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 | |
| 388 | static 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 Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 396 | static yyconst short int yy_base[204] = |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 397 | { 0, |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 398 | 0, 0, 391, 392, 392, 392, 0, 381, 26, 381, |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 399 | 27, 0, 28, 40, 29, 35, 34, 42, 30, 38, |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 400 | 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, 75, 92, 99, |
| 403 | 98, 105, 106, 108, 113, 116, 118, 117, 124, 121, |
| 404 | 126, 127, 129, 130, 133, 134, 138, 143, 372, 76, |
| 405 | 142, 137, 145, 151, 154, 156, 392, 0, 372, 370, |
| 406 | 155, 161, 159, 162, 164, 167, 369, 172, 368, 168, |
| 407 | 174, 179, 181, 177, 367, 184, 189, 191, 182, 366, |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 408 | |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 409 | 365, 364, 363, 362, 192, 212, 361, 180, 360, 196, |
| 410 | 359, 195, 198, 200, 202, 203, 215, 205, 224, 226, |
| 411 | 227, 358, 357, 356, 207, 231, 210, 217, 355, 232, |
| 412 | 233, 234, 354, 353, 235, 238, 237, 241, 246, 248, |
| 413 | 250, 251, 255, 352, 351, 256, 350, 258, 261, 349, |
| 414 | 268, 348, 263, 267, 347, 346, 271, 264, 345, 275, |
| 415 | 344, 343, 342, 341, 340, 335, 330, 325, 321, 272, |
| 416 | 316, 315, 274, 314, 282, 310, 283, 284, 307, 306, |
| 417 | 305, 208, 285, 286, 287, 289, 292, 294, 297, 298, |
| 418 | 301, 303, 302, 304, 201, 309, 74, 392, 331, 334, |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 419 | |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 420 | 337, 342, 53 |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 421 | } ; |
| 422 | |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 423 | static yyconst short int yy_def[204] = |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 424 | { 0, |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 425 | 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, 198, 203, 198, 200, |
| 433 | 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, |
| 434 | 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 435 | |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 436 | 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 Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 446 | |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 447 | 198, 198, 198 |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 448 | } ; |
| 449 | |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 450 | static yyconst short int yy_nxt[425] = |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 451 | { 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, |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 456 | 32, 39, 32, 32, 53, 80, 32, 40, 32, 46, |
| 457 | 32, 41, 50, 47, 42, 49, 78, 48, 54, 55, |
Chris Lattner | 0908309 | 2001-07-08 04:57:15 +0000 | [diff] [blame] | 458 | 32, 51, 43, 32, 32, 44, 56, 52, 32, 32, |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 459 | 58, 32, 61, 32, 60, 62, 37, 32, 57, 32, |
| 460 | 32, 32, 32, 32, 32, 76, 32, 69, 59, 32, |
| 461 | 70, 81, 63, 83, 82, 64, 71, 32, 65, 32, |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 462 | |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 463 | 32, 86, 87, 88, 113, 89, 32, 32, 66, 67, |
| 464 | 84, 68, 32, 32, 32, 72, 32, 85, 90, 92, |
| 465 | 91, 32, 73, 74, 32, 32, 32, 96, 97, 32, |
| 466 | 75, 94, 32, 93, 32, 32, 99, 32, 32, 98, |
| 467 | 95, 32, 32, 100, 102, 32, 32, 103, 101, 111, |
| 468 | 32, 32, 107, 32, 104, 108, 110, 106, 109, 32, |
| 469 | 105, 112, 32, 32, 32, 114, 116, 32, 115, 32, |
| 470 | 32, 118, 32, 117, 119, 32, 32, 120, 122, 121, |
| 471 | 32, 123, 32, 126, 128, 32, 125, 32, 32, 32, |
| 472 | 32, 124, 32, 129, 127, 130, 131, 32, 132, 32, |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 473 | |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 474 | 32, 135, 133, 32, 32, 141, 32, 134, 32, 32, |
| 475 | 32, 32, 144, 32, 145, 32, 32, 153, 32, 136, |
| 476 | 32, 142, 143, 32, 155, 32, 137, 149, 138, 146, |
| 477 | 147, 139, 32, 140, 32, 32, 148, 150, 151, 32, |
| 478 | 32, 32, 32, 32, 156, 32, 32, 158, 152, 32, |
| 479 | 154, 157, 161, 159, 32, 163, 32, 160, 32, 32, |
| 480 | 165, 162, 167, 32, 32, 169, 32, 170, 164, 32, |
| 481 | 171, 32, 32, 166, 172, 32, 32, 168, 174, 32, |
| 482 | 32, 176, 32, 32, 178, 177, 173, 179, 175, 180, |
| 483 | 32, 32, 32, 32, 32, 32, 182, 32, 184, 185, |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 484 | |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 485 | 32, 181, 32, 183, 190, 32, 32, 186, 187, 32, |
| 486 | 32, 32, 32, 32, 32, 32, 188, 32, 32, 189, |
| 487 | 191, 194, 32, 32, 32, 192, 196, 195, 193, 32, |
| 488 | 197, 30, 30, 32, 30, 30, 30, 31, 32, 31, |
| 489 | 33, 33, 38, 32, 38, 38, 38, 38, 32, 32, |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 490 | 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 491 | 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 492 | 32, 32, 32, 32, 32, 32, 32, 32, 32, 79, |
| 493 | 32, 32, 32, 36, 35, 79, 32, 77, 36, 32, |
| 494 | 198, 3, 198, 198, 198, 198, 198, 198, 198, 198, |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 495 | |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 496 | 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 Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 499 | } ; |
| 500 | |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 501 | static yyconst short int yy_chk[425] = |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 502 | { 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 Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 508 | 18, 14, 18, 16, 14, 17, 203, 16, 20, 20, |
Chris Lattner | 0908309 | 2001-07-08 04:57:15 +0000 | [diff] [blame] | 509 | 23, 18, 14, 24, 21, 14, 21, 18, 22, 25, |
| 510 | 22, 29, 24, 27, 23, 25, 37, 37, 21, 43, |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 511 | 40, 47, 197, 48, 70, 29, 42, 27, 22, 26, |
Chris Lattner | 0908309 | 2001-07-08 04:57:15 +0000 | [diff] [blame] | 512 | 27, 40, 26, 43, 42, 26, 27, 46, 26, 45, |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 513 | |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 514 | 49, 46, 47, 48, 70, 49, 51, 50, 26, 26, |
| 515 | 45, 26, 28, 52, 53, 28, 54, 45, 50, 52, |
| 516 | 51, 55, 28, 28, 56, 58, 57, 56, 57, 60, |
| 517 | 28, 54, 59, 53, 61, 62, 58, 63, 64, 57, |
| 518 | 55, 65, 66, 59, 61, 72, 67, 62, 60, 67, |
| 519 | 71, 68, 65, 73, 62, 65, 66, 64, 65, 74, |
| 520 | 63, 68, 75, 81, 76, 71, 73, 83, 72, 82, |
| 521 | 84, 75, 85, 74, 76, 86, 90, 81, 83, 82, |
| 522 | 88, 84, 91, 88, 91, 94, 86, 92, 108, 93, |
| 523 | 99, 85, 96, 92, 90, 93, 94, 97, 96, 98, |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 524 | |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 525 | 105, 99, 97, 112, 110, 108, 113, 98, 114, 195, |
| 526 | 115, 116, 113, 118, 114, 125, 182, 125, 127, 105, |
| 527 | 106, 110, 112, 117, 127, 128, 106, 118, 106, 115, |
| 528 | 116, 106, 119, 106, 120, 121, 117, 119, 120, 126, |
| 529 | 130, 131, 132, 135, 128, 137, 136, 131, 121, 138, |
| 530 | 126, 130, 136, 132, 139, 138, 140, 135, 141, 142, |
| 531 | 139, 137, 140, 143, 146, 142, 148, 143, 138, 149, |
| 532 | 146, 153, 158, 139, 148, 154, 151, 141, 151, 157, |
| 533 | 170, 154, 173, 160, 158, 157, 149, 160, 153, 170, |
| 534 | 175, 177, 178, 183, 184, 185, 175, 186, 178, 183, |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 535 | |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 536 | 187, 173, 188, 177, 188, 189, 190, 184, 185, 191, |
| 537 | 193, 192, 194, 181, 180, 179, 186, 196, 176, 187, |
| 538 | 189, 192, 174, 172, 171, 190, 194, 193, 191, 169, |
| 539 | 196, 199, 199, 168, 199, 199, 199, 200, 167, 200, |
| 540 | 201, 201, 202, 166, 202, 202, 202, 202, 165, 164, |
| 541 | 163, 162, 161, 159, 156, 155, 152, 150, 147, 145, |
| 542 | 144, 134, 133, 129, 124, 123, 122, 111, 109, 107, |
| 543 | 104, 103, 102, 101, 100, 95, 89, 87, 80, 79, |
| 544 | 69, 44, 41, 36, 35, 34, 31, 30, 10, 8, |
| 545 | 3, 198, 198, 198, 198, 198, 198, 198, 198, 198, |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 546 | |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 547 | 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 Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 550 | } ; |
| 551 | |
| 552 | static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; |
| 553 | static char *yy_full_match; |
| 554 | static int yy_lp; |
| 555 | #define REJECT \ |
| 556 | { \ |
| 557 | *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ |
| 558 | yy_cp = yy_full_match; /* restore poss. backed-over text */ \ |
| 559 | ++yy_lp; \ |
| 560 | goto find_rule; \ |
| 561 | } |
| 562 | #define yymore() yymore_used_but_not_detected |
| 563 | #define YY_MORE_ADJ 0 |
| 564 | #define YY_RESTORE_YY_MORE_OFFSET |
| 565 | char *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 | // |
| 594 | uint64_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 */ |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 617 | #line 618 "Lexer.cpp" |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 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 |
| 625 | extern "C" int yywrap YY_PROTO(( void )); |
| 626 | #else |
| 627 | extern int yywrap YY_PROTO(( void )); |
| 628 | #endif |
| 629 | #endif |
| 630 | |
| 631 | #ifndef YY_NO_UNPUT |
| 632 | static inline void yyunput YY_PROTO(( int c, char *buf_ptr )); |
| 633 | #endif |
| 634 | |
| 635 | #ifndef yytext_ptr |
| 636 | static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); |
| 637 | #endif |
| 638 | |
| 639 | #ifdef YY_NEED_STRLEN |
| 640 | static int yy_flex_strlen YY_PROTO(( yyconst char * )); |
| 641 | #endif |
| 642 | |
| 643 | #ifndef YY_NO_INPUT |
| 644 | #ifdef __cplusplus |
| 645 | static int yyinput YY_PROTO(( void )); |
| 646 | #else |
| 647 | static int input YY_PROTO(( void )); |
| 648 | #endif |
| 649 | #endif |
| 650 | |
| 651 | #if YY_STACK_USED |
| 652 | static int yy_start_stack_ptr = 0; |
| 653 | static int yy_start_stack_depth = 0; |
| 654 | static int *yy_start_stack = 0; |
| 655 | #ifndef YY_NO_PUSH_STATE |
| 656 | static void yy_push_state YY_PROTO(( int new_state )); |
| 657 | #endif |
| 658 | #ifndef YY_NO_POP_STATE |
| 659 | static void yy_pop_state YY_PROTO(( void )); |
| 660 | #endif |
| 661 | #ifndef YY_NO_TOP_STATE |
| 662 | static 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 |
| 672 | YY_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 | |
| 762 | YY_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 | |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 771 | #line 772 "Lexer.cpp" |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 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; |
| 812 | yy_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 Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 819 | if ( yy_current_state >= 199 ) |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 820 | 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 Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 826 | while ( yy_current_state != 198 ); |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 827 | |
| 828 | yy_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 | |
| 856 | do_action: /* This label is used only to access EOF actions. */ |
| 857 | |
| 858 | |
| 859 | switch ( yy_act ) |
| 860 | { /* beginning of action switch */ |
| 861 | case 1: |
| 862 | YY_RULE_SETUP |
| 863 | #line 85 "Lexer.l" |
| 864 | { /* Ignore comments for now */ } |
| 865 | YY_BREAK |
| 866 | case 2: |
| 867 | YY_RULE_SETUP |
| 868 | #line 87 "Lexer.l" |
| 869 | { return BEGINTOK; } |
| 870 | YY_BREAK |
| 871 | case 3: |
| 872 | YY_RULE_SETUP |
| 873 | #line 88 "Lexer.l" |
| 874 | { return END; } |
| 875 | YY_BREAK |
| 876 | case 4: |
| 877 | YY_RULE_SETUP |
| 878 | #line 89 "Lexer.l" |
| 879 | { return TRUE; } |
| 880 | YY_BREAK |
| 881 | case 5: |
| 882 | YY_RULE_SETUP |
| 883 | #line 90 "Lexer.l" |
| 884 | { return FALSE; } |
| 885 | YY_BREAK |
| 886 | case 6: |
| 887 | YY_RULE_SETUP |
| 888 | #line 91 "Lexer.l" |
| 889 | { return DECLARE; } |
| 890 | YY_BREAK |
| 891 | case 7: |
| 892 | YY_RULE_SETUP |
| 893 | #line 92 "Lexer.l" |
| 894 | { return IMPLEMENTATION; } |
| 895 | YY_BREAK |
| 896 | case 8: |
| 897 | YY_RULE_SETUP |
| 898 | #line 94 "Lexer.l" |
| 899 | { cerr << "deprecated argument '-' used!\n"; return '-'; } |
| 900 | YY_BREAK |
| 901 | case 9: |
| 902 | YY_RULE_SETUP |
| 903 | #line 95 "Lexer.l" |
| 904 | { cerr << "deprecated type 'bb' used!\n"; llvmAsmlval.TypeVal = Type::LabelTy; return LABEL;} |
| 905 | YY_BREAK |
| 906 | case 10: |
| 907 | YY_RULE_SETUP |
| 908 | #line 97 "Lexer.l" |
| 909 | { llvmAsmlval.TypeVal = Type::VoidTy ; return VOID; } |
| 910 | YY_BREAK |
| 911 | case 11: |
| 912 | YY_RULE_SETUP |
| 913 | #line 98 "Lexer.l" |
| 914 | { llvmAsmlval.TypeVal = Type::BoolTy ; return BOOL; } |
| 915 | YY_BREAK |
| 916 | case 12: |
| 917 | YY_RULE_SETUP |
| 918 | #line 99 "Lexer.l" |
| 919 | { llvmAsmlval.TypeVal = Type::SByteTy ; return SBYTE; } |
| 920 | YY_BREAK |
| 921 | case 13: |
| 922 | YY_RULE_SETUP |
| 923 | #line 100 "Lexer.l" |
| 924 | { llvmAsmlval.TypeVal = Type::UByteTy ; return UBYTE; } |
| 925 | YY_BREAK |
| 926 | case 14: |
| 927 | YY_RULE_SETUP |
| 928 | #line 101 "Lexer.l" |
| 929 | { llvmAsmlval.TypeVal = Type::ShortTy ; return SHORT; } |
| 930 | YY_BREAK |
| 931 | case 15: |
| 932 | YY_RULE_SETUP |
| 933 | #line 102 "Lexer.l" |
| 934 | { llvmAsmlval.TypeVal = Type::UShortTy; return USHORT; } |
| 935 | YY_BREAK |
| 936 | case 16: |
| 937 | YY_RULE_SETUP |
| 938 | #line 103 "Lexer.l" |
| 939 | { llvmAsmlval.TypeVal = Type::IntTy ; return INT; } |
| 940 | YY_BREAK |
| 941 | case 17: |
| 942 | YY_RULE_SETUP |
| 943 | #line 104 "Lexer.l" |
| 944 | { llvmAsmlval.TypeVal = Type::UIntTy ; return UINT; } |
| 945 | YY_BREAK |
| 946 | case 18: |
| 947 | YY_RULE_SETUP |
| 948 | #line 105 "Lexer.l" |
| 949 | { llvmAsmlval.TypeVal = Type::LongTy ; return LONG; } |
| 950 | YY_BREAK |
| 951 | case 19: |
| 952 | YY_RULE_SETUP |
| 953 | #line 106 "Lexer.l" |
| 954 | { llvmAsmlval.TypeVal = Type::ULongTy ; return ULONG; } |
| 955 | YY_BREAK |
| 956 | case 20: |
| 957 | YY_RULE_SETUP |
| 958 | #line 107 "Lexer.l" |
| 959 | { llvmAsmlval.TypeVal = Type::FloatTy ; return FLOAT; } |
| 960 | YY_BREAK |
| 961 | case 21: |
| 962 | YY_RULE_SETUP |
| 963 | #line 108 "Lexer.l" |
| 964 | { llvmAsmlval.TypeVal = Type::DoubleTy; return DOUBLE; } |
| 965 | YY_BREAK |
| 966 | case 22: |
| 967 | YY_RULE_SETUP |
| 968 | #line 110 "Lexer.l" |
| 969 | { llvmAsmlval.TypeVal = Type::TypeTy ; return TYPE; } |
| 970 | YY_BREAK |
| 971 | case 23: |
| 972 | YY_RULE_SETUP |
| 973 | #line 112 "Lexer.l" |
| 974 | { llvmAsmlval.TypeVal = Type::LabelTy ; return LABEL; } |
| 975 | YY_BREAK |
| 976 | case 24: |
| 977 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 978 | #line 115 "Lexer.l" |
Chris Lattner | 0908309 | 2001-07-08 04:57:15 +0000 | [diff] [blame] | 979 | { RET_TOK(UnaryOpVal, Not, NOT); } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 980 | YY_BREAK |
| 981 | case 25: |
| 982 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 983 | #line 117 "Lexer.l" |
| 984 | { RET_TOK(BinaryOpVal, Add, ADD); } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 985 | YY_BREAK |
| 986 | case 26: |
| 987 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 988 | #line 118 "Lexer.l" |
| 989 | { RET_TOK(BinaryOpVal, Sub, SUB); } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 990 | YY_BREAK |
| 991 | case 27: |
| 992 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 993 | #line 119 "Lexer.l" |
| 994 | { RET_TOK(BinaryOpVal, Mul, MUL); } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 995 | YY_BREAK |
| 996 | case 28: |
| 997 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 998 | #line 120 "Lexer.l" |
| 999 | { RET_TOK(BinaryOpVal, Div, DIV); } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1000 | YY_BREAK |
| 1001 | case 29: |
| 1002 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1003 | #line 121 "Lexer.l" |
| 1004 | { RET_TOK(BinaryOpVal, Rem, REM); } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1005 | YY_BREAK |
| 1006 | case 30: |
| 1007 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1008 | #line 122 "Lexer.l" |
| 1009 | { RET_TOK(BinaryOpVal, SetNE, SETNE); } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1010 | YY_BREAK |
| 1011 | case 31: |
| 1012 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1013 | #line 123 "Lexer.l" |
| 1014 | { RET_TOK(BinaryOpVal, SetEQ, SETEQ); } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1015 | YY_BREAK |
| 1016 | case 32: |
| 1017 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1018 | #line 124 "Lexer.l" |
| 1019 | { RET_TOK(BinaryOpVal, SetLT, SETLT); } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1020 | YY_BREAK |
| 1021 | case 33: |
| 1022 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1023 | #line 125 "Lexer.l" |
| 1024 | { RET_TOK(BinaryOpVal, SetGT, SETGT); } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1025 | YY_BREAK |
| 1026 | case 34: |
| 1027 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1028 | #line 126 "Lexer.l" |
| 1029 | { RET_TOK(BinaryOpVal, SetLE, SETLE); } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1030 | YY_BREAK |
| 1031 | case 35: |
| 1032 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1033 | #line 127 "Lexer.l" |
| 1034 | { RET_TOK(BinaryOpVal, SetGE, SETGE); } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1035 | YY_BREAK |
| 1036 | case 36: |
| 1037 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1038 | #line 129 "Lexer.l" |
| 1039 | { return TO; } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1040 | YY_BREAK |
| 1041 | case 37: |
| 1042 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1043 | #line 130 "Lexer.l" |
| 1044 | { RET_TOK(OtherOpVal, PHINode, PHI); } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1045 | YY_BREAK |
| 1046 | case 38: |
| 1047 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1048 | #line 131 "Lexer.l" |
| 1049 | { RET_TOK(OtherOpVal, Call, CALL); } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1050 | YY_BREAK |
| 1051 | case 39: |
| 1052 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1053 | #line 132 "Lexer.l" |
| 1054 | { RET_TOK(OtherOpVal, Cast, CAST); } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1055 | YY_BREAK |
| 1056 | case 40: |
| 1057 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1058 | #line 133 "Lexer.l" |
| 1059 | { RET_TOK(OtherOpVal, Shl, SHL); } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1060 | YY_BREAK |
| 1061 | case 41: |
| 1062 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1063 | #line 134 "Lexer.l" |
| 1064 | { RET_TOK(OtherOpVal, Shr, SHR); } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1065 | YY_BREAK |
| 1066 | case 42: |
| 1067 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1068 | #line 136 "Lexer.l" |
| 1069 | { RET_TOK(TermOpVal, Ret, RET); } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1070 | YY_BREAK |
| 1071 | case 43: |
| 1072 | YY_RULE_SETUP |
| 1073 | #line 137 "Lexer.l" |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1074 | { RET_TOK(TermOpVal, Br, BR); } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1075 | YY_BREAK |
| 1076 | case 44: |
| 1077 | YY_RULE_SETUP |
| 1078 | #line 138 "Lexer.l" |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1079 | { RET_TOK(TermOpVal, Switch, SWITCH); } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1080 | YY_BREAK |
| 1081 | case 45: |
| 1082 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1083 | #line 141 "Lexer.l" |
| 1084 | { RET_TOK(MemOpVal, Malloc, MALLOC); } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1085 | YY_BREAK |
| 1086 | case 46: |
| 1087 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1088 | #line 142 "Lexer.l" |
| 1089 | { RET_TOK(MemOpVal, Alloca, ALLOCA); } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1090 | YY_BREAK |
| 1091 | case 47: |
| 1092 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1093 | #line 143 "Lexer.l" |
| 1094 | { RET_TOK(MemOpVal, Free, FREE); } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1095 | YY_BREAK |
| 1096 | case 48: |
| 1097 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1098 | #line 144 "Lexer.l" |
| 1099 | { RET_TOK(MemOpVal, Load, LOAD); } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1100 | YY_BREAK |
| 1101 | case 49: |
| 1102 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1103 | #line 145 "Lexer.l" |
| 1104 | { RET_TOK(MemOpVal, Store, STORE); } |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1105 | YY_BREAK |
| 1106 | case 50: |
| 1107 | YY_RULE_SETUP |
| 1108 | #line 146 "Lexer.l" |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 1109 | { RET_TOK(MemOpVal, GetElementPtr, GETELEMENTPTR); } |
Chris Lattner | 0908309 | 2001-07-08 04:57:15 +0000 | [diff] [blame] | 1110 | YY_BREAK |
| 1111 | case 51: |
| 1112 | YY_RULE_SETUP |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 1113 | #line 149 "Lexer.l" |
| 1114 | { llvmAsmlval.StrVal = strdup(yytext+1); return VAR_ID; } |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1115 | YY_BREAK |
| 1116 | case 52: |
| 1117 | YY_RULE_SETUP |
| 1118 | #line 150 "Lexer.l" |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1119 | { |
| 1120 | yytext[strlen(yytext)-1] = 0; // nuke colon |
| 1121 | llvmAsmlval.StrVal = strdup(yytext); |
| 1122 | return LABELSTR; |
| 1123 | } |
| 1124 | YY_BREAK |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 1125 | case 53: |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1126 | YY_RULE_SETUP |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 1127 | #line 156 "Lexer.l" |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1128 | { |
| 1129 | yytext[strlen(yytext)-1] = 0; // nuke end quote |
| 1130 | llvmAsmlval.StrVal = strdup(yytext+1); // Nuke start quote |
| 1131 | return STRINGCONSTANT; |
| 1132 | } |
| 1133 | YY_BREAK |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 1134 | case 54: |
| 1135 | YY_RULE_SETUP |
| 1136 | #line 163 "Lexer.l" |
| 1137 | { llvmAsmlval.UInt64Val = atoull(yytext); return EUINT64VAL; } |
| 1138 | YY_BREAK |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1139 | case 55: |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1140 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1141 | #line 164 "Lexer.l" |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1142 | { |
| 1143 | uint64_t Val = atoull(yytext+1); |
| 1144 | // +1: we have bigger negative range |
| 1145 | if (Val > (uint64_t)INT64_MAX+1) |
| 1146 | ThrowException("Constant too large for signed 64 bits!"); |
| 1147 | llvmAsmlval.SInt64Val = -Val; |
| 1148 | return ESINT64VAL; |
| 1149 | } |
| 1150 | YY_BREAK |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 1151 | case 56: |
| 1152 | YY_RULE_SETUP |
| 1153 | #line 174 "Lexer.l" |
| 1154 | { llvmAsmlval.UIntVal = atoull(yytext+1); return UINTVAL; } |
| 1155 | YY_BREAK |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1156 | case 57: |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1157 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1158 | #line 175 "Lexer.l" |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1159 | { |
| 1160 | uint64_t Val = atoull(yytext+2); |
| 1161 | // +1: we have bigger negative range |
| 1162 | if (Val > (uint64_t)INT32_MAX+1) |
| 1163 | ThrowException("Constant too large for signed 32 bits!"); |
| 1164 | llvmAsmlval.SIntVal = -Val; |
| 1165 | return SINTVAL; |
| 1166 | } |
| 1167 | YY_BREAK |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 1168 | case 58: |
| 1169 | YY_RULE_SETUP |
| 1170 | #line 185 "Lexer.l" |
| 1171 | { /* Ignore whitespace */ } |
| 1172 | YY_BREAK |
Chris Lattner | 0908309 | 2001-07-08 04:57:15 +0000 | [diff] [blame] | 1173 | case 59: |
| 1174 | YY_RULE_SETUP |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1175 | #line 186 "Lexer.l" |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 1176 | { /*printf("'%s'", yytext);*/ return yytext[0]; } |
Chris Lattner | 027dcc5 | 2001-07-08 21:10:27 +0000 | [diff] [blame] | 1177 | YY_BREAK |
| 1178 | case 60: |
| 1179 | YY_RULE_SETUP |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 1180 | #line 188 "Lexer.l" |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1181 | YY_FATAL_ERROR( "flex scanner jammed" ); |
| 1182 | YY_BREAK |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 1183 | #line 1185 "Lexer.cpp" |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1184 | case YY_STATE_EOF(INITIAL): |
| 1185 | yyterminate(); |
| 1186 | |
| 1187 | case YY_END_OF_BUFFER: |
| 1188 | { |
| 1189 | /* Amount of text matched not including the EOB char. */ |
| 1190 | int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; |
| 1191 | |
| 1192 | /* Undo the effects of YY_DO_BEFORE_ACTION. */ |
| 1193 | *yy_cp = yy_hold_char; |
| 1194 | YY_RESTORE_YY_MORE_OFFSET |
| 1195 | |
| 1196 | if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) |
| 1197 | { |
| 1198 | /* We're scanning a new file or input source. It's |
| 1199 | * possible that this happened because the user |
| 1200 | * just pointed yyin at a new source and called |
| 1201 | * yylex(). If so, then we have to assure |
| 1202 | * consistency between yy_current_buffer and our |
| 1203 | * globals. Here is the right place to do so, because |
| 1204 | * this is the first action (other than possibly a |
| 1205 | * back-up) that will match for the new input source. |
| 1206 | */ |
| 1207 | yy_n_chars = yy_current_buffer->yy_n_chars; |
| 1208 | yy_current_buffer->yy_input_file = yyin; |
| 1209 | yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; |
| 1210 | } |
| 1211 | |
| 1212 | /* Note that here we test for yy_c_buf_p "<=" to the position |
| 1213 | * of the first EOB in the buffer, since yy_c_buf_p will |
| 1214 | * already have been incremented past the NUL character |
| 1215 | * (since all states make transitions on EOB to the |
| 1216 | * end-of-buffer state). Contrast this with the test |
| 1217 | * in input(). |
| 1218 | */ |
| 1219 | if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) |
| 1220 | { /* This was really a NUL. */ |
| 1221 | yy_state_type yy_next_state; |
| 1222 | |
| 1223 | yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; |
| 1224 | |
| 1225 | yy_current_state = yy_get_previous_state(); |
| 1226 | |
| 1227 | /* Okay, we're now positioned to make the NUL |
| 1228 | * transition. We couldn't have |
| 1229 | * yy_get_previous_state() go ahead and do it |
| 1230 | * for us because it doesn't know how to deal |
| 1231 | * with the possibility of jamming (and we don't |
| 1232 | * want to build jamming into it because then it |
| 1233 | * will run more slowly). |
| 1234 | */ |
| 1235 | |
| 1236 | yy_next_state = yy_try_NUL_trans( yy_current_state ); |
| 1237 | |
| 1238 | yy_bp = yytext_ptr + YY_MORE_ADJ; |
| 1239 | |
| 1240 | if ( yy_next_state ) |
| 1241 | { |
| 1242 | /* Consume the NUL. */ |
| 1243 | yy_cp = ++yy_c_buf_p; |
| 1244 | yy_current_state = yy_next_state; |
| 1245 | goto yy_match; |
| 1246 | } |
| 1247 | |
| 1248 | else |
| 1249 | { |
| 1250 | yy_cp = yy_c_buf_p; |
| 1251 | goto yy_find_action; |
| 1252 | } |
| 1253 | } |
| 1254 | |
| 1255 | else switch ( yy_get_next_buffer() ) |
| 1256 | { |
| 1257 | case EOB_ACT_END_OF_FILE: |
| 1258 | { |
| 1259 | yy_did_buffer_switch_on_eof = 0; |
| 1260 | |
| 1261 | if ( yywrap() ) |
| 1262 | { |
| 1263 | /* Note: because we've taken care in |
| 1264 | * yy_get_next_buffer() to have set up |
| 1265 | * yytext, we can now set up |
| 1266 | * yy_c_buf_p so that if some total |
| 1267 | * hoser (like flex itself) wants to |
| 1268 | * call the scanner after we return the |
| 1269 | * YY_NULL, it'll still work - another |
| 1270 | * YY_NULL will get returned. |
| 1271 | */ |
| 1272 | yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; |
| 1273 | |
| 1274 | yy_act = YY_STATE_EOF(YY_START); |
| 1275 | goto do_action; |
| 1276 | } |
| 1277 | |
| 1278 | else |
| 1279 | { |
| 1280 | if ( ! yy_did_buffer_switch_on_eof ) |
| 1281 | YY_NEW_FILE; |
| 1282 | } |
| 1283 | break; |
| 1284 | } |
| 1285 | |
| 1286 | case EOB_ACT_CONTINUE_SCAN: |
| 1287 | yy_c_buf_p = |
| 1288 | yytext_ptr + yy_amount_of_matched_text; |
| 1289 | |
| 1290 | yy_current_state = yy_get_previous_state(); |
| 1291 | |
| 1292 | yy_cp = yy_c_buf_p; |
| 1293 | yy_bp = yytext_ptr + YY_MORE_ADJ; |
| 1294 | goto yy_match; |
| 1295 | |
| 1296 | case EOB_ACT_LAST_MATCH: |
| 1297 | yy_c_buf_p = |
| 1298 | &yy_current_buffer->yy_ch_buf[yy_n_chars]; |
| 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_find_action; |
| 1305 | } |
| 1306 | break; |
| 1307 | } |
| 1308 | |
| 1309 | default: |
| 1310 | YY_FATAL_ERROR( |
| 1311 | "fatal flex scanner internal error--no action found" ); |
| 1312 | } /* end of action switch */ |
| 1313 | } /* end of scanning one token */ |
| 1314 | } /* end of yylex */ |
| 1315 | |
| 1316 | |
| 1317 | /* yy_get_next_buffer - try to read in a new buffer |
| 1318 | * |
| 1319 | * Returns a code representing an action: |
| 1320 | * EOB_ACT_LAST_MATCH - |
| 1321 | * EOB_ACT_CONTINUE_SCAN - continue scanning from current position |
| 1322 | * EOB_ACT_END_OF_FILE - end of file |
| 1323 | */ |
| 1324 | |
| 1325 | static int yy_get_next_buffer() |
| 1326 | { |
| 1327 | register char *dest = yy_current_buffer->yy_ch_buf; |
| 1328 | register char *source = yytext_ptr; |
| 1329 | register int number_to_move, i; |
| 1330 | int ret_val; |
| 1331 | |
| 1332 | if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) |
| 1333 | YY_FATAL_ERROR( |
| 1334 | "fatal flex scanner internal error--end of buffer missed" ); |
| 1335 | |
| 1336 | if ( yy_current_buffer->yy_fill_buffer == 0 ) |
| 1337 | { /* Don't try to fill the buffer, so this is an EOF. */ |
| 1338 | if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) |
| 1339 | { |
| 1340 | /* We matched a single character, the EOB, so |
| 1341 | * treat this as a final EOF. |
| 1342 | */ |
| 1343 | return EOB_ACT_END_OF_FILE; |
| 1344 | } |
| 1345 | |
| 1346 | else |
| 1347 | { |
| 1348 | /* We matched some text prior to the EOB, first |
| 1349 | * process it. |
| 1350 | */ |
| 1351 | return EOB_ACT_LAST_MATCH; |
| 1352 | } |
| 1353 | } |
| 1354 | |
| 1355 | /* Try to read more data. */ |
| 1356 | |
| 1357 | /* First move last chars to start of buffer. */ |
| 1358 | number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; |
| 1359 | |
| 1360 | for ( i = 0; i < number_to_move; ++i ) |
| 1361 | *(dest++) = *(source++); |
| 1362 | |
| 1363 | if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) |
| 1364 | /* don't do the read, it's not guaranteed to return an EOF, |
| 1365 | * just force an EOF |
| 1366 | */ |
| 1367 | yy_current_buffer->yy_n_chars = yy_n_chars = 0; |
| 1368 | |
| 1369 | else |
| 1370 | { |
| 1371 | int num_to_read = |
| 1372 | yy_current_buffer->yy_buf_size - number_to_move - 1; |
| 1373 | |
| 1374 | while ( num_to_read <= 0 ) |
| 1375 | { /* Not enough room in the buffer - grow it. */ |
| 1376 | #ifdef YY_USES_REJECT |
| 1377 | YY_FATAL_ERROR( |
| 1378 | "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); |
| 1379 | #else |
| 1380 | |
| 1381 | /* just a shorter name for the current buffer */ |
| 1382 | YY_BUFFER_STATE b = yy_current_buffer; |
| 1383 | |
| 1384 | int yy_c_buf_p_offset = |
| 1385 | (int) (yy_c_buf_p - b->yy_ch_buf); |
| 1386 | |
| 1387 | if ( b->yy_is_our_buffer ) |
| 1388 | { |
| 1389 | int new_size = b->yy_buf_size * 2; |
| 1390 | |
| 1391 | if ( new_size <= 0 ) |
| 1392 | b->yy_buf_size += b->yy_buf_size / 8; |
| 1393 | else |
| 1394 | b->yy_buf_size *= 2; |
| 1395 | |
| 1396 | b->yy_ch_buf = (char *) |
| 1397 | /* Include room in for 2 EOB chars. */ |
| 1398 | yy_flex_realloc( (void *) b->yy_ch_buf, |
| 1399 | b->yy_buf_size + 2 ); |
| 1400 | } |
| 1401 | else |
| 1402 | /* Can't grow it, we don't own it. */ |
| 1403 | b->yy_ch_buf = 0; |
| 1404 | |
| 1405 | if ( ! b->yy_ch_buf ) |
| 1406 | YY_FATAL_ERROR( |
| 1407 | "fatal error - scanner input buffer overflow" ); |
| 1408 | |
| 1409 | yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; |
| 1410 | |
| 1411 | num_to_read = yy_current_buffer->yy_buf_size - |
| 1412 | number_to_move - 1; |
| 1413 | #endif |
| 1414 | } |
| 1415 | |
| 1416 | if ( num_to_read > YY_READ_BUF_SIZE ) |
| 1417 | num_to_read = YY_READ_BUF_SIZE; |
| 1418 | |
| 1419 | /* Read in more data. */ |
| 1420 | YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), |
| 1421 | yy_n_chars, num_to_read ); |
| 1422 | |
| 1423 | yy_current_buffer->yy_n_chars = yy_n_chars; |
| 1424 | } |
| 1425 | |
| 1426 | if ( yy_n_chars == 0 ) |
| 1427 | { |
| 1428 | if ( number_to_move == YY_MORE_ADJ ) |
| 1429 | { |
| 1430 | ret_val = EOB_ACT_END_OF_FILE; |
| 1431 | yyrestart( yyin ); |
| 1432 | } |
| 1433 | |
| 1434 | else |
| 1435 | { |
| 1436 | ret_val = EOB_ACT_LAST_MATCH; |
| 1437 | yy_current_buffer->yy_buffer_status = |
| 1438 | YY_BUFFER_EOF_PENDING; |
| 1439 | } |
| 1440 | } |
| 1441 | |
| 1442 | else |
| 1443 | ret_val = EOB_ACT_CONTINUE_SCAN; |
| 1444 | |
| 1445 | yy_n_chars += number_to_move; |
| 1446 | yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; |
| 1447 | yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; |
| 1448 | |
| 1449 | yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; |
| 1450 | |
| 1451 | return ret_val; |
| 1452 | } |
| 1453 | |
| 1454 | |
| 1455 | /* yy_get_previous_state - get the state just before the EOB char was reached */ |
| 1456 | |
| 1457 | static yy_state_type yy_get_previous_state() |
| 1458 | { |
| 1459 | register yy_state_type yy_current_state; |
| 1460 | register char *yy_cp; |
| 1461 | |
| 1462 | yy_current_state = yy_start; |
| 1463 | yy_state_ptr = yy_state_buf; |
| 1464 | *yy_state_ptr++ = yy_current_state; |
| 1465 | |
| 1466 | for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) |
| 1467 | { |
| 1468 | register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); |
| 1469 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
| 1470 | { |
| 1471 | yy_current_state = (int) yy_def[yy_current_state]; |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 1472 | if ( yy_current_state >= 199 ) |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1473 | yy_c = yy_meta[(unsigned int) yy_c]; |
| 1474 | } |
| 1475 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
| 1476 | *yy_state_ptr++ = yy_current_state; |
| 1477 | } |
| 1478 | |
| 1479 | return yy_current_state; |
| 1480 | } |
| 1481 | |
| 1482 | |
| 1483 | /* yy_try_NUL_trans - try to make a transition on the NUL character |
| 1484 | * |
| 1485 | * synopsis |
| 1486 | * next_state = yy_try_NUL_trans( current_state ); |
| 1487 | */ |
| 1488 | |
| 1489 | #ifdef YY_USE_PROTOS |
| 1490 | static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) |
| 1491 | #else |
| 1492 | static yy_state_type yy_try_NUL_trans( yy_current_state ) |
| 1493 | yy_state_type yy_current_state; |
| 1494 | #endif |
| 1495 | { |
| 1496 | register int yy_is_jam; |
| 1497 | |
| 1498 | register YY_CHAR yy_c = 1; |
| 1499 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
| 1500 | { |
| 1501 | yy_current_state = (int) yy_def[yy_current_state]; |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 1502 | if ( yy_current_state >= 199 ) |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1503 | yy_c = yy_meta[(unsigned int) yy_c]; |
| 1504 | } |
| 1505 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 1506 | yy_is_jam = (yy_current_state == 198); |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 1507 | if ( ! yy_is_jam ) |
| 1508 | *yy_state_ptr++ = yy_current_state; |
| 1509 | |
| 1510 | return yy_is_jam ? 0 : yy_current_state; |
| 1511 | } |
| 1512 | |
| 1513 | |
| 1514 | #ifndef YY_NO_UNPUT |
| 1515 | #ifdef YY_USE_PROTOS |
| 1516 | static inline void yyunput( int c, register char *yy_bp ) |
| 1517 | #else |
| 1518 | static inline void yyunput( c, yy_bp ) |
| 1519 | int c; |
| 1520 | register char *yy_bp; |
| 1521 | #endif |
| 1522 | { |
| 1523 | register char *yy_cp = yy_c_buf_p; |
| 1524 | |
| 1525 | /* undo effects of setting up yytext */ |
| 1526 | *yy_cp = yy_hold_char; |
| 1527 | |
| 1528 | if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) |
| 1529 | { /* need to shift things up to make room */ |
| 1530 | /* +2 for EOB chars. */ |
| 1531 | register int number_to_move = yy_n_chars + 2; |
| 1532 | register char *dest = &yy_current_buffer->yy_ch_buf[ |
| 1533 | yy_current_buffer->yy_buf_size + 2]; |
| 1534 | register char *source = |
| 1535 | &yy_current_buffer->yy_ch_buf[number_to_move]; |
| 1536 | |
| 1537 | while ( source > yy_current_buffer->yy_ch_buf ) |
| 1538 | *--dest = *--source; |
| 1539 | |
| 1540 | yy_cp += (int) (dest - source); |
| 1541 | yy_bp += (int) (dest - source); |
| 1542 | yy_current_buffer->yy_n_chars = |
| 1543 | yy_n_chars = yy_current_buffer->yy_buf_size; |
| 1544 | |
| 1545 | if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) |
| 1546 | YY_FATAL_ERROR( "flex scanner push-back overflow" ); |
| 1547 | } |
| 1548 | |
| 1549 | *--yy_cp = (char) c; |
| 1550 | |
| 1551 | if ( c == '\n' ) |
| 1552 | --yylineno; |
| 1553 | |
| 1554 | yytext_ptr = yy_bp; |
| 1555 | yy_hold_char = *yy_cp; |
| 1556 | yy_c_buf_p = yy_cp; |
| 1557 | } |
| 1558 | #endif /* ifndef YY_NO_UNPUT */ |
| 1559 | |
| 1560 | |
| 1561 | #ifdef __cplusplus |
| 1562 | static int yyinput() |
| 1563 | #else |
| 1564 | static int input() |
| 1565 | #endif |
| 1566 | { |
| 1567 | int c; |
| 1568 | |
| 1569 | *yy_c_buf_p = yy_hold_char; |
| 1570 | |
| 1571 | if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) |
| 1572 | { |
| 1573 | /* yy_c_buf_p now points to the character we want to return. |
| 1574 | * If this occurs *before* the EOB characters, then it's a |
| 1575 | * valid NUL; if not, then we've hit the end of the buffer. |
| 1576 | */ |
| 1577 | if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) |
| 1578 | /* This was really a NUL. */ |
| 1579 | *yy_c_buf_p = '\0'; |
| 1580 | |
| 1581 | else |
| 1582 | { /* need more input */ |
| 1583 | int offset = yy_c_buf_p - yytext_ptr; |
| 1584 | ++yy_c_buf_p; |
| 1585 | |
| 1586 | switch ( yy_get_next_buffer() ) |
| 1587 | { |
| 1588 | case EOB_ACT_LAST_MATCH: |
| 1589 | /* This happens because yy_g_n_b() |
| 1590 | * sees that we've accumulated a |
| 1591 | * token and flags that we need to |
| 1592 | * try matching the token before |
| 1593 | * proceeding. But for input(), |
| 1594 | * there's no matching to consider. |
| 1595 | * So convert the EOB_ACT_LAST_MATCH |
| 1596 | * to EOB_ACT_END_OF_FILE. |
| 1597 | */ |
| 1598 | |
| 1599 | /* Reset buffer status. */ |
| 1600 | yyrestart( yyin ); |
| 1601 | |
| 1602 | /* fall through */ |
| 1603 | |
| 1604 | case EOB_ACT_END_OF_FILE: |
| 1605 | { |
| 1606 | if ( yywrap() ) |
| 1607 | return EOF; |
| 1608 | |
| 1609 | if ( ! yy_did_buffer_switch_on_eof ) |
| 1610 | YY_NEW_FILE; |
| 1611 | #ifdef __cplusplus |
| 1612 | return yyinput(); |
| 1613 | #else |
| 1614 | return input(); |
| 1615 | #endif |
| 1616 | } |
| 1617 | |
| 1618 | case EOB_ACT_CONTINUE_SCAN: |
| 1619 | yy_c_buf_p = yytext_ptr + offset; |
| 1620 | break; |
| 1621 | } |
| 1622 | } |
| 1623 | } |
| 1624 | |
| 1625 | c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ |
| 1626 | *yy_c_buf_p = '\0'; /* preserve yytext */ |
| 1627 | yy_hold_char = *++yy_c_buf_p; |
| 1628 | |
| 1629 | if ( c == '\n' ) |
| 1630 | ++yylineno; |
| 1631 | |
| 1632 | return c; |
| 1633 | } |
| 1634 | |
| 1635 | |
| 1636 | #ifdef YY_USE_PROTOS |
| 1637 | void yyrestart( FILE *input_file ) |
| 1638 | #else |
| 1639 | void yyrestart( input_file ) |
| 1640 | FILE *input_file; |
| 1641 | #endif |
| 1642 | { |
| 1643 | if ( ! yy_current_buffer ) |
| 1644 | yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); |
| 1645 | |
| 1646 | yy_init_buffer( yy_current_buffer, input_file ); |
| 1647 | yy_load_buffer_state(); |
| 1648 | } |
| 1649 | |
| 1650 | |
| 1651 | #ifdef YY_USE_PROTOS |
| 1652 | void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) |
| 1653 | #else |
| 1654 | void yy_switch_to_buffer( new_buffer ) |
| 1655 | YY_BUFFER_STATE new_buffer; |
| 1656 | #endif |
| 1657 | { |
| 1658 | if ( yy_current_buffer == new_buffer ) |
| 1659 | return; |
| 1660 | |
| 1661 | if ( yy_current_buffer ) |
| 1662 | { |
| 1663 | /* Flush out information for old buffer. */ |
| 1664 | *yy_c_buf_p = yy_hold_char; |
| 1665 | yy_current_buffer->yy_buf_pos = yy_c_buf_p; |
| 1666 | yy_current_buffer->yy_n_chars = yy_n_chars; |
| 1667 | } |
| 1668 | |
| 1669 | yy_current_buffer = new_buffer; |
| 1670 | yy_load_buffer_state(); |
| 1671 | |
| 1672 | /* We don't actually know whether we did this switch during |
| 1673 | * EOF (yywrap()) processing, but the only time this flag |
| 1674 | * is looked at is after yywrap() is called, so it's safe |
| 1675 | * to go ahead and always set it. |
| 1676 | */ |
| 1677 | yy_did_buffer_switch_on_eof = 1; |
| 1678 | } |
| 1679 | |
| 1680 | |
| 1681 | #ifdef YY_USE_PROTOS |
| 1682 | void yy_load_buffer_state( void ) |
| 1683 | #else |
| 1684 | void yy_load_buffer_state() |
| 1685 | #endif |
| 1686 | { |
| 1687 | yy_n_chars = yy_current_buffer->yy_n_chars; |
| 1688 | yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; |
| 1689 | yyin = yy_current_buffer->yy_input_file; |
| 1690 | yy_hold_char = *yy_c_buf_p; |
| 1691 | } |
| 1692 | |
| 1693 | |
| 1694 | #ifdef YY_USE_PROTOS |
| 1695 | YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) |
| 1696 | #else |
| 1697 | YY_BUFFER_STATE yy_create_buffer( file, size ) |
| 1698 | FILE *file; |
| 1699 | int size; |
| 1700 | #endif |
| 1701 | { |
| 1702 | YY_BUFFER_STATE b; |
| 1703 | |
| 1704 | b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); |
| 1705 | if ( ! b ) |
| 1706 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); |
| 1707 | |
| 1708 | b->yy_buf_size = size; |
| 1709 | |
| 1710 | /* yy_ch_buf has to be 2 characters longer than the size given because |
| 1711 | * we need to put in 2 end-of-buffer characters. |
| 1712 | */ |
| 1713 | b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); |
| 1714 | if ( ! b->yy_ch_buf ) |
| 1715 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); |
| 1716 | |
| 1717 | b->yy_is_our_buffer = 1; |
| 1718 | |
| 1719 | yy_init_buffer( b, file ); |
| 1720 | |
| 1721 | return b; |
| 1722 | } |
| 1723 | |
| 1724 | |
| 1725 | #ifdef YY_USE_PROTOS |
| 1726 | void yy_delete_buffer( YY_BUFFER_STATE b ) |
| 1727 | #else |
| 1728 | void yy_delete_buffer( b ) |
| 1729 | YY_BUFFER_STATE b; |
| 1730 | #endif |
| 1731 | { |
| 1732 | if ( ! b ) |
| 1733 | return; |
| 1734 | |
| 1735 | if ( b == yy_current_buffer ) |
| 1736 | yy_current_buffer = (YY_BUFFER_STATE) 0; |
| 1737 | |
| 1738 | if ( b->yy_is_our_buffer ) |
| 1739 | yy_flex_free( (void *) b->yy_ch_buf ); |
| 1740 | |
| 1741 | yy_flex_free( (void *) b ); |
| 1742 | } |
| 1743 | |
| 1744 | |
| 1745 | #ifndef YY_ALWAYS_INTERACTIVE |
| 1746 | #ifndef YY_NEVER_INTERACTIVE |
| 1747 | extern int isatty YY_PROTO(( int )); |
| 1748 | #endif |
| 1749 | #endif |
| 1750 | |
| 1751 | #ifdef YY_USE_PROTOS |
| 1752 | void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) |
| 1753 | #else |
| 1754 | void yy_init_buffer( b, file ) |
| 1755 | YY_BUFFER_STATE b; |
| 1756 | FILE *file; |
| 1757 | #endif |
| 1758 | |
| 1759 | |
| 1760 | { |
| 1761 | yy_flush_buffer( b ); |
| 1762 | |
| 1763 | b->yy_input_file = file; |
| 1764 | b->yy_fill_buffer = 1; |
| 1765 | |
| 1766 | #if YY_ALWAYS_INTERACTIVE |
| 1767 | b->yy_is_interactive = 1; |
| 1768 | #else |
| 1769 | #if YY_NEVER_INTERACTIVE |
| 1770 | b->yy_is_interactive = 0; |
| 1771 | #else |
| 1772 | b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; |
| 1773 | #endif |
| 1774 | #endif |
| 1775 | } |
| 1776 | |
| 1777 | |
| 1778 | #ifdef YY_USE_PROTOS |
| 1779 | void yy_flush_buffer( YY_BUFFER_STATE b ) |
| 1780 | #else |
| 1781 | void yy_flush_buffer( b ) |
| 1782 | YY_BUFFER_STATE b; |
| 1783 | #endif |
| 1784 | |
| 1785 | { |
| 1786 | if ( ! b ) |
| 1787 | return; |
| 1788 | |
| 1789 | b->yy_n_chars = 0; |
| 1790 | |
| 1791 | /* We always need two end-of-buffer characters. The first causes |
| 1792 | * a transition to the end-of-buffer state. The second causes |
| 1793 | * a jam in that state. |
| 1794 | */ |
| 1795 | b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; |
| 1796 | b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; |
| 1797 | |
| 1798 | b->yy_buf_pos = &b->yy_ch_buf[0]; |
| 1799 | |
| 1800 | b->yy_at_bol = 1; |
| 1801 | b->yy_buffer_status = YY_BUFFER_NEW; |
| 1802 | |
| 1803 | if ( b == yy_current_buffer ) |
| 1804 | yy_load_buffer_state(); |
| 1805 | } |
| 1806 | |
| 1807 | |
| 1808 | #ifndef YY_NO_SCAN_BUFFER |
| 1809 | #ifdef YY_USE_PROTOS |
| 1810 | YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) |
| 1811 | #else |
| 1812 | YY_BUFFER_STATE yy_scan_buffer( base, size ) |
| 1813 | char *base; |
| 1814 | yy_size_t size; |
| 1815 | #endif |
| 1816 | { |
| 1817 | YY_BUFFER_STATE b; |
| 1818 | |
| 1819 | if ( size < 2 || |
| 1820 | base[size-2] != YY_END_OF_BUFFER_CHAR || |
| 1821 | base[size-1] != YY_END_OF_BUFFER_CHAR ) |
| 1822 | /* They forgot to leave room for the EOB's. */ |
| 1823 | return 0; |
| 1824 | |
| 1825 | b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); |
| 1826 | if ( ! b ) |
| 1827 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); |
| 1828 | |
| 1829 | b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ |
| 1830 | b->yy_buf_pos = b->yy_ch_buf = base; |
| 1831 | b->yy_is_our_buffer = 0; |
| 1832 | b->yy_input_file = 0; |
| 1833 | b->yy_n_chars = b->yy_buf_size; |
| 1834 | b->yy_is_interactive = 0; |
| 1835 | b->yy_at_bol = 1; |
| 1836 | b->yy_fill_buffer = 0; |
| 1837 | b->yy_buffer_status = YY_BUFFER_NEW; |
| 1838 | |
| 1839 | yy_switch_to_buffer( b ); |
| 1840 | |
| 1841 | return b; |
| 1842 | } |
| 1843 | #endif |
| 1844 | |
| 1845 | |
| 1846 | #ifndef YY_NO_SCAN_STRING |
| 1847 | #ifdef YY_USE_PROTOS |
| 1848 | YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) |
| 1849 | #else |
| 1850 | YY_BUFFER_STATE yy_scan_string( yy_str ) |
| 1851 | yyconst char *yy_str; |
| 1852 | #endif |
| 1853 | { |
| 1854 | int len; |
| 1855 | for ( len = 0; yy_str[len]; ++len ) |
| 1856 | ; |
| 1857 | |
| 1858 | return yy_scan_bytes( yy_str, len ); |
| 1859 | } |
| 1860 | #endif |
| 1861 | |
| 1862 | |
| 1863 | #ifndef YY_NO_SCAN_BYTES |
| 1864 | #ifdef YY_USE_PROTOS |
| 1865 | YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) |
| 1866 | #else |
| 1867 | YY_BUFFER_STATE yy_scan_bytes( bytes, len ) |
| 1868 | yyconst char *bytes; |
| 1869 | int len; |
| 1870 | #endif |
| 1871 | { |
| 1872 | YY_BUFFER_STATE b; |
| 1873 | char *buf; |
| 1874 | yy_size_t n; |
| 1875 | int i; |
| 1876 | |
| 1877 | /* Get memory for full buffer, including space for trailing EOB's. */ |
| 1878 | n = len + 2; |
| 1879 | buf = (char *) yy_flex_alloc( n ); |
| 1880 | if ( ! buf ) |
| 1881 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); |
| 1882 | |
| 1883 | for ( i = 0; i < len; ++i ) |
| 1884 | buf[i] = bytes[i]; |
| 1885 | |
| 1886 | buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; |
| 1887 | |
| 1888 | b = yy_scan_buffer( buf, n ); |
| 1889 | if ( ! b ) |
| 1890 | YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); |
| 1891 | |
| 1892 | /* It's okay to grow etc. this buffer, and we should throw it |
| 1893 | * away when we're done. |
| 1894 | */ |
| 1895 | b->yy_is_our_buffer = 1; |
| 1896 | |
| 1897 | return b; |
| 1898 | } |
| 1899 | #endif |
| 1900 | |
| 1901 | |
| 1902 | #ifndef YY_NO_PUSH_STATE |
| 1903 | #ifdef YY_USE_PROTOS |
| 1904 | static void yy_push_state( int new_state ) |
| 1905 | #else |
| 1906 | static void yy_push_state( new_state ) |
| 1907 | int new_state; |
| 1908 | #endif |
| 1909 | { |
| 1910 | if ( yy_start_stack_ptr >= yy_start_stack_depth ) |
| 1911 | { |
| 1912 | yy_size_t new_size; |
| 1913 | |
| 1914 | yy_start_stack_depth += YY_START_STACK_INCR; |
| 1915 | new_size = yy_start_stack_depth * sizeof( int ); |
| 1916 | |
| 1917 | if ( ! yy_start_stack ) |
| 1918 | yy_start_stack = (int *) yy_flex_alloc( new_size ); |
| 1919 | |
| 1920 | else |
| 1921 | yy_start_stack = (int *) yy_flex_realloc( |
| 1922 | (void *) yy_start_stack, new_size ); |
| 1923 | |
| 1924 | if ( ! yy_start_stack ) |
| 1925 | YY_FATAL_ERROR( |
| 1926 | "out of memory expanding start-condition stack" ); |
| 1927 | } |
| 1928 | |
| 1929 | yy_start_stack[yy_start_stack_ptr++] = YY_START; |
| 1930 | |
| 1931 | BEGIN(new_state); |
| 1932 | } |
| 1933 | #endif |
| 1934 | |
| 1935 | |
| 1936 | #ifndef YY_NO_POP_STATE |
| 1937 | static void yy_pop_state() |
| 1938 | { |
| 1939 | if ( --yy_start_stack_ptr < 0 ) |
| 1940 | YY_FATAL_ERROR( "start-condition stack underflow" ); |
| 1941 | |
| 1942 | BEGIN(yy_start_stack[yy_start_stack_ptr]); |
| 1943 | } |
| 1944 | #endif |
| 1945 | |
| 1946 | |
| 1947 | #ifndef YY_NO_TOP_STATE |
| 1948 | static int yy_top_state() |
| 1949 | { |
| 1950 | return yy_start_stack[yy_start_stack_ptr - 1]; |
| 1951 | } |
| 1952 | #endif |
| 1953 | |
| 1954 | #ifndef YY_EXIT_FAILURE |
| 1955 | #define YY_EXIT_FAILURE 2 |
| 1956 | #endif |
| 1957 | |
| 1958 | #ifdef YY_USE_PROTOS |
| 1959 | static void yy_fatal_error( yyconst char msg[] ) |
| 1960 | #else |
| 1961 | static void yy_fatal_error( msg ) |
| 1962 | char msg[]; |
| 1963 | #endif |
| 1964 | { |
| 1965 | (void) fprintf( stderr, "%s\n", msg ); |
| 1966 | exit( YY_EXIT_FAILURE ); |
| 1967 | } |
| 1968 | |
| 1969 | |
| 1970 | |
| 1971 | /* Redefine yyless() so it works in section 3 code. */ |
| 1972 | |
| 1973 | #undef yyless |
| 1974 | #define yyless(n) \ |
| 1975 | do \ |
| 1976 | { \ |
| 1977 | /* Undo effects of setting up yytext. */ \ |
| 1978 | yytext[yyleng] = yy_hold_char; \ |
| 1979 | yy_c_buf_p = yytext + n; \ |
| 1980 | yy_hold_char = *yy_c_buf_p; \ |
| 1981 | *yy_c_buf_p = '\0'; \ |
| 1982 | yyleng = n; \ |
| 1983 | } \ |
| 1984 | while ( 0 ) |
| 1985 | |
| 1986 | |
| 1987 | /* Internal utility routines. */ |
| 1988 | |
| 1989 | #ifndef yytext_ptr |
| 1990 | #ifdef YY_USE_PROTOS |
| 1991 | static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) |
| 1992 | #else |
| 1993 | static void yy_flex_strncpy( s1, s2, n ) |
| 1994 | char *s1; |
| 1995 | yyconst char *s2; |
| 1996 | int n; |
| 1997 | #endif |
| 1998 | { |
| 1999 | register int i; |
| 2000 | for ( i = 0; i < n; ++i ) |
| 2001 | s1[i] = s2[i]; |
| 2002 | } |
| 2003 | #endif |
| 2004 | |
| 2005 | #ifdef YY_NEED_STRLEN |
| 2006 | #ifdef YY_USE_PROTOS |
| 2007 | static int yy_flex_strlen( yyconst char *s ) |
| 2008 | #else |
| 2009 | static int yy_flex_strlen( s ) |
| 2010 | yyconst char *s; |
| 2011 | #endif |
| 2012 | { |
| 2013 | register int n; |
| 2014 | for ( n = 0; s[n]; ++n ) |
| 2015 | ; |
| 2016 | |
| 2017 | return n; |
| 2018 | } |
| 2019 | #endif |
| 2020 | |
| 2021 | |
| 2022 | #ifdef YY_USE_PROTOS |
| 2023 | static void *yy_flex_alloc( yy_size_t size ) |
| 2024 | #else |
| 2025 | static void *yy_flex_alloc( size ) |
| 2026 | yy_size_t size; |
| 2027 | #endif |
| 2028 | { |
| 2029 | return (void *) malloc( size ); |
| 2030 | } |
| 2031 | |
| 2032 | #ifdef YY_USE_PROTOS |
| 2033 | static inline void *yy_flex_realloc( void *ptr, yy_size_t size ) |
| 2034 | #else |
| 2035 | static inline void *yy_flex_realloc( ptr, size ) |
| 2036 | void *ptr; |
| 2037 | yy_size_t size; |
| 2038 | #endif |
| 2039 | { |
| 2040 | /* The cast to (char *) in the following accommodates both |
| 2041 | * implementations that use char* generic pointers, and those |
| 2042 | * that use void* generic pointers. It works with the latter |
| 2043 | * because both ANSI C and C++ allow castless assignment from |
| 2044 | * any pointer type to void*, and deal with argument conversions |
| 2045 | * as though doing an assignment. |
| 2046 | */ |
| 2047 | return (void *) realloc( (char *) ptr, size ); |
| 2048 | } |
| 2049 | |
| 2050 | #ifdef YY_USE_PROTOS |
| 2051 | static void yy_flex_free( void *ptr ) |
| 2052 | #else |
| 2053 | static void yy_flex_free( ptr ) |
| 2054 | void *ptr; |
| 2055 | #endif |
| 2056 | { |
| 2057 | free( ptr ); |
| 2058 | } |
| 2059 | |
| 2060 | #if YY_MAIN |
| 2061 | int main() |
| 2062 | { |
| 2063 | yylex(); |
| 2064 | return 0; |
| 2065 | } |
| 2066 | #endif |
Chris Lattner | ab5ac6b | 2001-07-08 23:22:50 +0000 | [diff] [blame] | 2067 | #line 188 "Lexer.l" |
Chris Lattner | 0095054 | 2001-06-06 20:29:01 +0000 | [diff] [blame] | 2068 | |