LLVM API Documentation
00001 #line 2 "Lexer.cpp" 00002 00003 #line 4 "Lexer.cpp" 00004 00005 #define YY_INT_ALIGNED short int 00006 00007 /* A lexical scanner generated by flex */ 00008 00009 #define FLEX_SCANNER 00010 #define YY_FLEX_MAJOR_VERSION 2 00011 #define YY_FLEX_MINOR_VERSION 5 00012 #define YY_FLEX_SUBMINOR_VERSION 31 00013 #if YY_FLEX_SUBMINOR_VERSION > 0 00014 #define FLEX_BETA 00015 #endif 00016 00017 /* First, we deal with platform-specific or compiler-specific issues. */ 00018 00019 /* begin standard C headers. */ 00020 #include <stdio.h> 00021 #include <string.h> 00022 #include <errno.h> 00023 #include <stdlib.h> 00024 00025 /* end standard C headers. */ 00026 00027 /* flex integer type definitions */ 00028 00029 #ifndef FLEXINT_H 00030 #define FLEXINT_H 00031 00032 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ 00033 00034 #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L 00035 #include <inttypes.h> 00036 typedef int8_t flex_int8_t; 00037 typedef uint8_t flex_uint8_t; 00038 typedef int16_t flex_int16_t; 00039 typedef uint16_t flex_uint16_t; 00040 typedef int32_t flex_int32_t; 00041 typedef uint32_t flex_uint32_t; 00042 #else 00043 typedef signed char flex_int8_t; 00044 typedef short int flex_int16_t; 00045 typedef int flex_int32_t; 00046 typedef unsigned char flex_uint8_t; 00047 typedef unsigned short int flex_uint16_t; 00048 typedef unsigned int flex_uint32_t; 00049 #endif /* ! C99 */ 00050 00051 /* Limits of integral types. */ 00052 #ifndef INT8_MIN 00053 #define INT8_MIN (-128) 00054 #endif 00055 #ifndef INT16_MIN 00056 #define INT16_MIN (-32767-1) 00057 #endif 00058 #ifndef INT32_MIN 00059 #define INT32_MIN (-2147483647-1) 00060 #endif 00061 #ifndef INT8_MAX 00062 #define INT8_MAX (127) 00063 #endif 00064 #ifndef INT16_MAX 00065 #define INT16_MAX (32767) 00066 #endif 00067 #ifndef INT32_MAX 00068 #define INT32_MAX (2147483647) 00069 #endif 00070 #ifndef UINT8_MAX 00071 #define UINT8_MAX (255U) 00072 #endif 00073 #ifndef UINT16_MAX 00074 #define UINT16_MAX (65535U) 00075 #endif 00076 #ifndef UINT32_MAX 00077 #define UINT32_MAX (4294967295U) 00078 #endif 00079 00080 #endif /* ! FLEXINT_H */ 00081 00082 #ifdef __cplusplus 00083 00084 /* The "const" storage-class-modifier is valid. */ 00085 #define YY_USE_CONST 00086 00087 #else /* ! __cplusplus */ 00088 00089 #if __STDC__ 00090 00091 #define YY_USE_CONST 00092 00093 #endif /* __STDC__ */ 00094 #endif /* ! __cplusplus */ 00095 00096 #ifdef YY_USE_CONST 00097 #define yyconst const 00098 #else 00099 #define yyconst 00100 #endif 00101 00102 /* Returned upon end-of-file. */ 00103 #define YY_NULL 0 00104 00105 /* Promotes a possibly negative, possibly signed char to an unsigned 00106 * integer for use as an array index. If the signed char is negative, 00107 * we want to instead treat it as an 8-bit unsigned char, hence the 00108 * double cast. 00109 */ 00110 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) 00111 00112 /* Enter a start condition. This macro really ought to take a parameter, 00113 * but we do it the disgusting crufty way forced on us by the ()-less 00114 * definition of BEGIN. 00115 */ 00116 #define BEGIN (yy_start) = 1 + 2 * 00117 00118 /* Translate the current start state into a value that can be later handed 00119 * to BEGIN to return to the state. The YYSTATE alias is for lex 00120 * compatibility. 00121 */ 00122 #define YY_START (((yy_start) - 1) / 2) 00123 #define YYSTATE YY_START 00124 00125 /* Action number for EOF rule of a given start state. */ 00126 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 00127 00128 /* Special action meaning "start processing a new file". */ 00129 #define YY_NEW_FILE llvmAsmrestart(llvmAsmin ) 00130 00131 #define YY_END_OF_BUFFER_CHAR 0 00132 00133 /* Size of default input buffer. */ 00134 #ifndef YY_BUF_SIZE 00135 #define YY_BUF_SIZE (16384*64) 00136 #endif 00137 00138 #ifndef YY_TYPEDEF_YY_BUFFER_STATE 00139 #define YY_TYPEDEF_YY_BUFFER_STATE 00140 typedef struct yy_buffer_state *YY_BUFFER_STATE; 00141 #endif 00142 00143 extern int llvmAsmleng; 00144 00145 extern FILE *llvmAsmin, *llvmAsmout; 00146 00147 #define EOB_ACT_CONTINUE_SCAN 0 00148 #define EOB_ACT_END_OF_FILE 1 00149 #define EOB_ACT_LAST_MATCH 2 00150 00151 /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires 00152 * access to the local variable yy_act. Since yyless() is a macro, it would break 00153 * existing scanners that call yyless() from OUTSIDE llvmAsmlex. 00154 * One obvious solution it to make yy_act a global. I tried that, and saw 00155 * a 5% performance hit in a non-llvmAsmlineno scanner, because yy_act is 00156 * normally declared as a register variable-- so it is not worth it. 00157 */ 00158 #define YY_LESS_LINENO(n) \ 00159 do { \ 00160 int yyl;\ 00161 for ( yyl = n; yyl < llvmAsmleng; ++yyl )\ 00162 if ( llvmAsmtext[yyl] == '\n' )\ 00163 --llvmAsmlineno;\ 00164 }while(0) 00165 00166 /* Return all but the first "n" matched characters back to the input stream. */ 00167 #define yyless(n) \ 00168 do \ 00169 { \ 00170 /* Undo effects of setting up llvmAsmtext. */ \ 00171 int yyless_macro_arg = (n); \ 00172 YY_LESS_LINENO(yyless_macro_arg);\ 00173 *yy_cp = (yy_hold_char); \ 00174 YY_RESTORE_YY_MORE_OFFSET \ 00175 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ 00176 YY_DO_BEFORE_ACTION; /* set up llvmAsmtext again */ \ 00177 } \ 00178 while ( 0 ) 00179 00180 #define unput(c) yyunput( c, (yytext_ptr) ) 00181 00182 /* The following is because we cannot portably get our hands on size_t 00183 * (without autoconf's help, which isn't available because we want 00184 * flex-generated scanners to compile on their own). 00185 */ 00186 00187 #ifndef YY_TYPEDEF_YY_SIZE_T 00188 #define YY_TYPEDEF_YY_SIZE_T 00189 typedef unsigned int yy_size_t; 00190 #endif 00191 00192 #ifndef YY_STRUCT_YY_BUFFER_STATE 00193 #define YY_STRUCT_YY_BUFFER_STATE 00194 struct yy_buffer_state 00195 { 00196 FILE *yy_input_file; 00197 00198 char *yy_ch_buf; /* input buffer */ 00199 char *yy_buf_pos; /* current position in input buffer */ 00200 00201 /* Size of input buffer in bytes, not including room for EOB 00202 * characters. 00203 */ 00204 yy_size_t yy_buf_size; 00205 00206 /* Number of characters read into yy_ch_buf, not including EOB 00207 * characters. 00208 */ 00209 int yy_n_chars; 00210 00211 /* Whether we "own" the buffer - i.e., we know we created it, 00212 * and can realloc() it to grow it, and should free() it to 00213 * delete it. 00214 */ 00215 int yy_is_our_buffer; 00216 00217 /* Whether this is an "interactive" input source; if so, and 00218 * if we're using stdio for input, then we want to use getc() 00219 * instead of fread(), to make sure we stop fetching input after 00220 * each newline. 00221 */ 00222 int yy_is_interactive; 00223 00224 /* Whether we're considered to be at the beginning of a line. 00225 * If so, '^' rules will be active on the next match, otherwise 00226 * not. 00227 */ 00228 int yy_at_bol; 00229 00230 int yy_bs_lineno; /**< The line count. */ 00231 int yy_bs_column; /**< The column count. */ 00232 00233 /* Whether to try to fill the input buffer when we reach the 00234 * end of it. 00235 */ 00236 int yy_fill_buffer; 00237 00238 int yy_buffer_status; 00239 00240 #define YY_BUFFER_NEW 0 00241 #define YY_BUFFER_NORMAL 1 00242 /* When an EOF's been seen but there's still some text to process 00243 * then we mark the buffer as YY_EOF_PENDING, to indicate that we 00244 * shouldn't try reading from the input source any more. We might 00245 * still have a bunch of tokens to match, though, because of 00246 * possible backing-up. 00247 * 00248 * When we actually see the EOF, we change the status to "new" 00249 * (via llvmAsmrestart()), so that the user can continue scanning by 00250 * just pointing llvmAsmin at a new input file. 00251 */ 00252 #define YY_BUFFER_EOF_PENDING 2 00253 00254 }; 00255 #endif /* !YY_STRUCT_YY_BUFFER_STATE */ 00256 00257 /* Stack of input buffers. */ 00258 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ 00259 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ 00260 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ 00261 00262 /* We provide macros for accessing buffer states in case in the 00263 * future we want to put the buffer states in a more general 00264 * "scanner state". 00265 * 00266 * Returns the top of the stack, or NULL. 00267 */ 00268 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ 00269 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ 00270 : NULL) 00271 00272 /* Same as previous macro, but useful when we know that the buffer stack is not 00273 * NULL or when we need an lvalue. For internal use only. 00274 */ 00275 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] 00276 00277 /* yy_hold_char holds the character lost when llvmAsmtext is formed. */ 00278 static char yy_hold_char; 00279 static int yy_n_chars; /* number of characters read into yy_ch_buf */ 00280 int llvmAsmleng; 00281 00282 /* Points to current character in buffer. */ 00283 static char *yy_c_buf_p = (char *) 0; 00284 static int yy_init = 1; /* whether we need to initialize */ 00285 static int yy_start = 0; /* start state number */ 00286 00287 /* Flag which is used to allow llvmAsmwrap()'s to do buffer switches 00288 * instead of setting up a fresh llvmAsmin. A bit of a hack ... 00289 */ 00290 static int yy_did_buffer_switch_on_eof; 00291 00292 void llvmAsmrestart (FILE *input_file ); 00293 void llvmAsm_switch_to_buffer (YY_BUFFER_STATE new_buffer ); 00294 YY_BUFFER_STATE llvmAsm_create_buffer (FILE *file,int size ); 00295 void llvmAsm_delete_buffer (YY_BUFFER_STATE b ); 00296 void llvmAsm_flush_buffer (YY_BUFFER_STATE b ); 00297 void llvmAsmpush_buffer_state (YY_BUFFER_STATE new_buffer ); 00298 void llvmAsmpop_buffer_state (void ); 00299 00300 static void llvmAsmensure_buffer_stack (void ); 00301 static void llvmAsm_load_buffer_state (void ); 00302 static void llvmAsm_init_buffer (YY_BUFFER_STATE b,FILE *file ); 00303 00304 #define YY_FLUSH_BUFFER llvmAsm_flush_buffer(YY_CURRENT_BUFFER ) 00305 00306 YY_BUFFER_STATE llvmAsm_scan_buffer (char *base,yy_size_t size ); 00307 YY_BUFFER_STATE llvmAsm_scan_string (yyconst char *yy_str ); 00308 YY_BUFFER_STATE llvmAsm_scan_bytes (yyconst char *bytes,int len ); 00309 00310 void *llvmAsmalloc (yy_size_t ); 00311 void *llvmAsmrealloc (void *,yy_size_t ); 00312 void llvmAsmfree (void * ); 00313 00314 #define yy_new_buffer llvmAsm_create_buffer 00315 00316 #define yy_set_interactive(is_interactive) \ 00317 { \ 00318 if ( ! YY_CURRENT_BUFFER ){ \ 00319 llvmAsmensure_buffer_stack (); \ 00320 YY_CURRENT_BUFFER_LVALUE = \ 00321 llvmAsm_create_buffer(llvmAsmin,YY_BUF_SIZE ); \ 00322 } \ 00323 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ 00324 } 00325 00326 #define yy_set_bol(at_bol) \ 00327 { \ 00328 if ( ! YY_CURRENT_BUFFER ){\ 00329 llvmAsmensure_buffer_stack (); \ 00330 YY_CURRENT_BUFFER_LVALUE = \ 00331 llvmAsm_create_buffer(llvmAsmin,YY_BUF_SIZE ); \ 00332 } \ 00333 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ 00334 } 00335 00336 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) 00337 00338 /* Begin user sect3 */ 00339 00340 #define llvmAsmwrap(n) 1 00341 #define YY_SKIP_YYWRAP 00342 00343 typedef unsigned char YY_CHAR; 00344 00345 FILE *llvmAsmin = (FILE *) 0, *llvmAsmout = (FILE *) 0; 00346 00347 typedef int yy_state_type; 00348 00349 extern int llvmAsmlineno; 00350 00351 int llvmAsmlineno = 1; 00352 00353 extern char *llvmAsmtext; 00354 #define yytext_ptr llvmAsmtext 00355 00356 static yy_state_type yy_get_previous_state (void ); 00357 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); 00358 static int yy_get_next_buffer (void ); 00359 static void yy_fatal_error (yyconst char msg[] ); 00360 00361 /* Done after the current pattern has been matched and before the 00362 * corresponding action - sets up llvmAsmtext. 00363 */ 00364 #define YY_DO_BEFORE_ACTION \ 00365 (yytext_ptr) = yy_bp; \ 00366 llvmAsmleng = (size_t) (yy_cp - yy_bp); \ 00367 (yy_hold_char) = *yy_cp; \ 00368 *yy_cp = '\0'; \ 00369 (yy_c_buf_p) = yy_cp; 00370 00371 #define YY_NUM_RULES 93 00372 #define YY_END_OF_BUFFER 94 00373 /* This struct is not used in this scanner, 00374 but its presence is necessary. */ 00375 struct yy_trans_info 00376 { 00377 flex_int32_t yy_verify; 00378 flex_int32_t yy_nxt; 00379 }; 00380 static yyconst flex_int16_t yy_accept[383] = 00381 { 0, 00382 0, 0, 94, 92, 91, 91, 92, 92, 92, 92, 00383 92, 92, 84, 84, 1, 92, 92, 92, 92, 92, 00384 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 00385 92, 92, 92, 92, 92, 92, 0, 83, 0, 82, 00386 81, 81, 87, 0, 85, 0, 89, 84, 0, 1, 00387 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 00388 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 00389 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 00390 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 00391 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 00392 00393 0, 0, 0, 0, 0, 81, 81, 89, 17, 89, 00394 0, 90, 46, 0, 51, 0, 0, 29, 0, 0, 00395 0, 0, 0, 0, 49, 0, 3, 0, 0, 0, 00396 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 00397 0, 0, 0, 48, 22, 0, 0, 60, 0, 50, 00398 69, 0, 0, 0, 0, 64, 0, 65, 0, 47, 00399 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 00400 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 00401 0, 89, 0, 0, 0, 89, 0, 0, 0, 32, 00402 61, 62, 0, 0, 0, 0, 0, 0, 0, 0, 00403 00404 0, 77, 0, 0, 0, 0, 0, 0, 0, 0, 00405 78, 39, 0, 19, 0, 0, 86, 0, 0, 0, 00406 0, 0, 0, 0, 0, 0, 0, 0, 4, 44, 00407 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, 00408 0, 31, 0, 11, 0, 89, 0, 0, 2, 0, 00409 0, 0, 0, 0, 0, 0, 5, 41, 0, 0, 00410 0, 0, 0, 43, 0, 0, 0, 0, 0, 33, 00411 0, 55, 59, 57, 58, 56, 54, 35, 79, 0, 00412 0, 0, 34, 40, 18, 0, 0, 0, 0, 0, 00413 68, 0, 0, 0, 76, 0, 0, 0, 0, 42, 00414 00415 26, 21, 0, 0, 7, 0, 0, 72, 0, 28, 00416 75, 45, 0, 63, 71, 23, 24, 0, 0, 73, 00417 36, 66, 67, 0, 0, 0, 0, 6, 25, 0, 00418 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 00419 8, 14, 0, 0, 9, 10, 0, 0, 0, 30, 00420 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 00421 0, 0, 0, 0, 0, 0, 27, 0, 74, 0, 00422 0, 0, 0, 0, 80, 0, 13, 0, 15, 0, 00423 16, 0 00424 } ; 00425 00426 static yyconst flex_int32_t yy_ec[256] = 00427 { 0, 00428 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 00429 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 00430 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00431 1, 2, 1, 4, 1, 5, 6, 1, 1, 1, 00432 1, 1, 7, 1, 8, 9, 1, 10, 11, 11, 00433 11, 11, 11, 11, 11, 11, 11, 12, 13, 1, 00434 1, 1, 1, 1, 14, 14, 14, 14, 15, 14, 00435 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 00436 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 00437 1, 1, 1, 1, 16, 1, 17, 18, 19, 20, 00438 00439 21, 22, 23, 24, 25, 5, 26, 27, 28, 29, 00440 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 00441 40, 41, 1, 1, 1, 1, 1, 1, 1, 1, 00442 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00443 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00444 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00445 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00446 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00447 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00448 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00449 00450 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00451 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00452 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00453 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00454 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00455 1, 1, 1, 1, 1 00456 } ; 00457 00458 static yyconst flex_int32_t yy_meta[42] = 00459 { 0, 00460 1, 1, 2, 1, 3, 1, 1, 3, 3, 3, 00461 3, 4, 1, 3, 3, 3, 3, 3, 3, 3, 00462 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 00463 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 00464 3 00465 } ; 00466 00467 static yyconst flex_int16_t yy_base[388] = 00468 { 0, 00469 0, 0, 809, 810, 810, 810, 804, 795, 34, 36, 00470 38, 42, 46, 50, 0, 51, 54, 53, 56, 60, 00471 76, 79, 82, 90, 78, 62, 85, 89, 31, 111, 00472 100, 140, 114, 52, 92, 55, 802, 810, 793, 810, 00473 0, 114, 117, 127, 144, 96, 149, 166, 169, 0, 00474 122, 136, 131, 154, 145, 150, 170, 792, 180, 181, 00475 182, 159, 183, 185, 187, 190, 186, 191, 192, 196, 00476 197, 199, 127, 203, 206, 212, 213, 208, 217, 225, 00477 791, 221, 229, 233, 57, 209, 235, 236, 241, 238, 00478 239, 219, 790, 247, 243, 218, 248, 245, 253, 255, 00479 00480 264, 270, 272, 273, 275, 0, 288, 290, 789, 292, 00481 307, 0, 788, 280, 787, 300, 284, 786, 304, 308, 00482 310, 312, 311, 313, 785, 276, 314, 315, 316, 317, 00483 330, 320, 322, 332, 321, 337, 340, 341, 342, 343, 00484 344, 348, 345, 784, 783, 347, 349, 782, 351, 781, 00485 780, 372, 353, 354, 383, 779, 364, 778, 365, 777, 00486 361, 388, 372, 387, 393, 367, 389, 397, 395, 401, 00487 406, 403, 355, 405, 407, 408, 411, 420, 409, 776, 00488 413, 423, 438, 431, 440, 443, 444, 435, 445, 775, 00489 774, 773, 424, 448, 446, 449, 450, 454, 456, 457, 00490 00491 458, 772, 460, 463, 461, 465, 469, 467, 471, 472, 00492 771, 770, 474, 769, 476, 478, 0, 479, 484, 485, 00493 490, 493, 494, 495, 497, 504, 498, 508, 768, 767, 00494 510, 766, 509, 512, 514, 521, 515, 496, 524, 525, 00495 528, 765, 529, 764, 530, 535, 535, 531, 763, 537, 00496 538, 541, 544, 546, 548, 549, 762, 761, 551, 550, 00497 554, 556, 558, 760, 557, 568, 562, 572, 575, 759, 00498 564, 758, 757, 756, 755, 754, 753, 752, 751, 576, 00499 578, 580, 750, 749, 748, 579, 583, 585, 582, 586, 00500 747, 591, 594, 592, 746, 595, 596, 603, 598, 745, 00501 00502 744, 743, 599, 600, 742, 606, 617, 741, 611, 740, 00503 739, 738, 610, 737, 736, 733, 724, 619, 621, 723, 00504 721, 720, 719, 623, 624, 625, 626, 718, 716, 628, 00505 627, 629, 630, 635, 634, 647, 648, 641, 639, 640, 00506 714, 711, 654, 655, 708, 707, 657, 658, 659, 703, 00507 661, 561, 660, 663, 664, 666, 667, 672, 669, 675, 00508 676, 680, 681, 684, 687, 689, 480, 686, 427, 691, 00509 692, 694, 697, 696, 357, 700, 318, 706, 278, 701, 00510 160, 810, 737, 739, 138, 743, 50 00511 } ; 00512 00513 static yyconst flex_int16_t yy_def[388] = 00514 { 0, 00515 382, 1, 382, 382, 382, 382, 383, 384, 385, 382, 00516 384, 384, 384, 384, 386, 384, 384, 384, 384, 384, 00517 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00518 384, 384, 384, 384, 384, 384, 383, 382, 384, 382, 00519 387, 387, 382, 382, 384, 384, 384, 384, 384, 386, 00520 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00521 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00522 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00523 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00524 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00525 00526 384, 384, 384, 384, 384, 387, 387, 382, 384, 384, 00527 384, 49, 384, 384, 384, 384, 384, 384, 384, 384, 00528 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00529 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00530 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00531 384, 49, 384, 384, 384, 384, 384, 384, 384, 384, 00532 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00533 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00534 384, 382, 382, 382, 384, 384, 384, 384, 384, 384, 00535 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00536 00537 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00538 384, 384, 384, 384, 384, 384, 152, 384, 384, 384, 00539 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00540 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00541 384, 384, 384, 384, 384, 382, 384, 384, 384, 384, 00542 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00543 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00544 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00545 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00546 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00547 00548 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00549 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00550 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00551 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00552 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00553 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00554 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00555 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 00556 384, 0, 382, 382, 382, 382, 382 00557 } ; 00558 00559 static yyconst flex_int16_t yy_nxt[852] = 00560 { 0, 00561 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 00562 14, 4, 15, 8, 8, 8, 16, 17, 18, 19, 00563 20, 21, 22, 8, 23, 8, 24, 25, 26, 27, 00564 28, 8, 29, 30, 31, 32, 33, 34, 35, 8, 00565 36, 42, 40, 43, 43, 44, 44, 45, 45, 40, 00566 46, 84, 106, 40, 47, 48, 48, 40, 47, 48, 00567 48, 40, 40, 40, 40, 40, 40, 40, 40, 59, 00568 51, 40, 103, 40, 55, 105, 61, 52, 56, 53, 00569 62, 54, 60, 57, 49, 63, 58, 40, 64, 40, 00570 40, 78, 66, 40, 76, 152, 40, 79, 65, 69, 00571 00572 40, 40, 67, 40, 109, 70, 73, 40, 68, 71, 00573 72, 40, 82, 77, 74, 80, 92, 81, 83, 75, 00574 85, 104, 40, 107, 107, 40, 43, 43, 86, 93, 00575 101, 87, 94, 40, 88, 108, 44, 44, 40, 95, 00576 41, 113, 40, 102, 138, 89, 90, 40, 91, 85, 00577 115, 40, 47, 45, 45, 40, 40, 96, 110, 110, 00578 40, 40, 114, 111, 97, 40, 98, 117, 99, 111, 00579 40, 40, 118, 100, 47, 48, 48, 40, 112, 112, 00580 40, 40, 112, 112, 116, 112, 112, 112, 112, 112, 00581 112, 40, 40, 40, 40, 125, 40, 40, 40, 119, 00582 00583 123, 40, 40, 40, 127, 128, 120, 40, 40, 122, 00584 40, 132, 124, 121, 40, 131, 130, 40, 126, 40, 00585 40, 129, 141, 40, 40, 134, 133, 135, 40, 40, 00586 40, 139, 40, 136, 142, 137, 40, 140, 143, 144, 00587 40, 147, 145, 146, 40, 148, 40, 40, 153, 40, 00588 40, 162, 40, 149, 40, 160, 40, 166, 40, 40, 00589 150, 154, 156, 161, 40, 157, 40, 151, 158, 155, 00590 159, 163, 169, 165, 168, 40, 167, 170, 173, 174, 00591 175, 40, 164, 40, 40, 171, 40, 40, 179, 40, 00592 172, 40, 176, 196, 177, 40, 178, 107, 107, 182, 00593 00594 182, 110, 110, 40, 183, 180, 111, 181, 189, 187, 00595 183, 40, 111, 184, 185, 40, 186, 186, 40, 40, 00596 188, 40, 40, 40, 40, 40, 40, 40, 40, 40, 00597 190, 40, 40, 40, 191, 198, 199, 194, 197, 195, 00598 202, 40, 203, 40, 192, 193, 201, 205, 40, 204, 00599 200, 40, 40, 40, 40, 40, 40, 206, 40, 40, 00600 40, 208, 40, 211, 40, 40, 40, 209, 40, 207, 00601 212, 213, 40, 214, 219, 40, 40, 210, 40, 216, 00602 215, 217, 217, 40, 238, 217, 217, 218, 217, 217, 00603 217, 217, 217, 217, 40, 226, 224, 225, 40, 40, 00604 00605 40, 231, 228, 220, 40, 221, 40, 229, 40, 222, 00606 227, 223, 40, 230, 40, 234, 40, 40, 40, 40, 00607 40, 239, 40, 232, 40, 233, 236, 237, 241, 235, 00608 242, 40, 182, 182, 244, 40, 243, 183, 40, 240, 00609 246, 246, 245, 183, 184, 184, 40, 246, 246, 186, 00610 186, 40, 186, 186, 40, 40, 40, 40, 250, 40, 00611 40, 40, 247, 248, 251, 40, 254, 40, 40, 40, 00612 252, 40, 40, 249, 40, 253, 40, 257, 40, 260, 00613 40, 261, 40, 40, 255, 40, 259, 40, 256, 40, 00614 40, 40, 258, 264, 263, 40, 40, 262, 266, 270, 00615 00616 265, 40, 271, 267, 40, 40, 40, 40, 40, 40, 00617 273, 268, 269, 275, 277, 40, 272, 279, 281, 40, 00618 40, 40, 280, 40, 274, 40, 40, 276, 289, 278, 00619 283, 284, 40, 285, 282, 40, 40, 287, 286, 40, 00620 40, 40, 40, 288, 246, 246, 40, 291, 40, 40, 00621 296, 295, 40, 297, 294, 40, 290, 40, 299, 40, 00622 40, 40, 40, 293, 300, 40, 292, 40, 40, 40, 00623 298, 304, 40, 40, 301, 40, 305, 303, 308, 40, 00624 311, 306, 302, 40, 307, 309, 40, 40, 310, 40, 00625 40, 40, 312, 40, 40, 313, 40, 40, 314, 315, 00626 00627 317, 319, 40, 40, 320, 40, 40, 40, 322, 40, 00628 40, 40, 316, 318, 40, 330, 321, 40, 324, 326, 00629 325, 40, 40, 328, 327, 323, 332, 331, 40, 334, 00630 40, 329, 40, 333, 40, 40, 40, 40, 40, 40, 00631 40, 40, 335, 336, 337, 40, 40, 343, 339, 338, 00632 40, 40, 40, 340, 342, 346, 345, 344, 40, 40, 00633 341, 350, 352, 348, 349, 40, 40, 347, 40, 40, 00634 40, 40, 40, 351, 40, 40, 357, 40, 40, 360, 00635 40, 355, 353, 40, 356, 358, 40, 40, 364, 354, 00636 362, 40, 40, 363, 359, 40, 367, 40, 40, 365, 00637 00638 40, 369, 40, 40, 361, 40, 373, 40, 40, 366, 00639 370, 40, 40, 372, 40, 374, 377, 40, 40, 40, 00640 368, 371, 40, 376, 375, 40, 380, 40, 379, 40, 00641 40, 40, 40, 381, 40, 40, 378, 37, 37, 37, 00642 37, 39, 39, 50, 40, 50, 50, 40, 40, 40, 00643 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 00644 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 00645 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 00646 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 00647 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 00648 00649 40, 40, 40, 40, 40, 38, 40, 38, 382, 3, 00650 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 00651 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 00652 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 00653 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 00654 382 00655 } ; 00656 00657 static yyconst flex_int16_t yy_chk[852] = 00658 { 0, 00659 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00660 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00661 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00662 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00663 1, 9, 29, 9, 9, 10, 10, 11, 11, 11, 00664 12, 29, 387, 12, 13, 13, 13, 13, 14, 14, 00665 14, 14, 16, 34, 18, 17, 36, 19, 85, 18, 00666 16, 20, 34, 26, 17, 36, 19, 16, 17, 16, 00667 19, 16, 18, 17, 13, 19, 17, 21, 20, 25, 00668 22, 26, 21, 23, 25, 85, 27, 26, 20, 22, 00669 00670 28, 24, 21, 35, 46, 22, 24, 46, 21, 23, 00671 23, 31, 28, 25, 24, 27, 31, 27, 28, 24, 00672 30, 35, 30, 42, 42, 33, 43, 43, 30, 31, 00673 33, 30, 31, 51, 30, 44, 44, 44, 73, 31, 00674 385, 51, 53, 33, 73, 30, 30, 52, 30, 32, 00675 53, 32, 45, 45, 45, 45, 55, 32, 47, 47, 00676 47, 56, 52, 47, 32, 54, 32, 55, 32, 47, 00677 62, 381, 56, 32, 48, 48, 48, 48, 49, 49, 00678 49, 57, 49, 49, 54, 49, 49, 49, 49, 49, 00679 49, 59, 60, 61, 63, 62, 64, 67, 65, 57, 00680 00681 61, 66, 68, 69, 64, 65, 59, 70, 71, 60, 00682 72, 68, 61, 59, 74, 67, 66, 75, 63, 78, 00683 86, 65, 75, 76, 77, 70, 69, 71, 79, 96, 00684 92, 74, 82, 72, 75, 72, 80, 74, 76, 77, 00685 83, 80, 78, 79, 84, 82, 87, 88, 86, 90, 00686 91, 92, 89, 83, 95, 90, 98, 96, 94, 97, 00687 84, 87, 88, 91, 99, 88, 100, 84, 88, 87, 00688 89, 94, 99, 95, 98, 101, 97, 99, 100, 101, 00689 101, 102, 94, 103, 104, 99, 105, 126, 103, 379, 00690 99, 114, 101, 126, 102, 117, 102, 107, 107, 108, 00691 00692 108, 110, 110, 110, 108, 104, 110, 105, 117, 114, 00693 108, 116, 110, 111, 111, 119, 111, 111, 111, 120, 00694 116, 121, 123, 122, 124, 127, 128, 129, 130, 377, 00695 119, 132, 135, 133, 120, 128, 129, 123, 127, 124, 00696 132, 131, 133, 134, 121, 122, 131, 135, 136, 134, 00697 130, 137, 138, 139, 140, 141, 143, 136, 146, 142, 00698 147, 138, 149, 141, 153, 154, 173, 139, 375, 137, 00699 142, 143, 161, 146, 154, 157, 159, 140, 166, 149, 00700 147, 152, 152, 163, 173, 152, 152, 153, 152, 152, 00701 152, 152, 152, 152, 155, 161, 157, 159, 164, 162, 00702 00703 167, 166, 163, 155, 165, 155, 169, 164, 168, 155, 00704 162, 155, 170, 165, 172, 169, 174, 171, 175, 176, 00705 179, 174, 177, 167, 181, 168, 171, 172, 176, 170, 00706 177, 178, 182, 182, 179, 193, 178, 182, 369, 175, 00707 184, 184, 181, 182, 183, 183, 188, 183, 183, 185, 00708 185, 185, 186, 186, 186, 187, 189, 195, 193, 194, 00709 196, 197, 187, 188, 194, 198, 197, 199, 200, 201, 00710 195, 203, 205, 189, 204, 196, 206, 200, 208, 204, 00711 207, 205, 209, 210, 198, 213, 203, 215, 199, 216, 00712 218, 367, 201, 208, 207, 219, 220, 206, 210, 218, 00713 00714 209, 221, 219, 213, 222, 223, 224, 238, 225, 227, 00715 221, 215, 216, 222, 223, 226, 220, 225, 227, 228, 00716 233, 231, 226, 234, 221, 235, 237, 222, 238, 224, 00717 231, 233, 236, 234, 228, 239, 240, 236, 235, 241, 00718 243, 245, 248, 237, 246, 246, 247, 240, 250, 251, 00719 248, 247, 252, 250, 245, 253, 239, 254, 252, 255, 00720 256, 260, 259, 243, 253, 261, 241, 262, 265, 263, 00721 251, 259, 352, 267, 254, 271, 260, 256, 263, 266, 00722 267, 261, 255, 268, 262, 265, 269, 280, 266, 281, 00723 286, 282, 268, 289, 287, 269, 288, 290, 271, 280, 00724 00725 282, 287, 292, 294, 288, 293, 296, 297, 290, 299, 00726 303, 304, 281, 286, 298, 303, 289, 306, 293, 296, 00727 294, 313, 309, 298, 297, 292, 306, 304, 307, 309, 00728 318, 299, 319, 307, 324, 325, 326, 327, 331, 330, 00729 332, 333, 313, 318, 319, 335, 334, 331, 325, 324, 00730 339, 340, 338, 326, 330, 334, 333, 332, 336, 337, 00731 327, 338, 340, 336, 337, 343, 344, 335, 347, 348, 00732 349, 353, 351, 339, 354, 355, 349, 356, 357, 354, 00733 359, 347, 343, 358, 348, 351, 360, 361, 358, 344, 00734 356, 362, 363, 357, 353, 364, 361, 368, 365, 359, 00735 00736 366, 363, 370, 371, 355, 372, 368, 374, 373, 360, 00737 364, 376, 380, 366, 350, 370, 373, 378, 346, 345, 00738 362, 365, 342, 372, 371, 341, 378, 329, 376, 328, 00739 323, 322, 321, 380, 320, 317, 374, 383, 383, 383, 00740 383, 384, 384, 386, 316, 386, 386, 315, 314, 312, 00741 311, 310, 308, 305, 302, 301, 300, 295, 291, 285, 00742 284, 283, 279, 278, 277, 276, 275, 274, 273, 272, 00743 270, 264, 258, 257, 249, 244, 242, 232, 230, 229, 00744 214, 212, 211, 202, 192, 191, 190, 180, 160, 158, 00745 156, 151, 150, 148, 145, 144, 125, 118, 115, 113, 00746 00747 109, 93, 81, 58, 39, 37, 8, 7, 3, 382, 00748 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 00749 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 00750 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 00751 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 00752 382 00753 } ; 00754 00755 /* Table of booleans, true if rule could match eol. */ 00756 static yyconst flex_int32_t yy_rule_can_match_eol[94] = 00757 { 0, 00758 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 00759 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 00760 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 00761 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 00762 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, }; 00763 00764 static yy_state_type yy_last_accepting_state; 00765 static char *yy_last_accepting_cpos; 00766 00767 extern int llvmAsm_flex_debug; 00768 int llvmAsm_flex_debug = 0; 00769 00770 /* The intent behind this definition is that it'll catch 00771 * any uses of REJECT which flex missed. 00772 */ 00773 #define REJECT reject_used_but_not_detected 00774 #define yymore() yymore_used_but_not_detected 00775 #define YY_MORE_ADJ 0 00776 #define YY_RESTORE_YY_MORE_OFFSET 00777 char *llvmAsmtext; 00778 #line 1 "Lexer.l" 00779 /*===-- Lexer.l - Scanner for llvm assembly files --------------*- C++ -*--===// 00780 // 00781 // The LLVM Compiler Infrastructure 00782 // 00783 // This file was developed by the LLVM research group and is distributed under 00784 // the University of Illinois Open Source License. See LICENSE.TXT for details. 00785 // 00786 //===----------------------------------------------------------------------===// 00787 // 00788 // This file implements the flex scanner for LLVM assembly languages files. 00789 // 00790 //===----------------------------------------------------------------------===*/ 00791 #line 28 "Lexer.l" 00792 #include "ParserInternals.h" 00793 #include "llvm/Module.h" 00794 #include <list> 00795 #include "llvmAsmParser.h" 00796 #include <cctype> 00797 #include <cstdlib> 00798 00799 #define RET_TOK(type, Enum, sym) \ 00800 llvmAsmlval.type = Instruction::Enum; return sym 00801 00802 namespace llvm { 00803 00804 // TODO: All of the static identifiers are figured out by the lexer, 00805 // these should be hashed to reduce the lexer size 00806 00807 00808 // atoull - Convert an ascii string of decimal digits into the unsigned long 00809 // long representation... this does not have to do input error checking, 00810 // because we know that the input will be matched by a suitable regex... 00811 // 00812 static uint64_t atoull(const char *Buffer) { 00813 uint64_t Result = 0; 00814 for (; *Buffer; Buffer++) { 00815 uint64_t OldRes = Result; 00816 Result *= 10; 00817 Result += *Buffer-'0'; 00818 if (Result < OldRes) // Uh, oh, overflow detected!!! 00819 ThrowException("constant bigger than 64 bits detected!"); 00820 } 00821 return Result; 00822 } 00823 00824 static uint64_t HexIntToVal(const char *Buffer) { 00825 uint64_t Result = 0; 00826 for (; *Buffer; ++Buffer) { 00827 uint64_t OldRes = Result; 00828 Result *= 16; 00829 char C = *Buffer; 00830 if (C >= '0' && C <= '9') 00831 Result += C-'0'; 00832 else if (C >= 'A' && C <= 'F') 00833 Result += C-'A'+10; 00834 else if (C >= 'a' && C <= 'f') 00835 Result += C-'a'+10; 00836 00837 if (Result < OldRes) // Uh, oh, overflow detected!!! 00838 ThrowException("constant bigger than 64 bits detected!"); 00839 } 00840 return Result; 00841 } 00842 00843 00844 // HexToFP - Convert the ascii string in hexidecimal format to the floating 00845 // point representation of it. 00846 // 00847 static double HexToFP(const char *Buffer) { 00848 // Behave nicely in the face of C TBAA rules... see: 00849 // http://www.nullstone.com/htmls/category/aliastyp.htm 00850 union { 00851 uint64_t UI; 00852 double FP; 00853 } UIntToFP; 00854 UIntToFP.UI = HexIntToVal(Buffer); 00855 00856 assert(sizeof(double) == sizeof(uint64_t) && 00857 "Data sizes incompatible on this target!"); 00858 return UIntToFP.FP; // Cast Hex constant to double 00859 } 00860 00861 00862 // UnEscapeLexed - Run through the specified buffer and change \xx codes to the 00863 // appropriate character. If AllowNull is set to false, a \00 value will cause 00864 // an exception to be thrown. 00865 // 00866 // If AllowNull is set to true, the return value of the function points to the 00867 // last character of the string in memory. 00868 // 00869 char *UnEscapeLexed(char *Buffer, bool AllowNull) { 00870 char *BOut = Buffer; 00871 for (char *BIn = Buffer; *BIn; ) { 00872 if (BIn[0] == '\\' && isxdigit(BIn[1]) && isxdigit(BIn[2])) { 00873 char Tmp = BIn[3]; BIn[3] = 0; // Terminate string 00874 *BOut = strtol(BIn+1, 0, 16); // Convert to number 00875 if (!AllowNull && !*BOut) 00876 ThrowException("String literal cannot accept \\00 escape!"); 00877 00878 BIn[3] = Tmp; // Restore character 00879 BIn += 3; // Skip over handled chars 00880 ++BOut; 00881 } else { 00882 *BOut++ = *BIn++; 00883 } 00884 } 00885 00886 return BOut; 00887 } 00888 00889 } // End llvm namespace 00890 00891 using namespace llvm; 00892 00893 #define YY_NEVER_INTERACTIVE 1 00894 /* Comments start with a ; and go till end of line */ 00895 /* Variable(Value) identifiers start with a % sign */ 00896 /* Label identifiers end with a colon */ 00897 /* Quoted names can contain any character except " and \ */ 00898 /* [PN]Integer: match positive and negative literal integer values that 00899 * are preceeded by a '%' character. These represent unnamed variable slots. 00900 */ 00901 /* E[PN]Integer: match positive and negative literal integer values */ 00902 /* FPConstant - A Floating point constant. 00903 */ 00904 /* HexFPConstant - Floating point constant represented in IEEE format as a 00905 * hexadecimal number for when exponential notation is not precise enough. 00906 */ 00907 /* HexIntConstant - Hexadecimal constant generated by the CFE to avoid forcing 00908 * it to deal with 64 bit numbers. 00909 */ 00910 #line 911 "Lexer.cpp" 00911 00912 #define INITIAL 0 00913 00914 #ifndef YY_NO_UNISTD_H 00915 /* Special case for "unistd.h", since it is non-ANSI. We include it way 00916 * down here because we want the user's section 1 to have been scanned first. 00917 * The user has a chance to override it with an option. 00918 */ 00919 #include <unistd.h> 00920 #endif 00921 00922 #ifndef YY_EXTRA_TYPE 00923 #define YY_EXTRA_TYPE void * 00924 #endif 00925 00926 /* Macros after this point can all be overridden by user definitions in 00927 * section 1. 00928 */ 00929 00930 #ifndef YY_SKIP_YYWRAP 00931 #ifdef __cplusplus 00932 extern "C" int llvmAsmwrap (void ); 00933 #else 00934 extern int llvmAsmwrap (void ); 00935 #endif 00936 #endif 00937 00938 static inline void yyunput (int c,char *buf_ptr ); 00939 00940 #ifndef yytext_ptr 00941 static void yy_flex_strncpy (char *,yyconst char *,int ); 00942 #endif 00943 00944 #ifdef YY_NEED_STRLEN 00945 static int yy_flex_strlen (yyconst char * ); 00946 #endif 00947 00948 #ifndef YY_NO_INPUT 00949 00950 #ifdef __cplusplus 00951 static int yyinput (void ); 00952 #else 00953 static int input (void ); 00954 #endif 00955 00956 #endif 00957 00958 /* Amount of stuff to slurp up with each read. */ 00959 #ifndef YY_READ_BUF_SIZE 00960 #define YY_READ_BUF_SIZE 8192 00961 #endif 00962 00963 /* Copy whatever the last rule matched to the standard output. */ 00964 #ifndef ECHO 00965 /* This used to be an fputs(), but since the string might contain NUL's, 00966 * we now use fwrite(). 00967 */ 00968 #define ECHO (void) fwrite( llvmAsmtext, llvmAsmleng, 1, llvmAsmout ) 00969 #endif 00970 00971 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, 00972 * is returned in "result". 00973 */ 00974 #ifndef YY_INPUT 00975 #define YY_INPUT(buf,result,max_size) \ 00976 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ 00977 { \ 00978 int c = '*'; \ 00979 size_t n; \ 00980 for ( n = 0; n < max_size && \ 00981 (c = getc( llvmAsmin )) != EOF && c != '\n'; ++n ) \ 00982 buf[n] = (char) c; \ 00983 if ( c == '\n' ) \ 00984 buf[n++] = (char) c; \ 00985 if ( c == EOF && ferror( llvmAsmin ) ) \ 00986 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 00987 result = n; \ 00988 } \ 00989 else \ 00990 { \ 00991 errno=0; \ 00992 while ( (result = fread(buf, 1, max_size, llvmAsmin))==0 && ferror(llvmAsmin)) \ 00993 { \ 00994 if( errno != EINTR) \ 00995 { \ 00996 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 00997 break; \ 00998 } \ 00999 errno=0; \ 01000 clearerr(llvmAsmin); \ 01001 } \ 01002 }\ 01003 \ 01004 01005 #endif 01006 01007 /* No semi-colon after return; correct usage is to write "yyterminate();" - 01008 * we don't want an extra ';' after the "return" because that will cause 01009 * some compilers to complain about unreachable statements. 01010 */ 01011 #ifndef yyterminate 01012 #define yyterminate() return YY_NULL 01013 #endif 01014 01015 /* Number of entries by which start-condition stack grows. */ 01016 #ifndef YY_START_STACK_INCR 01017 #define YY_START_STACK_INCR 25 01018 #endif 01019 01020 /* Report a fatal error. */ 01021 #ifndef YY_FATAL_ERROR 01022 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) 01023 #endif 01024 01025 /* end tables serialization structures and prototypes */ 01026 01027 /* Default declaration of generated scanner - a define so the user can 01028 * easily add parameters. 01029 */ 01030 #ifndef YY_DECL 01031 #define YY_DECL_IS_OURS 1 01032 01033 extern int llvmAsmlex (void); 01034 01035 #define YY_DECL int llvmAsmlex (void) 01036 #endif /* !YY_DECL */ 01037 01038 /* Code executed at the beginning of each rule, after llvmAsmtext and llvmAsmleng 01039 * have been set up. 01040 */ 01041 #ifndef YY_USER_ACTION 01042 #define YY_USER_ACTION 01043 #endif 01044 01045 /* Code executed at the end of each rule. */ 01046 #ifndef YY_BREAK 01047 #define YY_BREAK break; 01048 #endif 01049 01050 #define YY_RULE_SETUP \ 01051 YY_USER_ACTION 01052 01053 /** The main scanner function which does all the work. 01054 */ 01055 YY_DECL 01056 { 01057 register yy_state_type yy_current_state; 01058 register char *yy_cp, *yy_bp; 01059 register int yy_act; 01060 01061 #line 171 "Lexer.l" 01062 01063 01064 #line 1065 "Lexer.cpp" 01065 01066 if ( (yy_init) ) 01067 { 01068 (yy_init) = 0; 01069 01070 #ifdef YY_USER_INIT 01071 YY_USER_INIT; 01072 #endif 01073 01074 if ( ! (yy_start) ) 01075 (yy_start) = 1; /* first start state */ 01076 01077 if ( ! llvmAsmin ) 01078 llvmAsmin = stdin; 01079 01080 if ( ! llvmAsmout ) 01081 llvmAsmout = stdout; 01082 01083 if ( ! YY_CURRENT_BUFFER ) { 01084 llvmAsmensure_buffer_stack (); 01085 YY_CURRENT_BUFFER_LVALUE = 01086 llvmAsm_create_buffer(llvmAsmin,YY_BUF_SIZE ); 01087 } 01088 01089 llvmAsm_load_buffer_state( ); 01090 } 01091 01092 while ( 1 ) /* loops until end-of-file is reached */ 01093 { 01094 yy_cp = (yy_c_buf_p); 01095 01096 /* Support of llvmAsmtext. */ 01097 *yy_cp = (yy_hold_char); 01098 01099 /* yy_bp points to the position in yy_ch_buf of the start of 01100 * the current run. 01101 */ 01102 yy_bp = yy_cp; 01103 01104 yy_current_state = (yy_start); 01105 yy_match: 01106 do 01107 { 01108 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; 01109 if ( yy_accept[yy_current_state] ) 01110 { 01111 (yy_last_accepting_state) = yy_current_state; 01112 (yy_last_accepting_cpos) = yy_cp; 01113 } 01114 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 01115 { 01116 yy_current_state = (int) yy_def[yy_current_state]; 01117 if ( yy_current_state >= 383 ) 01118 yy_c = yy_meta[(unsigned int) yy_c]; 01119 } 01120 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 01121 ++yy_cp; 01122 } 01123 while ( yy_current_state != 382 ); 01124 yy_cp = (yy_last_accepting_cpos); 01125 yy_current_state = (yy_last_accepting_state); 01126 01127 yy_find_action: 01128 yy_act = yy_accept[yy_current_state]; 01129 01130 YY_DO_BEFORE_ACTION; 01131 01132 if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) 01133 { 01134 int yyl; 01135 for ( yyl = 0; yyl < llvmAsmleng; ++yyl ) 01136 if ( llvmAsmtext[yyl] == '\n' ) 01137 01138 llvmAsmlineno++; 01139 ; 01140 } 01141 01142 do_action: /* This label is used only to access EOF actions. */ 01143 01144 switch ( yy_act ) 01145 { /* beginning of action switch */ 01146 case 0: /* must back up */ 01147 /* undo the effects of YY_DO_BEFORE_ACTION */ 01148 *yy_cp = (yy_hold_char); 01149 yy_cp = (yy_last_accepting_cpos); 01150 yy_current_state = (yy_last_accepting_state); 01151 goto yy_find_action; 01152 01153 case 1: 01154 YY_RULE_SETUP 01155 #line 173 "Lexer.l" 01156 { /* Ignore comments for now */ } 01157 YY_BREAK 01158 case 2: 01159 YY_RULE_SETUP 01160 #line 175 "Lexer.l" 01161 { return BEGINTOK; } 01162 YY_BREAK 01163 case 3: 01164 YY_RULE_SETUP 01165 #line 176 "Lexer.l" 01166 { return ENDTOK; } 01167 YY_BREAK 01168 case 4: 01169 YY_RULE_SETUP 01170 #line 177 "Lexer.l" 01171 { return TRUETOK; } 01172 YY_BREAK 01173 case 5: 01174 YY_RULE_SETUP 01175 #line 178 "Lexer.l" 01176 { return FALSETOK; } 01177 YY_BREAK 01178 case 6: 01179 YY_RULE_SETUP 01180 #line 179 "Lexer.l" 01181 { return DECLARE; } 01182 YY_BREAK 01183 case 7: 01184 YY_RULE_SETUP 01185 #line 180 "Lexer.l" 01186 { return GLOBAL; } 01187 YY_BREAK 01188 case 8: 01189 YY_RULE_SETUP 01190 #line 181 "Lexer.l" 01191 { return CONSTANT; } 01192 YY_BREAK 01193 case 9: 01194 YY_RULE_SETUP 01195 #line 182 "Lexer.l" 01196 { return INTERNAL; } 01197 YY_BREAK 01198 case 10: 01199 YY_RULE_SETUP 01200 #line 183 "Lexer.l" 01201 { return LINKONCE; } 01202 YY_BREAK 01203 case 11: 01204 YY_RULE_SETUP 01205 #line 184 "Lexer.l" 01206 { return WEAK; } 01207 YY_BREAK 01208 case 12: 01209 YY_RULE_SETUP 01210 #line 185 "Lexer.l" 01211 { return APPENDING; } 01212 YY_BREAK 01213 case 13: 01214 YY_RULE_SETUP 01215 #line 186 "Lexer.l" 01216 { return EXTERNAL; } /* Deprecated, turn into external */ 01217 YY_BREAK 01218 case 14: 01219 YY_RULE_SETUP 01220 #line 187 "Lexer.l" 01221 { return EXTERNAL; } 01222 YY_BREAK 01223 case 15: 01224 YY_RULE_SETUP 01225 #line 188 "Lexer.l" 01226 { return IMPLEMENTATION; } 01227 YY_BREAK 01228 case 16: 01229 YY_RULE_SETUP 01230 #line 189 "Lexer.l" 01231 { return ZEROINITIALIZER; } 01232 YY_BREAK 01233 case 17: 01234 YY_RULE_SETUP 01235 #line 190 "Lexer.l" 01236 { return DOTDOTDOT; } 01237 YY_BREAK 01238 case 18: 01239 YY_RULE_SETUP 01240 #line 191 "Lexer.l" 01241 { return UNDEF; } 01242 YY_BREAK 01243 case 19: 01244 YY_RULE_SETUP 01245 #line 192 "Lexer.l" 01246 { return NULL_TOK; } 01247 YY_BREAK 01248 case 20: 01249 YY_RULE_SETUP 01250 #line 193 "Lexer.l" 01251 { return TO; } 01252 YY_BREAK 01253 case 21: 01254 YY_RULE_SETUP 01255 #line 194 "Lexer.l" 01256 { RET_TOK(TermOpVal, Unwind, UNWIND); } 01257 YY_BREAK 01258 case 22: 01259 YY_RULE_SETUP 01260 #line 195 "Lexer.l" 01261 { return NOT; } /* Deprecated, turned into XOR */ 01262 YY_BREAK 01263 case 23: 01264 YY_RULE_SETUP 01265 #line 196 "Lexer.l" 01266 { return TARGET; } 01267 YY_BREAK 01268 case 24: 01269 YY_RULE_SETUP 01270 #line 197 "Lexer.l" 01271 { return TRIPLE; } 01272 YY_BREAK 01273 case 25: 01274 YY_RULE_SETUP 01275 #line 198 "Lexer.l" 01276 { return DEPLIBS; } 01277 YY_BREAK 01278 case 26: 01279 YY_RULE_SETUP 01280 #line 199 "Lexer.l" 01281 { return ENDIAN; } 01282 YY_BREAK 01283 case 27: 01284 YY_RULE_SETUP 01285 #line 200 "Lexer.l" 01286 { return POINTERSIZE; } 01287 YY_BREAK 01288 case 28: 01289 YY_RULE_SETUP 01290 #line 201 "Lexer.l" 01291 { return LITTLE; } 01292 YY_BREAK 01293 case 29: 01294 YY_RULE_SETUP 01295 #line 202 "Lexer.l" 01296 { return BIG; } 01297 YY_BREAK 01298 case 30: 01299 YY_RULE_SETUP 01300 #line 203 "Lexer.l" 01301 { return VOLATILE; } 01302 YY_BREAK 01303 case 31: 01304 YY_RULE_SETUP 01305 #line 205 "Lexer.l" 01306 { llvmAsmlval.PrimType = Type::VoidTy ; return VOID; } 01307 YY_BREAK 01308 case 32: 01309 YY_RULE_SETUP 01310 #line 206 "Lexer.l" 01311 { llvmAsmlval.PrimType = Type::BoolTy ; return BOOL; } 01312 YY_BREAK 01313 case 33: 01314 YY_RULE_SETUP 01315 #line 207 "Lexer.l" 01316 { llvmAsmlval.PrimType = Type::SByteTy ; return SBYTE; } 01317 YY_BREAK 01318 case 34: 01319 YY_RULE_SETUP 01320 #line 208 "Lexer.l" 01321 { llvmAsmlval.PrimType = Type::UByteTy ; return UBYTE; } 01322 YY_BREAK 01323 case 35: 01324 YY_RULE_SETUP 01325 #line 209 "Lexer.l" 01326 { llvmAsmlval.PrimType = Type::ShortTy ; return SHORT; } 01327 YY_BREAK 01328 case 36: 01329 YY_RULE_SETUP 01330 #line 210 "Lexer.l" 01331 { llvmAsmlval.PrimType = Type::UShortTy; return USHORT; } 01332 YY_BREAK 01333 case 37: 01334 YY_RULE_SETUP 01335 #line 211 "Lexer.l" 01336 { llvmAsmlval.PrimType = Type::IntTy ; return INT; } 01337 YY_BREAK 01338 case 38: 01339 YY_RULE_SETUP 01340 #line 212 "Lexer.l" 01341 { llvmAsmlval.PrimType = Type::UIntTy ; return UINT; } 01342 YY_BREAK 01343 case 39: 01344 YY_RULE_SETUP 01345 #line 213 "Lexer.l" 01346 { llvmAsmlval.PrimType = Type::LongTy ; return LONG; } 01347 YY_BREAK 01348 case 40: 01349 YY_RULE_SETUP 01350 #line 214 "Lexer.l" 01351 { llvmAsmlval.PrimType = Type::ULongTy ; return ULONG; } 01352 YY_BREAK 01353 case 41: 01354 YY_RULE_SETUP 01355 #line 215 "Lexer.l" 01356 { llvmAsmlval.PrimType = Type::FloatTy ; return FLOAT; } 01357 YY_BREAK 01358 case 42: 01359 YY_RULE_SETUP 01360 #line 216 "Lexer.l" 01361 { llvmAsmlval.PrimType = Type::DoubleTy; return DOUBLE; } 01362 YY_BREAK 01363 case 43: 01364 YY_RULE_SETUP 01365 #line 217 "Lexer.l" 01366 { llvmAsmlval.PrimType = Type::LabelTy ; return LABEL; } 01367 YY_BREAK 01368 case 44: 01369 YY_RULE_SETUP 01370 #line 218 "Lexer.l" 01371 { return TYPE; } 01372 YY_BREAK 01373 case 45: 01374 YY_RULE_SETUP 01375 #line 219 "Lexer.l" 01376 { return OPAQUE; } 01377 YY_BREAK 01378 case 46: 01379 YY_RULE_SETUP 01380 #line 221 "Lexer.l" 01381 { RET_TOK(BinaryOpVal, Add, ADD); } 01382 YY_BREAK 01383 case 47: 01384 YY_RULE_SETUP 01385 #line 222 "Lexer.l" 01386 { RET_TOK(BinaryOpVal, Sub, SUB); } 01387 YY_BREAK 01388 case 48: 01389 YY_RULE_SETUP 01390 #line 223 "Lexer.l" 01391 { RET_TOK(BinaryOpVal, Mul, MUL); } 01392 YY_BREAK 01393 case 49: 01394 YY_RULE_SETUP 01395 #line 224 "Lexer.l" 01396 { RET_TOK(BinaryOpVal, Div, DIV); } 01397 YY_BREAK 01398 case 50: 01399 YY_RULE_SETUP 01400 #line 225 "Lexer.l" 01401 { RET_TOK(BinaryOpVal, Rem, REM); } 01402 YY_BREAK 01403 case 51: 01404 YY_RULE_SETUP 01405 #line 226 "Lexer.l" 01406 { RET_TOK(BinaryOpVal, And, AND); } 01407 YY_BREAK 01408 case 52: 01409 YY_RULE_SETUP 01410 #line 227 "Lexer.l" 01411 { RET_TOK(BinaryOpVal, Or , OR ); } 01412 YY_BREAK 01413 case 53: 01414 YY_RULE_SETUP 01415 #line 228 "Lexer.l" 01416 { RET_TOK(BinaryOpVal, Xor, XOR); } 01417 YY_BREAK 01418 case 54: 01419 YY_RULE_SETUP 01420 #line 229 "Lexer.l" 01421 { RET_TOK(BinaryOpVal, SetNE, SETNE); } 01422 YY_BREAK 01423 case 55: 01424 YY_RULE_SETUP 01425 #line 230 "Lexer.l" 01426 { RET_TOK(BinaryOpVal, SetEQ, SETEQ); } 01427 YY_BREAK 01428 case 56: 01429 YY_RULE_SETUP 01430 #line 231 "Lexer.l" 01431 { RET_TOK(BinaryOpVal, SetLT, SETLT); } 01432 YY_BREAK 01433 case 57: 01434 YY_RULE_SETUP 01435 #line 232 "Lexer.l" 01436 { RET_TOK(BinaryOpVal, SetGT, SETGT); } 01437 YY_BREAK 01438 case 58: 01439 YY_RULE_SETUP 01440 #line 233 "Lexer.l" 01441 { RET_TOK(BinaryOpVal, SetLE, SETLE); } 01442 YY_BREAK 01443 case 59: 01444 YY_RULE_SETUP 01445 #line 234 "Lexer.l" 01446 { RET_TOK(BinaryOpVal, SetGE, SETGE); } 01447 YY_BREAK 01448 case 60: 01449 YY_RULE_SETUP 01450 #line 236 "Lexer.l" 01451 { RET_TOK(OtherOpVal, PHI, PHI_TOK); } 01452 YY_BREAK 01453 case 61: 01454 YY_RULE_SETUP 01455 #line 237 "Lexer.l" 01456 { RET_TOK(OtherOpVal, Call, CALL); } 01457 YY_BREAK 01458 case 62: 01459 YY_RULE_SETUP 01460 #line 238 "Lexer.l" 01461 { RET_TOK(OtherOpVal, Cast, CAST); } 01462 YY_BREAK 01463 case 63: 01464 YY_RULE_SETUP 01465 #line 239 "Lexer.l" 01466 { RET_TOK(OtherOpVal, Select, SELECT); } 01467 YY_BREAK 01468 case 64: 01469 YY_RULE_SETUP 01470 #line 240 "Lexer.l" 01471 { RET_TOK(OtherOpVal, Shl, SHL); } 01472 YY_BREAK 01473 case 65: 01474 YY_RULE_SETUP 01475 #line 241 "Lexer.l" 01476 { RET_TOK(OtherOpVal, Shr, SHR); } 01477 YY_BREAK 01478 case 66: 01479 YY_RULE_SETUP 01480 #line 242 "Lexer.l" 01481 { return VA_ARG; /* FIXME: OBSOLETE */} 01482 YY_BREAK 01483 case 67: 01484 YY_RULE_SETUP 01485 #line 243 "Lexer.l" 01486 { RET_TOK(OtherOpVal, VANext, VANEXT); } 01487 YY_BREAK 01488 case 68: 01489 YY_RULE_SETUP 01490 #line 244 "Lexer.l" 01491 { RET_TOK(OtherOpVal, VAArg , VAARG); } 01492 YY_BREAK 01493 case 69: 01494 YY_RULE_SETUP 01495 #line 246 "Lexer.l" 01496 { RET_TOK(TermOpVal, Ret, RET); } 01497 YY_BREAK 01498 case 70: 01499 YY_RULE_SETUP 01500 #line 247 "Lexer.l" 01501 { RET_TOK(TermOpVal, Br, BR); } 01502 YY_BREAK 01503 case 71: 01504 YY_RULE_SETUP 01505 #line 248 "Lexer.l" 01506 { RET_TOK(TermOpVal, Switch, SWITCH); } 01507 YY_BREAK 01508 case 72: 01509 YY_RULE_SETUP 01510 #line 249 "Lexer.l" 01511 { RET_TOK(TermOpVal, Invoke, INVOKE); } 01512 YY_BREAK 01513 case 73: 01514 YY_RULE_SETUP 01515 #line 250 "Lexer.l" 01516 { RET_TOK(TermOpVal, Unwind, UNWIND); } 01517 YY_BREAK 01518 case 74: 01519 YY_RULE_SETUP 01520 #line 251 "Lexer.l" 01521 { RET_TOK(TermOpVal, Unreachable, UNREACHABLE); } 01522 YY_BREAK 01523 case 75: 01524 YY_RULE_SETUP 01525 #line 253 "Lexer.l" 01526 { RET_TOK(MemOpVal, Malloc, MALLOC); } 01527 YY_BREAK 01528 case 76: 01529 YY_RULE_SETUP 01530 #line 254 "Lexer.l" 01531 { RET_TOK(MemOpVal, Alloca, ALLOCA); } 01532 YY_BREAK 01533 case 77: 01534 YY_RULE_SETUP 01535 #line 255 "Lexer.l" 01536 { RET_TOK(MemOpVal, Free, FREE); } 01537 YY_BREAK 01538 case 78: 01539 YY_RULE_SETUP 01540 #line 256 "Lexer.l" 01541 { RET_TOK(MemOpVal, Load, LOAD); } 01542 YY_BREAK 01543 case 79: 01544 YY_RULE_SETUP 01545 #line 257 "Lexer.l" 01546 { RET_TOK(MemOpVal, Store, STORE); } 01547 YY_BREAK 01548 case 80: 01549 YY_RULE_SETUP 01550 #line 258 "Lexer.l" 01551 { RET_TOK(MemOpVal, GetElementPtr, GETELEMENTPTR); } 01552 YY_BREAK 01553 case 81: 01554 YY_RULE_SETUP 01555 #line 261 "Lexer.l" 01556 { 01557 UnEscapeLexed(llvmAsmtext+1); 01558 llvmAsmlval.StrVal = strdup(llvmAsmtext+1); // Skip % 01559 return VAR_ID; 01560 } 01561 YY_BREAK 01562 case 82: 01563 YY_RULE_SETUP 01564 #line 266 "Lexer.l" 01565 { 01566 llvmAsmtext[strlen(llvmAsmtext)-1] = 0; // nuke colon 01567 UnEscapeLexed(llvmAsmtext); 01568 llvmAsmlval.StrVal = strdup(llvmAsmtext); 01569 return LABELSTR; 01570 } 01571 YY_BREAK 01572 case 83: 01573 /* rule 83 can match eol */ 01574 YY_RULE_SETUP 01575 #line 273 "Lexer.l" 01576 { // Note that we cannot unescape a string constant here! The 01577 // string constant might contain a \00 which would not be 01578 // understood by the string stuff. It is valid to make a 01579 // [sbyte] c"Hello World\00" constant, for example. 01580 // 01581 llvmAsmtext[strlen(llvmAsmtext)-1] = 0; // nuke end quote 01582 llvmAsmlval.StrVal = strdup(llvmAsmtext+1); // Nuke start quote 01583 return STRINGCONSTANT; 01584 } 01585 YY_BREAK 01586 case 84: 01587 YY_RULE_SETUP 01588 #line 284 "Lexer.l" 01589 { llvmAsmlval.UInt64Val = atoull(llvmAsmtext); return EUINT64VAL; } 01590 YY_BREAK 01591 case 85: 01592 YY_RULE_SETUP 01593 #line 285 "Lexer.l" 01594 { 01595 uint64_t Val = atoull(llvmAsmtext+1); 01596 // +1: we have bigger negative range 01597 if (Val > (uint64_t)INT64_MAX+1) 01598 ThrowException("Constant too large for signed 64 bits!"); 01599 llvmAsmlval.SInt64Val = -Val; 01600 return ESINT64VAL; 01601 } 01602 YY_BREAK 01603 case 86: 01604 YY_RULE_SETUP 01605 #line 293 "Lexer.l" 01606 { 01607 llvmAsmlval.UInt64Val = HexIntToVal(llvmAsmtext+3); 01608 return llvmAsmtext[0] == 's' ? ESINT64VAL : EUINT64VAL; 01609 } 01610 YY_BREAK 01611 case 87: 01612 YY_RULE_SETUP 01613 #line 298 "Lexer.l" 01614 { llvmAsmlval.UIntVal = atoull(llvmAsmtext+1); return UINTVAL; } 01615 YY_BREAK 01616 case 88: 01617 YY_RULE_SETUP 01618 #line 299 "Lexer.l" 01619 { 01620 uint64_t Val = atoull(llvmAsmtext+2); 01621 // +1: we have bigger negative range 01622 if (Val > (uint64_t)INT32_MAX+1) 01623 ThrowException("Constant too large for signed 32 bits!"); 01624 llvmAsmlval.SIntVal = -Val; 01625 return SINTVAL; 01626 } 01627 YY_BREAK 01628 case 89: 01629 YY_RULE_SETUP 01630 #line 308 "Lexer.l" 01631 { llvmAsmlval.FPVal = atof(llvmAsmtext); return FPVAL; } 01632 YY_BREAK 01633 case 90: 01634 YY_RULE_SETUP 01635 #line 309 "Lexer.l" 01636 { llvmAsmlval.FPVal = HexToFP(llvmAsmtext); return FPVAL; } 01637 YY_BREAK 01638 case YY_STATE_EOF(INITIAL): 01639 #line 311 "Lexer.l" 01640 { 01641 /* Make sure to free the internal buffers for flex when we are 01642 * done reading our input! 01643 */ 01644 llvmAsm_delete_buffer(YY_CURRENT_BUFFER); 01645 return EOF; 01646 } 01647 YY_BREAK 01648 case 91: 01649 /* rule 91 can match eol */ 01650 YY_RULE_SETUP 01651 #line 319 "Lexer.l" 01652 { /* Ignore whitespace */ } 01653 YY_BREAK 01654 case 92: 01655 YY_RULE_SETUP 01656 #line 320 "Lexer.l" 01657 { return llvmAsmtext[0]; } 01658 YY_BREAK 01659 case 93: 01660 YY_RULE_SETUP 01661 #line 322 "Lexer.l" 01662 YY_FATAL_ERROR( "flex scanner jammed" ); 01663 YY_BREAK 01664 #line 1665 "Lexer.cpp" 01665 01666 case YY_END_OF_BUFFER: 01667 { 01668 /* Amount of text matched not including the EOB char. */ 01669 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; 01670 01671 /* Undo the effects of YY_DO_BEFORE_ACTION. */ 01672 *yy_cp = (yy_hold_char); 01673 YY_RESTORE_YY_MORE_OFFSET 01674 01675 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) 01676 { 01677 /* We're scanning a new file or input source. It's 01678 * possible that this happened because the user 01679 * just pointed llvmAsmin at a new source and called 01680 * llvmAsmlex(). If so, then we have to assure 01681 * consistency between YY_CURRENT_BUFFER and our 01682 * globals. Here is the right place to do so, because 01683 * this is the first action (other than possibly a 01684 * back-up) that will match for the new input source. 01685 */ 01686 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 01687 YY_CURRENT_BUFFER_LVALUE->yy_input_file = llvmAsmin; 01688 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; 01689 } 01690 01691 /* Note that here we test for yy_c_buf_p "<=" to the position 01692 * of the first EOB in the buffer, since yy_c_buf_p will 01693 * already have been incremented past the NUL character 01694 * (since all states make transitions on EOB to the 01695 * end-of-buffer state). Contrast this with the test 01696 * in input(). 01697 */ 01698 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) 01699 { /* This was really a NUL. */ 01700 yy_state_type yy_next_state; 01701 01702 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; 01703 01704 yy_current_state = yy_get_previous_state( ); 01705 01706 /* Okay, we're now positioned to make the NUL 01707 * transition. We couldn't have 01708 * yy_get_previous_state() go ahead and do it 01709 * for us because it doesn't know how to deal 01710 * with the possibility of jamming (and we don't 01711 * want to build jamming into it because then it 01712 * will run more slowly). 01713 */ 01714 01715 yy_next_state = yy_try_NUL_trans( yy_current_state ); 01716 01717 yy_bp = (yytext_ptr) + YY_MORE_ADJ; 01718 01719 if ( yy_next_state ) 01720 { 01721 /* Consume the NUL. */ 01722 yy_cp = ++(yy_c_buf_p); 01723 yy_current_state = yy_next_state; 01724 goto yy_match; 01725 } 01726 01727 else 01728 { 01729 yy_cp = (yy_last_accepting_cpos); 01730 yy_current_state = (yy_last_accepting_state); 01731 goto yy_find_action; 01732 } 01733 } 01734 01735 else switch ( yy_get_next_buffer( ) ) 01736 { 01737 case EOB_ACT_END_OF_FILE: 01738 { 01739 (yy_did_buffer_switch_on_eof) = 0; 01740 01741 if ( llvmAsmwrap( ) ) 01742 { 01743 /* Note: because we've taken care in 01744 * yy_get_next_buffer() to have set up 01745 * llvmAsmtext, we can now set up 01746 * yy_c_buf_p so that if some total 01747 * hoser (like flex itself) wants to 01748 * call the scanner after we return the 01749 * YY_NULL, it'll still work - another 01750 * YY_NULL will get returned. 01751 */ 01752 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; 01753 01754 yy_act = YY_STATE_EOF(YY_START); 01755 goto do_action; 01756 } 01757 01758 else 01759 { 01760 if ( ! (yy_did_buffer_switch_on_eof) ) 01761 YY_NEW_FILE; 01762 } 01763 break; 01764 } 01765 01766 case EOB_ACT_CONTINUE_SCAN: 01767 (yy_c_buf_p) = 01768 (yytext_ptr) + yy_amount_of_matched_text; 01769 01770 yy_current_state = yy_get_previous_state( ); 01771 01772 yy_cp = (yy_c_buf_p); 01773 yy_bp = (yytext_ptr) + YY_MORE_ADJ; 01774 goto yy_match; 01775 01776 case EOB_ACT_LAST_MATCH: 01777 (yy_c_buf_p) = 01778 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; 01779 01780 yy_current_state = yy_get_previous_state( ); 01781 01782 yy_cp = (yy_c_buf_p); 01783 yy_bp = (yytext_ptr) + YY_MORE_ADJ; 01784 goto yy_find_action; 01785 } 01786 break; 01787 } 01788 01789 default: 01790 YY_FATAL_ERROR( 01791 "fatal flex scanner internal error--no action found" ); 01792 } /* end of action switch */ 01793 } /* end of scanning one token */ 01794 } /* end of llvmAsmlex */ 01795 01796 /* yy_get_next_buffer - try to read in a new buffer 01797 * 01798 * Returns a code representing an action: 01799 * EOB_ACT_LAST_MATCH - 01800 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position 01801 * EOB_ACT_END_OF_FILE - end of file 01802 */ 01803 static int yy_get_next_buffer (void) 01804 { 01805 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; 01806 register char *source = (yytext_ptr); 01807 register int number_to_move, i; 01808 int ret_val; 01809 01810 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) 01811 YY_FATAL_ERROR( 01812 "fatal flex scanner internal error--end of buffer missed" ); 01813 01814 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) 01815 { /* Don't try to fill the buffer, so this is an EOF. */ 01816 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) 01817 { 01818 /* We matched a single character, the EOB, so 01819 * treat this as a final EOF. 01820 */ 01821 return EOB_ACT_END_OF_FILE; 01822 } 01823 01824 else 01825 { 01826 /* We matched some text prior to the EOB, first 01827 * process it. 01828 */ 01829 return EOB_ACT_LAST_MATCH; 01830 } 01831 } 01832 01833 /* Try to read more data. */ 01834 01835 /* First move last chars to start of buffer. */ 01836 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; 01837 01838 for ( i = 0; i < number_to_move; ++i ) 01839 *(dest++) = *(source++); 01840 01841 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) 01842 /* don't do the read, it's not guaranteed to return an EOF, 01843 * just force an EOF 01844 */ 01845 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; 01846 01847 else 01848 { 01849 size_t num_to_read = 01850 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; 01851 01852 while ( num_to_read <= 0 ) 01853 { /* Not enough room in the buffer - grow it. */ 01854 01855 /* just a shorter name for the current buffer */ 01856 YY_BUFFER_STATE b = YY_CURRENT_BUFFER; 01857 01858 int yy_c_buf_p_offset = 01859 (int) ((yy_c_buf_p) - b->yy_ch_buf); 01860 01861 if ( b->yy_is_our_buffer ) 01862 { 01863 int new_size = b->yy_buf_size * 2; 01864 01865 if ( new_size <= 0 ) 01866 b->yy_buf_size += b->yy_buf_size / 8; 01867 else 01868 b->yy_buf_size *= 2; 01869 01870 b->yy_ch_buf = (char *) 01871 /* Include room in for 2 EOB chars. */ 01872 llvmAsmrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); 01873 } 01874 else 01875 /* Can't grow it, we don't own it. */ 01876 b->yy_ch_buf = 0; 01877 01878 if ( ! b->yy_ch_buf ) 01879 YY_FATAL_ERROR( 01880 "fatal error - scanner input buffer overflow" ); 01881 01882 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; 01883 01884 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - 01885 number_to_move - 1; 01886 01887 } 01888 01889 if ( num_to_read > YY_READ_BUF_SIZE ) 01890 num_to_read = YY_READ_BUF_SIZE; 01891 01892 /* Read in more data. */ 01893 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), 01894 (yy_n_chars), num_to_read ); 01895 01896 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 01897 } 01898 01899 if ( (yy_n_chars) == 0 ) 01900 { 01901 if ( number_to_move == YY_MORE_ADJ ) 01902 { 01903 ret_val = EOB_ACT_END_OF_FILE; 01904 llvmAsmrestart(llvmAsmin ); 01905 } 01906 01907 else 01908 { 01909 ret_val = EOB_ACT_LAST_MATCH; 01910 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = 01911 YY_BUFFER_EOF_PENDING; 01912 } 01913 } 01914 01915 else 01916 ret_val = EOB_ACT_CONTINUE_SCAN; 01917 01918 (yy_n_chars) += number_to_move; 01919 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; 01920 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; 01921 01922 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; 01923 01924 return ret_val; 01925 } 01926 01927 /* yy_get_previous_state - get the state just before the EOB char was reached */ 01928 01929 static yy_state_type yy_get_previous_state (void) 01930 { 01931 register yy_state_type yy_current_state; 01932 register char *yy_cp; 01933 01934 yy_current_state = (yy_start); 01935 01936 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) 01937 { 01938 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 01939 if ( yy_accept[yy_current_state] ) 01940 { 01941 (yy_last_accepting_state) = yy_current_state; 01942 (yy_last_accepting_cpos) = yy_cp; 01943 } 01944 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 01945 { 01946 yy_current_state = (int) yy_def[yy_current_state]; 01947 if ( yy_current_state >= 383 ) 01948 yy_c = yy_meta[(unsigned int) yy_c]; 01949 } 01950 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 01951 } 01952 01953 return yy_current_state; 01954 } 01955 01956 /* yy_try_NUL_trans - try to make a transition on the NUL character 01957 * 01958 * synopsis 01959 * next_state = yy_try_NUL_trans( current_state ); 01960 */ 01961 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) 01962 { 01963 register int yy_is_jam; 01964 register char *yy_cp = (yy_c_buf_p); 01965 01966 register YY_CHAR yy_c = 1; 01967 if ( yy_accept[yy_current_state] ) 01968 { 01969 (yy_last_accepting_state) = yy_current_state; 01970 (yy_last_accepting_cpos) = yy_cp; 01971 } 01972 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 01973 { 01974 yy_current_state = (int) yy_def[yy_current_state]; 01975 if ( yy_current_state >= 383 ) 01976 yy_c = yy_meta[(unsigned int) yy_c]; 01977 } 01978 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 01979 yy_is_jam = (yy_current_state == 382); 01980 01981 return yy_is_jam ? 0 : yy_current_state; 01982 } 01983 01984 static inline void yyunput (int c, register char * yy_bp ) 01985 { 01986 register char *yy_cp; 01987 01988 yy_cp = (yy_c_buf_p); 01989 01990 /* undo effects of setting up llvmAsmtext */ 01991 *yy_cp = (yy_hold_char); 01992 01993 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) 01994 { /* need to shift things up to make room */ 01995 /* +2 for EOB chars. */ 01996 register int number_to_move = (yy_n_chars) + 2; 01997 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ 01998 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; 01999 register char *source = 02000 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; 02001 02002 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) 02003 *--dest = *--source; 02004 02005 yy_cp += (int) (dest - source); 02006 yy_bp += (int) (dest - source); 02007 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = 02008 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; 02009 02010 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) 02011 YY_FATAL_ERROR( "flex scanner push-back overflow" ); 02012 } 02013 02014 *--yy_cp = (char) c; 02015 02016 if ( c == '\n' ){ 02017 --llvmAsmlineno; 02018 } 02019 02020 (yytext_ptr) = yy_bp; 02021 (yy_hold_char) = *yy_cp; 02022 (yy_c_buf_p) = yy_cp; 02023 } 02024 02025 #ifndef YY_NO_INPUT 02026 #ifdef __cplusplus 02027 static int yyinput (void) 02028 #else 02029 static int input (void) 02030 #endif 02031 02032 { 02033 int c; 02034 02035 *(yy_c_buf_p) = (yy_hold_char); 02036 02037 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) 02038 { 02039 /* yy_c_buf_p now points to the character we want to return. 02040 * If this occurs *before* the EOB characters, then it's a 02041 * valid NUL; if not, then we've hit the end of the buffer. 02042 */ 02043 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) 02044 /* This was really a NUL. */ 02045 *(yy_c_buf_p) = '\0'; 02046 02047 else 02048 { /* need more input */ 02049 int offset = (yy_c_buf_p) - (yytext_ptr); 02050 ++(yy_c_buf_p); 02051 02052 switch ( yy_get_next_buffer( ) ) 02053 { 02054 case EOB_ACT_LAST_MATCH: 02055 /* This happens because yy_g_n_b() 02056 * sees that we've accumulated a 02057 * token and flags that we need to 02058 * try matching the token before 02059 * proceeding. But for input(), 02060 * there's no matching to consider. 02061 * So convert the EOB_ACT_LAST_MATCH 02062 * to EOB_ACT_END_OF_FILE. 02063 */ 02064 02065 /* Reset buffer status. */ 02066 llvmAsmrestart(llvmAsmin ); 02067 02068 /*FALLTHROUGH*/ 02069 02070 case EOB_ACT_END_OF_FILE: 02071 { 02072 if ( llvmAsmwrap( ) ) 02073 return EOF; 02074 02075 if ( ! (yy_did_buffer_switch_on_eof) ) 02076 YY_NEW_FILE; 02077 #ifdef __cplusplus 02078 return yyinput(); 02079 #else 02080 return input(); 02081 #endif 02082 } 02083 02084 case EOB_ACT_CONTINUE_SCAN: 02085 (yy_c_buf_p) = (yytext_ptr) + offset; 02086 break; 02087 } 02088 } 02089 } 02090 02091 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ 02092 *(yy_c_buf_p) = '\0'; /* preserve llvmAsmtext */ 02093 (yy_hold_char) = *++(yy_c_buf_p); 02094 02095 if ( c == '\n' ) 02096 02097 llvmAsmlineno++; 02098 ; 02099 02100 return c; 02101 } 02102 #endif /* ifndef YY_NO_INPUT */ 02103 02104 /** Immediately switch to a different input stream. 02105 * @param input_file A readable stream. 02106 * 02107 * @note This function does not reset the start condition to @c INITIAL . 02108 */ 02109 void llvmAsmrestart (FILE * input_file ) 02110 { 02111 02112 if ( ! YY_CURRENT_BUFFER ){ 02113 llvmAsmensure_buffer_stack (); 02114 YY_CURRENT_BUFFER_LVALUE = 02115 llvmAsm_create_buffer(llvmAsmin,YY_BUF_SIZE ); 02116 } 02117 02118 llvmAsm_init_buffer(YY_CURRENT_BUFFER,input_file ); 02119 llvmAsm_load_buffer_state( ); 02120 } 02121 02122 /** Switch to a different input buffer. 02123 * @param new_buffer The new input buffer. 02124 * 02125 */ 02126 void llvmAsm_switch_to_buffer (YY_BUFFER_STATE new_buffer ) 02127 { 02128 02129 /* TODO. We should be able to replace this entire function body 02130 * with 02131 * llvmAsmpop_buffer_state(); 02132 * llvmAsmpush_buffer_state(new_buffer); 02133 */ 02134 llvmAsmensure_buffer_stack (); 02135 if ( YY_CURRENT_BUFFER == new_buffer ) 02136 return; 02137 02138 if ( YY_CURRENT_BUFFER ) 02139 { 02140 /* Flush out information for old buffer. */ 02141 *(yy_c_buf_p) = (yy_hold_char); 02142 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); 02143 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 02144 } 02145 02146 YY_CURRENT_BUFFER_LVALUE = new_buffer; 02147 llvmAsm_load_buffer_state( ); 02148 02149 /* We don't actually know whether we did this switch during 02150 * EOF (llvmAsmwrap()) processing, but the only time this flag 02151 * is looked at is after llvmAsmwrap() is called, so it's safe 02152 * to go ahead and always set it. 02153 */ 02154 (yy_did_buffer_switch_on_eof) = 1; 02155 } 02156 02157 static void llvmAsm_load_buffer_state (void) 02158 { 02159 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 02160 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; 02161 llvmAsmin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; 02162 (yy_hold_char) = *(yy_c_buf_p); 02163 } 02164 02165 /** Allocate and initialize an input buffer state. 02166 * @param file A readable stream. 02167 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. 02168 * 02169 * @return the allocated buffer state. 02170 */ 02171 YY_BUFFER_STATE llvmAsm_create_buffer (FILE * file, int size ) 02172 { 02173 YY_BUFFER_STATE b; 02174 02175 b = (YY_BUFFER_STATE) llvmAsmalloc(sizeof( struct yy_buffer_state ) ); 02176 if ( ! b ) 02177 YY_FATAL_ERROR( "out of dynamic memory in llvmAsm_create_buffer()" ); 02178 02179 b->yy_buf_size = size; 02180 02181 /* yy_ch_buf has to be 2 characters longer than the size given because 02182 * we need to put in 2 end-of-buffer characters. 02183 */ 02184 b->yy_ch_buf = (char *) llvmAsmalloc(b->yy_buf_size + 2 ); 02185 if ( ! b->yy_ch_buf ) 02186 YY_FATAL_ERROR( "out of dynamic memory in llvmAsm_create_buffer()" ); 02187 02188 b->yy_is_our_buffer = 1; 02189 02190 llvmAsm_init_buffer(b,file ); 02191 02192 return b; 02193 } 02194 02195 /** Destroy the buffer. 02196 * @param b a buffer created with llvmAsm_create_buffer() 02197 * 02198 */ 02199 void llvmAsm_delete_buffer (YY_BUFFER_STATE b ) 02200 { 02201 02202 if ( ! b ) 02203 return; 02204 02205 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ 02206 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; 02207 02208 if ( b->yy_is_our_buffer ) 02209 llvmAsmfree((void *) b->yy_ch_buf ); 02210 02211 llvmAsmfree((void *) b ); 02212 } 02213 02214 /* Initializes or reinitializes a buffer. 02215 * This function is sometimes called more than once on the same buffer, 02216 * such as during a llvmAsmrestart() or at EOF. 02217 */ 02218 static void llvmAsm_init_buffer (YY_BUFFER_STATE b, FILE * file ) 02219 02220 { 02221 int oerrno = errno; 02222 02223 llvmAsm_flush_buffer(b ); 02224 02225 b->yy_input_file = file; 02226 b->yy_fill_buffer = 1; 02227 02228 /* If b is the current buffer, then llvmAsm_init_buffer was _probably_ 02229 * called from llvmAsmrestart() or through yy_get_next_buffer. 02230 * In that case, we don't want to reset the lineno or column. 02231 */ 02232 if (b != YY_CURRENT_BUFFER){ 02233 b->yy_bs_lineno = 1; 02234 b->yy_bs_column = 0; 02235 } 02236 02237 b->yy_is_interactive = 0; 02238 02239 errno = oerrno; 02240 } 02241 02242 /** Discard all buffered characters. On the next scan, YY_INPUT will be called. 02243 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. 02244 * 02245 */ 02246 void llvmAsm_flush_buffer (YY_BUFFER_STATE b ) 02247 { 02248 if ( ! b ) 02249 return; 02250 02251 b->yy_n_chars = 0; 02252 02253 /* We always need two end-of-buffer characters. The first causes 02254 * a transition to the end-of-buffer state. The second causes 02255 * a jam in that state. 02256 */ 02257 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; 02258 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; 02259 02260 b->yy_buf_pos = &b->yy_ch_buf[0]; 02261 02262 b->yy_at_bol = 1; 02263 b->yy_buffer_status = YY_BUFFER_NEW; 02264 02265 if ( b == YY_CURRENT_BUFFER ) 02266 llvmAsm_load_buffer_state( ); 02267 } 02268 02269 /** Pushes the new state onto the stack. The new state becomes 02270 * the current state. This function will allocate the stack 02271 * if necessary. 02272 * @param new_buffer The new state. 02273 * 02274 */ 02275 void llvmAsmpush_buffer_state (YY_BUFFER_STATE new_buffer ) 02276 { 02277 if (new_buffer == NULL) 02278 return; 02279 02280 llvmAsmensure_buffer_stack(); 02281 02282 /* This block is copied from llvmAsm_switch_to_buffer. */ 02283 if ( YY_CURRENT_BUFFER ) 02284 { 02285 /* Flush out information for old buffer. */ 02286 *(yy_c_buf_p) = (yy_hold_char); 02287 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); 02288 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 02289 } 02290 02291 /* Only push if top exists. Otherwise, replace top. */ 02292 if (YY_CURRENT_BUFFER) 02293 (yy_buffer_stack_top)++; 02294 YY_CURRENT_BUFFER_LVALUE = new_buffer; 02295 02296 /* copied from llvmAsm_switch_to_buffer. */ 02297 llvmAsm_load_buffer_state( ); 02298 (yy_did_buffer_switch_on_eof) = 1; 02299 } 02300 02301 /** Removes and deletes the top of the stack, if present. 02302 * The next element becomes the new top. 02303 * 02304 */ 02305 void llvmAsmpop_buffer_state (void) 02306 { 02307 if (!YY_CURRENT_BUFFER) 02308 return; 02309 02310 llvmAsm_delete_buffer(YY_CURRENT_BUFFER ); 02311 YY_CURRENT_BUFFER_LVALUE = NULL; 02312 if ((yy_buffer_stack_top) > 0) 02313 --(yy_buffer_stack_top); 02314 02315 if (YY_CURRENT_BUFFER) { 02316 llvmAsm_load_buffer_state( ); 02317 (yy_did_buffer_switch_on_eof) = 1; 02318 } 02319 } 02320 02321 /* Allocates the stack if it does not exist. 02322 * Guarantees space for at least one push. 02323 */ 02324 static void llvmAsmensure_buffer_stack (void) 02325 { 02326 int num_to_alloc; 02327 02328 if (!(yy_buffer_stack)) { 02329 02330 /* First allocation is just for 2 elements, since we don't know if this 02331 * scanner will even need a stack. We use 2 instead of 1 to avoid an 02332 * immediate realloc on the next call. 02333 */ 02334 num_to_alloc = 1; 02335 (yy_buffer_stack) = (struct yy_buffer_state**)llvmAsmalloc 02336 (num_to_alloc * sizeof(struct yy_buffer_state*) 02337 ); 02338 02339 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); 02340 02341 (yy_buffer_stack_max) = num_to_alloc; 02342 (yy_buffer_stack_top) = 0; 02343 return; 02344 } 02345 02346 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ 02347 02348 /* Increase the buffer to prepare for a possible push. */ 02349 int grow_size = 8 /* arbitrary grow size */; 02350 02351 num_to_alloc = (yy_buffer_stack_max) + grow_size; 02352 (yy_buffer_stack) = (struct yy_buffer_state**)llvmAsmrealloc 02353 ((yy_buffer_stack), 02354 num_to_alloc * sizeof(struct yy_buffer_state*) 02355 ); 02356 02357 /* zero only the new slots.*/ 02358 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); 02359 (yy_buffer_stack_max) = num_to_alloc; 02360 } 02361 } 02362 02363 /** Setup the input buffer state to scan directly from a user-specified character buffer. 02364 * @param base the character buffer 02365 * @param size the size in bytes of the character buffer 02366 * 02367 * @return the newly allocated buffer state object. 02368 */ 02369 YY_BUFFER_STATE llvmAsm_scan_buffer (char * base, yy_size_t size ) 02370 { 02371 YY_BUFFER_STATE b; 02372 02373 if ( size < 2 || 02374 base[size-2] != YY_END_OF_BUFFER_CHAR || 02375 base[size-1] != YY_END_OF_BUFFER_CHAR ) 02376 /* They forgot to leave room for the EOB's. */ 02377 return 0; 02378 02379 b = (YY_BUFFER_STATE) llvmAsmalloc(sizeof( struct yy_buffer_state ) ); 02380 if ( ! b ) 02381 YY_FATAL_ERROR( "out of dynamic memory in llvmAsm_scan_buffer()" ); 02382 02383 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ 02384 b->yy_buf_pos = b->yy_ch_buf = base; 02385 b->yy_is_our_buffer = 0; 02386 b->yy_input_file = 0; 02387 b->yy_n_chars = b->yy_buf_size; 02388 b->yy_is_interactive = 0; 02389 b->yy_at_bol = 1; 02390 b->yy_fill_buffer = 0; 02391 b->yy_buffer_status = YY_BUFFER_NEW; 02392 02393 llvmAsm_switch_to_buffer(b ); 02394 02395 return b; 02396 } 02397 02398 /** Setup the input buffer state to scan a string. The next call to llvmAsmlex() will 02399 * scan from a @e copy of @a str. 02400 * @param str a NUL-terminated string to scan 02401 * 02402 * @return the newly allocated buffer state object. 02403 * @note If you want to scan bytes that may contain NUL values, then use 02404 * llvmAsm_scan_bytes() instead. 02405 */ 02406 YY_BUFFER_STATE llvmAsm_scan_string (yyconst char * yy_str ) 02407 { 02408 02409 return llvmAsm_scan_bytes(yy_str,strlen(yy_str) ); 02410 } 02411 02412 /** Setup the input buffer state to scan the given bytes. The next call to llvmAsmlex() will 02413 * scan from a @e copy of @a bytes. 02414 * @param bytes the byte buffer to scan 02415 * @param len the number of bytes in the buffer pointed to by @a bytes. 02416 * 02417 * @return the newly allocated buffer state object. 02418 */ 02419 YY_BUFFER_STATE llvmAsm_scan_bytes (yyconst char * bytes, int len ) 02420 { 02421 YY_BUFFER_STATE b; 02422 char *buf; 02423 yy_size_t n; 02424 int i; 02425 02426 /* Get memory for full buffer, including space for trailing EOB's. */ 02427 n = len + 2; 02428 buf = (char *) llvmAsmalloc(n ); 02429 if ( ! buf ) 02430 YY_FATAL_ERROR( "out of dynamic memory in llvmAsm_scan_bytes()" ); 02431 02432 for ( i = 0; i < len; ++i ) 02433 buf[i] = bytes[i]; 02434 02435 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; 02436 02437 b = llvmAsm_scan_buffer(buf,n ); 02438 if ( ! b ) 02439 YY_FATAL_ERROR( "bad buffer in llvmAsm_scan_bytes()" ); 02440 02441 /* It's okay to grow etc. this buffer, and we should throw it 02442 * away when we're done. 02443 */ 02444 b->yy_is_our_buffer = 1; 02445 02446 return b; 02447 } 02448 02449 #ifndef YY_EXIT_FAILURE 02450 #define YY_EXIT_FAILURE 2 02451 #endif 02452 02453 static void yy_fatal_error (yyconst char* msg ) 02454 { 02455 (void) fprintf( stderr, "%s\n", msg ); 02456 exit( YY_EXIT_FAILURE ); 02457 } 02458 02459 /* Redefine yyless() so it works in section 3 code. */ 02460 02461 #undef yyless 02462 #define yyless(n) \ 02463 do \ 02464 { \ 02465 /* Undo effects of setting up llvmAsmtext. */ \ 02466 int yyless_macro_arg = (n); \ 02467 YY_LESS_LINENO(yyless_macro_arg);\ 02468 llvmAsmtext[llvmAsmleng] = (yy_hold_char); \ 02469 (yy_c_buf_p) = llvmAsmtext + yyless_macro_arg; \ 02470 (yy_hold_char) = *(yy_c_buf_p); \ 02471 *(yy_c_buf_p) = '\0'; \ 02472 llvmAsmleng = yyless_macro_arg; \ 02473 } \ 02474 while ( 0 ) 02475 02476 /* Accessor methods (get/set functions) to struct members. */ 02477 02478 /** Get the current line number. 02479 * 02480 */ 02481 int llvmAsmget_lineno (void) 02482 { 02483 02484 return llvmAsmlineno; 02485 } 02486 02487 /** Get the input stream. 02488 * 02489 */ 02490 FILE *llvmAsmget_in (void) 02491 { 02492 return llvmAsmin; 02493 } 02494 02495 /** Get the output stream. 02496 * 02497 */ 02498 FILE *llvmAsmget_out (void) 02499 { 02500 return llvmAsmout; 02501 } 02502 02503 /** Get the length of the current token. 02504 * 02505 */ 02506 int llvmAsmget_leng (void) 02507 { 02508 return llvmAsmleng; 02509 } 02510 02511 /** Get the current token. 02512 * 02513 */ 02514 02515 char *llvmAsmget_text (void) 02516 { 02517 return llvmAsmtext; 02518 } 02519 02520 /** Set the current line number. 02521 * @param line_number 02522 * 02523 */ 02524 void llvmAsmset_lineno (int line_number ) 02525 { 02526 02527 llvmAsmlineno = line_number; 02528 } 02529 02530 /** Set the input stream. This does not discard the current 02531 * input buffer. 02532 * @param in_str A readable stream. 02533 * 02534 * @see llvmAsm_switch_to_buffer 02535 */ 02536 void llvmAsmset_in (FILE * in_str ) 02537 { 02538 llvmAsmin = in_str ; 02539 } 02540 02541 void llvmAsmset_out (FILE * out_str ) 02542 { 02543 llvmAsmout = out_str ; 02544 } 02545 02546 int llvmAsmget_debug (void) 02547 { 02548 return llvmAsm_flex_debug; 02549 } 02550 02551 void llvmAsmset_debug (int bdebug ) 02552 { 02553 llvmAsm_flex_debug = bdebug ; 02554 } 02555 02556 /* llvmAsmlex_destroy is for both reentrant and non-reentrant scanners. */ 02557 int llvmAsmlex_destroy (void) 02558 { 02559 02560 /* Pop the buffer stack, destroying each element. */ 02561 while(YY_CURRENT_BUFFER){ 02562 llvmAsm_delete_buffer(YY_CURRENT_BUFFER ); 02563 YY_CURRENT_BUFFER_LVALUE = NULL; 02564 llvmAsmpop_buffer_state(); 02565 } 02566 02567 /* Destroy the stack itself. */ 02568 llvmAsmfree((yy_buffer_stack) ); 02569 (yy_buffer_stack) = NULL; 02570 02571 return 0; 02572 } 02573 02574 /* 02575 * Internal utility routines. 02576 */ 02577 02578 #ifndef yytext_ptr 02579 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) 02580 { 02581 register int i; 02582 for ( i = 0; i < n; ++i ) 02583 s1[i] = s2[i]; 02584 } 02585 #endif 02586 02587 #ifdef YY_NEED_STRLEN 02588 static int yy_flex_strlen (yyconst char * s ) 02589 { 02590 register int n; 02591 for ( n = 0; s[n]; ++n ) 02592 ; 02593 02594 return n; 02595 } 02596 #endif 02597 02598 void *llvmAsmalloc (yy_size_t size ) 02599 { 02600 return (void *) malloc( size ); 02601 } 02602 02603 void *llvmAsmrealloc (void * ptr, yy_size_t size ) 02604 { 02605 /* The cast to (char *) in the following accommodates both 02606 * implementations that use char* generic pointers, and those 02607 * that use void* generic pointers. It works with the latter 02608 * because both ANSI C and C++ allow castless assignment from 02609 * any pointer type to void*, and deal with argument conversions 02610 * as though doing an assignment. 02611 */ 02612 return (void *) realloc( (char *) ptr, size ); 02613 } 02614 02615 void llvmAsmfree (void * ptr ) 02616 { 02617 free( (char *) ptr ); /* see llvmAsmrealloc() for (char *) cast */ 02618 } 02619 02620 #define YYTABLES_NAME "yytables" 02621 02622 #undef YY_NEW_FILE 02623 #undef YY_FLUSH_BUFFER 02624 #undef yy_set_bol 02625 #undef yy_new_buffer 02626 #undef yy_set_interactive 02627 #undef yytext_ptr 02628 #undef YY_DO_BEFORE_ACTION 02629 02630 #ifdef YY_DECL_IS_OURS 02631 #undef YY_DECL_IS_OURS 02632 #undef YY_DECL 02633 #endif 02634 #line 322 "Lexer.l" 02635 02636 02637