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