OLD | NEW |
(Empty) | |
| 1 |
| 2 #line 3 "gen/errorscanner.cpp" |
| 3 |
| 4 #define YY_INT_ALIGNED short int |
| 5 |
| 6 /* A lexical scanner generated by flex */ |
| 7 |
| 8 #define FLEX_SCANNER |
| 9 #define YY_FLEX_MAJOR_VERSION 2 |
| 10 #define YY_FLEX_MINOR_VERSION 5 |
| 11 #define YY_FLEX_SUBMINOR_VERSION 35 |
| 12 #if YY_FLEX_SUBMINOR_VERSION > 0 |
| 13 #define FLEX_BETA |
| 14 #endif |
| 15 |
| 16 /* First, we deal with platform-specific or compiler-specific issues. */ |
| 17 |
| 18 /* begin standard C headers. */ |
| 19 #include <stdio.h> |
| 20 #include <string.h> |
| 21 #include <errno.h> |
| 22 #include <stdlib.h> |
| 23 |
| 24 /* end standard C headers. */ |
| 25 |
| 26 /* flex integer type definitions */ |
| 27 |
| 28 #ifndef FLEXINT_H |
| 29 #define FLEXINT_H |
| 30 |
| 31 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ |
| 32 |
| 33 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L |
| 34 |
| 35 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, |
| 36 * if you want the limit (max/min) macros for int types. |
| 37 */ |
| 38 #ifndef __STDC_LIMIT_MACROS |
| 39 #define __STDC_LIMIT_MACROS 1 |
| 40 #endif |
| 41 |
| 42 #include <inttypes.h> |
| 43 typedef int8_t flex_int8_t; |
| 44 typedef uint8_t flex_uint8_t; |
| 45 typedef int16_t flex_int16_t; |
| 46 typedef uint16_t flex_uint16_t; |
| 47 typedef int32_t flex_int32_t; |
| 48 typedef uint32_t flex_uint32_t; |
| 49 #else |
| 50 typedef signed char flex_int8_t; |
| 51 typedef short int flex_int16_t; |
| 52 typedef int flex_int32_t; |
| 53 typedef unsigned char flex_uint8_t; |
| 54 typedef unsigned short int flex_uint16_t; |
| 55 typedef unsigned int flex_uint32_t; |
| 56 |
| 57 /* Limits of integral types. */ |
| 58 #ifndef INT8_MIN |
| 59 #define INT8_MIN (-128) |
| 60 #endif |
| 61 #ifndef INT16_MIN |
| 62 #define INT16_MIN (-32767-1) |
| 63 #endif |
| 64 #ifndef INT32_MIN |
| 65 #define INT32_MIN (-2147483647-1) |
| 66 #endif |
| 67 #ifndef INT8_MAX |
| 68 #define INT8_MAX (127) |
| 69 #endif |
| 70 #ifndef INT16_MAX |
| 71 #define INT16_MAX (32767) |
| 72 #endif |
| 73 #ifndef INT32_MAX |
| 74 #define INT32_MAX (2147483647) |
| 75 #endif |
| 76 #ifndef UINT8_MAX |
| 77 #define UINT8_MAX (255U) |
| 78 #endif |
| 79 #ifndef UINT16_MAX |
| 80 #define UINT16_MAX (65535U) |
| 81 #endif |
| 82 #ifndef UINT32_MAX |
| 83 #define UINT32_MAX (4294967295U) |
| 84 #endif |
| 85 |
| 86 #endif /* ! C99 */ |
| 87 |
| 88 #endif /* ! FLEXINT_H */ |
| 89 |
| 90 #ifdef __cplusplus |
| 91 |
| 92 /* The "const" storage-class-modifier is valid. */ |
| 93 #define YY_USE_CONST |
| 94 |
| 95 #else /* ! __cplusplus */ |
| 96 |
| 97 /* C99 requires __STDC__ to be defined as 1. */ |
| 98 #if defined (__STDC__) |
| 99 |
| 100 #define YY_USE_CONST |
| 101 |
| 102 #endif /* defined (__STDC__) */ |
| 103 #endif /* ! __cplusplus */ |
| 104 |
| 105 #ifdef YY_USE_CONST |
| 106 #define yyconst const |
| 107 #else |
| 108 #define yyconst |
| 109 #endif |
| 110 |
| 111 /* Returned upon end-of-file. */ |
| 112 #define YY_NULL 0 |
| 113 |
| 114 /* Promotes a possibly negative, possibly signed char to an unsigned |
| 115 * integer for use as an array index. If the signed char is negative, |
| 116 * we want to instead treat it as an 8-bit unsigned char, hence the |
| 117 * double cast. |
| 118 */ |
| 119 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) |
| 120 |
| 121 /* An opaque pointer. */ |
| 122 #ifndef YY_TYPEDEF_YY_SCANNER_T |
| 123 #define YY_TYPEDEF_YY_SCANNER_T |
| 124 typedef void* yyscan_t; |
| 125 #endif |
| 126 |
| 127 /* For convenience, these vars (plus the bison vars far below) |
| 128 are macros in the reentrant scanner. */ |
| 129 #define yyin yyg->yyin_r |
| 130 #define yyout yyg->yyout_r |
| 131 #define yyextra yyg->yyextra_r |
| 132 #define yyleng yyg->yyleng_r |
| 133 #define yytext yyg->yytext_r |
| 134 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) |
| 135 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) |
| 136 #define yy_flex_debug yyg->yy_flex_debug_r |
| 137 |
| 138 /* Enter a start condition. This macro really ought to take a parameter, |
| 139 * but we do it the disgusting crufty way forced on us by the ()-less |
| 140 * definition of BEGIN. |
| 141 */ |
| 142 #define BEGIN yyg->yy_start = 1 + 2 * |
| 143 |
| 144 /* Translate the current start state into a value that can be later handed |
| 145 * to BEGIN to return to the state. The YYSTATE alias is for lex |
| 146 * compatibility. |
| 147 */ |
| 148 #define YY_START ((yyg->yy_start - 1) / 2) |
| 149 #define YYSTATE YY_START |
| 150 |
| 151 /* Action number for EOF rule of a given start state. */ |
| 152 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) |
| 153 |
| 154 /* Special action meaning "start processing a new file". */ |
| 155 #define YY_NEW_FILE error_restart(yyin ,yyscanner ) |
| 156 |
| 157 #define YY_END_OF_BUFFER_CHAR 0 |
| 158 |
| 159 /* Size of default input buffer. */ |
| 160 #ifndef YY_BUF_SIZE |
| 161 #ifdef __ia64__ |
| 162 /* On IA-64, the buffer size is 16k, not 8k. |
| 163 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. |
| 164 * Ditto for the __ia64__ case accordingly. |
| 165 */ |
| 166 #define YY_BUF_SIZE 32768 |
| 167 #else |
| 168 #define YY_BUF_SIZE 16384 |
| 169 #endif /* __ia64__ */ |
| 170 #endif |
| 171 |
| 172 /* The state buf must be large enough to hold one state per character in the mai
n buffer. |
| 173 */ |
| 174 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) |
| 175 |
| 176 #ifndef YY_TYPEDEF_YY_BUFFER_STATE |
| 177 #define YY_TYPEDEF_YY_BUFFER_STATE |
| 178 typedef struct yy_buffer_state *YY_BUFFER_STATE; |
| 179 #endif |
| 180 |
| 181 #define EOB_ACT_CONTINUE_SCAN 0 |
| 182 #define EOB_ACT_END_OF_FILE 1 |
| 183 #define EOB_ACT_LAST_MATCH 2 |
| 184 |
| 185 #define YY_LESS_LINENO(n) |
| 186 |
| 187 /* Return all but the first "n" matched characters back to the input stream. */ |
| 188 #define yyless(n) \ |
| 189 do \ |
| 190 { \ |
| 191 /* Undo effects of setting up yytext. */ \ |
| 192 int yyless_macro_arg = (n); \ |
| 193 YY_LESS_LINENO(yyless_macro_arg);\ |
| 194 *yy_cp = yyg->yy_hold_char; \ |
| 195 YY_RESTORE_YY_MORE_OFFSET \ |
| 196 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ
; \ |
| 197 YY_DO_BEFORE_ACTION; /* set up yytext again */ \ |
| 198 } \ |
| 199 while ( 0 ) |
| 200 |
| 201 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) |
| 202 |
| 203 #ifndef YY_TYPEDEF_YY_SIZE_T |
| 204 #define YY_TYPEDEF_YY_SIZE_T |
| 205 typedef size_t yy_size_t; |
| 206 #endif |
| 207 |
| 208 #ifndef YY_STRUCT_YY_BUFFER_STATE |
| 209 #define YY_STRUCT_YY_BUFFER_STATE |
| 210 struct yy_buffer_state |
| 211 { |
| 212 FILE *yy_input_file; |
| 213 |
| 214 char *yy_ch_buf; /* input buffer */ |
| 215 char *yy_buf_pos; /* current position in input buffer */ |
| 216 |
| 217 /* Size of input buffer in bytes, not including room for EOB |
| 218 * characters. |
| 219 */ |
| 220 yy_size_t yy_buf_size; |
| 221 |
| 222 /* Number of characters read into yy_ch_buf, not including EOB |
| 223 * characters. |
| 224 */ |
| 225 int yy_n_chars; |
| 226 |
| 227 /* Whether we "own" the buffer - i.e., we know we created it, |
| 228 * and can realloc() it to grow it, and should free() it to |
| 229 * delete it. |
| 230 */ |
| 231 int yy_is_our_buffer; |
| 232 |
| 233 /* Whether this is an "interactive" input source; if so, and |
| 234 * if we're using stdio for input, then we want to use getc() |
| 235 * instead of fread(), to make sure we stop fetching input after |
| 236 * each newline. |
| 237 */ |
| 238 int yy_is_interactive; |
| 239 |
| 240 /* Whether we're considered to be at the beginning of a line. |
| 241 * If so, '^' rules will be active on the next match, otherwise |
| 242 * not. |
| 243 */ |
| 244 int yy_at_bol; |
| 245 |
| 246 int yy_bs_lineno; /**< The line count. */ |
| 247 int yy_bs_column; /**< The column count. */ |
| 248 |
| 249 /* Whether to try to fill the input buffer when we reach the |
| 250 * end of it. |
| 251 */ |
| 252 int yy_fill_buffer; |
| 253 |
| 254 int yy_buffer_status; |
| 255 |
| 256 #define YY_BUFFER_NEW 0 |
| 257 #define YY_BUFFER_NORMAL 1 |
| 258 /* When an EOF's been seen but there's still some text to process |
| 259 * then we mark the buffer as YY_EOF_PENDING, to indicate that we |
| 260 * shouldn't try reading from the input source any more. We might |
| 261 * still have a bunch of tokens to match, though, because of |
| 262 * possible backing-up. |
| 263 * |
| 264 * When we actually see the EOF, we change the status to "new" |
| 265 * (via error_restart()), so that the user can continue scanning by |
| 266 * just pointing yyin at a new input file. |
| 267 */ |
| 268 #define YY_BUFFER_EOF_PENDING 2 |
| 269 |
| 270 }; |
| 271 #endif /* !YY_STRUCT_YY_BUFFER_STATE */ |
| 272 |
| 273 /* We provide macros for accessing buffer states in case in the |
| 274 * future we want to put the buffer states in a more general |
| 275 * "scanner state". |
| 276 * |
| 277 * Returns the top of the stack, or NULL. |
| 278 */ |
| 279 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ |
| 280 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ |
| 281 : NULL) |
| 282 |
| 283 /* Same as previous macro, but useful when we know that the buffer stack is not |
| 284 * NULL or when we need an lvalue. For internal use only. |
| 285 */ |
| 286 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] |
| 287 |
| 288 void error_restart (FILE *input_file ,yyscan_t yyscanner ); |
| 289 void error__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); |
| 290 YY_BUFFER_STATE error__create_buffer (FILE *file,int size ,yyscan_t yyscanner ); |
| 291 void error__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); |
| 292 void error__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); |
| 293 void error_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); |
| 294 void error_pop_buffer_state (yyscan_t yyscanner ); |
| 295 |
| 296 static void error_ensure_buffer_stack (yyscan_t yyscanner ); |
| 297 static void error__load_buffer_state (yyscan_t yyscanner ); |
| 298 static void error__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner
); |
| 299 |
| 300 #define YY_FLUSH_BUFFER error__flush_buffer(YY_CURRENT_BUFFER ,yyscanner) |
| 301 |
| 302 YY_BUFFER_STATE error__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanne
r ); |
| 303 YY_BUFFER_STATE error__scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); |
| 304 YY_BUFFER_STATE error__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscann
er ); |
| 305 |
| 306 void *error_alloc (yy_size_t ,yyscan_t yyscanner ); |
| 307 void *error_realloc (void *,yy_size_t ,yyscan_t yyscanner ); |
| 308 void error_free (void * ,yyscan_t yyscanner ); |
| 309 |
| 310 #define yy_new_buffer error__create_buffer |
| 311 |
| 312 #define yy_set_interactive(is_interactive) \ |
| 313 { \ |
| 314 if ( ! YY_CURRENT_BUFFER ){ \ |
| 315 error_ensure_buffer_stack (yyscanner); \ |
| 316 YY_CURRENT_BUFFER_LVALUE = \ |
| 317 error__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ |
| 318 } \ |
| 319 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ |
| 320 } |
| 321 |
| 322 #define yy_set_bol(at_bol) \ |
| 323 { \ |
| 324 if ( ! YY_CURRENT_BUFFER ){\ |
| 325 error_ensure_buffer_stack (yyscanner); \ |
| 326 YY_CURRENT_BUFFER_LVALUE = \ |
| 327 error__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ |
| 328 } \ |
| 329 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ |
| 330 } |
| 331 |
| 332 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) |
| 333 |
| 334 /* Begin user sect3 */ |
| 335 |
| 336 #define error_wrap(n) 1 |
| 337 #define YY_SKIP_YYWRAP |
| 338 |
| 339 typedef unsigned char YY_CHAR; |
| 340 |
| 341 typedef int yy_state_type; |
| 342 |
| 343 #define yytext_ptr yytext_r |
| 344 |
| 345 static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); |
| 346 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yy
scanner); |
| 347 static int yy_get_next_buffer (yyscan_t yyscanner ); |
| 348 static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); |
| 349 |
| 350 /* Done after the current pattern has been matched and before the |
| 351 * corresponding action - sets up yytext. |
| 352 */ |
| 353 #define YY_DO_BEFORE_ACTION \ |
| 354 yyg->yytext_ptr = yy_bp; \ |
| 355 yyleng = (size_t) (yy_cp - yy_bp); \ |
| 356 yyg->yy_hold_char = *yy_cp; \ |
| 357 *yy_cp = '\0'; \ |
| 358 yyg->yy_c_buf_p = yy_cp; |
| 359 |
| 360 #define YY_NUM_RULES 28 |
| 361 #define YY_END_OF_BUFFER 29 |
| 362 /* This struct is not used in this scanner, |
| 363 but its presence is necessary. */ |
| 364 struct yy_trans_info |
| 365 { |
| 366 flex_int32_t yy_verify; |
| 367 flex_int32_t yy_nxt; |
| 368 }; |
| 369 static yyconst flex_int16_t yy_accept[263] = |
| 370 { 0, |
| 371 0, 0, 29, 27, 5, 2, 1, 3, 26, 4, |
| 372 25, 25, 5, 26, 25, 25, 25, 25, 25, 25, |
| 373 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, |
| 374 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, |
| 375 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, |
| 376 16, 25, 25, 25, 25, 25, 25, 25, 25, 25, |
| 377 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, |
| 378 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, |
| 379 25, 25, 25, 25, 25, 15, 25, 25, 25, 25, |
| 380 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, |
| 381 |
| 382 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, |
| 383 25, 25, 25, 25, 25, 25, 25, 22, 25, 25, |
| 384 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, |
| 385 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, |
| 386 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, |
| 387 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, |
| 388 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, |
| 389 25, 25, 25, 25, 25, 25, 25, 25, 24, 25, |
| 390 25, 25, 25, 25, 25, 25, 25, 6, 25, 25, |
| 391 25, 25, 11, 10, 25, 25, 25, 25, 25, 20, |
| 392 |
| 393 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, |
| 394 25, 7, 25, 25, 25, 23, 25, 25, 25, 25, |
| 395 12, 25, 25, 25, 25, 25, 25, 25, 25, 19, |
| 396 8, 25, 14, 25, 25, 13, 25, 25, 25, 25, |
| 397 25, 25, 9, 25, 25, 25, 25, 25, 25, 25, |
| 398 25, 25, 25, 25, 25, 18, 25, 17, 25, 25, |
| 399 21, 0 |
| 400 } ; |
| 401 |
| 402 static yyconst flex_int32_t yy_ec[256] = |
| 403 { 0, |
| 404 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, |
| 405 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, |
| 406 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 407 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, |
| 408 1, 1, 1, 5, 6, 1, 1, 7, 7, 8, |
| 409 9, 7, 7, 7, 7, 7, 7, 10, 1, 1, |
| 410 1, 1, 1, 1, 11, 12, 13, 14, 15, 16, |
| 411 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, |
| 412 27, 28, 29, 30, 31, 32, 33, 20, 34, 20, |
| 413 1, 1, 1, 1, 35, 1, 36, 37, 38, 39, |
| 414 |
| 415 40, 41, 42, 43, 44, 20, 45, 46, 47, 48, |
| 416 49, 50, 51, 52, 53, 54, 55, 56, 57, 20, |
| 417 58, 20, 1, 1, 1, 1, 1, 1, 1, 1, |
| 418 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 419 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 420 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 421 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 422 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 423 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 424 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 425 |
| 426 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 427 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 428 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 429 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 430 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 431 1, 1, 1, 1, 1 |
| 432 } ; |
| 433 |
| 434 static yyconst flex_int32_t yy_meta[59] = |
| 435 { 0, |
| 436 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, |
| 437 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 438 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 439 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 440 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 441 2, 2, 2, 2, 2, 2, 2, 2 |
| 442 } ; |
| 443 |
| 444 static yyconst flex_int16_t yy_base[266] = |
| 445 { 0, |
| 446 0, 10, 496, 513, 490, 513, 513, 513, 14, 513, |
| 447 0, 8, 489, 18, 0, 14, 452, 59, 15, 0, |
| 448 11, 15, 27, 9, 13, 9, 12, 25, 27, 450, |
| 449 36, 423, 32, 53, 29, 61, 52, 66, 52, 81, |
| 450 74, 82, 82, 54, 81, 86, 90, 92, 94, 97, |
| 451 0, 401, 108, 96, 104, 112, 118, 117, 114, 110, |
| 452 111, 114, 124, 126, 121, 123, 120, 136, 138, 140, |
| 453 149, 148, 379, 143, 156, 358, 145, 144, 158, 151, |
| 454 162, 168, 166, 155, 160, 0, 173, 171, 174, 352, |
| 455 174, 178, 170, 330, 164, 170, 187, 171, 182, 185, |
| 456 |
| 457 185, 185, 192, 210, 207, 207, 200, 203, 219, 204, |
| 458 209, 297, 255, 248, 204, 221, 227, 233, 196, 214, |
| 459 211, 217, 147, 231, 220, 221, 225, 228, 228, 245, |
| 460 247, 253, 239, 243, 249, 262, 246, 251, 264, 267, |
| 461 107, 258, 99, 258, 269, 275, 262, 44, 275, 282, |
| 462 284, 289, 283, 281, 281, 296, 298, 30, 286, 292, |
| 463 294, 293, 290, 307, 298, 296, 299, 312, 309, 324, |
| 464 310, 310, 325, 319, 314, 320, 330, 338, 0, 335, |
| 465 334, 328, 337, 339, 347, 336, 344, 0, 359, 348, |
| 466 350, 356, 0, 0, 349, 17, 358, 359, 367, 0, |
| 467 |
| 468 359, 381, 370, 370, 384, 388, 377, 373, 391, 393, |
| 469 379, 0, 380, 396, 385, 0, 386, 397, 392, 13, |
| 470 0, 387, 394, 410, 400, 411, 424, 415, 428, 0, |
| 471 0, 12, 0, 421, 414, 0, 431, 419, 427, 7, |
| 472 426, 435, 0, 433, 446, 436, 437, 451, 445, 451, |
| 473 449, 447, 454, 452, 460, 0, 459, 0, 451, 450, |
| 474 0, 513, 508, 510, 4 |
| 475 } ; |
| 476 |
| 477 static yyconst flex_int16_t yy_def[266] = |
| 478 { 0, |
| 479 263, 264, 262, 262, 262, 262, 262, 262, 262, 262, |
| 480 265, 265, 262, 262, 265, 265, 265, 265, 265, 265, |
| 481 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, |
| 482 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, |
| 483 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, |
| 484 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, |
| 485 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, |
| 486 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, |
| 487 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, |
| 488 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, |
| 489 |
| 490 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, |
| 491 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, |
| 492 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, |
| 493 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, |
| 494 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, |
| 495 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, |
| 496 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, |
| 497 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, |
| 498 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, |
| 499 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, |
| 500 |
| 501 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, |
| 502 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, |
| 503 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, |
| 504 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, |
| 505 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, |
| 506 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, |
| 507 265, 0, 262, 262, 262 |
| 508 } ; |
| 509 |
| 510 static yyconst flex_int16_t yy_nxt[572] = |
| 511 { 0, |
| 512 262, 5, 6, 7, 8, 15, 9, 9, 9, 10, |
| 513 4, 5, 6, 7, 8, 4, 9, 9, 9, 10, |
| 514 14, 14, 14, 16, 14, 14, 14, 17, 30, 262, |
| 515 31, 32, 33, 35, 36, 34, 38, 39, 40, 41, |
| 516 37, 244, 12, 42, 4, 43, 238, 229, 16, 45, |
| 517 47, 208, 17, 30, 31, 32, 33, 50, 35, 34, |
| 518 38, 39, 40, 41, 174, 37, 12, 19, 42, 20, |
| 519 43, 21, 22, 51, 45, 47, 48, 23, 164, 52, |
| 520 53, 50, 54, 49, 24, 59, 25, 26, 27, 28, |
| 521 29, 55, 56, 57, 20, 58, 21, 22, 51, 60, |
| 522 |
| 523 48, 61, 23, 52, 62, 53, 54, 49, 24, 59, |
| 524 25, 26, 27, 28, 29, 63, 55, 56, 57, 65, |
| 525 58, 64, 66, 68, 60, 70, 61, 71, 72, 62, |
| 526 73, 74, 75, 159, 76, 77, 69, 78, 79, 63, |
| 527 80, 157, 81, 65, 82, 64, 66, 83, 68, 70, |
| 528 84, 71, 85, 72, 86, 73, 74, 75, 76, 77, |
| 529 69, 78, 87, 79, 88, 80, 81, 90, 82, 91, |
| 530 95, 83, 93, 94, 96, 84, 97, 85, 98, 86, |
| 531 99, 139, 100, 101, 102, 103, 104, 87, 107, 88, |
| 532 108, 90, 109, 111, 91, 95, 93, 94, 96, 112, |
| 533 |
| 534 113, 97, 105, 98, 114, 99, 100, 101, 115, 102, |
| 535 103, 104, 116, 107, 117, 108, 109, 111, 118, 119, |
| 536 120, 121, 122, 112, 123, 113, 105, 124, 114, 125, |
| 537 135, 126, 115, 127, 131, 132, 116, 133, 117, 136, |
| 538 137, 138, 118, 119, 140, 120, 121, 122, 123, 141, |
| 539 142, 124, 143, 144, 125, 126, 145, 127, 131, 146, |
| 540 132, 147, 133, 136, 137, 138, 148, 134, 149, 140, |
| 541 150, 151, 152, 141, 142, 153, 143, 144, 154, 155, |
| 542 145, 156, 130, 158, 146, 160, 147, 161, 162, 129, |
| 543 163, 148, 149, 165, 150, 151, 166, 152, 167, 153, |
| 544 |
| 545 168, 169, 154, 170, 155, 171, 156, 158, 172, 160, |
| 546 173, 178, 161, 162, 163, 175, 176, 177, 165, 179, |
| 547 180, 166, 181, 167, 182, 168, 169, 170, 183, 171, |
| 548 184, 128, 185, 172, 186, 173, 178, 187, 188, 175, |
| 549 176, 177, 189, 179, 190, 180, 181, 191, 182, 192, |
| 550 193, 194, 183, 195, 198, 184, 185, 196, 197, 186, |
| 551 199, 187, 188, 200, 110, 201, 202, 189, 190, 203, |
| 552 206, 191, 204, 192, 193, 205, 194, 207, 195, 198, |
| 553 209, 196, 197, 210, 199, 211, 106, 212, 200, 201, |
| 554 202, 213, 92, 214, 203, 206, 204, 215, 216, 205, |
| 555 |
| 556 217, 207, 218, 219, 209, 220, 221, 210, 222, 223, |
| 557 211, 212, 224, 89, 225, 226, 213, 214, 227, 228, |
| 558 230, 215, 231, 216, 232, 217, 218, 219, 233, 234, |
| 559 220, 221, 222, 223, 235, 67, 236, 224, 225, 226, |
| 560 237, 241, 227, 228, 230, 239, 231, 240, 242, 232, |
| 561 243, 245, 233, 246, 234, 247, 248, 46, 249, 235, |
| 562 236, 250, 251, 252, 253, 237, 241, 254, 256, 239, |
| 563 255, 240, 242, 257, 243, 245, 258, 259, 246, 247, |
| 564 260, 248, 249, 261, 44, 250, 18, 251, 252, 253, |
| 565 13, 13, 254, 256, 255, 262, 262, 257, 262, 262, |
| 566 |
| 567 262, 258, 259, 262, 260, 262, 262, 261, 4, 4, |
| 568 11, 11, 3, 262, 262, 262, 262, 262, 262, 262, |
| 569 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, |
| 570 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, |
| 571 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, |
| 572 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, |
| 573 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, |
| 574 262 |
| 575 } ; |
| 576 |
| 577 static yyconst flex_int16_t yy_chk[572] = |
| 578 { 0, |
| 579 0, 1, 1, 1, 1, 265, 1, 1, 1, 1, |
| 580 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 581 9, 9, 9, 12, 14, 14, 14, 16, 19, 0, |
| 582 20, 20, 21, 22, 23, 21, 24, 25, 26, 27, |
| 583 23, 240, 2, 28, 2, 29, 232, 220, 12, 31, |
| 584 33, 196, 16, 19, 20, 20, 21, 35, 22, 21, |
| 585 24, 25, 26, 27, 158, 23, 2, 18, 28, 18, |
| 586 29, 18, 18, 36, 31, 33, 34, 18, 148, 37, |
| 587 38, 35, 39, 34, 18, 44, 18, 18, 18, 18, |
| 588 18, 40, 41, 42, 18, 43, 18, 18, 36, 45, |
| 589 |
| 590 34, 46, 18, 37, 47, 38, 39, 34, 18, 44, |
| 591 18, 18, 18, 18, 18, 48, 40, 41, 42, 49, |
| 592 43, 48, 50, 53, 45, 54, 46, 55, 56, 47, |
| 593 57, 58, 59, 143, 60, 61, 53, 62, 63, 48, |
| 594 64, 141, 65, 49, 66, 48, 50, 67, 53, 54, |
| 595 68, 55, 69, 56, 70, 57, 58, 59, 60, 61, |
| 596 53, 62, 71, 63, 72, 64, 65, 74, 66, 75, |
| 597 79, 67, 77, 78, 80, 68, 81, 69, 82, 70, |
| 598 83, 123, 84, 85, 87, 88, 89, 71, 91, 72, |
| 599 92, 74, 93, 95, 75, 79, 77, 78, 80, 96, |
| 600 |
| 601 97, 81, 89, 82, 98, 83, 84, 85, 99, 87, |
| 602 88, 89, 100, 91, 101, 92, 93, 95, 102, 103, |
| 603 104, 105, 106, 96, 107, 97, 89, 108, 98, 109, |
| 604 119, 110, 99, 111, 115, 116, 100, 117, 101, 120, |
| 605 121, 122, 102, 103, 124, 104, 105, 106, 107, 125, |
| 606 126, 108, 127, 128, 109, 110, 129, 111, 115, 130, |
| 607 116, 131, 117, 120, 121, 122, 132, 118, 133, 124, |
| 608 134, 135, 136, 125, 126, 137, 127, 128, 138, 139, |
| 609 129, 140, 114, 142, 130, 144, 131, 145, 146, 113, |
| 610 147, 132, 133, 149, 134, 135, 150, 136, 151, 137, |
| 611 |
| 612 152, 153, 138, 154, 139, 155, 140, 142, 156, 144, |
| 613 157, 162, 145, 146, 147, 159, 160, 161, 149, 163, |
| 614 164, 150, 165, 151, 166, 152, 153, 154, 167, 155, |
| 615 168, 112, 169, 156, 170, 157, 162, 171, 172, 159, |
| 616 160, 161, 173, 163, 174, 164, 165, 175, 166, 176, |
| 617 177, 178, 167, 180, 183, 168, 169, 181, 182, 170, |
| 618 184, 171, 172, 185, 94, 186, 187, 173, 174, 189, |
| 619 192, 175, 190, 176, 177, 191, 178, 195, 180, 183, |
| 620 197, 181, 182, 198, 184, 199, 90, 201, 185, 186, |
| 621 187, 202, 76, 203, 189, 192, 190, 204, 205, 191, |
| 622 |
| 623 206, 195, 207, 208, 197, 209, 210, 198, 211, 213, |
| 624 199, 201, 214, 73, 215, 217, 202, 203, 218, 219, |
| 625 222, 204, 223, 205, 224, 206, 207, 208, 225, 226, |
| 626 209, 210, 211, 213, 227, 52, 228, 214, 215, 217, |
| 627 229, 237, 218, 219, 222, 234, 223, 235, 238, 224, |
| 628 239, 241, 225, 242, 226, 244, 245, 32, 246, 227, |
| 629 228, 247, 248, 249, 250, 229, 237, 251, 253, 234, |
| 630 252, 235, 238, 254, 239, 241, 255, 257, 242, 244, |
| 631 259, 245, 246, 260, 30, 247, 17, 248, 249, 250, |
| 632 13, 5, 251, 253, 252, 3, 0, 254, 0, 0, |
| 633 |
| 634 0, 255, 257, 0, 259, 0, 0, 260, 263, 263, |
| 635 264, 264, 262, 262, 262, 262, 262, 262, 262, 262, |
| 636 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, |
| 637 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, |
| 638 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, |
| 639 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, |
| 640 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, |
| 641 262 |
| 642 } ; |
| 643 |
| 644 /* The intent behind this definition is that it'll catch |
| 645 * any uses of REJECT which flex missed. |
| 646 */ |
| 647 #define REJECT reject_used_but_not_detected |
| 648 #define yymore() yymore_used_but_not_detected |
| 649 #define YY_MORE_ADJ 0 |
| 650 #define YY_RESTORE_YY_MORE_OFFSET |
| 651 /* |
| 652 * This file is part of Wireless Display Software for Linux OS |
| 653 * |
| 654 * Copyright (C) 2015 Intel Corporation. |
| 655 * |
| 656 * This library is free software; you can redistribute it and/or |
| 657 * modify it under the terms of the GNU Lesser General Public |
| 658 * License as published by the Free Software Foundation; either |
| 659 * version 2.1 of the License, or (at your option) any later version. |
| 660 * |
| 661 * This library is distributed in the hope that it will be useful, |
| 662 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 663 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 664 * Lesser General Public License for more details. |
| 665 * |
| 666 * You should have received a copy of the GNU Lesser General Public |
| 667 * License along with this library; if not, write to the Free Software |
| 668 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
| 669 * 02110-1301 USA |
| 670 */ |
| 671 |
| 672 #include <string> |
| 673 #include "parser.h" |
| 674 #define yyterminate() return(END) |
| 675 |
| 676 #define INITIAL 0 |
| 677 |
| 678 #ifndef YY_NO_UNISTD_H |
| 679 /* Special case for "unistd.h", since it is non-ANSI. We include it way |
| 680 * down here because we want the user's section 1 to have been scanned first. |
| 681 * The user has a chance to override it with an option. |
| 682 */ |
| 683 #include <unistd.h> |
| 684 #endif |
| 685 |
| 686 #define YY_EXTRA_TYPE bool |
| 687 |
| 688 /* Holds the entire state of the reentrant scanner. */ |
| 689 struct yyguts_t |
| 690 { |
| 691 |
| 692 /* User-defined. Not touched by flex. */ |
| 693 YY_EXTRA_TYPE yyextra_r; |
| 694 |
| 695 /* The rest are the same as the globals declared in the non-reentrant scanne
r. */ |
| 696 FILE *yyin_r, *yyout_r; |
| 697 size_t yy_buffer_stack_top; /**< index of top of stack. */ |
| 698 size_t yy_buffer_stack_max; /**< capacity of stack. */ |
| 699 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ |
| 700 char yy_hold_char; |
| 701 int yy_n_chars; |
| 702 int yyleng_r; |
| 703 char *yy_c_buf_p; |
| 704 int yy_init; |
| 705 int yy_start; |
| 706 int yy_did_buffer_switch_on_eof; |
| 707 int yy_start_stack_ptr; |
| 708 int yy_start_stack_depth; |
| 709 int *yy_start_stack; |
| 710 yy_state_type yy_last_accepting_state; |
| 711 char* yy_last_accepting_cpos; |
| 712 |
| 713 int yylineno_r; |
| 714 int yy_flex_debug_r; |
| 715 |
| 716 char *yytext_r; |
| 717 int yy_more_flag; |
| 718 int yy_more_len; |
| 719 |
| 720 YYSTYPE * yylval_r; |
| 721 |
| 722 }; /* end struct yyguts_t */ |
| 723 |
| 724 static int yy_init_globals (yyscan_t yyscanner ); |
| 725 |
| 726 /* This must go here because YYSTYPE and YYLTYPE are included |
| 727 * from bison output in section 1.*/ |
| 728 # define yylval yyg->yylval_r |
| 729 |
| 730 int error_lex_init (yyscan_t* scanner); |
| 731 |
| 732 int error_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); |
| 733 |
| 734 /* Accessor methods to globals. |
| 735 These are made visible to non-reentrant scanners for convenience. */ |
| 736 |
| 737 int error_lex_destroy (yyscan_t yyscanner ); |
| 738 |
| 739 int error_get_debug (yyscan_t yyscanner ); |
| 740 |
| 741 void error_set_debug (int debug_flag ,yyscan_t yyscanner ); |
| 742 |
| 743 YY_EXTRA_TYPE error_get_extra (yyscan_t yyscanner ); |
| 744 |
| 745 void error_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); |
| 746 |
| 747 FILE *error_get_in (yyscan_t yyscanner ); |
| 748 |
| 749 void error_set_in (FILE * in_str ,yyscan_t yyscanner ); |
| 750 |
| 751 FILE *error_get_out (yyscan_t yyscanner ); |
| 752 |
| 753 void error_set_out (FILE * out_str ,yyscan_t yyscanner ); |
| 754 |
| 755 int error_get_leng (yyscan_t yyscanner ); |
| 756 |
| 757 char *error_get_text (yyscan_t yyscanner ); |
| 758 |
| 759 int error_get_lineno (yyscan_t yyscanner ); |
| 760 |
| 761 void error_set_lineno (int line_number ,yyscan_t yyscanner ); |
| 762 |
| 763 YYSTYPE * error_get_lval (yyscan_t yyscanner ); |
| 764 |
| 765 void error_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); |
| 766 |
| 767 /* Macros after this point can all be overridden by user definitions in |
| 768 * section 1. |
| 769 */ |
| 770 |
| 771 #ifndef YY_SKIP_YYWRAP |
| 772 #ifdef __cplusplus |
| 773 extern "C" int error_wrap (yyscan_t yyscanner ); |
| 774 #else |
| 775 extern int error_wrap (yyscan_t yyscanner ); |
| 776 #endif |
| 777 #endif |
| 778 |
| 779 #ifndef yytext_ptr |
| 780 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); |
| 781 #endif |
| 782 |
| 783 #ifdef YY_NEED_STRLEN |
| 784 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); |
| 785 #endif |
| 786 |
| 787 #ifndef YY_NO_INPUT |
| 788 |
| 789 #ifdef __cplusplus |
| 790 static int yyinput (yyscan_t yyscanner ); |
| 791 #else |
| 792 static int input (yyscan_t yyscanner ); |
| 793 #endif |
| 794 |
| 795 #endif |
| 796 |
| 797 /* Amount of stuff to slurp up with each read. */ |
| 798 #ifndef YY_READ_BUF_SIZE |
| 799 #ifdef __ia64__ |
| 800 /* On IA-64, the buffer size is 16k, not 8k */ |
| 801 #define YY_READ_BUF_SIZE 16384 |
| 802 #else |
| 803 #define YY_READ_BUF_SIZE 8192 |
| 804 #endif /* __ia64__ */ |
| 805 #endif |
| 806 |
| 807 /* Copy whatever the last rule matched to the standard output. */ |
| 808 #ifndef ECHO |
| 809 /* This used to be an fputs(), but since the string might contain NUL's, |
| 810 * we now use fwrite(). |
| 811 */ |
| 812 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) |
| 813 #endif |
| 814 |
| 815 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, |
| 816 * is returned in "result". |
| 817 */ |
| 818 #ifndef YY_INPUT |
| 819 #define YY_INPUT(buf,result,max_size) \ |
| 820 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ |
| 821 { \ |
| 822 int c = '*'; \ |
| 823 size_t n; \ |
| 824 for ( n = 0; n < max_size && \ |
| 825 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ |
| 826 buf[n] = (char) c; \ |
| 827 if ( c == '\n' ) \ |
| 828 buf[n++] = (char) c; \ |
| 829 if ( c == EOF && ferror( yyin ) ) \ |
| 830 YY_FATAL_ERROR( "input in flex scanner failed" ); \ |
| 831 result = n; \ |
| 832 } \ |
| 833 else \ |
| 834 { \ |
| 835 errno=0; \ |
| 836 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yy
in)) \ |
| 837 { \ |
| 838 if( errno != EINTR) \ |
| 839 { \ |
| 840 YY_FATAL_ERROR( "input in flex scanner failed" )
; \ |
| 841 break; \ |
| 842 } \ |
| 843 errno=0; \ |
| 844 clearerr(yyin); \ |
| 845 } \ |
| 846 }\ |
| 847 \ |
| 848 |
| 849 #endif |
| 850 |
| 851 /* No semi-colon after return; correct usage is to write "yyterminate();" - |
| 852 * we don't want an extra ';' after the "return" because that will cause |
| 853 * some compilers to complain about unreachable statements. |
| 854 */ |
| 855 #ifndef yyterminate |
| 856 #define yyterminate() return YY_NULL |
| 857 #endif |
| 858 |
| 859 /* Number of entries by which start-condition stack grows. */ |
| 860 #ifndef YY_START_STACK_INCR |
| 861 #define YY_START_STACK_INCR 25 |
| 862 #endif |
| 863 |
| 864 /* Report a fatal error. */ |
| 865 #ifndef YY_FATAL_ERROR |
| 866 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) |
| 867 #endif |
| 868 |
| 869 /* end tables serialization structures and prototypes */ |
| 870 |
| 871 /* Default declaration of generated scanner - a define so the user can |
| 872 * easily add parameters. |
| 873 */ |
| 874 #ifndef YY_DECL |
| 875 #define YY_DECL_IS_OURS 1 |
| 876 |
| 877 extern int error_lex \ |
| 878 (YYSTYPE * yylval_param ,yyscan_t yyscanner); |
| 879 |
| 880 #define YY_DECL int error_lex \ |
| 881 (YYSTYPE * yylval_param , yyscan_t yyscanner) |
| 882 #endif /* !YY_DECL */ |
| 883 |
| 884 /* Code executed at the beginning of each rule, after yytext and yyleng |
| 885 * have been set up. |
| 886 */ |
| 887 #ifndef YY_USER_ACTION |
| 888 #define YY_USER_ACTION |
| 889 #endif |
| 890 |
| 891 /* Code executed at the end of each rule. */ |
| 892 #ifndef YY_BREAK |
| 893 #define YY_BREAK break; |
| 894 #endif |
| 895 |
| 896 #define YY_RULE_SETUP \ |
| 897 if ( yyleng > 0 ) \ |
| 898 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ |
| 899 (yytext[yyleng - 1] == '\n'); \ |
| 900 YY_USER_ACTION |
| 901 |
| 902 /** The main scanner function which does all the work. |
| 903 */ |
| 904 YY_DECL |
| 905 { |
| 906 register yy_state_type yy_current_state; |
| 907 register char *yy_cp, *yy_bp; |
| 908 register int yy_act; |
| 909 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 910 |
| 911 /* skip these */ |
| 912 |
| 913 yylval = yylval_param; |
| 914 |
| 915 if ( !yyg->yy_init ) |
| 916 { |
| 917 yyg->yy_init = 1; |
| 918 |
| 919 #ifdef YY_USER_INIT |
| 920 YY_USER_INIT; |
| 921 #endif |
| 922 |
| 923 if ( ! yyg->yy_start ) |
| 924 yyg->yy_start = 1; /* first start state */ |
| 925 |
| 926 if ( ! yyin ) |
| 927 yyin = stdin; |
| 928 |
| 929 if ( ! yyout ) |
| 930 yyout = stdout; |
| 931 |
| 932 if ( ! YY_CURRENT_BUFFER ) { |
| 933 error_ensure_buffer_stack (yyscanner); |
| 934 YY_CURRENT_BUFFER_LVALUE = |
| 935 error__create_buffer(yyin,YY_BUF_SIZE ,yyscanner
); |
| 936 } |
| 937 |
| 938 error__load_buffer_state(yyscanner ); |
| 939 } |
| 940 |
| 941 while ( 1 ) /* loops until end-of-file is reached */ |
| 942 { |
| 943 yy_cp = yyg->yy_c_buf_p; |
| 944 |
| 945 /* Support of yytext. */ |
| 946 *yy_cp = yyg->yy_hold_char; |
| 947 |
| 948 /* yy_bp points to the position in yy_ch_buf of the start of |
| 949 * the current run. |
| 950 */ |
| 951 yy_bp = yy_cp; |
| 952 |
| 953 yy_current_state = yyg->yy_start; |
| 954 yy_current_state += YY_AT_BOL(); |
| 955 yy_match: |
| 956 do |
| 957 { |
| 958 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; |
| 959 if ( yy_accept[yy_current_state] ) |
| 960 { |
| 961 yyg->yy_last_accepting_state = yy_current_state; |
| 962 yyg->yy_last_accepting_cpos = yy_cp; |
| 963 } |
| 964 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_c
urrent_state ) |
| 965 { |
| 966 yy_current_state = (int) yy_def[yy_current_state
]; |
| 967 if ( yy_current_state >= 263 ) |
| 968 yy_c = yy_meta[(unsigned int) yy_c]; |
| 969 } |
| 970 yy_current_state = yy_nxt[yy_base[yy_current_state] + (u
nsigned int) yy_c]; |
| 971 ++yy_cp; |
| 972 } |
| 973 while ( yy_current_state != 262 ); |
| 974 yy_cp = yyg->yy_last_accepting_cpos; |
| 975 yy_current_state = yyg->yy_last_accepting_state; |
| 976 |
| 977 yy_find_action: |
| 978 yy_act = yy_accept[yy_current_state]; |
| 979 |
| 980 YY_DO_BEFORE_ACTION; |
| 981 |
| 982 do_action: /* This label is used only to access EOF actions. */ |
| 983 |
| 984 switch ( yy_act ) |
| 985 { /* beginning of action switch */ |
| 986 case 0: /* must back up */ |
| 987 /* undo the effects of YY_DO_BEFORE_ACTION */ |
| 988 *yy_cp = yyg->yy_hold_char; |
| 989 yy_cp = yyg->yy_last_accepting_cpos; |
| 990 yy_current_state = yyg->yy_last_accepting_state; |
| 991 goto yy_find_action; |
| 992 |
| 993 case 1: |
| 994 YY_RULE_SETUP |
| 995 |
| 996 YY_BREAK |
| 997 case 2: |
| 998 /* rule 2 can match eol */ |
| 999 YY_RULE_SETUP |
| 1000 |
| 1001 YY_BREAK |
| 1002 /* Convert these */ |
| 1003 case 3: |
| 1004 YY_RULE_SETUP |
| 1005 { return ','; } |
| 1006 YY_BREAK |
| 1007 case 4: |
| 1008 YY_RULE_SETUP |
| 1009 { return ':'; } |
| 1010 YY_BREAK |
| 1011 case 5: |
| 1012 YY_RULE_SETUP |
| 1013 return WFD_SP; |
| 1014 YY_BREAK |
| 1015 case 6: |
| 1016 YY_RULE_SETUP |
| 1017 { |
| 1018 return WFD_AUDIO_CODECS_ERROR; |
| 1019 } |
| 1020 YY_BREAK |
| 1021 case 7: |
| 1022 YY_RULE_SETUP |
| 1023 { |
| 1024 return WFD_VIDEO_FORMATS_ERROR; |
| 1025 } |
| 1026 YY_BREAK |
| 1027 case 8: |
| 1028 YY_RULE_SETUP |
| 1029 { |
| 1030 return WFD_3D_FORMATS_ERROR; |
| 1031 } |
| 1032 YY_BREAK |
| 1033 case 9: |
| 1034 YY_RULE_SETUP |
| 1035 { |
| 1036 return WFD_CONTENT_PROTECTION_ERROR; |
| 1037 } |
| 1038 YY_BREAK |
| 1039 case 10: |
| 1040 YY_RULE_SETUP |
| 1041 { |
| 1042 return WFD_DISPLAY_EDID_ERROR; |
| 1043 } |
| 1044 YY_BREAK |
| 1045 case 11: |
| 1046 YY_RULE_SETUP |
| 1047 { |
| 1048 return WFD_COUPLED_SINK_ERROR; |
| 1049 } |
| 1050 YY_BREAK |
| 1051 case 12: |
| 1052 YY_RULE_SETUP |
| 1053 { |
| 1054 return WFD_TRIGGER_METHOD_ERROR; |
| 1055 } |
| 1056 YY_BREAK |
| 1057 case 13: |
| 1058 YY_RULE_SETUP |
| 1059 { |
| 1060 return WFD_PRESENTATION_URL_ERROR; |
| 1061 } |
| 1062 YY_BREAK |
| 1063 case 14: |
| 1064 YY_RULE_SETUP |
| 1065 { |
| 1066 return WFD_CLIENT_RTP_PORTS_ERROR; |
| 1067 } |
| 1068 YY_BREAK |
| 1069 case 15: |
| 1070 YY_RULE_SETUP |
| 1071 { |
| 1072 return WFD_ROUTE_ERROR; |
| 1073 } |
| 1074 YY_BREAK |
| 1075 case 16: |
| 1076 YY_RULE_SETUP |
| 1077 { |
| 1078 return WFD_I2C_ERROR; |
| 1079 } |
| 1080 YY_BREAK |
| 1081 case 17: |
| 1082 YY_RULE_SETUP |
| 1083 { |
| 1084 return WFD_AV_FORMAT_CHANGE_TIMING_ERROR; |
| 1085 } |
| 1086 YY_BREAK |
| 1087 case 18: |
| 1088 YY_RULE_SETUP |
| 1089 { |
| 1090 return WFD_PREFERRED_DISPLAY_MODE_ERROR; |
| 1091 } |
| 1092 YY_BREAK |
| 1093 case 19: |
| 1094 YY_RULE_SETUP |
| 1095 { |
| 1096 return WFD_UIBC_CAPABILITY_ERROR; |
| 1097 } |
| 1098 YY_BREAK |
| 1099 case 20: |
| 1100 YY_RULE_SETUP |
| 1101 { |
| 1102 return WFD_UIBC_SETTING_ERROR; |
| 1103 } |
| 1104 YY_BREAK |
| 1105 case 21: |
| 1106 YY_RULE_SETUP |
| 1107 { |
| 1108 return WFD_STANDBY_RESUME_CAPABILITY_ERROR; |
| 1109 } |
| 1110 YY_BREAK |
| 1111 case 22: |
| 1112 YY_RULE_SETUP |
| 1113 { |
| 1114 return WFD_STANDBY_ERROR; |
| 1115 } |
| 1116 YY_BREAK |
| 1117 case 23: |
| 1118 YY_RULE_SETUP |
| 1119 { |
| 1120 return WFD_CONNECTOR_TYPE_ERROR; |
| 1121 } |
| 1122 YY_BREAK |
| 1123 case 24: |
| 1124 YY_RULE_SETUP |
| 1125 { |
| 1126 return WFD_IDR_REQUEST_ERROR; |
| 1127 } |
| 1128 YY_BREAK |
| 1129 case 25: |
| 1130 YY_RULE_SETUP |
| 1131 { |
| 1132 yylval->sval = new std::string(yytext, yyleng); |
| 1133 return WFD_GENERIC_PROPERTY_ERROR; |
| 1134 } |
| 1135 YY_BREAK |
| 1136 case 26: |
| 1137 YY_RULE_SETUP |
| 1138 { |
| 1139 std::string str(yytext, yyleng); |
| 1140 str += '\0'; |
| 1141 yylval->nval = strtoull(str.c_str(), NULL, 10); |
| 1142 if (errno == ERANGE) { |
| 1143 // todo: handle error |
| 1144 } |
| 1145 return WFD_NUM; |
| 1146 } |
| 1147 YY_BREAK |
| 1148 /* all unmatched */ |
| 1149 case 27: |
| 1150 YY_RULE_SETUP |
| 1151 {} |
| 1152 YY_BREAK |
| 1153 case 28: |
| 1154 YY_RULE_SETUP |
| 1155 YY_FATAL_ERROR( "flex scanner jammed" ); |
| 1156 YY_BREAK |
| 1157 case YY_STATE_EOF(INITIAL): |
| 1158 yyterminate(); |
| 1159 |
| 1160 case YY_END_OF_BUFFER: |
| 1161 { |
| 1162 /* Amount of text matched not including the EOB char. */ |
| 1163 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr)
- 1; |
| 1164 |
| 1165 /* Undo the effects of YY_DO_BEFORE_ACTION. */ |
| 1166 *yy_cp = yyg->yy_hold_char; |
| 1167 YY_RESTORE_YY_MORE_OFFSET |
| 1168 |
| 1169 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW
) |
| 1170 { |
| 1171 /* We're scanning a new file or input source. It's |
| 1172 * possible that this happened because the user |
| 1173 * just pointed yyin at a new source and called |
| 1174 * error_lex(). If so, then we have to assure |
| 1175 * consistency between YY_CURRENT_BUFFER and our |
| 1176 * globals. Here is the right place to do so, because |
| 1177 * this is the first action (other than possibly a |
| 1178 * back-up) that will match for the new input source. |
| 1179 */ |
| 1180 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; |
| 1181 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; |
| 1182 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_N
ORMAL; |
| 1183 } |
| 1184 |
| 1185 /* Note that here we test for yy_c_buf_p "<=" to the position |
| 1186 * of the first EOB in the buffer, since yy_c_buf_p will |
| 1187 * already have been incremented past the NUL character |
| 1188 * (since all states make transitions on EOB to the |
| 1189 * end-of-buffer state). Contrast this with the test |
| 1190 * in input(). |
| 1191 */ |
| 1192 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg
->yy_n_chars] ) |
| 1193 { /* This was really a NUL. */ |
| 1194 yy_state_type yy_next_state; |
| 1195 |
| 1196 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched
_text; |
| 1197 |
| 1198 yy_current_state = yy_get_previous_state( yyscanner ); |
| 1199 |
| 1200 /* Okay, we're now positioned to make the NUL |
| 1201 * transition. We couldn't have |
| 1202 * yy_get_previous_state() go ahead and do it |
| 1203 * for us because it doesn't know how to deal |
| 1204 * with the possibility of jamming (and we don't |
| 1205 * want to build jamming into it because then it |
| 1206 * will run more slowly). |
| 1207 */ |
| 1208 |
| 1209 yy_next_state = yy_try_NUL_trans( yy_current_state , yys
canner); |
| 1210 |
| 1211 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; |
| 1212 |
| 1213 if ( yy_next_state ) |
| 1214 { |
| 1215 /* Consume the NUL. */ |
| 1216 yy_cp = ++yyg->yy_c_buf_p; |
| 1217 yy_current_state = yy_next_state; |
| 1218 goto yy_match; |
| 1219 } |
| 1220 |
| 1221 else |
| 1222 { |
| 1223 yy_cp = yyg->yy_last_accepting_cpos; |
| 1224 yy_current_state = yyg->yy_last_accepting_state; |
| 1225 goto yy_find_action; |
| 1226 } |
| 1227 } |
| 1228 |
| 1229 else switch ( yy_get_next_buffer( yyscanner ) ) |
| 1230 { |
| 1231 case EOB_ACT_END_OF_FILE: |
| 1232 { |
| 1233 yyg->yy_did_buffer_switch_on_eof = 0; |
| 1234 |
| 1235 if ( error_wrap(yyscanner ) ) |
| 1236 { |
| 1237 /* Note: because we've taken care in |
| 1238 * yy_get_next_buffer() to have set up |
| 1239 * yytext, we can now set up |
| 1240 * yy_c_buf_p so that if some total |
| 1241 * hoser (like flex itself) wants to |
| 1242 * call the scanner after we return the |
| 1243 * YY_NULL, it'll still work - another |
| 1244 * YY_NULL will get returned. |
| 1245 */ |
| 1246 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_M
ORE_ADJ; |
| 1247 |
| 1248 yy_act = YY_STATE_EOF(YY_START); |
| 1249 goto do_action; |
| 1250 } |
| 1251 |
| 1252 else |
| 1253 { |
| 1254 if ( ! yyg->yy_did_buffer_switch_on_eof
) |
| 1255 YY_NEW_FILE; |
| 1256 } |
| 1257 break; |
| 1258 } |
| 1259 |
| 1260 case EOB_ACT_CONTINUE_SCAN: |
| 1261 yyg->yy_c_buf_p = |
| 1262 yyg->yytext_ptr + yy_amount_of_matched_t
ext; |
| 1263 |
| 1264 yy_current_state = yy_get_previous_state( yyscan
ner ); |
| 1265 |
| 1266 yy_cp = yyg->yy_c_buf_p; |
| 1267 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; |
| 1268 goto yy_match; |
| 1269 |
| 1270 case EOB_ACT_LAST_MATCH: |
| 1271 yyg->yy_c_buf_p = |
| 1272 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_c
hars]; |
| 1273 |
| 1274 yy_current_state = yy_get_previous_state( yyscan
ner ); |
| 1275 |
| 1276 yy_cp = yyg->yy_c_buf_p; |
| 1277 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; |
| 1278 goto yy_find_action; |
| 1279 } |
| 1280 break; |
| 1281 } |
| 1282 |
| 1283 default: |
| 1284 YY_FATAL_ERROR( |
| 1285 "fatal flex scanner internal error--no action found" ); |
| 1286 } /* end of action switch */ |
| 1287 } /* end of scanning one token */ |
| 1288 } /* end of error_lex */ |
| 1289 |
| 1290 /* yy_get_next_buffer - try to read in a new buffer |
| 1291 * |
| 1292 * Returns a code representing an action: |
| 1293 * EOB_ACT_LAST_MATCH - |
| 1294 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position |
| 1295 * EOB_ACT_END_OF_FILE - end of file |
| 1296 */ |
| 1297 static int yy_get_next_buffer (yyscan_t yyscanner) |
| 1298 { |
| 1299 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 1300 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; |
| 1301 register char *source = yyg->yytext_ptr; |
| 1302 register int number_to_move, i; |
| 1303 int ret_val; |
| 1304 |
| 1305 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_ch
ars + 1] ) |
| 1306 YY_FATAL_ERROR( |
| 1307 "fatal flex scanner internal error--end of buffer missed" ); |
| 1308 |
| 1309 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) |
| 1310 { /* Don't try to fill the buffer, so this is an EOF. */ |
| 1311 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) |
| 1312 { |
| 1313 /* We matched a single character, the EOB, so |
| 1314 * treat this as a final EOF. |
| 1315 */ |
| 1316 return EOB_ACT_END_OF_FILE; |
| 1317 } |
| 1318 |
| 1319 else |
| 1320 { |
| 1321 /* We matched some text prior to the EOB, first |
| 1322 * process it. |
| 1323 */ |
| 1324 return EOB_ACT_LAST_MATCH; |
| 1325 } |
| 1326 } |
| 1327 |
| 1328 /* Try to read more data. */ |
| 1329 |
| 1330 /* First move last chars to start of buffer. */ |
| 1331 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; |
| 1332 |
| 1333 for ( i = 0; i < number_to_move; ++i ) |
| 1334 *(dest++) = *(source++); |
| 1335 |
| 1336 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING
) |
| 1337 /* don't do the read, it's not guaranteed to return an EOF, |
| 1338 * just force an EOF |
| 1339 */ |
| 1340 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; |
| 1341 |
| 1342 else |
| 1343 { |
| 1344 int num_to_read = |
| 1345 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move -
1; |
| 1346 |
| 1347 while ( num_to_read <= 0 ) |
| 1348 { /* Not enough room in the buffer - grow it. */ |
| 1349 |
| 1350 /* just a shorter name for the current buffer */ |
| 1351 YY_BUFFER_STATE b = YY_CURRENT_BUFFER; |
| 1352 |
| 1353 int yy_c_buf_p_offset = |
| 1354 (int) (yyg->yy_c_buf_p - b->yy_ch_buf); |
| 1355 |
| 1356 if ( b->yy_is_our_buffer ) |
| 1357 { |
| 1358 int new_size = b->yy_buf_size * 2; |
| 1359 |
| 1360 if ( new_size <= 0 ) |
| 1361 b->yy_buf_size += b->yy_buf_size / 8; |
| 1362 else |
| 1363 b->yy_buf_size *= 2; |
| 1364 |
| 1365 b->yy_ch_buf = (char *) |
| 1366 /* Include room in for 2 EOB chars. */ |
| 1367 error_realloc((void *) b->yy_ch_buf,b->y
y_buf_size + 2 ,yyscanner ); |
| 1368 } |
| 1369 else |
| 1370 /* Can't grow it, we don't own it. */ |
| 1371 b->yy_ch_buf = 0; |
| 1372 |
| 1373 if ( ! b->yy_ch_buf ) |
| 1374 YY_FATAL_ERROR( |
| 1375 "fatal error - scanner input buffer overflow" ); |
| 1376 |
| 1377 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; |
| 1378 |
| 1379 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - |
| 1380 number_to_move - 1; |
| 1381 |
| 1382 } |
| 1383 |
| 1384 if ( num_to_read > YY_READ_BUF_SIZE ) |
| 1385 num_to_read = YY_READ_BUF_SIZE; |
| 1386 |
| 1387 /* Read in more data. */ |
| 1388 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move])
, |
| 1389 yyg->yy_n_chars, (size_t) num_to_read ); |
| 1390 |
| 1391 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; |
| 1392 } |
| 1393 |
| 1394 if ( yyg->yy_n_chars == 0 ) |
| 1395 { |
| 1396 if ( number_to_move == YY_MORE_ADJ ) |
| 1397 { |
| 1398 ret_val = EOB_ACT_END_OF_FILE; |
| 1399 error_restart(yyin ,yyscanner); |
| 1400 } |
| 1401 |
| 1402 else |
| 1403 { |
| 1404 ret_val = EOB_ACT_LAST_MATCH; |
| 1405 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = |
| 1406 YY_BUFFER_EOF_PENDING; |
| 1407 } |
| 1408 } |
| 1409 |
| 1410 else |
| 1411 ret_val = EOB_ACT_CONTINUE_SCAN; |
| 1412 |
| 1413 if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_L
VALUE->yy_buf_size) { |
| 1414 /* Extend the array by 50%, plus the number we really need. */ |
| 1415 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy
_n_chars >> 1); |
| 1416 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) error_realloc((vo
id *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); |
| 1417 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) |
| 1418 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_bu
ffer()" ); |
| 1419 } |
| 1420 |
| 1421 yyg->yy_n_chars += number_to_move; |
| 1422 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_
CHAR; |
| 1423 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUF
FER_CHAR; |
| 1424 |
| 1425 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; |
| 1426 |
| 1427 return ret_val; |
| 1428 } |
| 1429 |
| 1430 /* yy_get_previous_state - get the state just before the EOB char was reached */ |
| 1431 |
| 1432 static yy_state_type yy_get_previous_state (yyscan_t yyscanner) |
| 1433 { |
| 1434 register yy_state_type yy_current_state; |
| 1435 register char *yy_cp; |
| 1436 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 1437 |
| 1438 yy_current_state = yyg->yy_start; |
| 1439 yy_current_state += YY_AT_BOL(); |
| 1440 |
| 1441 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++
yy_cp ) |
| 1442 { |
| 1443 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1
); |
| 1444 if ( yy_accept[yy_current_state] ) |
| 1445 { |
| 1446 yyg->yy_last_accepting_state = yy_current_state; |
| 1447 yyg->yy_last_accepting_cpos = yy_cp; |
| 1448 } |
| 1449 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_s
tate ) |
| 1450 { |
| 1451 yy_current_state = (int) yy_def[yy_current_state]; |
| 1452 if ( yy_current_state >= 263 ) |
| 1453 yy_c = yy_meta[(unsigned int) yy_c]; |
| 1454 } |
| 1455 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned
int) yy_c]; |
| 1456 } |
| 1457 |
| 1458 return yy_current_state; |
| 1459 } |
| 1460 |
| 1461 /* yy_try_NUL_trans - try to make a transition on the NUL character |
| 1462 * |
| 1463 * synopsis |
| 1464 * next_state = yy_try_NUL_trans( current_state ); |
| 1465 */ |
| 1466 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yys
can_t yyscanner) |
| 1467 { |
| 1468 register int yy_is_jam; |
| 1469 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unus
ed depending upon options. */ |
| 1470 register char *yy_cp = yyg->yy_c_buf_p; |
| 1471 |
| 1472 register YY_CHAR yy_c = 1; |
| 1473 if ( yy_accept[yy_current_state] ) |
| 1474 { |
| 1475 yyg->yy_last_accepting_state = yy_current_state; |
| 1476 yyg->yy_last_accepting_cpos = yy_cp; |
| 1477 } |
| 1478 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
| 1479 { |
| 1480 yy_current_state = (int) yy_def[yy_current_state]; |
| 1481 if ( yy_current_state >= 263 ) |
| 1482 yy_c = yy_meta[(unsigned int) yy_c]; |
| 1483 } |
| 1484 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_
c]; |
| 1485 yy_is_jam = (yy_current_state == 262); |
| 1486 |
| 1487 return yy_is_jam ? 0 : yy_current_state; |
| 1488 } |
| 1489 |
| 1490 #ifndef YY_NO_INPUT |
| 1491 #ifdef __cplusplus |
| 1492 static int yyinput (yyscan_t yyscanner) |
| 1493 #else |
| 1494 static int input (yyscan_t yyscanner) |
| 1495 #endif |
| 1496 |
| 1497 { |
| 1498 int c; |
| 1499 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 1500 |
| 1501 *yyg->yy_c_buf_p = yyg->yy_hold_char; |
| 1502 |
| 1503 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) |
| 1504 { |
| 1505 /* yy_c_buf_p now points to the character we want to return. |
| 1506 * If this occurs *before* the EOB characters, then it's a |
| 1507 * valid NUL; if not, then we've hit the end of the buffer. |
| 1508 */ |
| 1509 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg-
>yy_n_chars] ) |
| 1510 /* This was really a NUL. */ |
| 1511 *yyg->yy_c_buf_p = '\0'; |
| 1512 |
| 1513 else |
| 1514 { /* need more input */ |
| 1515 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; |
| 1516 ++yyg->yy_c_buf_p; |
| 1517 |
| 1518 switch ( yy_get_next_buffer( yyscanner ) ) |
| 1519 { |
| 1520 case EOB_ACT_LAST_MATCH: |
| 1521 /* This happens because yy_g_n_b() |
| 1522 * sees that we've accumulated a |
| 1523 * token and flags that we need to |
| 1524 * try matching the token before |
| 1525 * proceeding. But for input(), |
| 1526 * there's no matching to consider. |
| 1527 * So convert the EOB_ACT_LAST_MATCH |
| 1528 * to EOB_ACT_END_OF_FILE. |
| 1529 */ |
| 1530 |
| 1531 /* Reset buffer status. */ |
| 1532 error_restart(yyin ,yyscanner); |
| 1533 |
| 1534 /*FALLTHROUGH*/ |
| 1535 |
| 1536 case EOB_ACT_END_OF_FILE: |
| 1537 { |
| 1538 if ( error_wrap(yyscanner ) ) |
| 1539 return EOF; |
| 1540 |
| 1541 if ( ! yyg->yy_did_buffer_switch_on_eof
) |
| 1542 YY_NEW_FILE; |
| 1543 #ifdef __cplusplus |
| 1544 return yyinput(yyscanner); |
| 1545 #else |
| 1546 return input(yyscanner); |
| 1547 #endif |
| 1548 } |
| 1549 |
| 1550 case EOB_ACT_CONTINUE_SCAN: |
| 1551 yyg->yy_c_buf_p = yyg->yytext_ptr + offs
et; |
| 1552 break; |
| 1553 } |
| 1554 } |
| 1555 } |
| 1556 |
| 1557 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ |
| 1558 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ |
| 1559 yyg->yy_hold_char = *++yyg->yy_c_buf_p; |
| 1560 |
| 1561 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); |
| 1562 |
| 1563 return c; |
| 1564 } |
| 1565 #endif /* ifndef YY_NO_INPUT */ |
| 1566 |
| 1567 /** Immediately switch to a different input stream. |
| 1568 * @param input_file A readable stream. |
| 1569 * @param yyscanner The scanner object. |
| 1570 * @note This function does not reset the start condition to @c INITIAL . |
| 1571 */ |
| 1572 void error_restart (FILE * input_file , yyscan_t yyscanner) |
| 1573 { |
| 1574 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 1575 |
| 1576 if ( ! YY_CURRENT_BUFFER ){ |
| 1577 error_ensure_buffer_stack (yyscanner); |
| 1578 YY_CURRENT_BUFFER_LVALUE = |
| 1579 error__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); |
| 1580 } |
| 1581 |
| 1582 error__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); |
| 1583 error__load_buffer_state(yyscanner ); |
| 1584 } |
| 1585 |
| 1586 /** Switch to a different input buffer. |
| 1587 * @param new_buffer The new input buffer. |
| 1588 * @param yyscanner The scanner object. |
| 1589 */ |
| 1590 void error__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscan
ner) |
| 1591 { |
| 1592 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 1593 |
| 1594 /* TODO. We should be able to replace this entire function body |
| 1595 * with |
| 1596 * error_pop_buffer_state(); |
| 1597 * error_push_buffer_state(new_buffer); |
| 1598 */ |
| 1599 error_ensure_buffer_stack (yyscanner); |
| 1600 if ( YY_CURRENT_BUFFER == new_buffer ) |
| 1601 return; |
| 1602 |
| 1603 if ( YY_CURRENT_BUFFER ) |
| 1604 { |
| 1605 /* Flush out information for old buffer. */ |
| 1606 *yyg->yy_c_buf_p = yyg->yy_hold_char; |
| 1607 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; |
| 1608 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; |
| 1609 } |
| 1610 |
| 1611 YY_CURRENT_BUFFER_LVALUE = new_buffer; |
| 1612 error__load_buffer_state(yyscanner ); |
| 1613 |
| 1614 /* We don't actually know whether we did this switch during |
| 1615 * EOF (error_wrap()) processing, but the only time this flag |
| 1616 * is looked at is after error_wrap() is called, so it's safe |
| 1617 * to go ahead and always set it. |
| 1618 */ |
| 1619 yyg->yy_did_buffer_switch_on_eof = 1; |
| 1620 } |
| 1621 |
| 1622 static void error__load_buffer_state (yyscan_t yyscanner) |
| 1623 { |
| 1624 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 1625 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; |
| 1626 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos
; |
| 1627 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; |
| 1628 yyg->yy_hold_char = *yyg->yy_c_buf_p; |
| 1629 } |
| 1630 |
| 1631 /** Allocate and initialize an input buffer state. |
| 1632 * @param file A readable stream. |
| 1633 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_
SIZE. |
| 1634 * @param yyscanner The scanner object. |
| 1635 * @return the allocated buffer state. |
| 1636 */ |
| 1637 YY_BUFFER_STATE error__create_buffer (FILE * file, int size , yyscan_t yys
canner) |
| 1638 { |
| 1639 YY_BUFFER_STATE b; |
| 1640 |
| 1641 b = (YY_BUFFER_STATE) error_alloc(sizeof( struct yy_buffer_state ) ,yysc
anner ); |
| 1642 if ( ! b ) |
| 1643 YY_FATAL_ERROR( "out of dynamic memory in error__create_buffer()
" ); |
| 1644 |
| 1645 b->yy_buf_size = size; |
| 1646 |
| 1647 /* yy_ch_buf has to be 2 characters longer than the size given because |
| 1648 * we need to put in 2 end-of-buffer characters. |
| 1649 */ |
| 1650 b->yy_ch_buf = (char *) error_alloc(b->yy_buf_size + 2 ,yyscanner ); |
| 1651 if ( ! b->yy_ch_buf ) |
| 1652 YY_FATAL_ERROR( "out of dynamic memory in error__create_buffer()
" ); |
| 1653 |
| 1654 b->yy_is_our_buffer = 1; |
| 1655 |
| 1656 error__init_buffer(b,file ,yyscanner); |
| 1657 |
| 1658 return b; |
| 1659 } |
| 1660 |
| 1661 /** Destroy the buffer. |
| 1662 * @param b a buffer created with error__create_buffer() |
| 1663 * @param yyscanner The scanner object. |
| 1664 */ |
| 1665 void error__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) |
| 1666 { |
| 1667 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 1668 |
| 1669 if ( ! b ) |
| 1670 return; |
| 1671 |
| 1672 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ |
| 1673 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; |
| 1674 |
| 1675 if ( b->yy_is_our_buffer ) |
| 1676 error_free((void *) b->yy_ch_buf ,yyscanner ); |
| 1677 |
| 1678 error_free((void *) b ,yyscanner ); |
| 1679 } |
| 1680 |
| 1681 /* Initializes or reinitializes a buffer. |
| 1682 * This function is sometimes called more than once on the same buffer, |
| 1683 * such as during a error_restart() or at EOF. |
| 1684 */ |
| 1685 static void error__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t
yyscanner) |
| 1686 |
| 1687 { |
| 1688 int oerrno = errno; |
| 1689 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 1690 |
| 1691 error__flush_buffer(b ,yyscanner); |
| 1692 |
| 1693 b->yy_input_file = file; |
| 1694 b->yy_fill_buffer = 1; |
| 1695 |
| 1696 /* If b is the current buffer, then error__init_buffer was _probably_ |
| 1697 * called from error_restart() or through yy_get_next_buffer. |
| 1698 * In that case, we don't want to reset the lineno or column. |
| 1699 */ |
| 1700 if (b != YY_CURRENT_BUFFER){ |
| 1701 b->yy_bs_lineno = 1; |
| 1702 b->yy_bs_column = 0; |
| 1703 } |
| 1704 |
| 1705 b->yy_is_interactive = 0; |
| 1706 |
| 1707 errno = oerrno; |
| 1708 } |
| 1709 |
| 1710 /** Discard all buffered characters. On the next scan, YY_INPUT will be called. |
| 1711 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. |
| 1712 * @param yyscanner The scanner object. |
| 1713 */ |
| 1714 void error__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) |
| 1715 { |
| 1716 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 1717 if ( ! b ) |
| 1718 return; |
| 1719 |
| 1720 b->yy_n_chars = 0; |
| 1721 |
| 1722 /* We always need two end-of-buffer characters. The first causes |
| 1723 * a transition to the end-of-buffer state. The second causes |
| 1724 * a jam in that state. |
| 1725 */ |
| 1726 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; |
| 1727 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; |
| 1728 |
| 1729 b->yy_buf_pos = &b->yy_ch_buf[0]; |
| 1730 |
| 1731 b->yy_at_bol = 1; |
| 1732 b->yy_buffer_status = YY_BUFFER_NEW; |
| 1733 |
| 1734 if ( b == YY_CURRENT_BUFFER ) |
| 1735 error__load_buffer_state(yyscanner ); |
| 1736 } |
| 1737 |
| 1738 /** Pushes the new state onto the stack. The new state becomes |
| 1739 * the current state. This function will allocate the stack |
| 1740 * if necessary. |
| 1741 * @param new_buffer The new state. |
| 1742 * @param yyscanner The scanner object. |
| 1743 */ |
| 1744 void error_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) |
| 1745 { |
| 1746 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 1747 if (new_buffer == NULL) |
| 1748 return; |
| 1749 |
| 1750 error_ensure_buffer_stack(yyscanner); |
| 1751 |
| 1752 /* This block is copied from error__switch_to_buffer. */ |
| 1753 if ( YY_CURRENT_BUFFER ) |
| 1754 { |
| 1755 /* Flush out information for old buffer. */ |
| 1756 *yyg->yy_c_buf_p = yyg->yy_hold_char; |
| 1757 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; |
| 1758 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; |
| 1759 } |
| 1760 |
| 1761 /* Only push if top exists. Otherwise, replace top. */ |
| 1762 if (YY_CURRENT_BUFFER) |
| 1763 yyg->yy_buffer_stack_top++; |
| 1764 YY_CURRENT_BUFFER_LVALUE = new_buffer; |
| 1765 |
| 1766 /* copied from error__switch_to_buffer. */ |
| 1767 error__load_buffer_state(yyscanner ); |
| 1768 yyg->yy_did_buffer_switch_on_eof = 1; |
| 1769 } |
| 1770 |
| 1771 /** Removes and deletes the top of the stack, if present. |
| 1772 * The next element becomes the new top. |
| 1773 * @param yyscanner The scanner object. |
| 1774 */ |
| 1775 void error_pop_buffer_state (yyscan_t yyscanner) |
| 1776 { |
| 1777 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 1778 if (!YY_CURRENT_BUFFER) |
| 1779 return; |
| 1780 |
| 1781 error__delete_buffer(YY_CURRENT_BUFFER ,yyscanner); |
| 1782 YY_CURRENT_BUFFER_LVALUE = NULL; |
| 1783 if (yyg->yy_buffer_stack_top > 0) |
| 1784 --yyg->yy_buffer_stack_top; |
| 1785 |
| 1786 if (YY_CURRENT_BUFFER) { |
| 1787 error__load_buffer_state(yyscanner ); |
| 1788 yyg->yy_did_buffer_switch_on_eof = 1; |
| 1789 } |
| 1790 } |
| 1791 |
| 1792 /* Allocates the stack if it does not exist. |
| 1793 * Guarantees space for at least one push. |
| 1794 */ |
| 1795 static void error_ensure_buffer_stack (yyscan_t yyscanner) |
| 1796 { |
| 1797 int num_to_alloc; |
| 1798 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 1799 |
| 1800 if (!yyg->yy_buffer_stack) { |
| 1801 |
| 1802 /* First allocation is just for 2 elements, since we don't know
if this |
| 1803 * scanner will even need a stack. We use 2 instead of 1 to avoi
d an |
| 1804 * immediate realloc on the next call. |
| 1805 */ |
| 1806 num_to_alloc = 1; |
| 1807 yyg->yy_buffer_stack = (struct yy_buffer_state**)error_alloc |
| 1808 (num_to_alloc *
sizeof(struct yy_buffer_state*) |
| 1809 , yyscanner); |
| 1810 if ( ! yyg->yy_buffer_stack ) |
| 1811 YY_FATAL_ERROR( "out of dynamic memory in error_ensure_b
uffer_stack()" ); |
| 1812 |
| 1813 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_
buffer_state*)); |
| 1814 |
| 1815 yyg->yy_buffer_stack_max = num_to_alloc; |
| 1816 yyg->yy_buffer_stack_top = 0; |
| 1817 return; |
| 1818 } |
| 1819 |
| 1820 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ |
| 1821 |
| 1822 /* Increase the buffer to prepare for a possible push. */ |
| 1823 int grow_size = 8 /* arbitrary grow size */; |
| 1824 |
| 1825 num_to_alloc = yyg->yy_buffer_stack_max + grow_size; |
| 1826 yyg->yy_buffer_stack = (struct yy_buffer_state**)error_realloc |
| 1827 (yyg->yy_buffer_
stack, |
| 1828 num_to_alloc * s
izeof(struct yy_buffer_state*) |
| 1829 , yyscanner); |
| 1830 if ( ! yyg->yy_buffer_stack ) |
| 1831 YY_FATAL_ERROR( "out of dynamic memory in error_ensure_b
uffer_stack()" ); |
| 1832 |
| 1833 /* zero only the new slots.*/ |
| 1834 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_
size * sizeof(struct yy_buffer_state*)); |
| 1835 yyg->yy_buffer_stack_max = num_to_alloc; |
| 1836 } |
| 1837 } |
| 1838 |
| 1839 /** Setup the input buffer state to scan directly from a user-specified characte
r buffer. |
| 1840 * @param base the character buffer |
| 1841 * @param size the size in bytes of the character buffer |
| 1842 * @param yyscanner The scanner object. |
| 1843 * @return the newly allocated buffer state object. |
| 1844 */ |
| 1845 YY_BUFFER_STATE error__scan_buffer (char * base, yy_size_t size , yyscan_t yys
canner) |
| 1846 { |
| 1847 YY_BUFFER_STATE b; |
| 1848 |
| 1849 if ( size < 2 || |
| 1850 base[size-2] != YY_END_OF_BUFFER_CHAR || |
| 1851 base[size-1] != YY_END_OF_BUFFER_CHAR ) |
| 1852 /* They forgot to leave room for the EOB's. */ |
| 1853 return 0; |
| 1854 |
| 1855 b = (YY_BUFFER_STATE) error_alloc(sizeof( struct yy_buffer_state ) ,yysc
anner ); |
| 1856 if ( ! b ) |
| 1857 YY_FATAL_ERROR( "out of dynamic memory in error__scan_buffer()"
); |
| 1858 |
| 1859 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ |
| 1860 b->yy_buf_pos = b->yy_ch_buf = base; |
| 1861 b->yy_is_our_buffer = 0; |
| 1862 b->yy_input_file = 0; |
| 1863 b->yy_n_chars = b->yy_buf_size; |
| 1864 b->yy_is_interactive = 0; |
| 1865 b->yy_at_bol = 1; |
| 1866 b->yy_fill_buffer = 0; |
| 1867 b->yy_buffer_status = YY_BUFFER_NEW; |
| 1868 |
| 1869 error__switch_to_buffer(b ,yyscanner ); |
| 1870 |
| 1871 return b; |
| 1872 } |
| 1873 |
| 1874 /** Setup the input buffer state to scan a string. The next call to error_lex()
will |
| 1875 * scan from a @e copy of @a str. |
| 1876 * @param yystr a NUL-terminated string to scan |
| 1877 * @param yyscanner The scanner object. |
| 1878 * @return the newly allocated buffer state object. |
| 1879 * @note If you want to scan bytes that may contain NUL values, then use |
| 1880 * error__scan_bytes() instead. |
| 1881 */ |
| 1882 YY_BUFFER_STATE error__scan_string (yyconst char * yystr , yyscan_t yyscanner) |
| 1883 { |
| 1884 |
| 1885 return error__scan_bytes(yystr,strlen(yystr) ,yyscanner); |
| 1886 } |
| 1887 |
| 1888 /** Setup the input buffer state to scan the given bytes. The next call to error
_lex() will |
| 1889 * scan from a @e copy of @a bytes. |
| 1890 * @param yybytes the byte buffer to scan |
| 1891 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. |
| 1892 * @param yyscanner The scanner object. |
| 1893 * @return the newly allocated buffer state object. |
| 1894 */ |
| 1895 YY_BUFFER_STATE error__scan_bytes (yyconst char * yybytes, int _yybytes_len ,
yyscan_t yyscanner) |
| 1896 { |
| 1897 YY_BUFFER_STATE b; |
| 1898 char *buf; |
| 1899 yy_size_t n; |
| 1900 int i; |
| 1901 |
| 1902 /* Get memory for full buffer, including space for trailing EOB's. */ |
| 1903 n = _yybytes_len + 2; |
| 1904 buf = (char *) error_alloc(n ,yyscanner ); |
| 1905 if ( ! buf ) |
| 1906 YY_FATAL_ERROR( "out of dynamic memory in error__scan_bytes()" )
; |
| 1907 |
| 1908 for ( i = 0; i < _yybytes_len; ++i ) |
| 1909 buf[i] = yybytes[i]; |
| 1910 |
| 1911 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; |
| 1912 |
| 1913 b = error__scan_buffer(buf,n ,yyscanner); |
| 1914 if ( ! b ) |
| 1915 YY_FATAL_ERROR( "bad buffer in error__scan_bytes()" ); |
| 1916 |
| 1917 /* It's okay to grow etc. this buffer, and we should throw it |
| 1918 * away when we're done. |
| 1919 */ |
| 1920 b->yy_is_our_buffer = 1; |
| 1921 |
| 1922 return b; |
| 1923 } |
| 1924 |
| 1925 #ifndef YY_EXIT_FAILURE |
| 1926 #define YY_EXIT_FAILURE 2 |
| 1927 #endif |
| 1928 |
| 1929 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) |
| 1930 { |
| 1931 (void) fprintf( stderr, "%s\n", msg ); |
| 1932 exit( YY_EXIT_FAILURE ); |
| 1933 } |
| 1934 |
| 1935 /* Redefine yyless() so it works in section 3 code. */ |
| 1936 |
| 1937 #undef yyless |
| 1938 #define yyless(n) \ |
| 1939 do \ |
| 1940 { \ |
| 1941 /* Undo effects of setting up yytext. */ \ |
| 1942 int yyless_macro_arg = (n); \ |
| 1943 YY_LESS_LINENO(yyless_macro_arg);\ |
| 1944 yytext[yyleng] = yyg->yy_hold_char; \ |
| 1945 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ |
| 1946 yyg->yy_hold_char = *yyg->yy_c_buf_p; \ |
| 1947 *yyg->yy_c_buf_p = '\0'; \ |
| 1948 yyleng = yyless_macro_arg; \ |
| 1949 } \ |
| 1950 while ( 0 ) |
| 1951 |
| 1952 /* Accessor methods (get/set functions) to struct members. */ |
| 1953 |
| 1954 /** Get the user-defined data for this scanner. |
| 1955 * @param yyscanner The scanner object. |
| 1956 */ |
| 1957 YY_EXTRA_TYPE error_get_extra (yyscan_t yyscanner) |
| 1958 { |
| 1959 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 1960 return yyextra; |
| 1961 } |
| 1962 |
| 1963 /** Get the current line number. |
| 1964 * @param yyscanner The scanner object. |
| 1965 */ |
| 1966 int error_get_lineno (yyscan_t yyscanner) |
| 1967 { |
| 1968 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 1969 |
| 1970 if (! YY_CURRENT_BUFFER) |
| 1971 return 0; |
| 1972 |
| 1973 return yylineno; |
| 1974 } |
| 1975 |
| 1976 /** Get the current column number. |
| 1977 * @param yyscanner The scanner object. |
| 1978 */ |
| 1979 int error_get_column (yyscan_t yyscanner) |
| 1980 { |
| 1981 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 1982 |
| 1983 if (! YY_CURRENT_BUFFER) |
| 1984 return 0; |
| 1985 |
| 1986 return yycolumn; |
| 1987 } |
| 1988 |
| 1989 /** Get the input stream. |
| 1990 * @param yyscanner The scanner object. |
| 1991 */ |
| 1992 FILE *error_get_in (yyscan_t yyscanner) |
| 1993 { |
| 1994 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 1995 return yyin; |
| 1996 } |
| 1997 |
| 1998 /** Get the output stream. |
| 1999 * @param yyscanner The scanner object. |
| 2000 */ |
| 2001 FILE *error_get_out (yyscan_t yyscanner) |
| 2002 { |
| 2003 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 2004 return yyout; |
| 2005 } |
| 2006 |
| 2007 /** Get the length of the current token. |
| 2008 * @param yyscanner The scanner object. |
| 2009 */ |
| 2010 int error_get_leng (yyscan_t yyscanner) |
| 2011 { |
| 2012 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 2013 return yyleng; |
| 2014 } |
| 2015 |
| 2016 /** Get the current token. |
| 2017 * @param yyscanner The scanner object. |
| 2018 */ |
| 2019 |
| 2020 char *error_get_text (yyscan_t yyscanner) |
| 2021 { |
| 2022 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 2023 return yytext; |
| 2024 } |
| 2025 |
| 2026 /** Set the user-defined data. This data is never touched by the scanner. |
| 2027 * @param user_defined The data to be associated with this scanner. |
| 2028 * @param yyscanner The scanner object. |
| 2029 */ |
| 2030 void error_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) |
| 2031 { |
| 2032 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 2033 yyextra = user_defined ; |
| 2034 } |
| 2035 |
| 2036 /** Set the current line number. |
| 2037 * @param line_number |
| 2038 * @param yyscanner The scanner object. |
| 2039 */ |
| 2040 void error_set_lineno (int line_number , yyscan_t yyscanner) |
| 2041 { |
| 2042 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 2043 |
| 2044 /* lineno is only valid if an input buffer exists. */ |
| 2045 if (! YY_CURRENT_BUFFER ) |
| 2046 yy_fatal_error( "error_set_lineno called with no buffer" , yyscanner)
; |
| 2047 |
| 2048 yylineno = line_number; |
| 2049 } |
| 2050 |
| 2051 /** Set the current column. |
| 2052 * @param line_number |
| 2053 * @param yyscanner The scanner object. |
| 2054 */ |
| 2055 void error_set_column (int column_no , yyscan_t yyscanner) |
| 2056 { |
| 2057 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 2058 |
| 2059 /* column is only valid if an input buffer exists. */ |
| 2060 if (! YY_CURRENT_BUFFER ) |
| 2061 yy_fatal_error( "error_set_column called with no buffer" , yyscanner)
; |
| 2062 |
| 2063 yycolumn = column_no; |
| 2064 } |
| 2065 |
| 2066 /** Set the input stream. This does not discard the current |
| 2067 * input buffer. |
| 2068 * @param in_str A readable stream. |
| 2069 * @param yyscanner The scanner object. |
| 2070 * @see error__switch_to_buffer |
| 2071 */ |
| 2072 void error_set_in (FILE * in_str , yyscan_t yyscanner) |
| 2073 { |
| 2074 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 2075 yyin = in_str ; |
| 2076 } |
| 2077 |
| 2078 void error_set_out (FILE * out_str , yyscan_t yyscanner) |
| 2079 { |
| 2080 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 2081 yyout = out_str ; |
| 2082 } |
| 2083 |
| 2084 int error_get_debug (yyscan_t yyscanner) |
| 2085 { |
| 2086 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 2087 return yy_flex_debug; |
| 2088 } |
| 2089 |
| 2090 void error_set_debug (int bdebug , yyscan_t yyscanner) |
| 2091 { |
| 2092 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 2093 yy_flex_debug = bdebug ; |
| 2094 } |
| 2095 |
| 2096 /* Accessor methods for yylval and yylloc */ |
| 2097 |
| 2098 YYSTYPE * error_get_lval (yyscan_t yyscanner) |
| 2099 { |
| 2100 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 2101 return yylval; |
| 2102 } |
| 2103 |
| 2104 void error_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) |
| 2105 { |
| 2106 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 2107 yylval = yylval_param; |
| 2108 } |
| 2109 |
| 2110 /* User-visible API */ |
| 2111 |
| 2112 /* error_lex_init is special because it creates the scanner itself, so it is |
| 2113 * the ONLY reentrant function that doesn't take the scanner as the last argumen
t. |
| 2114 * That's why we explicitly handle the declaration, instead of using our macros. |
| 2115 */ |
| 2116 |
| 2117 int error_lex_init(yyscan_t* ptr_yy_globals) |
| 2118 |
| 2119 { |
| 2120 if (ptr_yy_globals == NULL){ |
| 2121 errno = EINVAL; |
| 2122 return 1; |
| 2123 } |
| 2124 |
| 2125 *ptr_yy_globals = (yyscan_t) error_alloc ( sizeof( struct yyguts_t ), NULL )
; |
| 2126 |
| 2127 if (*ptr_yy_globals == NULL){ |
| 2128 errno = ENOMEM; |
| 2129 return 1; |
| 2130 } |
| 2131 |
| 2132 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for
releases. */ |
| 2133 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); |
| 2134 |
| 2135 return yy_init_globals ( *ptr_yy_globals ); |
| 2136 } |
| 2137 |
| 2138 /* error_lex_init_extra has the same functionality as error_lex_init, but follow
s the |
| 2139 * convention of taking the scanner as the last argument. Note however, that |
| 2140 * this is a *pointer* to a scanner, as it will be allocated by this call (and |
| 2141 * is the reason, too, why this function also must handle its own declaration). |
| 2142 * The user defined value in the first argument will be available to error_alloc
in |
| 2143 * the yyextra field. |
| 2144 */ |
| 2145 |
| 2146 int error_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals
) |
| 2147 |
| 2148 { |
| 2149 struct yyguts_t dummy_yyguts; |
| 2150 |
| 2151 error_set_extra (yy_user_defined, &dummy_yyguts); |
| 2152 |
| 2153 if (ptr_yy_globals == NULL){ |
| 2154 errno = EINVAL; |
| 2155 return 1; |
| 2156 } |
| 2157 |
| 2158 *ptr_yy_globals = (yyscan_t) error_alloc ( sizeof( struct yyguts_t ), &dummy
_yyguts ); |
| 2159 |
| 2160 if (*ptr_yy_globals == NULL){ |
| 2161 errno = ENOMEM; |
| 2162 return 1; |
| 2163 } |
| 2164 |
| 2165 /* By setting to 0xAA, we expose bugs in |
| 2166 yy_init_globals. Leave at 0x00 for releases. */ |
| 2167 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); |
| 2168 |
| 2169 error_set_extra (yy_user_defined, *ptr_yy_globals); |
| 2170 |
| 2171 return yy_init_globals ( *ptr_yy_globals ); |
| 2172 } |
| 2173 |
| 2174 static int yy_init_globals (yyscan_t yyscanner) |
| 2175 { |
| 2176 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 2177 /* Initialization is the same as for the non-reentrant scanner. |
| 2178 * This function is called from error_lex_destroy(), so don't allocate here. |
| 2179 */ |
| 2180 |
| 2181 yyg->yy_buffer_stack = 0; |
| 2182 yyg->yy_buffer_stack_top = 0; |
| 2183 yyg->yy_buffer_stack_max = 0; |
| 2184 yyg->yy_c_buf_p = (char *) 0; |
| 2185 yyg->yy_init = 0; |
| 2186 yyg->yy_start = 0; |
| 2187 |
| 2188 yyg->yy_start_stack_ptr = 0; |
| 2189 yyg->yy_start_stack_depth = 0; |
| 2190 yyg->yy_start_stack = NULL; |
| 2191 |
| 2192 /* Defined in main.c */ |
| 2193 #ifdef YY_STDINIT |
| 2194 yyin = stdin; |
| 2195 yyout = stdout; |
| 2196 #else |
| 2197 yyin = (FILE *) 0; |
| 2198 yyout = (FILE *) 0; |
| 2199 #endif |
| 2200 |
| 2201 /* For future reference: Set errno on error, since we are called by |
| 2202 * error_lex_init() |
| 2203 */ |
| 2204 return 0; |
| 2205 } |
| 2206 |
| 2207 /* error_lex_destroy is for both reentrant and non-reentrant scanners. */ |
| 2208 int error_lex_destroy (yyscan_t yyscanner) |
| 2209 { |
| 2210 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; |
| 2211 |
| 2212 /* Pop the buffer stack, destroying each element. */ |
| 2213 while(YY_CURRENT_BUFFER){ |
| 2214 error__delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); |
| 2215 YY_CURRENT_BUFFER_LVALUE = NULL; |
| 2216 error_pop_buffer_state(yyscanner); |
| 2217 } |
| 2218 |
| 2219 /* Destroy the stack itself. */ |
| 2220 error_free(yyg->yy_buffer_stack ,yyscanner); |
| 2221 yyg->yy_buffer_stack = NULL; |
| 2222 |
| 2223 /* Destroy the start condition stack. */ |
| 2224 error_free(yyg->yy_start_stack ,yyscanner ); |
| 2225 yyg->yy_start_stack = NULL; |
| 2226 |
| 2227 /* Reset the globals. This is important in a non-reentrant scanner so the ne
xt time |
| 2228 * error_lex() is called, initialization will occur. */ |
| 2229 yy_init_globals( yyscanner); |
| 2230 |
| 2231 /* Destroy the main struct (reentrant only). */ |
| 2232 error_free ( yyscanner , yyscanner ); |
| 2233 yyscanner = NULL; |
| 2234 return 0; |
| 2235 } |
| 2236 |
| 2237 /* |
| 2238 * Internal utility routines. |
| 2239 */ |
| 2240 |
| 2241 #ifndef yytext_ptr |
| 2242 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yysca
nner) |
| 2243 { |
| 2244 register int i; |
| 2245 for ( i = 0; i < n; ++i ) |
| 2246 s1[i] = s2[i]; |
| 2247 } |
| 2248 #endif |
| 2249 |
| 2250 #ifdef YY_NEED_STRLEN |
| 2251 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) |
| 2252 { |
| 2253 register int n; |
| 2254 for ( n = 0; s[n]; ++n ) |
| 2255 ; |
| 2256 |
| 2257 return n; |
| 2258 } |
| 2259 #endif |
| 2260 |
| 2261 void *error_alloc (yy_size_t size , yyscan_t yyscanner) |
| 2262 { |
| 2263 return (void *) malloc( size ); |
| 2264 } |
| 2265 |
| 2266 void *error_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner) |
| 2267 { |
| 2268 /* The cast to (char *) in the following accommodates both |
| 2269 * implementations that use char* generic pointers, and those |
| 2270 * that use void* generic pointers. It works with the latter |
| 2271 * because both ANSI C and C++ allow castless assignment from |
| 2272 * any pointer type to void*, and deal with argument conversions |
| 2273 * as though doing an assignment. |
| 2274 */ |
| 2275 return (void *) realloc( (char *) ptr, size ); |
| 2276 } |
| 2277 |
| 2278 void error_free (void * ptr , yyscan_t yyscanner) |
| 2279 { |
| 2280 free( (char *) ptr ); /* see error_realloc() for (char *) cast */ |
| 2281 } |
| 2282 |
| 2283 #define YYTABLES_NAME "yytables" |
| 2284 |
OLD | NEW |