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