| 1 |
|
| 2 |
#line 3 "apr_scanner.cc" |
| 3 |
|
| 4 |
#define YY_INT_ALIGNED short int |
| 5 |
|
| 6 |
/* A lexical scanner generated by flex */ |
| 7 |
|
| 8 |
/* %not-for-header */ |
| 9 |
|
| 10 |
/* %if-c-only */ |
| 11 |
/* %if-not-reentrant */ |
| 12 |
/* %endif */ |
| 13 |
/* %endif */ |
| 14 |
/* %ok-for-header */ |
| 15 |
|
| 16 |
#define FLEX_SCANNER |
| 17 |
#define YY_FLEX_MAJOR_VERSION 2 |
| 18 |
#define YY_FLEX_MINOR_VERSION 5 |
| 19 |
#define YY_FLEX_SUBMINOR_VERSION 39 |
| 20 |
#if YY_FLEX_SUBMINOR_VERSION > 0 |
| 21 |
#define FLEX_BETA |
| 22 |
#endif |
| 23 |
|
| 24 |
/* %if-c++-only */ |
| 25 |
/* The c++ scanner is a mess. The FlexLexer.h header file relies on the |
| 26 |
* following macro. This is required in order to pass the c++-multiple-scanners |
| 27 |
* test in the regression suite. We get reports that it breaks inheritance. |
| 28 |
* We will address this in a future release of flex, or omit the C++ scanner |
| 29 |
* altogether. |
| 30 |
*/ |
| 31 |
#define yyFlexLexer SEAMSFlexLexer |
| 32 |
/* %endif */ |
| 33 |
|
| 34 |
/* %if-c-only */ |
| 35 |
/* %endif */ |
| 36 |
|
| 37 |
/* %if-c-only */ |
| 38 |
/* %endif */ |
| 39 |
|
| 40 |
/* First, we deal with platform-specific or compiler-specific issues. */ |
| 41 |
|
| 42 |
/* begin standard C headers. */ |
| 43 |
/* %if-c-only */ |
| 44 |
/* %endif */ |
| 45 |
|
| 46 |
/* %if-tables-serialization */ |
| 47 |
/* %endif */ |
| 48 |
/* end standard C headers. */ |
| 49 |
|
| 50 |
/* %if-c-or-c++ */ |
| 51 |
/* flex integer type definitions */ |
| 52 |
|
| 53 |
#ifndef FLEXINT_H |
| 54 |
#define FLEXINT_H |
| 55 |
|
| 56 |
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ |
| 57 |
|
| 58 |
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L |
| 59 |
|
| 60 |
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, |
| 61 |
* if you want the limit (max/min) macros for int types. |
| 62 |
*/ |
| 63 |
#ifndef __STDC_LIMIT_MACROS |
| 64 |
#define __STDC_LIMIT_MACROS 1 |
| 65 |
#endif |
| 66 |
|
| 67 |
#include <inttypes.h> |
| 68 |
typedef int8_t flex_int8_t; |
| 69 |
typedef uint8_t flex_uint8_t; |
| 70 |
typedef int16_t flex_int16_t; |
| 71 |
typedef uint16_t flex_uint16_t; |
| 72 |
typedef int32_t flex_int32_t; |
| 73 |
typedef uint32_t flex_uint32_t; |
| 74 |
#else |
| 75 |
typedef signed char flex_int8_t; |
| 76 |
typedef short int flex_int16_t; |
| 77 |
typedef int flex_int32_t; |
| 78 |
typedef unsigned char flex_uint8_t; |
| 79 |
typedef unsigned short int flex_uint16_t; |
| 80 |
typedef unsigned int flex_uint32_t; |
| 81 |
|
| 82 |
/* Limits of integral types. */ |
| 83 |
#ifndef INT8_MIN |
| 84 |
#define INT8_MIN (-128) |
| 85 |
#endif |
| 86 |
#ifndef INT16_MIN |
| 87 |
#define INT16_MIN (-32767 - 1) |
| 88 |
#endif |
| 89 |
#ifndef INT32_MIN |
| 90 |
#define INT32_MIN (-2147483647 - 1) |
| 91 |
#endif |
| 92 |
#ifndef INT8_MAX |
| 93 |
#define INT8_MAX (127) |
| 94 |
#endif |
| 95 |
#ifndef INT16_MAX |
| 96 |
#define INT16_MAX (32767) |
| 97 |
#endif |
| 98 |
#ifndef INT32_MAX |
| 99 |
#define INT32_MAX (2147483647) |
| 100 |
#endif |
| 101 |
#ifndef UINT8_MAX |
| 102 |
#define UINT8_MAX (255U) |
| 103 |
#endif |
| 104 |
#ifndef UINT16_MAX |
| 105 |
#define UINT16_MAX (65535U) |
| 106 |
#endif |
| 107 |
#ifndef UINT32_MAX |
| 108 |
#define UINT32_MAX (4294967295U) |
| 109 |
#endif |
| 110 |
|
| 111 |
#endif /* ! C99 */ |
| 112 |
|
| 113 |
#endif /* ! FLEXINT_H */ |
| 114 |
|
| 115 |
/* %endif */ |
| 116 |
|
| 117 |
/* %if-c++-only */ |
| 118 |
/* begin standard C++ headers. */ |
| 119 |
#include <cstdio> |
| 120 |
#include <cstdlib> |
| 121 |
#include <cstring> |
| 122 |
#include <errno.h> |
| 123 |
#include <iostream> |
| 124 |
/* end standard C++ headers. */ |
| 125 |
/* %endif */ |
| 126 |
|
| 127 |
#ifdef __cplusplus |
| 128 |
|
| 129 |
/* The "const" storage-class-modifier is valid. */ |
| 130 |
#define YY_USE_CONST |
| 131 |
|
| 132 |
#else /* ! __cplusplus */ |
| 133 |
|
| 134 |
/* C99 requires __STDC__ to be defined as 1. */ |
| 135 |
#if defined(__STDC__) |
| 136 |
|
| 137 |
#define YY_USE_CONST |
| 138 |
|
| 139 |
#endif /* defined (__STDC__) */ |
| 140 |
#endif /* ! __cplusplus */ |
| 141 |
|
| 142 |
#ifdef YY_USE_CONST |
| 143 |
#define yyconst const |
| 144 |
#else |
| 145 |
#define yyconst |
| 146 |
#endif |
| 147 |
|
| 148 |
/* %not-for-header */ |
| 149 |
|
| 150 |
/* Returned upon end-of-file. */ |
| 151 |
#define YY_NULL 0 |
| 152 |
/* %ok-for-header */ |
| 153 |
|
| 154 |
/* %not-for-header */ |
| 155 |
|
| 156 |
/* Promotes a possibly negative, possibly signed char to an unsigned |
| 157 |
* integer for use as an array index. If the signed char is negative, |
| 158 |
* we want to instead treat it as an 8-bit unsigned char, hence the |
| 159 |
* double cast. |
| 160 |
*/ |
| 161 |
#define YY_SC_TO_UI(c) ((unsigned int)(unsigned char)c) |
| 162 |
/* %ok-for-header */ |
| 163 |
|
| 164 |
/* %if-reentrant */ |
| 165 |
/* %endif */ |
| 166 |
|
| 167 |
/* %if-not-reentrant */ |
| 168 |
|
| 169 |
/* %endif */ |
| 170 |
|
| 171 |
/* Enter a start condition. This macro really ought to take a parameter, |
| 172 |
* but we do it the disgusting crufty way forced on us by the ()-less |
| 173 |
* definition of BEGIN. |
| 174 |
*/ |
| 175 |
#define BEGIN (yy_start) = 1 + 2 * |
| 176 |
|
| 177 |
/* Translate the current start state into a value that can be later handed |
| 178 |
* to BEGIN to return to the state. The YYSTATE alias is for lex |
| 179 |
* compatibility. |
| 180 |
*/ |
| 181 |
#define YY_START (((yy_start) - 1) / 2) |
| 182 |
#define YYSTATE YY_START |
| 183 |
|
| 184 |
/* Action number for EOF rule of a given start state. */ |
| 185 |
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) |
| 186 |
|
| 187 |
/* Special action meaning "start processing a new file". */ |
| 188 |
#define YY_NEW_FILE yyrestart(yyin) |
| 189 |
|
| 190 |
#define YY_END_OF_BUFFER_CHAR 0 |
| 191 |
|
| 192 |
/* Size of default input buffer. */ |
| 193 |
#ifndef YY_BUF_SIZE |
| 194 |
#define YY_BUF_SIZE 16384 |
| 195 |
#endif |
| 196 |
|
| 197 |
/* The state buf must be large enough to hold one state per character in the main buffer. |
| 198 |
*/ |
| 199 |
#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) |
| 200 |
|
| 201 |
#ifndef YY_TYPEDEF_YY_BUFFER_STATE |
| 202 |
#define YY_TYPEDEF_YY_BUFFER_STATE |
| 203 |
typedef struct yy_buffer_state *YY_BUFFER_STATE; |
| 204 |
#endif |
| 205 |
|
| 206 |
#ifndef YY_TYPEDEF_YY_SIZE_T |
| 207 |
#define YY_TYPEDEF_YY_SIZE_T |
| 208 |
typedef size_t yy_size_t; |
| 209 |
#endif |
| 210 |
|
| 211 |
/* %if-not-reentrant */ |
| 212 |
extern int yyleng; |
| 213 |
/* %endif */ |
| 214 |
|
| 215 |
/* %if-c-only */ |
| 216 |
/* %if-not-reentrant */ |
| 217 |
/* %endif */ |
| 218 |
/* %endif */ |
| 219 |
|
| 220 |
#define EOB_ACT_CONTINUE_SCAN 0 |
| 221 |
#define EOB_ACT_END_OF_FILE 1 |
| 222 |
#define EOB_ACT_LAST_MATCH 2 |
| 223 |
|
| 224 |
#define YY_LESS_LINENO(n) |
| 225 |
#define YY_LINENO_REWIND_TO(ptr) |
| 226 |
|
| 227 |
/* Return all but the first "n" matched characters back to the input stream. */ |
| 228 |
#define yyless(n) \ |
| 229 |
do { \ |
| 230 |
/* Undo effects of setting up yytext. */ \ |
| 231 |
int yyless_macro_arg = (n); \ |
| 232 |
YY_LESS_LINENO(yyless_macro_arg); \ |
| 233 |
*yy_cp = (yy_hold_char); \ |
| 234 |
YY_RESTORE_YY_MORE_OFFSET(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ |
| 235 |
YY_DO_BEFORE_ACTION; /* set up yytext again */ \ |
| 236 |
} while (0) |
| 237 |
|
| 238 |
#define unput(c) yyunput(c, (yytext_ptr)) |
| 239 |
|
| 240 |
#ifndef YY_STRUCT_YY_BUFFER_STATE |
| 241 |
#define YY_STRUCT_YY_BUFFER_STATE |
| 242 |
struct yy_buffer_state |
| 243 |
{ |
| 244 |
/* %if-c-only */ |
| 245 |
/* %endif */ |
| 246 |
|
| 247 |
/* %if-c++-only */ |
| 248 |
std::istream *yy_input_file; |
| 249 |
/* %endif */ |
| 250 |
|
| 251 |
char *yy_ch_buf; /* input buffer */ |
| 252 |
char *yy_buf_pos; /* current position in input buffer */ |
| 253 |
|
| 254 |
/* Size of input buffer in bytes, not including room for EOB |
| 255 |
* characters. |
| 256 |
*/ |
| 257 |
yy_size_t yy_buf_size; |
| 258 |
|
| 259 |
/* Number of characters read into yy_ch_buf, not including EOB |
| 260 |
* characters. |
| 261 |
*/ |
| 262 |
yy_size_t yy_n_chars; |
| 263 |
|
| 264 |
/* Whether we "own" the buffer - i.e., we know we created it, |
| 265 |
* and can realloc() it to grow it, and should free() it to |
| 266 |
* delete it. |
| 267 |
*/ |
| 268 |
int yy_is_our_buffer; |
| 269 |
|
| 270 |
/* Whether this is an "interactive" input source; if so, and |
| 271 |
* if we're using stdio for input, then we want to use getc() |
| 272 |
* instead of fread(), to make sure we stop fetching input after |
| 273 |
* each newline. |
| 274 |
*/ |
| 275 |
int yy_is_interactive; |
| 276 |
|
| 277 |
/* Whether we're considered to be at the beginning of a line. |
| 278 |
* If so, '^' rules will be active on the next match, otherwise |
| 279 |
* not. |
| 280 |
*/ |
| 281 |
int yy_at_bol; |
| 282 |
|
| 283 |
int yy_bs_lineno; /**< The line count. */ |
| 284 |
int yy_bs_column; /**< The column count. */ |
| 285 |
|
| 286 |
/* Whether to try to fill the input buffer when we reach the |
| 287 |
* end of it. |
| 288 |
*/ |
| 289 |
int yy_fill_buffer; |
| 290 |
|
| 291 |
int yy_buffer_status; |
| 292 |
|
| 293 |
#define YY_BUFFER_NEW 0 |
| 294 |
#define YY_BUFFER_NORMAL 1 |
| 295 |
/* When an EOF's been seen but there's still some text to process |
| 296 |
* then we mark the buffer as YY_EOF_PENDING, to indicate that we |
| 297 |
* shouldn't try reading from the input source any more. We might |
| 298 |
* still have a bunch of tokens to match, though, because of |
| 299 |
* possible backing-up. |
| 300 |
* |
| 301 |
* When we actually see the EOF, we change the status to "new" |
| 302 |
* (via yyrestart()), so that the user can continue scanning by |
| 303 |
* just pointing yyin at a new input file. |
| 304 |
*/ |
| 305 |
#define YY_BUFFER_EOF_PENDING 2 |
| 306 |
}; |
| 307 |
#endif /* !YY_STRUCT_YY_BUFFER_STATE */ |
| 308 |
|
| 309 |
/* %if-c-only Standard (non-C++) definition */ |
| 310 |
/* %not-for-header */ |
| 311 |
|
| 312 |
/* %if-not-reentrant */ |
| 313 |
/* %endif */ |
| 314 |
/* %ok-for-header */ |
| 315 |
|
| 316 |
/* %endif */ |
| 317 |
|
| 318 |
/* We provide macros for accessing buffer states in case in the |
| 319 |
* future we want to put the buffer states in a more general |
| 320 |
* "scanner state". |
| 321 |
* |
| 322 |
* Returns the top of the stack, or NULL. |
| 323 |
*/ |
| 324 |
#define YY_CURRENT_BUFFER ((yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)] : NULL) |
| 325 |
|
| 326 |
/* Same as previous macro, but useful when we know that the buffer stack is not |
| 327 |
* NULL or when we need an lvalue. For internal use only. |
| 328 |
*/ |
| 329 |
#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] |
| 330 |
|
| 331 |
/* %if-c-only Standard (non-C++) definition */ |
| 332 |
/* %if-not-reentrant */ |
| 333 |
/* %not-for-header */ |
| 334 |
|
| 335 |
/* %ok-for-header */ |
| 336 |
|
| 337 |
/* %endif */ |
| 338 |
/* %endif */ |
| 339 |
|
| 340 |
void *SEAMSalloc(yy_size_t); |
| 341 |
void *SEAMSrealloc(void *, yy_size_t); |
| 342 |
void SEAMSfree(void *); |
| 343 |
|
| 344 |
#define yy_new_buffer yy_create_buffer |
| 345 |
|
| 346 |
#define yy_set_interactive(is_interactive) \ |
| 347 |
{ \ |
| 348 |
if (!YY_CURRENT_BUFFER) { \ |
| 349 |
yyensure_buffer_stack(); \ |
| 350 |
YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE); \ |
| 351 |
} \ |
| 352 |
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ |
| 353 |
} |
| 354 |
|
| 355 |
#define yy_set_bol(at_bol) \ |
| 356 |
{ \ |
| 357 |
if (!YY_CURRENT_BUFFER) { \ |
| 358 |
yyensure_buffer_stack(); \ |
| 359 |
YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE); \ |
| 360 |
} \ |
| 361 |
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ |
| 362 |
} |
| 363 |
|
| 364 |
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) |
| 365 |
|
| 366 |
/* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */ |
| 367 |
/* Begin user sect3 */ |
| 368 |
|
| 369 |
#define FLEX_DEBUG |
| 370 |
|
| 371 |
typedef unsigned char YY_CHAR; |
| 372 |
|
| 373 |
#define yytext_ptr yytext |
| 374 |
#define YY_INTERACTIVE |
| 375 |
|
| 376 |
#include <FlexLexer.h> |
| 377 |
|
| 378 |
/* %% [1.5] DFA */ |
| 379 |
|
| 380 |
/* %if-c-only Standard (non-C++) definition */ |
| 381 |
/* %endif */ |
| 382 |
|
| 383 |
/* Done after the current pattern has been matched and before the |
| 384 |
* corresponding action - sets up yytext. |
| 385 |
*/ |
| 386 |
#define YY_DO_BEFORE_ACTION \ |
| 387 |
(yytext_ptr) = yy_bp; \ |
| 388 |
/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */ \ |
| 389 |
yyleng = (yy_cp - yy_bp); \ |
| 390 |
(yy_hold_char) = *yy_cp; \ |
| 391 |
*yy_cp = '\0'; \ |
| 392 |
/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */ \ |
| 393 |
(yy_c_buf_p) = yy_cp; |
| 394 |
|
| 395 |
/* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */ |
| 396 |
#define YY_NUM_RULES 102 |
| 397 |
#define YY_END_OF_BUFFER 103 |
| 398 |
/* This struct is not used in this scanner, |
| 399 |
but its presence is necessary. */ |
| 400 |
struct yy_trans_info |
| 401 |
{ |
| 402 |
flex_int32_t yy_verify; |
| 403 |
flex_int32_t yy_nxt; |
| 404 |
}; |
| 405 |
static yyconst flex_int16_t yy_accept[685] = { |
| 406 |
0, 0, 0, 50, 50, 0, 0, 39, 39, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, |
| 407 |
0, 0, 0, 103, 100, 100, 101, 98, 99, 99, 99, 100, 95, 50, 70, 85, 100, 67, 100, 100, |
| 408 |
71, 72, 63, 61, 73, 62, 49, 66, 48, 75, 74, 77, 52, 78, 76, 51, 51, 51, 86, 87, |
| 409 |
68, 95, 100, 90, 64, 100, 100, 98, 99, 99, 99, 100, 95, 42, 42, 43, 39, 42, 39, 39, |
| 410 |
39, 39, 42, 42, 100, 3, 3, 4, 2, 3, 2, 2, 2, 2, 3, 3, 100, 100, 33, 98, |
| 411 |
99, |
| 412 |
|
| 413 |
99, 99, 100, 95, 100, 100, 98, 99, 99, 99, 100, 95, 100, 100, 17, 98, 99, 99, 99, 100, |
| 414 |
95, 100, 100, 21, 98, 99, 99, 99, 100, 95, 100, 100, 25, 98, 99, 99, 99, 100, 95, 0, |
| 415 |
0, 99, 99, 99, 92, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 50, 0, 82, |
| 416 |
0, 88, 83, 0, 89, 69, 55, 59, 53, 60, 54, 49, 0, 65, 56, 49, 48, 0, 79, 81, |
| 417 |
80, 51, 51, 51, 57, 0, 84, 91, 0, 0, 0, 0, 99, 99, 99, 92, 93, 0, 94, 0, |
| 418 |
|
| 419 |
0, 39, 39, 39, 39, 39, 40, 41, 0, 0, 0, 0, 2, 2, 2, 2, 2, 0, 0, 33, |
| 420 |
0, 0, 99, 99, 99, 92, 93, 0, 0, 94, 0, 0, 0, 0, 99, 99, 99, 92, 93, 0, |
| 421 |
94, 0, 17, 0, 0, 99, 99, 99, 92, 93, 0, 0, 0, 94, 0, 21, 0, 0, 99, 99, |
| 422 |
99, 92, 93, 0, 0, 0, 94, 0, 25, 0, 0, 99, 99, 99, 92, 93, 0, 0, 0, 0, |
| 423 |
0, 94, 99, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, 0, 49, |
| 424 |
|
| 425 |
0, 48, 51, 51, 0, 47, 99, 99, 0, 0, 39, 39, 0, 0, 0, 2, 2, 0, 99, 99, |
| 426 |
0, 0, 0, 0, 99, 99, 0, 0, 99, 99, 0, 0, 0, 0, 99, 99, 0, 0, 0, 0, |
| 427 |
99, 99, 0, 0, 0, 0, 0, 0, 96, 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 428 |
0, 0, 0, 0, 51, 51, 47, 96, 97, 0, 0, 39, 39, 0, 0, 0, 35, 0, 0, 2, |
| 429 |
2, 0, 96, 97, 0, 0, 0, 0, 0, 0, 0, 13, 0, 96, 97, 0, 0, 96, 97, 0, |
| 430 |
|
| 431 |
0, 0, 0, 96, 97, 0, 0, 0, 0, 96, 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 432 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 433 |
0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 434 |
0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, |
| 435 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 436 |
|
| 437 |
0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 37, 0, 0, 0, 27, 0, 0, 0, |
| 438 |
0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, |
| 439 |
0, 0, 17, 0, 0, 0, 15, 0, 0, 21, 0, 0, 0, 19, 0, 25, 0, 0, 0, 0, |
| 440 |
0, 0, 0, 44, 0, 0, 28, 0, 8, 0, 0, 0, 0, 47, 0, 0, 0, 38, 0, 36, |
| 441 |
0, 0, 29, 0, 30, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 21, 0, 0, 25, |
| 442 |
|
| 443 |
0, 0, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 37, 0, 47, 0, 0, 32, 0, 13, |
| 444 |
0, 0, 0, 0, 14, 0, 0, 18, 0, 0, 0, 0, 46, 0, 7, 0, 0, 0, 23, 0, |
| 445 |
44, 0, 0, 0, 13, 0, 0, 0, 0, 23, 0, 9, 0, 0, 0, 0, 0, 0, 0, 16, |
| 446 |
0, 20, 0, 0, 0, 0, 0, 26, 0, 0, 24, 0, 0, 0, 0, 0, 0, 5, 0, 0, |
| 447 |
10, 1, 11, 0}; |
| 448 |
|
| 449 |
static yyconst flex_int32_t yy_ec[256] = { |
| 450 |
0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, |
| 451 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 5, 6, 1, 7, 8, 9, 10, 11, 12, |
| 452 |
13, 14, 15, 16, 17, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 21, 22, 23, 24, |
| 453 |
25, 1, 26, 27, 28, 29, 30, 31, 29, 32, 33, 29, 29, 34, 35, 36, 37, 29, 38, 39, 29, |
| 454 |
40, 41, 42, 29, 43, 29, 29, 44, 45, 46, 47, 29, 1, 48, 49, 50, 51, |
| 455 |
|
| 456 |
52, 53, 29, 54, 55, 29, 29, 56, 29, 57, 58, 59, 38, 60, 61, 62, 63, 29, 64, 43, 29, |
| 457 |
29, 65, 66, 67, 68, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 458 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 459 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 460 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 461 |
|
| 462 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 463 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 464 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; |
| 465 |
|
| 466 |
static yyconst flex_int32_t yy_meta[69] = {0, 1, 2, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 467 |
1, 5, 6, 1, 1, 1, 1, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, |
| 468 |
5, 5, 5, 5, 5, 5, 5, 5, 1, 1, 1, 1, 5, 5, 5, 5, 5, 5, |
| 469 |
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 2, 1, 1, 1}; |
| 470 |
|
| 471 |
static yyconst flex_int16_t yy_base[731] = { |
| 472 |
0, 0, 0, 68, 0, 136, 0, 204, 0, 271, 272, 337, 0, 405, 0, |
| 473 |
473, 0, 541, 0, 609, 0, 677, 0, 2445, 2446, 744, 2446, 2446, 0, 2401, |
| 474 |
236, 213, 808, 748, 2446, 2420, 276, 2446, 2433, 2431, 2446, 2446, 268, 269, 2446, |
| 475 |
270, 265, 267, 270, 2446, 2446, 2417, 2416, 2415, 2446, 0, 2394, 247, 2446, 2446, |
| 476 |
2413, 264, 2369, 2367, 2446, 2421, 749, 2420, 873, 2388, 255, 735, 742, 2446, 753, |
| 477 |
2446, 754, 2446, 757, 293, 745, 758, 236, 765, 762, 2446, 766, 2446, 769, 2446, |
| 478 |
758, 294, 772, 770, 237, 751, 2427, 780, 2446, 2426, 941, |
| 479 |
|
| 480 |
2385, 264, 772, 802, 2415, 775, 2414, 1009, 2382, 265, 784, 796, 2421, 1076, 2446, |
| 481 |
2420, 1141, 2379, 267, 788, 1207, 2418, 1209, 2446, 2417, 1274, 2376, 268, 801, 1340, |
| 482 |
2415, 1342, 2446, 2414, 1407, 2373, 270, 1473, 1476, 1479, 270, 0, 730, 773, 2446, |
| 483 |
2446, 1079, 2360, 815, 812, 2356, 2376, 2382, 2359, 263, 268, 2446, 1480, 794, 2446, |
| 484 |
320, 2446, 2446, 2400, 2446, 2386, 2446, 2446, 2446, 2446, 2446, 1063, 1070, 2446, 2446, |
| 485 |
1066, 1071, 1078, 2446, 2446, 2446, 0, 1054, 1058, 2446, 1042, 2446, 2446, 2396, 1483, |
| 486 |
1484, 1202, 0, 1062, 1067, 2395, 2394, 1204, 2393, 1487, |
| 487 |
|
| 488 |
1213, 1488, 787, 1099, 1214, 1215, 2446, 2446, 1219, 1048, 2351, 1495, 1496, 1491, 1104, |
| 489 |
1218, 1343, 2373, 2399, 2446, 1499, 1345, 0, 1073, 1074, 2398, 2397, 1346, 1348, 2396, |
| 490 |
2386, 789, 1503, 1212, 0, 1077, 1078, 2385, 2384, 1338, 2383, 2391, 2446, 1506, 1491, |
| 491 |
0, 1079, 1081, 2390, 2389, 1217, 1474, 1501, 2388, 2387, 2446, 1509, 1532, 0, 1083, |
| 492 |
1195, 2386, 2385, 1350, 1513, 1515, 2384, 2383, 2446, 1520, 1573, 0, 1197, 1198, 2382, |
| 493 |
2381, 1579, 1530, 777, 1352, 1533, 2380, 1196, 1200, 2325, 2324, 2348, 2318, 2327, 2342, |
| 494 |
819, 2326, 2317, 2344, 2334, 2319, 2320, 2446, 2351, 2350, |
| 495 |
|
| 496 |
2349, 2348, 1205, 1317, 1530, 312, 1318, 1319, 1502, 1340, 1574, 1575, 2310, 2304, 1589, |
| 497 |
1588, 1592, 2325, 1320, 1321, 1543, 1516, 1607, 1123, 1322, 1324, 1545, 1342, 1325, 1327, |
| 498 |
1562, 1552, 1548, 1569, 1328, 1576, 1595, 1598, 1551, 1602, 1577, 1579, 1604, 1618, 1619, |
| 499 |
1623, 1353, 1630, 0, 0, 2312, 2312, 2324, 2308, 1601, 2318, 2306, 2306, 2300, 2296, |
| 500 |
2326, 2326, 2304, 1602, 0, 0, 2348, 0, 0, 1630, 1632, 1117, 1365, 2289, 2297, |
| 501 |
1641, 2446, 2296, 2296, 1647, 1651, 2319, 0, 0, 1644, 1645, 1672, 2342, 1646, 1659, |
| 502 |
1517, 2446, 1665, 0, 0, 1654, 1657, 0, 0, 1669, |
| 503 |
|
| 504 |
1670, 1682, 1677, 0, 0, 1683, 1688, 1686, 1685, 0, 0, 1694, 1696, 1691, 1698, |
| 505 |
1699, 1700, 2283, 2287, 1682, 2275, 2288, 2300, 2286, 2286, 2274, 1703, 2304, 2309, 2271, |
| 506 |
2269, 1692, 1699, 2280, 1684, 2278, 2278, 2303, 1689, 1705, 2325, 2446, 1710, 1715, 1718, |
| 507 |
1697, 1713, 1692, 1720, 1723, 1724, 1766, 1728, 1725, 1731, 1750, 1769, 1732, 1754, 1757, |
| 508 |
2324, 1759, 1762, 2263, 2288, 2446, 2321, 2256, 2296, 1777, 2268, 2269, 1787, 2446, 2282, |
| 509 |
2278, 2261, 2261, 1771, 1763, 1745, 2262, 1792, 2261, 2060, 2083, 1782, 1802, 1783, 1799, |
| 510 |
1783, 1798, 2076, 1794, 1804, 1812, 2071, 1809, 2051, 1796, |
| 511 |
|
| 512 |
1806, 1816, 2050, 2049, 1814, 2048, 2446, 1821, 1825, 1999, 1089, 2045, 2446, 2044, 2019, |
| 513 |
1827, 2446, 1831, 1993, 1977, 2010, 1980, 1979, 1822, 1843, 1836, 2037, 1849, 2446, 1855, |
| 514 |
2005, 2034, 2446, 2033, 1865, 2032, 1868, 1870, 1871, 1872, 1834, 2031, 2446, 2029, 1837, |
| 515 |
2028, 2446, 1841, 2027, 2446, 2026, 1838, 2025, 2446, 2023, 2446, 2022, 1849, 1853, 1971, |
| 516 |
1991, 2009, 2017, 2446, 1985, 1883, 2446, 1884, 2446, 1983, 1887, 1967, 1900, 1895, 1897, |
| 517 |
1914, 2013, 2446, 1917, 2446, 1980, 2011, 2446, 2010, 2446, 1920, 2008, 1902, 1917, 1922, |
| 518 |
1855, 2006, 2446, 2003, 1875, 2002, 2446, 2001, 2000, 2446, |
| 519 |
|
| 520 |
1933, 1890, 1928, 1990, 1934, 1969, 1939, 2446, 1987, 1904, 1994, 1942, 1992, 1943, 1939, |
| 521 |
1983, 1990, 2446, 1941, 2446, 1945, 1946, 1924, 1985, 2446, 1949, 1984, 2446, 1957, 1979, |
| 522 |
1953, 1961, 2446, 1913, 2446, 1962, 1864, 1887, 2446, 1960, 1545, 1500, 1963, 1965, 2446, |
| 523 |
1966, 1374, 1370, 1369, 2446, 1982, 2446, 1334, 1221, 1972, 1253, 1198, 1967, 1224, 2446, |
| 524 |
1223, 2446, 1988, 1222, 1208, 1128, 1136, 2446, 1096, 1099, 2446, 981, 850, 762, 785, |
| 525 |
774, 267, 2446, 265, 240, 2446, 2446, 2446, 2446, 2051, 2057, 2063, 2065, 2071, 2076, |
| 526 |
2078, 2083, 2085, 2091, 2097, 2103, 2109, 2115, 2121, 2127, |
| 527 |
|
| 528 |
2133, 2139, 2145, 2151, 2157, 2163, 2169, 2175, 2181, 2187, 2193, 2199, 2205, 2211, 2217, |
| 529 |
2223, 2229, 2235, 2241, 2247, 2253, 2259, 2265, 2271, 2277, 2283, 2289, 2295, 2301, 2307}; |
| 530 |
|
| 531 |
static yyconst flex_int16_t yy_def[731] = { |
| 532 |
0, 684, 1, 684, 3, 684, 5, 684, 7, 1, 1, 684, 11, 684, 13, 684, 15, |
| 533 |
684, 17, 684, 19, 684, 21, 684, 684, 684, 684, 684, 685, 685, 685, 684, 684, 684, |
| 534 |
684, 684, 686, 684, 684, 687, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, |
| 535 |
684, 684, 684, 684, 688, 688, 688, 684, 684, 684, 684, 684, 684, 684, 689, 689, 689, |
| 536 |
684, 68, 68, 689, 689, 684, 684, 684, 690, 684, 690, 691, 691, 691, 684, 684, 684, |
| 537 |
684, 684, 684, 692, 684, 692, 693, 693, 693, 684, 684, 694, 694, 684, 694, 684, |
| 538 |
|
| 539 |
100, 100, 694, 694, 695, 695, 695, 684, 108, 108, 695, 695, 696, 696, 684, 696, 684, |
| 540 |
117, 117, 696, 696, 697, 697, 684, 697, 684, 126, 126, 697, 697, 698, 698, 684, 698, |
| 541 |
684, 135, 135, 698, 698, 684, 32, 685, 685, 685, 684, 684, 684, 684, 684, 684, 684, |
| 542 |
684, 684, 684, 684, 684, 684, 684, 684, 684, 686, 684, 684, 687, 684, 684, 684, 684, |
| 543 |
684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 688, 688, 688, 684, |
| 544 |
684, 684, 684, 689, 689, 689, 689, 68, 68, 68, 689, 689, 689, 689, 684, |
| 545 |
|
| 546 |
684, 690, 690, 691, 691, 691, 684, 684, 684, 684, 684, 684, 692, 692, 693, 693, 693, |
| 547 |
684, 694, 684, 694, 694, 100, 100, 100, 694, 694, 694, 694, 694, 695, 695, 695, 695, |
| 548 |
108, 108, 108, 695, 695, 695, 695, 696, 684, 696, 696, 117, 117, 117, 696, 696, 696, |
| 549 |
696, 696, 696, 697, 684, 697, 697, 126, 126, 126, 697, 697, 697, 697, 697, 697, 698, |
| 550 |
684, 698, 698, 135, 135, 135, 698, 698, 698, 698, 698, 698, 698, 698, 685, 685, 684, |
| 551 |
684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, |
| 552 |
|
| 553 |
684, 684, 688, 688, 689, 689, 68, 68, 689, 689, 691, 691, 684, 684, 684, 693, 693, |
| 554 |
684, 100, 100, 694, 694, 694, 699, 108, 108, 695, 695, 117, 117, 696, 696, 696, 696, |
| 555 |
126, 126, 697, 697, 697, 697, 135, 135, 698, 698, 698, 698, 698, 698, 685, 685, 684, |
| 556 |
684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 688, 688, 684, 68, |
| 557 |
68, 689, 689, 691, 691, 684, 684, 684, 684, 684, 684, 693, 693, 684, 100, 100, 694, |
| 558 |
694, 694, 700, 694, 694, 699, 684, 699, 108, 108, 695, 695, 117, 117, 696, |
| 559 |
|
| 560 |
696, 696, 696, 126, 126, 697, 697, 697, 697, 135, 135, 698, 698, 698, 698, 698, 698, |
| 561 |
684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 689, 689, 684, |
| 562 |
684, 684, 684, 684, 694, 694, 700, 684, 694, 694, 699, 695, 695, 696, 696, 696, 696, |
| 563 |
696, 697, 697, 697, 697, 697, 698, 698, 698, 701, 698, 698, 684, 684, 684, 702, 684, |
| 564 |
684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 703, 689, 684, 684, 684, 684, 684, |
| 565 |
704, 694, 694, 694, 705, 695, 696, 706, 696, 696, 696, 707, 697, 708, 697, |
| 566 |
|
| 567 |
697, 697, 709, 710, 698, 701, 684, 698, 698, 684, 684, 702, 684, 711, 684, 684, 684, |
| 568 |
684, 684, 684, 684, 684, 684, 703, 703, 712, 713, 684, 684, 684, 684, 704, 684, 714, |
| 569 |
694, 715, 694, 705, 705, 716, 696, 706, 684, 717, 696, 707, 684, 697, 708, 684, 718, |
| 570 |
697, 709, 684, 710, 684, 719, 698, 698, 684, 684, 684, 711, 684, 684, 684, 684, 684, |
| 571 |
684, 684, 684, 684, 703, 703, 712, 712, 713, 684, 684, 684, 684, 714, 684, 715, 684, |
| 572 |
694, 720, 721, 716, 716, 696, 717, 684, 722, 697, 718, 684, 723, 719, 684, |
| 573 |
|
| 574 |
698, 698, 684, 684, 684, 684, 684, 684, 684, 684, 724, 684, 684, 712, 712, 684, 720, |
| 575 |
684, 721, 684, 721, 725, 696, 722, 684, 697, 723, 684, 698, 726, 698, 684, 684, 684, |
| 576 |
684, 684, 684, 724, 684, 684, 684, 684, 721, 725, 684, 725, 727, 728, 726, 684, 698, |
| 577 |
684, 684, 684, 684, 729, 684, 725, 727, 684, 728, 684, 698, 730, 684, 684, 729, 684, |
| 578 |
684, 730, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 0, 684, |
| 579 |
684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, |
| 580 |
|
| 581 |
684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, |
| 582 |
684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684}; |
| 583 |
|
| 584 |
static yyconst flex_int16_t yy_nxt[2515] = { |
| 585 |
0, 24, 25, 26, 25, 24, 24, 27, 24, 24, 24, 24, 24, 24, 24, 24, 24, |
| 586 |
24, 24, 24, 24, 24, 24, 24, 24, 24, 28, 28, 28, 28, 29, 28, 28, 28, |
| 587 |
28, 28, 28, 28, 30, 28, 28, 28, 28, 28, 24, 31, 24, 24, 28, 28, 28, |
| 588 |
28, 29, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 32, 24, 24, |
| 589 |
24, 24, 33, 34, 33, 35, 36, 27, 37, 38, 39, 40, 41, 42, 43, 44, 45, |
| 590 |
46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 55, 55, 55, 56, 55, 55, |
| 591 |
|
| 592 |
55, 55, 55, 55, 55, 57, 55, 55, 55, 55, 55, 58, 31, 59, 60, 55, 55, |
| 593 |
55, 55, 56, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 61, 62, |
| 594 |
63, 64, 65, 66, 26, 66, 65, 65, 67, 65, 65, 65, 65, 65, 65, 65, 65, |
| 595 |
65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 68, 68, 68, 68, 69, 68, 68, |
| 596 |
68, 68, 68, 68, 68, 70, 68, 68, 68, 68, 68, 65, 71, 65, 65, 68, 68, |
| 597 |
68, 68, 69, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, |
| 598 |
|
| 599 |
72, 65, 65, 65, 73, 74, 75, 76, 73, 73, 77, 73, 73, 73, 73, 73, 73, |
| 600 |
73, 73, 73, 73, 73, 78, 73, 73, 73, 73, 73, 73, 79, 79, 79, 79, 80, |
| 601 |
79, 79, 79, 79, 79, 79, 79, 81, 79, 79, 79, 79, 79, 73, 82, 73, 73, |
| 602 |
79, 79, 79, 79, 80, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, |
| 603 |
83, 73, 73, 73, 84, 84, 84, 84, 144, 145, 162, 146, 166, 162, 168, 172, 174, |
| 604 |
170, 176, 184, 177, 175, 167, 169, 171, 186, 173, 195, 203, 214, 144, 178, |
| 605 |
|
| 606 |
207, 145, 208, 146, 225, 237, 683, 248, 261, 184, 274, 684, 142, 142, 367, 186, 173, |
| 607 |
195, 288, 297, 291, 178, 162, 190, 292, 162, 225, 237, 157, 248, 261, 682, 274, 681, |
| 608 |
684, 61, 61, 85, 86, 87, 88, 85, 85, 89, 85, 85, 85, 85, 85, 85, 85, |
| 609 |
85, 85, 85, 85, 90, 85, 85, 85, 85, 85, 85, 91, 91, 91, 91, 92, 91, |
| 610 |
91, 91, 91, 91, 91, 91, 93, 91, 91, 91, 91, 91, 85, 94, 85, 85, 91, |
| 611 |
91, 91, 91, 92, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, |
| 612 |
|
| 613 |
91, 95, 85, 85, 85, 96, 97, 98, 97, 96, 96, 99, 96, 96, 96, 96, 96, |
| 614 |
96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 100, 100, 100, 100, |
| 615 |
101, 100, 100, 100, 100, 100, 100, 100, 102, 100, 100, 100, 100, 100, 96, 103, 96, |
| 616 |
96, 100, 100, 100, 100, 101, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, |
| 617 |
100, 104, 96, 96, 96, 105, 106, 26, 106, 105, 105, 107, 105, 105, 105, 105, 105, |
| 618 |
105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 108, 108, |
| 619 |
|
| 620 |
108, 108, 109, 108, 108, 108, 108, 108, 108, 108, 110, 108, 108, 108, 108, 108, 105, |
| 621 |
111, 105, 105, 108, 108, 108, 108, 109, 108, 108, 108, 108, 108, 108, 108, 108, 108, |
| 622 |
108, 108, 108, 112, 105, 105, 105, 113, 114, 115, 114, 113, 113, 116, 113, 113, 113, |
| 623 |
113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 117, 117, |
| 624 |
117, 117, 118, 117, 117, 117, 117, 117, 117, 117, 119, 117, 117, 117, 117, 117, 113, |
| 625 |
120, 113, 113, 117, 117, 117, 117, 118, 117, 117, 117, 117, 117, 117, 117, |
| 626 |
|
| 627 |
117, 117, 117, 117, 117, 121, 113, 113, 113, 122, 123, 124, 123, 122, 122, 125, 122, |
| 628 |
122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, |
| 629 |
126, 126, 126, 126, 127, 126, 126, 126, 126, 126, 126, 126, 128, 126, 126, 126, 126, |
| 630 |
126, 122, 129, 122, 122, 126, 126, 126, 126, 127, 126, 126, 126, 126, 126, 126, 126, |
| 631 |
126, 126, 126, 126, 126, 130, 122, 122, 122, 131, 132, 133, 132, 131, 131, 134, 131, |
| 632 |
131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, |
| 633 |
|
| 634 |
131, 131, 135, 135, 135, 135, 136, 135, 135, 135, 135, 135, 135, 135, 137, 135, 135, |
| 635 |
135, 135, 135, 131, 138, 131, 131, 135, 135, 135, 135, 136, 135, 135, 135, 135, 135, |
| 636 |
135, 135, 135, 135, 135, 135, 135, 139, 131, 131, 131, 140, 190, 140, 203, 158, 191, |
| 637 |
158, 191, 190, 200, 200, 200, 202, 684, 684, 190, 203, 283, 212, 142, 212, 209, 212, |
| 638 |
209, 212, 212, 198, 213, 214, 220, 214, 233, 142, 233, 269, 186, 221, 220, 221, 283, |
| 639 |
680, 232, 205, 684, 142, 243, 142, 218, 198, 210, 232, 679, 211, 206, 196, |
| 640 |
|
| 641 |
232, 197, 186, 256, 220, 284, 199, 232, 141, 147, 217, 147, 159, 192, 216, 157, 210, |
| 642 |
201, 201, 211, 206, 684, 684, 186, 346, 240, 159, 284, 678, 157, 159, 228, 217, 159, |
| 643 |
229, 148, 226, 149, 227, 234, 150, 151, 287, 152, 222, 186, 290, 240, 238, 153, 239, |
| 644 |
684, 249, 228, 250, 324, 229, 148, 154, 155, 241, 677, 156, 151, 291, 262, 230, 263, |
| 645 |
292, 357, 288, 289, 157, 189, 189, 358, 189, 189, 189, 189, 189, 189, 189, 189, 190, |
| 646 |
189, 189, 189, 189, 189, 189, 193, 193, 189, 189, 189, 189, 189, 193, 193, |
| 647 |
|
| 648 |
193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 189, |
| 649 |
189, 189, 189, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, |
| 650 |
193, 193, 193, 189, 189, 189, 189, 219, 219, 220, 219, 219, 219, 219, 219, 219, 219, |
| 651 |
219, 219, 219, 219, 219, 219, 219, 219, 223, 223, 219, 219, 219, 219, 219, 223, 223, |
| 652 |
223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 219, |
| 653 |
219, 219, 219, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, |
| 654 |
|
| 655 |
223, 223, 223, 223, 223, 219, 219, 219, 219, 231, 231, 676, 231, 231, 231, 231, 231, |
| 656 |
231, 231, 231, 232, 231, 231, 231, 231, 231, 231, 235, 235, 231, 231, 231, 231, 231, |
| 657 |
235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, |
| 658 |
235, 231, 231, 231, 231, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, |
| 659 |
235, 235, 235, 235, 235, 231, 231, 231, 231, 244, 243, 244, 147, 172, 147, 299, 172, |
| 660 |
299, 303, 176, 300, 177, 304, 301, 173, 301, 307, 173, 302, 288, 289, 308, |
| 661 |
|
| 662 |
178, 671, 203, 314, 289, 319, 320, 214, 303, 325, 326, 329, 304, 330, 173, 335, 307, |
| 663 |
173, 142, 561, 203, 308, 178, 142, 562, 392, 675, 319, 320, 154, 285, 325, 326, 329, |
| 664 |
393, 330, 142, 335, 668, 674, 245, 242, 242, 243, 242, 242, 242, 242, 242, 242, 242, |
| 665 |
242, 242, 242, 242, 242, 242, 242, 242, 246, 246, 242, 242, 242, 242, 242, 246, 246, |
| 666 |
246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 242, |
| 667 |
242, 242, 242, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, |
| 668 |
|
| 669 |
246, 246, 246, 246, 246, 242, 242, 242, 242, 243, 257, 256, 257, 190, 209, 190, 209, |
| 670 |
203, 203, 243, 209, 214, 209, 232, 671, 662, 660, 336, 669, 341, 342, 198, 251, 142, |
| 671 |
142, 349, 252, 142, 672, 350, 253, 240, 210, 673, 365, 211, 311, 312, 313, 336, 316, |
| 672 |
341, 342, 198, 251, 668, 666, 349, 252, 309, 310, 350, 253, 240, 210, 331, 365, 211, |
| 673 |
311, 312, 313, 254, 316, 258, 255, 255, 256, 255, 255, 255, 255, 255, 255, 255, 255, |
| 674 |
255, 255, 255, 255, 255, 255, 255, 259, 259, 255, 255, 255, 255, 255, 259, |
| 675 |
|
| 676 |
259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, |
| 677 |
255, 255, 255, 255, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, |
| 678 |
259, 259, 259, 259, 255, 255, 255, 255, 256, 270, 269, 270, 214, 220, 220, 232, 220, |
| 679 |
190, 256, 232, 269, 269, 366, 368, 369, 383, 384, 394, 142, 395, 398, 264, 399, 404, |
| 680 |
203, 265, 665, 650, 662, 266, 228, 317, 660, 229, 366, 368, 369, 383, 384, 394, 142, |
| 681 |
395, 398, 264, 399, 404, 371, 265, 397, 327, 328, 266, 228, 317, 337, 229, |
| 682 |
|
| 683 |
323, 321, 322, 347, 267, 416, 271, 268, 268, 269, 268, 268, 268, 268, 268, 268, 268, |
| 684 |
268, 268, 268, 268, 268, 268, 268, 268, 272, 272, 268, 268, 268, 268, 268, 272, 272, |
| 685 |
272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 268, |
| 686 |
268, 268, 268, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, |
| 687 |
272, 272, 272, 268, 268, 268, 268, 269, 243, 277, 269, 277, 140, 158, 140, 158, 305, |
| 688 |
191, 305, 191, 200, 200, 200, 202, 684, 243, 190, 190, 212, 212, 212, 213, |
| 689 |
|
| 690 |
221, 220, 221, 243, 233, 278, 233, 244, 243, 244, 257, 256, 257, 190, 232, 256, 251, |
| 691 |
256, 220, 392, 252, 270, 269, 270, 253, 279, 280, 281, 393, 332, 333, 305, 269, 305, |
| 692 |
256, 269, 657, 275, 251, 276, 282, 190, 252, 141, 159, 220, 253, 367, 192, 306, 243, |
| 693 |
201, 201, 256, 243, 684, 232, 264, 334, 159, 159, 265, 370, 222, 243, 266, 386, 234, |
| 694 |
338, 339, 245, 243, 340, 258, 277, 269, 277, 203, 203, 264, 277, 269, 277, 265, 271, |
| 695 |
344, 345, 266, 344, 348, 376, 214, 376, 142, 142, 214, 306, 256, 402, 377, |
| 696 |
|
| 697 |
256, 408, 278, 385, 256, 396, 269, 142, 387, 220, 387, 142, 401, 372, 373, 405, 410, |
| 698 |
388, 411, 400, 269, 269, 279, 280, 281, 269, 403, 380, 279, 280, 343, 381, 269, 422, |
| 699 |
422, 372, 373, 405, 410, 378, 411, 190, 376, 190, 376, 379, 220, 220, 220, 380, 214, |
| 700 |
377, 406, 381, 214, 422, 422, 389, 407, 409, 412, 220, 431, 390, 433, 232, 142, 392, |
| 701 |
232, 414, 142, 243, 243, 387, 220, 387, 393, 440, 413, 243, 417, 432, 388, 415, 243, |
| 702 |
256, 433, 256, 256, 447, 256, 220, 465, 269, 243, 439, 269, 443, 269, 440, |
| 703 |
|
| 704 |
269, 269, 269, 190, 473, 446, 473, 220, 232, 444, 190, 447, 220, 474, 450, 451, 482, |
| 705 |
220, 455, 456, 392, 449, 243, 460, 232, 243, 243, 256, 448, 393, 256, 445, 460, 256, |
| 706 |
269, 452, 450, 451, 482, 454, 455, 456, 453, 457, 458, 460, 462, 459, 466, 461, 467, |
| 707 |
480, 256, 492, 460, 486, 269, 487, 479, 269, 463, 269, 488, 490, 269, 491, 489, 496, |
| 708 |
243, 496, 502, 256, 502, 513, 190, 494, 497, 482, 516, 503, 516, 495, 525, 500, 220, |
| 709 |
220, 493, 517, 473, 498, 473, 499, 463, 528, 232, 528, 243, 474, 256, 482, |
| 710 |
|
| 711 |
243, 513, 529, 535, 220, 535, 243, 501, 256, 505, 539, 256, 536, 496, 243, 496, 269, |
| 712 |
502, 256, 502, 504, 508, 497, 269, 513, 509, 503, 269, 516, 526, 516, 541, 566, 525, |
| 713 |
566, 537, 243, 517, 564, 243, 256, 567, 548, 256, 573, 513, 573, 576, 534, 540, 528, |
| 714 |
269, 528, 541, 525, 269, 579, 243, 579, 529, 544, 545, 551, 552, 548, 580, 535, 220, |
| 715 |
535, 586, 220, 586, 513, 513, 564, 536, 558, 256, 587, 559, 557, 539, 539, 590, 566, |
| 716 |
607, 566, 607, 610, 639, 610, 591, 269, 567, 608, 594, 598, 613, 595, 564, |
| 717 |
|
| 718 |
654, 573, 513, 573, 620, 610, 525, 610, 576, 574, 601, 525, 623, 621, 602, 614, 564, |
| 719 |
614, 579, 564, 579, 586, 220, 586, 564, 576, 243, 580, 590, 632, 587, 632, 626, 590, |
| 720 |
629, 269, 629, 588, 633, 631, 607, 641, 607, 620, 614, 564, 614, 620, 645, 608, 576, |
| 721 |
256, 621, 611, 576, 269, 621, 646, 629, 269, 629, 655, 632, 655, 632, 620, 574, 645, |
| 722 |
645, 645, 611, 633, 653, 655, 621, 655, 646, 646, 646, 652, 615, 650, 647, 663, 269, |
| 723 |
663, 628, 625, 622, 663, 269, 663, 618, 642, 367, 640, 639, 637, 636, 630, |
| 724 |
|
| 725 |
635, 634, 600, 628, 597, 625, 651, 648, 593, 615, 618, 643, 585, 583, 616, 578, 612, |
| 726 |
609, 606, 564, 605, 604, 603, 630, 600, 556, 656, 554, 597, 550, 547, 593, 658, 543, |
| 727 |
585, 583, 533, 581, 656, 578, 572, 571, 570, 569, 568, 565, 564, 513, 664, 560, 507, |
| 728 |
556, 554, 550, 664, 142, 142, 161, 161, 161, 161, 161, 161, 164, 164, 164, 164, 164, |
| 729 |
164, 182, 182, 189, 189, 547, 189, 189, 189, 203, 543, 203, 203, 204, 204, 204, 214, |
| 730 |
533, 214, 214, 215, 215, 215, 219, 219, 219, 219, 219, 219, 231, 231, 531, |
| 731 |
|
| 732 |
231, 231, 231, 242, 242, 242, 242, 242, 242, 255, 255, 255, 255, 255, 255, 268, 268, |
| 733 |
268, 268, 268, 268, 391, 391, 391, 391, 391, 391, 441, 441, 441, 441, 441, 441, 506, |
| 734 |
506, 506, 506, 506, 506, 512, 512, 512, 512, 512, 512, 524, 524, 524, 524, 524, 524, |
| 735 |
532, 532, 532, 532, 532, 532, 538, 538, 538, 538, 538, 538, 542, 542, 542, 542, 542, |
| 736 |
542, 546, 546, 546, 546, 546, 546, 549, 549, 549, 549, 549, 549, 553, 553, 553, 553, |
| 737 |
553, 553, 555, 555, 555, 555, 555, 555, 563, 563, 563, 563, 563, 563, 575, |
| 738 |
|
| 739 |
575, 575, 575, 575, 575, 577, 577, 577, 577, 577, 577, 582, 582, 582, 582, 582, 582, |
| 740 |
584, 584, 584, 584, 584, 584, 589, 589, 589, 589, 589, 589, 592, 592, 592, 592, 592, |
| 741 |
592, 596, 596, 596, 596, 596, 596, 599, 599, 599, 599, 599, 599, 617, 617, 617, 617, |
| 742 |
617, 617, 619, 619, 619, 619, 619, 619, 624, 624, 624, 624, 624, 624, 627, 627, 627, |
| 743 |
627, 627, 627, 638, 638, 638, 638, 638, 638, 644, 644, 644, 644, 644, 644, 649, 649, |
| 744 |
649, 649, 649, 649, 659, 659, 659, 659, 659, 659, 661, 661, 661, 661, 661, |
| 745 |
|
| 746 |
661, 667, 667, 667, 667, 667, 667, 670, 670, 670, 670, 670, 670, 530, 527, 523, 522, |
| 747 |
521, 520, 519, 518, 515, 514, 513, 511, 510, 507, 442, 485, 484, 483, 481, 478, 477, |
| 748 |
476, 475, 472, 471, 470, 469, 468, 467, 464, 431, 442, 438, 437, 436, 435, 434, 367, |
| 749 |
430, 429, 428, 427, 426, 425, 424, 423, 421, 420, 419, 418, 382, 375, 374, 302, 302, |
| 750 |
300, 300, 364, 363, 362, 361, 360, 359, 356, 355, 354, 353, 352, 351, 269, 269, 269, |
| 751 |
269, 256, 256, 256, 256, 243, 243, 243, 243, 232, 232, 232, 232, 220, 220, |
| 752 |
|
| 753 |
220, 220, 318, 315, 190, 190, 190, 190, 298, 165, 296, 295, 294, 293, 286, 273, 269, |
| 754 |
269, 260, 256, 256, 247, 243, 243, 236, 232, 232, 224, 220, 220, 194, 190, 190, 188, |
| 755 |
187, 185, 183, 181, 180, 179, 165, 163, 160, 143, 684, 23, 684, 684, 684, 684, 684, |
| 756 |
684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, |
| 757 |
684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, |
| 758 |
684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, |
| 759 |
|
| 760 |
684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684}; |
| 761 |
|
| 762 |
static yyconst flex_int16_t yy_chk[2515] = { |
| 763 |
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 764 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 765 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 766 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 767 |
1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, |
| 768 |
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, |
| 769 |
|
| 770 |
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, |
| 771 |
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, |
| 772 |
3, 3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, |
| 773 |
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, |
| 774 |
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, |
| 775 |
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, |
| 776 |
|
| 777 |
5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
| 778 |
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
| 779 |
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
| 780 |
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, |
| 781 |
7, 7, 7, 7, 9, 10, 9, 10, 30, 31, 36, 31, 42, 36, 43, 46, 47, |
| 782 |
45, 48, 57, 48, 47, 42, 43, 45, 61, 46, 70, 79, 91, 30, 48, |
| 783 |
|
| 784 |
82, 94, 82, 94, 102, 110, 680, 119, 128, 57, 137, 141, 79, 91, 306, 61, 46, |
| 785 |
70, 155, 155, 156, 48, 161, 306, 156, 161, 102, 110, 61, 119, 128, 679, 137, 677, |
| 786 |
141, 9, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, |
| 787 |
11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, |
| 788 |
11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, |
| 789 |
11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, |
| 790 |
|
| 791 |
11, 11, 11, 11, 11, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, |
| 792 |
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, |
| 793 |
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, |
| 794 |
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, |
| 795 |
13, 13, 13, 13, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, |
| 796 |
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, |
| 797 |
|
| 798 |
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, |
| 799 |
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, |
| 800 |
15, 15, 15, 15, 15, 15, 15, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, |
| 801 |
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, |
| 802 |
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, |
| 803 |
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, |
| 804 |
|
| 805 |
17, 17, 17, 17, 17, 17, 17, 17, 17, 19, 19, 19, 19, 19, 19, 19, 19, |
| 806 |
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, |
| 807 |
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, |
| 808 |
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, |
| 809 |
19, 19, 19, 19, 19, 19, 19, 19, 19, 21, 21, 21, 21, 21, 21, 21, 21, |
| 810 |
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, |
| 811 |
|
| 812 |
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, |
| 813 |
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, |
| 814 |
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 25, 71, 25, 80, 33, 66, |
| 815 |
33, 66, 72, 74, 76, 74, 76, 78, 90, 66, 81, 143, 84, 80, 84, 83, 86, |
| 816 |
83, 86, 88, 72, 88, 93, 103, 92, 106, 81, 106, 279, 95, 97, 97, 97, 143, |
| 817 |
676, 106, 80, 203, 93, 120, 92, 95, 72, 83, 111, 675, 83, 81, 71, |
| 818 |
|
| 819 |
232, 71, 95, 129, 104, 144, 72, 112, 25, 32, 93, 32, 33, 66, 92, 95, 83, |
| 820 |
74, 76, 83, 81, 78, 90, 159, 279, 112, 84, 144, 674, 83, 86, 104, 93, 88, |
| 821 |
104, 32, 103, 32, 103, 106, 32, 32, 149, 32, 97, 159, 150, 112, 111, 32, 111, |
| 822 |
203, 120, 104, 120, 232, 104, 32, 32, 32, 112, 673, 32, 32, 150, 129, 104, 129, |
| 823 |
150, 291, 149, 149, 32, 68, 68, 291, 68, 68, 68, 68, 68, 68, 68, 68, 68, |
| 824 |
68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, |
| 825 |
|
| 826 |
68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, |
| 827 |
68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, |
| 828 |
68, 68, 68, 68, 68, 68, 68, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, |
| 829 |
100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, |
| 830 |
100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, |
| 831 |
100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, |
| 832 |
|
| 833 |
100, 100, 100, 100, 100, 100, 100, 100, 100, 108, 108, 672, 108, 108, 108, 108, 108, |
| 834 |
108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, |
| 835 |
108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, |
| 836 |
108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, |
| 837 |
108, 108, 108, 108, 108, 108, 108, 108, 108, 114, 114, 114, 147, 172, 147, 173, 176, |
| 838 |
173, 183, 177, 173, 177, 184, 178, 172, 178, 194, 176, 178, 186, 186, 195, |
| 839 |
|
| 840 |
177, 670, 204, 210, 210, 224, 225, 215, 183, 236, 237, 247, 184, 248, 172, 260, 194, |
| 841 |
176, 204, 511, 372, 195, 177, 215, 511, 324, 669, 224, 225, 147, 147, 236, 237, 247, |
| 842 |
324, 248, 372, 260, 667, 666, 114, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, |
| 843 |
117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, |
| 844 |
117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, |
| 845 |
117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, |
| 846 |
|
| 847 |
117, 117, 117, 117, 117, 117, 117, 117, 117, 121, 123, 123, 123, 192, 201, 198, 201, |
| 848 |
205, 206, 251, 209, 216, 209, 234, 664, 661, 659, 261, 657, 273, 274, 192, 121, 205, |
| 849 |
206, 283, 121, 216, 665, 284, 121, 234, 201, 665, 303, 201, 205, 206, 209, 261, 216, |
| 850 |
273, 274, 192, 121, 656, 654, 283, 121, 198, 198, 284, 121, 234, 201, 251, 303, 201, |
| 851 |
205, 206, 209, 121, 216, 123, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, |
| 852 |
126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, |
| 853 |
|
| 854 |
126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, |
| 855 |
126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, |
| 856 |
126, 126, 126, 126, 126, 126, 126, 126, 130, 132, 132, 132, 217, 222, 228, 240, 229, |
| 857 |
310, 264, 328, 280, 347, 304, 307, 308, 319, 320, 325, 217, 326, 329, 130, 330, 335, |
| 858 |
373, 130, 653, 649, 648, 130, 222, 217, 647, 222, 304, 307, 308, 319, 320, 325, 373, |
| 859 |
326, 329, 130, 330, 335, 310, 130, 328, 240, 240, 130, 222, 217, 264, 222, |
| 860 |
|
| 861 |
229, 228, 228, 280, 130, 347, 132, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, |
| 862 |
135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, |
| 863 |
135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, |
| 864 |
135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, |
| 865 |
135, 135, 135, 135, 135, 135, 135, 138, 252, 139, 139, 139, 140, 158, 140, 158, 190, |
| 866 |
191, 190, 191, 200, 202, 200, 202, 214, 245, 190, 191, 212, 213, 212, 213, |
| 867 |
|
| 868 |
221, 221, 221, 253, 233, 139, 233, 244, 244, 244, 257, 257, 257, 309, 233, 265, 245, |
| 869 |
266, 322, 391, 245, 270, 270, 270, 245, 139, 139, 139, 391, 252, 252, 305, 278, 305, |
| 870 |
258, 281, 642, 138, 245, 138, 139, 305, 245, 140, 158, 321, 245, 641, 191, 190, 333, |
| 871 |
200, 202, 339, 332, 214, 327, 258, 253, 212, 213, 258, 309, 221, 331, 258, 322, 233, |
| 872 |
265, 265, 244, 334, 266, 257, 271, 271, 271, 311, 312, 258, 277, 277, 277, 258, 270, |
| 873 |
278, 278, 258, 281, 281, 315, 316, 315, 311, 312, 317, 305, 337, 333, 315, |
| 874 |
|
| 875 |
338, 339, 271, 321, 340, 327, 343, 316, 323, 323, 323, 317, 332, 311, 312, 336, 341, |
| 876 |
323, 342, 331, 344, 345, 271, 271, 271, 346, 334, 316, 277, 277, 277, 317, 348, 355, |
| 877 |
364, 311, 312, 336, 341, 315, 342, 370, 376, 371, 376, 315, 385, 386, 389, 316, 380, |
| 878 |
376, 337, 317, 381, 355, 364, 323, 338, 340, 343, 390, 364, 323, 371, 396, 380, 393, |
| 879 |
397, 345, 381, 400, 401, 387, 387, 387, 393, 386, 344, 403, 348, 370, 387, 346, 402, |
| 880 |
406, 371, 409, 408, 397, 407, 439, 420, 414, 448, 385, 412, 389, 413, 386, |
| 881 |
|
| 882 |
415, 416, 417, 432, 427, 396, 427, 440, 446, 390, 433, 397, 443, 427, 402, 402, 435, |
| 883 |
444, 408, 408, 445, 401, 449, 414, 447, 450, 451, 454, 400, 445, 453, 393, 417, 455, |
| 884 |
458, 403, 402, 402, 435, 407, 408, 408, 406, 409, 412, 414, 416, 413, 420, 415, 435, |
| 885 |
433, 456, 448, 417, 439, 459, 440, 432, 460, 417, 462, 443, 446, 463, 447, 444, 452, |
| 886 |
452, 452, 457, 457, 457, 479, 480, 450, 452, 481, 470, 457, 470, 451, 479, 455, 487, |
| 887 |
489, 449, 470, 473, 453, 473, 454, 458, 483, 491, 483, 494, 473, 500, 481, |
| 888 |
|
| 889 |
492, 490, 483, 488, 488, 488, 495, 456, 501, 460, 490, 498, 488, 496, 496, 496, 505, |
| 890 |
502, 502, 502, 459, 462, 496, 508, 524, 463, 502, 509, 516, 480, 516, 492, 518, 524, |
| 891 |
518, 489, 541, 516, 526, 545, 552, 518, 498, 548, 525, 525, 525, 526, 487, 491, 528, |
| 892 |
558, 528, 492, 525, 559, 530, 591, 530, 528, 494, 495, 500, 501, 498, 530, 535, 535, |
| 893 |
535, 537, 537, 537, 538, 539, 540, 535, 508, 595, 537, 509, 505, 538, 539, 540, 566, |
| 894 |
568, 566, 568, 571, 638, 571, 541, 602, 566, 568, 545, 552, 574, 548, 575, |
| 895 |
|
| 896 |
637, 573, 573, 573, 588, 610, 574, 610, 575, 525, 558, 573, 591, 588, 559, 576, 576, |
| 897 |
576, 579, 589, 579, 586, 586, 586, 590, 576, 623, 579, 589, 603, 586, 603, 595, 590, |
| 898 |
601, 601, 601, 539, 603, 602, 607, 615, 607, 619, 614, 614, 614, 621, 622, 607, 615, |
| 899 |
626, 619, 571, 614, 631, 621, 622, 629, 629, 629, 640, 632, 640, 632, 643, 573, 644, |
| 900 |
646, 658, 610, 632, 636, 655, 643, 655, 644, 646, 658, 634, 576, 630, 623, 651, 651, |
| 901 |
651, 627, 624, 590, 663, 663, 663, 617, 616, 613, 612, 611, 609, 606, 601, |
| 902 |
|
| 903 |
605, 604, 599, 598, 596, 594, 631, 626, 592, 614, 587, 621, 584, 582, 581, 577, 572, |
| 904 |
570, 565, 563, 562, 561, 560, 629, 557, 555, 640, 553, 551, 549, 546, 544, 646, 542, |
| 905 |
536, 534, 532, 531, 655, 527, 523, 522, 521, 520, 519, 515, 514, 512, 651, 510, 506, |
| 906 |
504, 503, 499, 663, 685, 685, 686, 686, 686, 686, 686, 686, 687, 687, 687, 687, 687, |
| 907 |
687, 688, 688, 689, 689, 497, 689, 689, 689, 690, 493, 690, 690, 691, 691, 691, 692, |
| 908 |
486, 692, 692, 693, 693, 693, 694, 694, 694, 694, 694, 694, 695, 695, 485, |
| 909 |
|
| 910 |
695, 695, 695, 696, 696, 696, 696, 696, 696, 697, 697, 697, 697, 697, 697, 698, 698, |
| 911 |
698, 698, 698, 698, 699, 699, 699, 699, 699, 699, 700, 700, 700, 700, 700, 700, 701, |
| 912 |
701, 701, 701, 701, 701, 702, 702, 702, 702, 702, 702, 703, 703, 703, 703, 703, 703, |
| 913 |
704, 704, 704, 704, 704, 704, 705, 705, 705, 705, 705, 705, 706, 706, 706, 706, 706, |
| 914 |
706, 707, 707, 707, 707, 707, 707, 708, 708, 708, 708, 708, 708, 709, 709, 709, 709, |
| 915 |
709, 709, 710, 710, 710, 710, 710, 710, 711, 711, 711, 711, 711, 711, 712, |
| 916 |
|
| 917 |
712, 712, 712, 712, 712, 713, 713, 713, 713, 713, 713, 714, 714, 714, 714, 714, 714, |
| 918 |
715, 715, 715, 715, 715, 715, 716, 716, 716, 716, 716, 716, 717, 717, 717, 717, 717, |
| 919 |
717, 718, 718, 718, 718, 718, 718, 719, 719, 719, 719, 719, 719, 720, 720, 720, 720, |
| 920 |
720, 720, 721, 721, 721, 721, 721, 721, 722, 722, 722, 722, 722, 722, 723, 723, 723, |
| 921 |
723, 723, 723, 724, 724, 724, 724, 724, 724, 725, 725, 725, 725, 725, 725, 726, 726, |
| 922 |
726, 726, 726, 726, 727, 727, 727, 727, 727, 727, 728, 728, 728, 728, 728, |
| 923 |
|
| 924 |
728, 729, 729, 729, 729, 729, 729, 730, 730, 730, 730, 730, 730, 484, 482, 478, 477, |
| 925 |
476, 475, 472, 471, 469, 468, 467, 465, 464, 461, 441, 438, 437, 436, 434, 431, 430, |
| 926 |
429, 428, 426, 425, 424, 423, 422, 421, 419, 418, 388, 382, 379, 378, 375, 374, 367, |
| 927 |
363, 362, 361, 360, 359, 358, 357, 356, 354, 353, 352, 351, 318, 314, 313, 302, 301, |
| 928 |
300, 299, 297, 296, 295, 294, 293, 292, 290, 289, 288, 287, 286, 285, 282, 276, 275, |
| 929 |
268, 267, 263, 262, 255, 254, 250, 249, 242, 241, 239, 238, 231, 230, 227, |
| 930 |
|
| 931 |
226, 219, 218, 211, 199, 197, 196, 189, 166, 164, 154, 153, 152, 151, 148, 136, 134, |
| 932 |
131, 127, 125, 122, 118, 116, 113, 109, 107, 105, 101, 99, 96, 69, 67, 65, 63, |
| 933 |
62, 60, 56, 53, 52, 51, 39, 38, 35, 29, 23, 684, 684, 684, 684, 684, 684, |
| 934 |
684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, |
| 935 |
684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, |
| 936 |
684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, |
| 937 |
|
| 938 |
684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684}; |
| 939 |
|
| 940 |
static yyconst flex_int16_t yy_rule_linenum[102] = { |
| 941 |
0, 124, 125, 126, 127, 131, 132, 133, 134, 135, 137, 138, 140, 146, 227, 251, 257, |
| 942 |
278, 285, 296, 301, 315, 320, 327, 350, 361, 363, 377, 390, 415, 421, 426, 431, 436, |
| 943 |
446, 454, 462, 471, 499, 520, 521, 522, 523, 525, 530, 555, 557, 559, 598, 599, 602, |
| 944 |
604, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, |
| 945 |
628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, |
| 946 |
645, 646, 647, 648, 654, 660, 672, 692, 694, 696, 713, 729, 730, 740, 743, 744, |
| 947 |
|
| 948 |
746}; |
| 949 |
|
| 950 |
/* The intent behind this definition is that it'll catch |
| 951 |
* any uses of REJECT which flex missed. |
| 952 |
*/ |
| 953 |
#define REJECT reject_used_but_not_detected |
| 954 |
#define yymore() yymore_used_but_not_detected |
| 955 |
#define YY_MORE_ADJ 0 |
| 956 |
#define YY_RESTORE_YY_MORE_OFFSET |
| 957 |
/* -*- Mode: c++ -*- */ |
| 958 |
/* |
| 959 |
* Copyright(C) 1999-2022 National Technology & Engineering Solutions |
| 960 |
* of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with |
| 961 |
* NTESS, the U.S. Government retains certain rights in this software. |
| 962 |
* |
| 963 |
* See packages/seacas/LICENSE for details |
| 964 |
*/ |
| 965 |
|
| 966 |
#include <assert.h> |
| 967 |
#include <fcntl.h> |
| 968 |
#include <fstream> |
| 969 |
#include <iostream> |
| 970 |
#include <sstream> |
| 971 |
#include <stack> |
| 972 |
#include <stdio.h> |
| 973 |
#include <string.h> |
| 974 |
#include <unistd.h> |
| 975 |
|
| 976 |
#include "apr_getline.h" |
| 977 |
#include "apr_scanner.h" |
| 978 |
#include "apr_tokenize.h" |
| 979 |
#include "apr_util.h" |
| 980 |
#include "aprepro.h" |
| 981 |
#include "fmt/format.h" |
| 982 |
#include "fmt/ostream.h" |
| 983 |
#include "fmt/ranges.h" |
| 984 |
|
| 985 |
#define YY_NO_UNISTD_H |
| 986 |
/* import the parser's token type into a local typedef */ |
| 987 |
typedef SEAMS::Parser::token token; |
| 988 |
typedef SEAMS::Parser::token_type token_type; |
| 989 |
|
| 990 |
/* By default yylex returns int, we use token_type. Unfortunately yyterminate |
| 991 |
* by default returns 0, which is not of token_type. */ |
| 992 |
#define yyterminate() return token::END |
| 993 |
|
| 994 |
#define show(x) *(aprepro->infoStream) << "<" << x << ">" << std::flush; |
| 995 |
namespace SEAMS { |
| 996 |
extern bool echo; |
| 997 |
void yyerror(const char *s); |
| 998 |
} // namespace SEAMS |
| 999 |
|
| 1000 |
namespace { |
| 1001 |
bool begin_double_brace = false; |
| 1002 |
bool end_double_brace = false; |
| 1003 |
bool string_is_ascii(const char *line, size_t len) |
| 1004 |
{ |
| 1005 |
for (size_t i = 0; i < len; i++) { |
| 1006 |
if (!(std::isspace(static_cast<unsigned char>(line[i])) || |
| 1007 |
std::isprint(static_cast<unsigned char>(line[i])))) { |
| 1008 |
return false; |
| 1009 |
} |
| 1010 |
} |
| 1011 |
return true; |
| 1012 |
} |
| 1013 |
} // namespace |
| 1014 |
|
| 1015 |
int file_must_exist = 0; /* Global used by include/conditional include */ |
| 1016 |
|
| 1017 |
/* Global variables used by the looping mechanism */ |
| 1018 |
SEAMS::file_rec *outer_file = nullptr; |
| 1019 |
int loop_lvl = 0; |
| 1020 |
std::fstream *tmp_file; |
| 1021 |
const char *temp_f; |
| 1022 |
|
| 1023 |
#if defined __NVCC__ |
| 1024 |
#pragma diag_suppress code_is_unreachable |
| 1025 |
#endif |
| 1026 |
|
| 1027 |
#define MAX_IF_NESTING 1024 |
| 1028 |
|
| 1029 |
int if_state[MAX_IF_NESTING] = {0}; // INITIAL |
| 1030 |
int if_case_run[MAX_IF_NESTING] = {false}; /* Has any if or elseif condition executed */ |
| 1031 |
int if_lvl = 0; |
| 1032 |
int if_skip_level = 0; |
| 1033 |
bool suppress_nl = false; |
| 1034 |
bool switch_active = false; // Are we in a switch |
| 1035 |
bool switch_case_run = false; // has there been a case which matched condition run? |
| 1036 |
bool switch_skip_to_endcase = false; |
| 1037 |
double switch_condition = 0.0; // Value specified in "switch(condition)" |
| 1038 |
|
| 1039 |
// For substitution history |
| 1040 |
int curr_index = 0; |
| 1041 |
std::string history_string; |
| 1042 |
size_t hist_start = 0; |
| 1043 |
|
| 1044 |
#define YY_USER_ACTION curr_index += yyleng; |
| 1045 |
|
| 1046 |
/*** Flex Declarations and Options ***/ |
| 1047 |
/* enable c++ scanner class generation */ |
| 1048 |
/* change the name of the scanner class. results in "SEAMSFlexLexer" */ |
| 1049 |
/* enable scanner to generate debug output. disable this for release |
| 1050 |
* versions. */ |
| 1051 |
/* enables the use of start condition stacks */ |
| 1052 |
|
| 1053 |
#define INITIAL 0 |
| 1054 |
#define PARSING 1 |
| 1055 |
#define GET_FILENAME 2 |
| 1056 |
#define IF_SKIP 3 |
| 1057 |
#define GET_VAR 4 |
| 1058 |
#define VERBATIM 5 |
| 1059 |
#define IF_WHILE_SKIP 6 |
| 1060 |
#define GET_LOOP_VAR 7 |
| 1061 |
#define LOOP 8 |
| 1062 |
#define LOOP_SKIP 9 |
| 1063 |
#define END_CASE_SKIP 10 |
| 1064 |
|
| 1065 |
#ifndef YY_NO_UNISTD_H |
| 1066 |
/* Special case for "unistd.h", since it is non-ANSI. We include it way |
| 1067 |
* down here because we want the user's section 1 to have been scanned first. |
| 1068 |
* The user has a chance to override it with an option. |
| 1069 |
*/ |
| 1070 |
/* %if-c-only */ |
| 1071 |
/* %endif */ |
| 1072 |
/* %if-c++-only */ |
| 1073 |
#include <unistd.h> |
| 1074 |
/* %endif */ |
| 1075 |
#endif |
| 1076 |
|
| 1077 |
#ifndef YY_EXTRA_TYPE |
| 1078 |
#define YY_EXTRA_TYPE void * |
| 1079 |
#endif |
| 1080 |
|
| 1081 |
/* %if-c-only Reentrant structure and macros (non-C++). */ |
| 1082 |
/* %if-reentrant */ |
| 1083 |
/* %if-c-only */ |
| 1084 |
/* %endif */ |
| 1085 |
/* %if-reentrant */ |
| 1086 |
/* %endif */ |
| 1087 |
/* %endif End reentrant structures and macros. */ |
| 1088 |
/* %if-bison-bridge */ |
| 1089 |
/* %endif */ |
| 1090 |
/* %not-for-header */ |
| 1091 |
|
| 1092 |
/* %ok-for-header */ |
| 1093 |
|
| 1094 |
/* %endif */ |
| 1095 |
|
| 1096 |
#ifndef yytext_ptr |
| 1097 |
static void yy_flex_strncpy(char *, yyconst char *, int); |
| 1098 |
#endif |
| 1099 |
|
| 1100 |
#ifdef YY_NEED_STRLEN |
| 1101 |
static int yy_flex_strlen(yyconst char *); |
| 1102 |
#endif |
| 1103 |
|
| 1104 |
#ifndef YY_NO_INPUT |
| 1105 |
/* %if-c-only Standard (non-C++) definition */ |
| 1106 |
/* %not-for-header */ |
| 1107 |
|
| 1108 |
/* %ok-for-header */ |
| 1109 |
|
| 1110 |
/* %endif */ |
| 1111 |
#endif |
| 1112 |
|
| 1113 |
/* %if-c-only */ |
| 1114 |
/* %endif */ |
| 1115 |
|
| 1116 |
/* Amount of stuff to slurp up with each read. */ |
| 1117 |
#ifndef YY_READ_BUF_SIZE |
| 1118 |
#define YY_READ_BUF_SIZE 8192 |
| 1119 |
#endif |
| 1120 |
|
| 1121 |
/* Copy whatever the last rule matched to the standard output. */ |
| 1122 |
#ifndef ECHO |
| 1123 |
/* %if-c-only Standard (non-C++) definition */ |
| 1124 |
/* %endif */ |
| 1125 |
/* %if-c++-only C++ definition */ |
| 1126 |
#define ECHO LexerOutput(yytext, yyleng) |
| 1127 |
/* %endif */ |
| 1128 |
#endif |
| 1129 |
|
| 1130 |
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, |
| 1131 |
* is returned in "result". |
| 1132 |
*/ |
| 1133 |
#ifndef YY_INPUT |
| 1134 |
#define YY_INPUT(buf, result, max_size) \ |
| 1135 |
/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */ \ |
| 1136 |
\ |
| 1137 |
/* %if-c++-only C++ definition \ */ \ |
| 1138 |
if ((result = LexerInput((char *)buf, max_size)) < 0) \ |
| 1139 |
YY_FATAL_ERROR("input in flex scanner failed"); |
| 1140 |
/* %endif */ |
| 1141 |
|
| 1142 |
#endif |
| 1143 |
|
| 1144 |
/* No semi-colon after return; correct usage is to write "yyterminate();" - |
| 1145 |
* we don't want an extra ';' after the "return" because that will cause |
| 1146 |
* some compilers to complain about unreachable statements. |
| 1147 |
*/ |
| 1148 |
#ifndef yyterminate |
| 1149 |
#define yyterminate() return YY_NULL |
| 1150 |
#endif |
| 1151 |
|
| 1152 |
/* Number of entries by which start-condition stack grows. */ |
| 1153 |
#ifndef YY_START_STACK_INCR |
| 1154 |
#define YY_START_STACK_INCR 25 |
| 1155 |
#endif |
| 1156 |
|
| 1157 |
/* Report a fatal error. */ |
| 1158 |
#ifndef YY_FATAL_ERROR |
| 1159 |
/* %if-c-only */ |
| 1160 |
/* %endif */ |
| 1161 |
/* %if-c++-only */ |
| 1162 |
#define YY_FATAL_ERROR(msg) LexerError(msg) |
| 1163 |
/* %endif */ |
| 1164 |
#endif |
| 1165 |
|
| 1166 |
/* %if-tables-serialization structures and prototypes */ |
| 1167 |
/* %not-for-header */ |
| 1168 |
|
| 1169 |
/* %ok-for-header */ |
| 1170 |
|
| 1171 |
/* %not-for-header */ |
| 1172 |
|
| 1173 |
/* %tables-yydmap generated elements */ |
| 1174 |
/* %endif */ |
| 1175 |
/* end tables serialization structures and prototypes */ |
| 1176 |
|
| 1177 |
/* %ok-for-header */ |
| 1178 |
|
| 1179 |
/* Default declaration of generated scanner - a define so the user can |
| 1180 |
* easily add parameters. |
| 1181 |
*/ |
| 1182 |
#ifndef YY_DECL |
| 1183 |
#define YY_DECL_IS_OURS 1 |
| 1184 |
/* %if-c-only Standard (non-C++) definition */ |
| 1185 |
/* %endif */ |
| 1186 |
/* %if-c++-only C++ definition */ |
| 1187 |
#define YY_DECL int yyFlexLexer::yylex() |
| 1188 |
/* %endif */ |
| 1189 |
#endif /* !YY_DECL */ |
| 1190 |
|
| 1191 |
/* Code executed at the beginning of each rule, after yytext and yyleng |
| 1192 |
* have been set up. |
| 1193 |
*/ |
| 1194 |
#ifndef YY_USER_ACTION |
| 1195 |
#define YY_USER_ACTION |
| 1196 |
#endif |
| 1197 |
|
| 1198 |
/* Code executed at the end of each rule. */ |
| 1199 |
#ifndef YY_BREAK |
| 1200 |
#define YY_BREAK break; |
| 1201 |
#endif |
| 1202 |
|
| 1203 |
/* %% [6.0] YY_RULE_SETUP definition goes here */ |
| 1204 |
#define YY_RULE_SETUP YY_USER_ACTION |
| 1205 |
|
| 1206 |
/* %not-for-header */ |
| 1207 |
|
| 1208 |
/** The main scanner function which does all the work. |
| 1209 |
*/ |
| 1210 |
YY_DECL |
| 1211 |
{ |
| 1212 |
yy_state_type yy_current_state; |
| 1213 |
char *yy_cp, *yy_bp; |
| 1214 |
int yy_act; |
| 1215 |
|
| 1216 |
if (!(yy_init)) { |
| 1217 |
(yy_init) = 1; |
| 1218 |
|
| 1219 |
#ifdef YY_USER_INIT |
| 1220 |
YY_USER_INIT; |
| 1221 |
#endif |
| 1222 |
|
| 1223 |
if (!(yy_start)) |
| 1224 |
(yy_start) = 1; /* first start state */ |
| 1225 |
|
| 1226 |
if (!yyin) |
| 1227 |
/* %if-c-only */ |
| 1228 |
/* %endif */ |
| 1229 |
/* %if-c++-only */ |
| 1230 |
yyin = &std::cin; |
| 1231 |
/* %endif */ |
| 1232 |
|
| 1233 |
if (!yyout) |
| 1234 |
/* %if-c-only */ |
| 1235 |
/* %endif */ |
| 1236 |
/* %if-c++-only */ |
| 1237 |
yyout = &std::cout; |
| 1238 |
/* %endif */ |
| 1239 |
|
| 1240 |
if (!YY_CURRENT_BUFFER) { |
| 1241 |
yyensure_buffer_stack(); |
| 1242 |
YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE); |
| 1243 |
} |
| 1244 |
|
| 1245 |
yy_load_buffer_state(); |
| 1246 |
} |
| 1247 |
|
| 1248 |
{ |
| 1249 |
/* %% [7.0] user's declarations go here */ |
| 1250 |
|
| 1251 |
while (1) /* loops until end-of-file is reached */ |
| 1252 |
{ |
| 1253 |
/* %% [8.0] yymore()-related code goes here */ |
| 1254 |
yy_cp = (yy_c_buf_p); |
| 1255 |
|
| 1256 |
/* Support of yytext. */ |
| 1257 |
*yy_cp = (yy_hold_char); |
| 1258 |
|
| 1259 |
/* yy_bp points to the position in yy_ch_buf of the start of |
| 1260 |
* the current run. |
| 1261 |
*/ |
| 1262 |
yy_bp = yy_cp; |
| 1263 |
|
| 1264 |
/* %% [9.0] code to set up and find next match goes here */ |
| 1265 |
yy_current_state = (yy_start); |
| 1266 |
yy_match: |
| 1267 |
do { |
| 1268 |
YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; |
| 1269 |
if (yy_accept[yy_current_state]) { |
| 1270 |
(yy_last_accepting_state) = yy_current_state; |
| 1271 |
(yy_last_accepting_cpos) = yy_cp; |
| 1272 |
} |
| 1273 |
while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { |
| 1274 |
yy_current_state = (int)yy_def[yy_current_state]; |
| 1275 |
if (yy_current_state >= 685) |
| 1276 |
yy_c = yy_meta[(unsigned int)yy_c]; |
| 1277 |
} |
| 1278 |
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)yy_c]; |
| 1279 |
++yy_cp; |
| 1280 |
} while (yy_base[yy_current_state] != 2446); |
| 1281 |
|
| 1282 |
yy_find_action: |
| 1283 |
/* %% [10.0] code to find the action number goes here */ |
| 1284 |
yy_act = yy_accept[yy_current_state]; |
| 1285 |
if (yy_act == 0) { /* have to back up */ |
| 1286 |
yy_cp = (yy_last_accepting_cpos); |
| 1287 |
yy_current_state = (yy_last_accepting_state); |
| 1288 |
yy_act = yy_accept[yy_current_state]; |
| 1289 |
} |
| 1290 |
|
| 1291 |
YY_DO_BEFORE_ACTION; |
| 1292 |
|
| 1293 |
/* %% [11.0] code for yylineno update goes here */ |
| 1294 |
|
| 1295 |
do_action: /* This label is used only to access EOF actions. */ |
| 1296 |
|
| 1297 |
/* %% [12.0] debug code goes here */ |
| 1298 |
if (yy_flex_debug) { |
| 1299 |
if (yy_act == 0) |
| 1300 |
std::cerr << "--scanner backing up\n"; |
| 1301 |
else if (yy_act < 102) |
| 1302 |
std::cerr << "--accepting rule at line " << yy_rule_linenum[yy_act] << "(\"" << yytext |
| 1303 |
<< "\")\n"; |
| 1304 |
else if (yy_act == 102) |
| 1305 |
std::cerr << "--accepting default rule (\"" << yytext << "\")\n"; |
| 1306 |
else if (yy_act == 103) |
| 1307 |
std::cerr << "--(end of buffer or a NUL)\n"; |
| 1308 |
else |
| 1309 |
std::cerr << "--EOF (start condition " << YY_START << ")\n"; |
| 1310 |
} |
| 1311 |
|
| 1312 |
switch (yy_act) { /* beginning of action switch */ |
| 1313 |
/* %% [13.0] actions go here */ |
| 1314 |
case 0: /* must back up */ |
| 1315 |
/* undo the effects of YY_DO_BEFORE_ACTION */ |
| 1316 |
*yy_cp = (yy_hold_char); |
| 1317 |
yy_cp = (yy_last_accepting_cpos); |
| 1318 |
yy_current_state = (yy_last_accepting_state); |
| 1319 |
goto yy_find_action; |
| 1320 |
|
| 1321 |
case 1: |
| 1322 |
YY_RULE_SETUP { BEGIN(INITIAL); } |
| 1323 |
YY_BREAK |
| 1324 |
case 2: |
| 1325 |
case 3: |
| 1326 |
YY_RULE_SETUP |
| 1327 |
{ |
| 1328 |
if (echo) |
| 1329 |
ECHO; |
| 1330 |
} |
| 1331 |
YY_BREAK |
| 1332 |
case 4: |
| 1333 |
/* rule 4 can match eol */ |
| 1334 |
YY_RULE_SETUP |
| 1335 |
{ |
| 1336 |
if (echo) |
| 1337 |
ECHO; |
| 1338 |
aprepro.ap_file_list.top().lineno++; |
| 1339 |
} |
| 1340 |
YY_BREAK |
| 1341 |
|
| 1342 |
case 5: |
| 1343 |
YY_RULE_SETUP { BEGIN(VERBATIM); } |
| 1344 |
YY_BREAK |
| 1345 |
case 6: |
| 1346 |
case 7: |
| 1347 |
YY_RULE_SETUP { echo = true; } |
| 1348 |
YY_BREAK |
| 1349 |
case 8: |
| 1350 |
case 9: |
| 1351 |
YY_RULE_SETUP { echo = false; } |
| 1352 |
YY_BREAK |
| 1353 |
case 10: |
| 1354 |
YY_RULE_SETUP { aprepro.stateImmutable = true; } |
| 1355 |
YY_BREAK |
| 1356 |
case 11: |
| 1357 |
YY_RULE_SETUP { aprepro.stateImmutable = aprepro.ap_options.immutable; } |
| 1358 |
YY_BREAK |
| 1359 |
case 12: |
| 1360 |
YY_RULE_SETUP { BEGIN(GET_LOOP_VAR); } |
| 1361 |
YY_BREAK |
| 1362 |
|
| 1363 |
case 13: |
| 1364 |
/* rule 13 can match eol */ |
| 1365 |
YY_RULE_SETUP |
| 1366 |
{ |
| 1367 |
aprepro.ap_file_list.top().lineno++; |
| 1368 |
/* `yytext` includes closing `)}` and newline... Strip these */ |
| 1369 |
char *pt = strchr(yytext, ')'); |
| 1370 |
*pt = '\0'; |
| 1371 |
auto tokens = tokenize(yytext, " ,\t"); |
| 1372 |
if (aprepro.ap_options.debugging) { |
| 1373 |
fmt::print(stderr, "DEBUG LOOP: tokens = {}\n", fmt::join(tokens, ", ")); |
| 1374 |
} |
| 1375 |
|
| 1376 |
/* Determine if the first token is a symbol or an explicit number... */ |
| 1377 |
auto count = tokens[0]; |
| 1378 |
bool all_dig = count.find_first_not_of("0123456789") == std::string::npos; |
| 1379 |
int loop_iterations = 0; |
| 1380 |
if (all_dig) { |
| 1381 |
loop_iterations = std::stoi(count); |
| 1382 |
} |
| 1383 |
else { |
| 1384 |
symrec *s; |
| 1385 |
if (!check_valid_var(tokens[0].c_str())) { |
| 1386 |
aprepro.warning("Invalid variable name syntax '" + tokens[0] + "'"); |
| 1387 |
BEGIN(LOOP_SKIP); |
| 1388 |
} |
| 1389 |
else { |
| 1390 |
s = aprepro.getsym(tokens[0]); |
| 1391 |
if (s == nullptr || |
| 1392 |
(s->type != token::SVAR && s->type != token::IMMSVAR && s->value.var == 0.)) { |
| 1393 |
BEGIN(LOOP_SKIP); |
| 1394 |
} |
| 1395 |
else { |
| 1396 |
loop_iterations = (int)s->value.var; |
| 1397 |
} |
| 1398 |
} |
| 1399 |
} |
| 1400 |
|
| 1401 |
if (loop_iterations <= 0) { |
| 1402 |
BEGIN(LOOP_SKIP); |
| 1403 |
if (aprepro.ap_options.debugging) { |
| 1404 |
fmt::print(stderr, "DEBUG LOOP: iteration count = {}, Skipping loop...\n", |
| 1405 |
loop_iterations); |
| 1406 |
} |
| 1407 |
} |
| 1408 |
else { |
| 1409 |
temp_f = get_temp_filename(); |
| 1410 |
SEAMS::file_rec new_file(temp_f, 0, true, loop_iterations); |
| 1411 |
outer_file = &aprepro.ap_file_list.top(); |
| 1412 |
new_file.loop_level = outer_file->loop_level + 1; |
| 1413 |
|
| 1414 |
// Get optional loop index... |
| 1415 |
std::string sym_name; |
| 1416 |
if (tokens.size() == 1) { |
| 1417 |
// Default loop index variable name if not specified in loop command. |
| 1418 |
sym_name = fmt::format("__loop_{}", new_file.loop_level); |
| 1419 |
} |
| 1420 |
else { |
| 1421 |
sym_name = tokens[1]; |
| 1422 |
} |
| 1423 |
SEAMS::symrec *li = aprepro.getsym(sym_name); |
| 1424 |
if (li == nullptr) { |
| 1425 |
li = aprepro.putsym(sym_name, SEAMS::Aprepro::SYMBOL_TYPE::VARIABLE, true); |
| 1426 |
} |
| 1427 |
|
| 1428 |
// Get optional loop index initial value. Default to 0 if not specified. |
| 1429 |
double init = 0.0; |
| 1430 |
if (tokens.size() >= 3) { |
| 1431 |
init = std::stod(tokens[2]); |
| 1432 |
} |
| 1433 |
li->value.var = init; |
| 1434 |
|
| 1435 |
// Get optional loop index increment value. Default to 1 if not specified. |
| 1436 |
if (tokens.size() >= 4) { |
| 1437 |
double increment = std::stod(tokens[3]); |
| 1438 |
new_file.loop_increment = increment; |
| 1439 |
} |
| 1440 |
|
| 1441 |
new_file.loop_index = li; |
| 1442 |
aprepro.ap_file_list.push(new_file); |
| 1443 |
|
| 1444 |
tmp_file = new std::fstream(temp_f, std::ios::out); |
| 1445 |
loop_lvl++; |
| 1446 |
BEGIN(LOOP); |
| 1447 |
aprepro.isCollectingLoop = true; |
| 1448 |
if (aprepro.ap_options.debugging) { |
| 1449 |
fmt::print( |
| 1450 |
stderr, |
| 1451 |
"DEBUG LOOP: iteration count = {}, loop_index variable = {}, initial value = " |
| 1452 |
"{}, increment = {}\n", |
| 1453 |
loop_iterations, sym_name, init, new_file.loop_increment); |
| 1454 |
} |
| 1455 |
} |
| 1456 |
} |
| 1457 |
YY_BREAK |
| 1458 |
|
| 1459 |
case 14: |
| 1460 |
/* rule 14 can match eol */ |
| 1461 |
YY_RULE_SETUP |
| 1462 |
{ |
| 1463 |
outer_file->lineno++; |
| 1464 |
if (loop_lvl > 0) |
| 1465 |
--loop_lvl; |
| 1466 |
|
| 1467 |
if (loop_lvl == 0) { |
| 1468 |
BEGIN(INITIAL); |
| 1469 |
tmp_file->close(); |
| 1470 |
delete tmp_file; |
| 1471 |
|
| 1472 |
if (!aprepro.doLoopSubstitution) |
| 1473 |
yy_push_state(VERBATIM); |
| 1474 |
|
| 1475 |
aprepro.isCollectingLoop = false; |
| 1476 |
|
| 1477 |
yyin = aprepro.open_file(aprepro.ap_file_list.top().name, "r"); |
| 1478 |
yyFlexLexer::yypush_buffer_state(yyFlexLexer::yy_create_buffer(yyin, YY_BUF_SIZE)); |
| 1479 |
curr_index = 0; |
| 1480 |
} |
| 1481 |
else { |
| 1482 |
(*tmp_file) << yytext; |
| 1483 |
} |
| 1484 |
} |
| 1485 |
YY_BREAK |
| 1486 |
case 15: |
| 1487 |
/* rule 15 can match eol */ |
| 1488 |
YY_RULE_SETUP |
| 1489 |
{ |
| 1490 |
loop_lvl++; /* Nested Loop */ |
| 1491 |
(*tmp_file) << yytext; |
| 1492 |
outer_file->lineno++; |
| 1493 |
} |
| 1494 |
YY_BREAK |
| 1495 |
case 16: |
| 1496 |
/* rule 16 can match eol */ |
| 1497 |
YY_RULE_SETUP |
| 1498 |
{ |
| 1499 |
if (aprepro.ap_options.interactive || aprepro.string_interactive()) { |
| 1500 |
aprepro.warning("Aborting loop(s).", false); |
| 1501 |
|
| 1502 |
// Leave the looping state and remove the loop file |
| 1503 |
BEGIN(INITIAL); |
| 1504 |
tmp_file->close(); |
| 1505 |
delete tmp_file; |
| 1506 |
|
| 1507 |
if (aprepro.ap_file_list.top().tmp_file) { |
| 1508 |
remove(aprepro.ap_file_list.top().name.c_str()); |
| 1509 |
aprepro.ap_file_list.pop(); |
| 1510 |
} |
| 1511 |
|
| 1512 |
loop_lvl = 0; |
| 1513 |
aprepro.isCollectingLoop = false; |
| 1514 |
} |
| 1515 |
} |
| 1516 |
YY_BREAK |
| 1517 |
case 17: |
| 1518 |
/* rule 17 can match eol */ |
| 1519 |
YY_RULE_SETUP |
| 1520 |
{ |
| 1521 |
(*tmp_file) << yytext; |
| 1522 |
outer_file->lineno++; |
| 1523 |
} |
| 1524 |
YY_BREAK |
| 1525 |
|
| 1526 |
case 18: |
| 1527 |
/* rule 18 can match eol */ |
| 1528 |
YY_RULE_SETUP |
| 1529 |
{ |
| 1530 |
aprepro.ap_file_list.top().lineno++; |
| 1531 |
if (loop_lvl > 0) |
| 1532 |
--loop_lvl; |
| 1533 |
|
| 1534 |
if (loop_lvl == 0) { |
| 1535 |
BEGIN(INITIAL); |
| 1536 |
aprepro.isCollectingLoop = false; |
| 1537 |
} |
| 1538 |
} |
| 1539 |
YY_BREAK |
| 1540 |
case 19: |
| 1541 |
/* rule 19 can match eol */ |
| 1542 |
YY_RULE_SETUP |
| 1543 |
{ |
| 1544 |
loop_lvl++; /* Nested Loop */ |
| 1545 |
aprepro.ap_file_list.top().lineno++; |
| 1546 |
} |
| 1547 |
YY_BREAK |
| 1548 |
case 20: |
| 1549 |
/* rule 20 can match eol */ |
| 1550 |
YY_RULE_SETUP |
| 1551 |
{ |
| 1552 |
if (aprepro.ap_options.interactive || aprepro.string_interactive()) { |
| 1553 |
aprepro.warning("Aborting loops(s).", false); |
| 1554 |
|
| 1555 |
// Leave the looping state |
| 1556 |
BEGIN(INITIAL); |
| 1557 |
|
| 1558 |
loop_lvl = 0; |
| 1559 |
aprepro.isCollectingLoop = false; |
| 1560 |
} |
| 1561 |
} |
| 1562 |
YY_BREAK |
| 1563 |
case 21: |
| 1564 |
/* rule 21 can match eol */ |
| 1565 |
YY_RULE_SETUP { /* Do not increment line count */ ; } |
| 1566 |
YY_BREAK |
| 1567 |
|
| 1568 |
case 22: |
| 1569 |
/* rule 22 can match eol */ |
| 1570 |
YY_RULE_SETUP |
| 1571 |
{ |
| 1572 |
yyless(0); |
| 1573 |
curr_index = 0; |
| 1574 |
BEGIN(INITIAL); |
| 1575 |
switch_skip_to_endcase = false; |
| 1576 |
} |
| 1577 |
YY_BREAK |
| 1578 |
case 23: |
| 1579 |
/* rule 23 can match eol */ |
| 1580 |
YY_RULE_SETUP |
| 1581 |
{ |
| 1582 |
if (!switch_active) { |
| 1583 |
yyerror("default statement found outside switch statement."); |
| 1584 |
} |
| 1585 |
|
| 1586 |
if (!switch_case_run) { |
| 1587 |
switch_case_run = true; |
| 1588 |
BEGIN(INITIAL); |
| 1589 |
switch_skip_to_endcase = false; |
| 1590 |
if (aprepro.ap_options.debugging) |
| 1591 |
fprintf(stderr, "DEBUG SWITCH: 'default' code executing at line %d\n", |
| 1592 |
aprepro.ap_file_list.top().lineno); |
| 1593 |
} |
| 1594 |
else { |
| 1595 |
if (aprepro.ap_options.debugging) |
| 1596 |
fprintf(stderr, |
| 1597 |
"DEBUG SWITCH: 'default' not executing since a previous case already ran at " |
| 1598 |
"line %d\n", |
| 1599 |
aprepro.ap_file_list.top().lineno); |
| 1600 |
|
| 1601 |
/* Need to skip all code until end of case */ |
| 1602 |
BEGIN(END_CASE_SKIP); |
| 1603 |
} |
| 1604 |
} |
| 1605 |
YY_BREAK |
| 1606 |
case 24: |
| 1607 |
/* rule 24 can match eol */ |
| 1608 |
YY_RULE_SETUP |
| 1609 |
{ |
| 1610 |
aprepro.ap_file_list.top().lineno++; |
| 1611 |
BEGIN(INITIAL); |
| 1612 |
switch_active = false; |
| 1613 |
switch_skip_to_endcase = false; |
| 1614 |
suppress_nl = false; |
| 1615 |
if (aprepro.ap_options.debugging) |
| 1616 |
fprintf(stderr, "DEBUG SWITCH: 'endswitch' at line %d\n", |
| 1617 |
aprepro.ap_file_list.top().lineno); |
| 1618 |
} |
| 1619 |
YY_BREAK |
| 1620 |
case 25: |
| 1621 |
/* rule 25 can match eol */ |
| 1622 |
YY_RULE_SETUP { aprepro.ap_file_list.top().lineno++; } |
| 1623 |
YY_BREAK |
| 1624 |
case 26: |
| 1625 |
/* rule 26 can match eol */ |
| 1626 |
YY_RULE_SETUP |
| 1627 |
{ |
| 1628 |
aprepro.ap_file_list.top().lineno++; |
| 1629 |
if (!switch_active) { |
| 1630 |
yyerror("endswitch statement found without matching switch."); |
| 1631 |
} |
| 1632 |
switch_active = false; |
| 1633 |
switch_skip_to_endcase = false; |
| 1634 |
} |
| 1635 |
YY_BREAK |
| 1636 |
|
| 1637 |
/* This restores the old behavior of ifdef and ifndef |
| 1638 |
* where they would eat up any leading whitespace on |
| 1639 |
* a line. |
| 1640 |
*/ |
| 1641 |
case 27: |
| 1642 |
YY_RULE_SETUP |
| 1643 |
{ |
| 1644 |
// Used to avoid undefined variable warnings in old ifdef/ifndef construct |
| 1645 |
aprepro.inIfdefGetvar = true; |
| 1646 |
unput('('); |
| 1647 |
unput('f'); |
| 1648 |
unput('e'); |
| 1649 |
unput('d'); |
| 1650 |
unput('f'); |
| 1651 |
unput('i'); |
| 1652 |
unput('_'); |
| 1653 |
unput('{'); |
| 1654 |
curr_index = 0; |
| 1655 |
} |
| 1656 |
YY_BREAK |
| 1657 |
case 28: |
| 1658 |
YY_RULE_SETUP |
| 1659 |
{ |
| 1660 |
// Used to avoid undefined variable warnings in old ifdef/ifndef construct |
| 1661 |
aprepro.inIfdefGetvar = true; |
| 1662 |
unput('('); |
| 1663 |
unput('f'); |
| 1664 |
unput('e'); |
| 1665 |
unput('d'); |
| 1666 |
unput('n'); |
| 1667 |
unput('f'); |
| 1668 |
unput('i'); |
| 1669 |
unput('_'); |
| 1670 |
unput('{'); |
| 1671 |
curr_index = 0; |
| 1672 |
} |
| 1673 |
YY_BREAK |
| 1674 |
|
| 1675 |
/* If an if was found while skipping, then eat |
| 1676 |
* that entire if block until endif |
| 1677 |
* found since there is no way that |
| 1678 |
* any of the code in that if block could be executed. |
| 1679 |
* Make sure to handle multiple levels of skipped ifs... |
| 1680 |
* |
| 1681 |
* NOTE: if_lvl was not incremented, so don't need to decrement when |
| 1682 |
* endif found. |
| 1683 |
*/ |
| 1684 |
case 29: |
| 1685 |
/* rule 29 can match eol */ |
| 1686 |
YY_RULE_SETUP |
| 1687 |
{ |
| 1688 |
aprepro.ap_file_list.top().lineno++; |
| 1689 |
if (--if_skip_level == 0) |
| 1690 |
BEGIN(IF_SKIP); |
| 1691 |
} |
| 1692 |
YY_BREAK |
| 1693 |
case 30: |
| 1694 |
/* rule 30 can match eol */ |
| 1695 |
YY_RULE_SETUP |
| 1696 |
{ |
| 1697 |
aprepro.ap_file_list.top().lineno++; |
| 1698 |
if_skip_level++; |
| 1699 |
} |
| 1700 |
YY_BREAK |
| 1701 |
case 31: |
| 1702 |
/* rule 31 can match eol */ |
| 1703 |
YY_RULE_SETUP |
| 1704 |
{ |
| 1705 |
aprepro.ap_file_list.top().lineno++; |
| 1706 |
if_skip_level++; |
| 1707 |
} |
| 1708 |
YY_BREAK |
| 1709 |
case 32: |
| 1710 |
/* rule 32 can match eol */ |
| 1711 |
YY_RULE_SETUP |
| 1712 |
{ |
| 1713 |
aprepro.ap_file_list.top().lineno++; |
| 1714 |
if_skip_level++; |
| 1715 |
} |
| 1716 |
YY_BREAK |
| 1717 |
case 33: |
| 1718 |
/* rule 33 can match eol */ |
| 1719 |
YY_RULE_SETUP { aprepro.ap_file_list.top().lineno++; } |
| 1720 |
YY_BREAK |
| 1721 |
|
| 1722 |
/* IF an if, ifdef, or ifndef found while skipping, then |
| 1723 |
* skip the entire block up and including the endif. |
| 1724 |
* The (IF_WHILE_SKIP) start condition handles this skipping. |
| 1725 |
*/ |
| 1726 |
case 34: |
| 1727 |
YY_RULE_SETUP |
| 1728 |
{ |
| 1729 |
if (aprepro.ap_options.debugging) |
| 1730 |
fprintf(stderr, "DEBUG IF: 'ifdef' found while skipping at line %d\n", |
| 1731 |
aprepro.ap_file_list.top().lineno); |
| 1732 |
if_skip_level = 1; |
| 1733 |
BEGIN(IF_WHILE_SKIP); |
| 1734 |
} |
| 1735 |
YY_BREAK |
| 1736 |
case 35: |
| 1737 |
YY_RULE_SETUP |
| 1738 |
{ |
| 1739 |
if (aprepro.ap_options.debugging) |
| 1740 |
fprintf(stderr, "DEBUG IF: 'ifdef' found while skipping at line %d\n", |
| 1741 |
aprepro.ap_file_list.top().lineno); |
| 1742 |
if_skip_level = 1; |
| 1743 |
BEGIN(IF_WHILE_SKIP); |
| 1744 |
} |
| 1745 |
YY_BREAK |
| 1746 |
case 36: |
| 1747 |
YY_RULE_SETUP |
| 1748 |
{ |
| 1749 |
if (aprepro.ap_options.debugging) |
| 1750 |
fprintf(stderr, "DEBUG IF: 'ifndef' found while skipping at line %d\n", |
| 1751 |
aprepro.ap_file_list.top().lineno); |
| 1752 |
if_skip_level = 1; |
| 1753 |
BEGIN(IF_WHILE_SKIP); |
| 1754 |
} |
| 1755 |
YY_BREAK |
| 1756 |
|
| 1757 |
case 37: |
| 1758 |
/* rule 37 can match eol */ |
| 1759 |
YY_RULE_SETUP |
| 1760 |
{ |
| 1761 |
aprepro.ap_file_list.top().lineno++; |
| 1762 |
if (aprepro.ap_options.debugging) |
| 1763 |
fprintf(stderr, "DEBUG IF: 'else' at level = %d at line %d\n", if_lvl, |
| 1764 |
aprepro.ap_file_list.top().lineno); |
| 1765 |
if (YY_START == VERBATIM) { |
| 1766 |
if (echo) |
| 1767 |
ECHO; |
| 1768 |
} |
| 1769 |
else if (if_state[if_lvl] == IF_SKIP) { |
| 1770 |
if (!if_case_run[if_lvl]) { |
| 1771 |
BEGIN(INITIAL); |
| 1772 |
if_state[if_lvl] = INITIAL; |
| 1773 |
if_case_run[if_lvl] = true; |
| 1774 |
} |
| 1775 |
else { |
| 1776 |
BEGIN(IF_SKIP); |
| 1777 |
if_state[if_lvl] = IF_SKIP; |
| 1778 |
} |
| 1779 |
} |
| 1780 |
else if (if_state[if_lvl] == INITIAL) { |
| 1781 |
BEGIN(IF_SKIP); |
| 1782 |
if_state[if_lvl] = IF_SKIP; |
| 1783 |
} |
| 1784 |
|
| 1785 |
/* If neither is true, this is a nested |
| 1786 |
if that should be skipped */ |
| 1787 |
} |
| 1788 |
YY_BREAK |
| 1789 |
|
| 1790 |
case 38: |
| 1791 |
/* rule 38 can match eol */ |
| 1792 |
YY_RULE_SETUP |
| 1793 |
{ |
| 1794 |
/* If any previous 'block' of this if has executed, then |
| 1795 |
* just skip this block; otherwise see if condition is |
| 1796 |
* true and execute this block |
| 1797 |
*/ |
| 1798 |
if (aprepro.ap_options.debugging) |
| 1799 |
fprintf(stderr, "DEBUG IF: 'elseif' at level = %d at line %d\n", if_lvl, |
| 1800 |
aprepro.ap_file_list.top().lineno); |
| 1801 |
|
| 1802 |
if (if_case_run[if_lvl]) { /* A previous else/elseif has run */ |
| 1803 |
aprepro.ap_file_list.top().lineno++; |
| 1804 |
/* Already in IF_SKIP, so don't need to change state */ |
| 1805 |
} |
| 1806 |
else { |
| 1807 |
/* Need to check the elseif condition; push back and parse */ |
| 1808 |
yyless(0); |
| 1809 |
curr_index = 0; |
| 1810 |
BEGIN(INITIAL); |
| 1811 |
if_state[if_lvl] = INITIAL; |
| 1812 |
} |
| 1813 |
} |
| 1814 |
YY_BREAK |
| 1815 |
case 39: |
| 1816 |
case 40: |
| 1817 |
case 41: |
| 1818 |
case 42: |
| 1819 |
YY_RULE_SETUP { ; } |
| 1820 |
YY_BREAK |
| 1821 |
case 43: |
| 1822 |
/* rule 43 can match eol */ |
| 1823 |
YY_RULE_SETUP { aprepro.ap_file_list.top().lineno++; } |
| 1824 |
YY_BREAK |
| 1825 |
|
| 1826 |
case 44: |
| 1827 |
/* rule 44 can match eol */ |
| 1828 |
YY_RULE_SETUP |
| 1829 |
{ |
| 1830 |
|
| 1831 |
if (YY_START == VERBATIM) { |
| 1832 |
if (echo) |
| 1833 |
ECHO; |
| 1834 |
} |
| 1835 |
else { |
| 1836 |
if (if_state[if_lvl] == IF_SKIP || if_state[if_lvl] == INITIAL) { |
| 1837 |
BEGIN(INITIAL); |
| 1838 |
suppress_nl = false; |
| 1839 |
} |
| 1840 |
/* If neither is true, this is a nested |
| 1841 |
if that should be skipped */ |
| 1842 |
if (aprepro.ap_options.debugging) |
| 1843 |
printf("DEBUG IF: 'endif' at level = %d at line %d\n", if_lvl, |
| 1844 |
aprepro.ap_file_list.top().lineno); |
| 1845 |
if (--if_lvl < 0) { |
| 1846 |
if_lvl = 0; |
| 1847 |
yyerror("Improperly Nested ifdef/ifndef statements"); |
| 1848 |
} |
| 1849 |
/* Ignore endif if not skipping */ |
| 1850 |
} |
| 1851 |
aprepro.ap_file_list.top().lineno++; |
| 1852 |
} |
| 1853 |
YY_BREAK |
| 1854 |
case 45: |
| 1855 |
YY_RULE_SETUP |
| 1856 |
{ |
| 1857 |
BEGIN(GET_FILENAME); |
| 1858 |
file_must_exist = true; |
| 1859 |
} |
| 1860 |
YY_BREAK |
| 1861 |
case 46: |
| 1862 |
YY_RULE_SETUP |
| 1863 |
{ |
| 1864 |
BEGIN(GET_FILENAME); |
| 1865 |
file_must_exist = false; |
| 1866 |
} |
| 1867 |
YY_BREAK |
| 1868 |
case 47: |
| 1869 |
/* rule 47 can match eol */ |
| 1870 |
YY_RULE_SETUP |
| 1871 |
{ |
| 1872 |
aprepro.ap_file_list.top().lineno++; |
| 1873 |
BEGIN(INITIAL); |
| 1874 |
{ |
| 1875 |
symrec *s; |
| 1876 |
int quoted = 0; |
| 1877 |
char *pt = strchr(yytext, ')'); |
| 1878 |
*pt = '\0'; |
| 1879 |
/* Check to see if surrounded by double quote */ |
| 1880 |
if ((pt = strchr(yytext, '"')) != nullptr) { |
| 1881 |
yytext++; |
| 1882 |
quoted = 1; |
| 1883 |
} |
| 1884 |
if ((pt = strrchr(yytext, '"')) != nullptr) { |
| 1885 |
*pt = '\0'; |
| 1886 |
quoted = 1; |
| 1887 |
} |
| 1888 |
|
| 1889 |
if (quoted == 0) { |
| 1890 |
/* See if this is an aprepro variable referring to a name */ |
| 1891 |
s = aprepro.getsym(yytext); |
| 1892 |
if (s == nullptr || (s->type != token::SVAR && s->type != token::IMMSVAR)) { |
| 1893 |
pt = yytext; |
| 1894 |
} |
| 1895 |
else { |
| 1896 |
pt = (char *)s->value.svar.c_str(); |
| 1897 |
} |
| 1898 |
} |
| 1899 |
else { |
| 1900 |
pt = yytext; |
| 1901 |
} |
| 1902 |
|
| 1903 |
bool added = add_include_file(pt, file_must_exist); |
| 1904 |
|
| 1905 |
if (added && !aprepro.doIncludeSubstitution) |
| 1906 |
yy_push_state(VERBATIM); |
| 1907 |
|
| 1908 |
aprepro.ap_file_list.top().lineno++; |
| 1909 |
} |
| 1910 |
} |
| 1911 |
YY_BREAK |
| 1912 |
case 48: |
| 1913 |
case 49: |
| 1914 |
YY_RULE_SETUP |
| 1915 |
{ |
| 1916 |
sscanf(yytext, "%lf", &yylval->val); |
| 1917 |
return (token::NUM); |
| 1918 |
} |
| 1919 |
YY_BREAK |
| 1920 |
case 50: |
| 1921 |
YY_RULE_SETUP; // Empty rule |
| 1922 |
YY_BREAK |
| 1923 |
case 51: |
| 1924 |
YY_RULE_SETUP |
| 1925 |
{ |
| 1926 |
symrec *s; |
| 1927 |
s = aprepro.getsym(yytext); |
| 1928 |
if (s == nullptr) |
| 1929 |
s = aprepro.putsym(yytext, SEAMS::Aprepro::SYMBOL_TYPE::UNDEFINED_VARIABLE, false); |
| 1930 |
yylval->tptr = s; |
| 1931 |
return ((token::yytokentype)s->type); |
| 1932 |
} |
| 1933 |
YY_BREAK |
| 1934 |
case 52: |
| 1935 |
YY_RULE_SETUP |
| 1936 |
return (token::EQUAL); |
| 1937 |
YY_BREAK |
| 1938 |
case 53: |
| 1939 |
YY_RULE_SETUP |
| 1940 |
return (token::EQ_PLUS); |
| 1941 |
YY_BREAK |
| 1942 |
case 54: |
| 1943 |
YY_RULE_SETUP |
| 1944 |
return (token::EQ_MINUS); |
| 1945 |
YY_BREAK |
| 1946 |
case 55: |
| 1947 |
YY_RULE_SETUP |
| 1948 |
return (token::EQ_TIME); |
| 1949 |
YY_BREAK |
| 1950 |
case 56: |
| 1951 |
YY_RULE_SETUP |
| 1952 |
return (token::EQ_DIV); |
| 1953 |
YY_BREAK |
| 1954 |
case 57: |
| 1955 |
YY_RULE_SETUP |
| 1956 |
return (token::EQ_POW); |
| 1957 |
YY_BREAK |
| 1958 |
case 58: |
| 1959 |
YY_RULE_SETUP |
| 1960 |
return (token::EQ_POW); |
| 1961 |
YY_BREAK |
| 1962 |
case 59: |
| 1963 |
YY_RULE_SETUP |
| 1964 |
return (token::INC); |
| 1965 |
YY_BREAK |
| 1966 |
case 60: |
| 1967 |
YY_RULE_SETUP |
| 1968 |
return (token::DEC); |
| 1969 |
YY_BREAK |
| 1970 |
case 61: |
| 1971 |
YY_RULE_SETUP |
| 1972 |
return (token::PLU); |
| 1973 |
YY_BREAK |
| 1974 |
case 62: |
| 1975 |
YY_RULE_SETUP |
| 1976 |
return (token::SUB); |
| 1977 |
YY_BREAK |
| 1978 |
case 63: |
| 1979 |
YY_RULE_SETUP |
| 1980 |
return (token::TIM); |
| 1981 |
YY_BREAK |
| 1982 |
case 64: |
| 1983 |
YY_RULE_SETUP |
| 1984 |
return (token::TIM); /* ~ is same as multiply */ |
| 1985 |
YY_BREAK |
| 1986 |
case 65: |
| 1987 |
YY_RULE_SETUP |
| 1988 |
return (token::CONCAT); /* String concatenation */ |
| 1989 |
YY_BREAK |
| 1990 |
case 66: |
| 1991 |
YY_RULE_SETUP |
| 1992 |
return (token::DIV); |
| 1993 |
YY_BREAK |
| 1994 |
case 67: |
| 1995 |
YY_RULE_SETUP |
| 1996 |
return (token::MOD); |
| 1997 |
YY_BREAK |
| 1998 |
case 68: |
| 1999 |
YY_RULE_SETUP |
| 2000 |
return (token::POW); |
| 2001 |
YY_BREAK |
| 2002 |
case 69: |
| 2003 |
YY_RULE_SETUP |
| 2004 |
return (token::POW); |
| 2005 |
YY_BREAK |
| 2006 |
case 70: |
| 2007 |
/* rule 70 can match eol */ |
| 2008 |
YY_RULE_SETUP |
| 2009 |
aprepro.ap_file_list.top().lineno++; |
| 2010 |
YY_BREAK |
| 2011 |
case 71: |
| 2012 |
YY_RULE_SETUP |
| 2013 |
return (token::LPAR); |
| 2014 |
YY_BREAK |
| 2015 |
case 72: |
| 2016 |
YY_RULE_SETUP |
| 2017 |
return (token::RPAR); |
| 2018 |
YY_BREAK |
| 2019 |
case 73: |
| 2020 |
YY_RULE_SETUP |
| 2021 |
return (token::COMMA); |
| 2022 |
YY_BREAK |
| 2023 |
case 74: |
| 2024 |
YY_RULE_SETUP |
| 2025 |
return (token::SEMI); |
| 2026 |
YY_BREAK |
| 2027 |
case 75: |
| 2028 |
YY_RULE_SETUP |
| 2029 |
return (token::COLON); |
| 2030 |
YY_BREAK |
| 2031 |
case 76: |
| 2032 |
YY_RULE_SETUP |
| 2033 |
return (token::QUEST); |
| 2034 |
YY_BREAK |
| 2035 |
case 77: |
| 2036 |
YY_RULE_SETUP |
| 2037 |
return (token::LT); |
| 2038 |
YY_BREAK |
| 2039 |
case 78: |
| 2040 |
YY_RULE_SETUP |
| 2041 |
return (token::GT); |
| 2042 |
YY_BREAK |
| 2043 |
case 79: |
| 2044 |
YY_RULE_SETUP |
| 2045 |
return (token::LE); |
| 2046 |
YY_BREAK |
| 2047 |
case 80: |
| 2048 |
YY_RULE_SETUP |
| 2049 |
return (token::GE); |
| 2050 |
YY_BREAK |
| 2051 |
case 81: |
| 2052 |
YY_RULE_SETUP |
| 2053 |
return (token::EQ); |
| 2054 |
YY_BREAK |
| 2055 |
case 82: |
| 2056 |
YY_RULE_SETUP |
| 2057 |
return (token::NE); |
| 2058 |
YY_BREAK |
| 2059 |
case 83: |
| 2060 |
YY_RULE_SETUP |
| 2061 |
return (token::LAND); |
| 2062 |
YY_BREAK |
| 2063 |
case 84: |
| 2064 |
YY_RULE_SETUP |
| 2065 |
return (token::LOR); |
| 2066 |
YY_BREAK |
| 2067 |
case 85: |
| 2068 |
YY_RULE_SETUP |
| 2069 |
return (token::NOT); |
| 2070 |
YY_BREAK |
| 2071 |
case 86: |
| 2072 |
YY_RULE_SETUP |
| 2073 |
return (token::LBRACK); |
| 2074 |
YY_BREAK |
| 2075 |
case 87: |
| 2076 |
YY_RULE_SETUP |
| 2077 |
return (token::RBRACK); |
| 2078 |
YY_BREAK |
| 2079 |
case 88: |
| 2080 |
/* rule 88 can match eol */ |
| 2081 |
YY_RULE_SETUP |
| 2082 |
{ |
| 2083 |
char *pt = strrchr(yytext, '"'); |
| 2084 |
*pt = '\0'; |
| 2085 |
new_string(yytext + 1, &yylval->string); |
| 2086 |
return token::QSTRING; |
| 2087 |
} |
| 2088 |
YY_BREAK |
| 2089 |
case 89: |
| 2090 |
/* rule 89 can match eol */ |
| 2091 |
YY_RULE_SETUP |
| 2092 |
{ |
| 2093 |
char *pt = strrchr(yytext, '\''); |
| 2094 |
*pt = '\0'; |
| 2095 |
new_string(yytext + 1, &yylval->string); |
| 2096 |
return token::QSTRING; |
| 2097 |
} |
| 2098 |
YY_BREAK |
| 2099 |
case 90: |
| 2100 |
YY_RULE_SETUP |
| 2101 |
{ |
| 2102 |
// Add to the history string |
| 2103 |
save_history_string(); |
| 2104 |
|
| 2105 |
if (switch_skip_to_endcase) |
| 2106 |
BEGIN(END_CASE_SKIP); |
| 2107 |
else |
| 2108 |
BEGIN(if_state[if_lvl]); |
| 2109 |
return (token::RBRACE); |
| 2110 |
} |
| 2111 |
YY_BREAK |
| 2112 |
case 91: |
| 2113 |
YY_RULE_SETUP |
| 2114 |
{ |
| 2115 |
if (begin_double_brace) { |
| 2116 |
end_double_brace = true; |
| 2117 |
} |
| 2118 |
else { |
| 2119 |
yyerror("Found an unexpected double end brace ('}}').\n\t" |
| 2120 |
"It can only end an expression started with a double brace ('{{').\n\tCheck " |
| 2121 |
"syntax."); |
| 2122 |
} |
| 2123 |
|
| 2124 |
// Add to the history string |
| 2125 |
save_history_string(); |
| 2126 |
|
| 2127 |
if (switch_skip_to_endcase) |
| 2128 |
BEGIN(END_CASE_SKIP); |
| 2129 |
else |
| 2130 |
BEGIN(if_state[if_lvl]); |
| 2131 |
unput('}'); |
| 2132 |
unput('O'); |
| 2133 |
unput('H'); |
| 2134 |
unput('C'); |
| 2135 |
unput('E'); |
| 2136 |
unput('{'); |
| 2137 |
return (token::RBRACE); |
| 2138 |
} |
| 2139 |
YY_BREAK |
| 2140 |
case 92: |
| 2141 |
YY_RULE_SETUP |
| 2142 |
{ |
| 2143 |
if (echo) |
| 2144 |
LexerOutput("{", 1); |
| 2145 |
} |
| 2146 |
YY_BREAK |
| 2147 |
case 93: |
| 2148 |
YY_RULE_SETUP |
| 2149 |
{ |
| 2150 |
if (echo) |
| 2151 |
LexerOutput("}", 1); |
| 2152 |
} |
| 2153 |
YY_BREAK |
| 2154 |
case 94: |
| 2155 |
YY_RULE_SETUP |
| 2156 |
{ |
| 2157 |
// Check if we need to save the substitution history first. |
| 2158 |
if (aprepro.ap_options.keep_history && (aprepro.ap_file_list.top().name != "_string_")) { |
| 2159 |
if (curr_index > yyleng) |
| 2160 |
hist_start = curr_index - yyleng; |
| 2161 |
else |
| 2162 |
hist_start = 0; |
| 2163 |
} |
| 2164 |
|
| 2165 |
BEGIN(PARSING); |
| 2166 |
echo = false; |
| 2167 |
begin_double_brace = true; |
| 2168 |
return (token::LBRACE); |
| 2169 |
} |
| 2170 |
YY_BREAK |
| 2171 |
case 95: |
| 2172 |
YY_RULE_SETUP |
| 2173 |
{ |
| 2174 |
// Check if we need to save the substitution history first. |
| 2175 |
if (aprepro.ap_options.keep_history && (aprepro.ap_file_list.top().name != "_string_")) { |
| 2176 |
if (curr_index > yyleng) |
| 2177 |
hist_start = curr_index - yyleng; |
| 2178 |
else |
| 2179 |
hist_start = 0; |
| 2180 |
} |
| 2181 |
|
| 2182 |
BEGIN(PARSING); |
| 2183 |
|
| 2184 |
return (token::LBRACE); |
| 2185 |
} |
| 2186 |
YY_BREAK |
| 2187 |
case 96: |
| 2188 |
case 97: |
| 2189 |
YY_RULE_SETUP |
| 2190 |
{ |
| 2191 |
if (aprepro.ap_options.end_on_exit) { |
| 2192 |
if (echo) |
| 2193 |
ECHO; |
| 2194 |
return ((token::yytokentype)-1); |
| 2195 |
} |
| 2196 |
else if (echo) |
| 2197 |
ECHO; |
| 2198 |
} |
| 2199 |
YY_BREAK |
| 2200 |
case 98: |
| 2201 |
YY_RULE_SETUP |
| 2202 |
{ |
| 2203 |
if (echo) |
| 2204 |
ECHO; |
| 2205 |
} |
| 2206 |
YY_BREAK |
| 2207 |
case 99: |
| 2208 |
case 100: |
| 2209 |
YY_RULE_SETUP |
| 2210 |
{ |
| 2211 |
if (echo && if_state[if_lvl] != IF_SKIP) |
| 2212 |
ECHO; |
| 2213 |
} |
| 2214 |
YY_BREAK |
| 2215 |
case 101: |
| 2216 |
/* rule 101 can match eol */ |
| 2217 |
YY_RULE_SETUP |
| 2218 |
{ |
| 2219 |
if (echo && !suppress_nl) |
| 2220 |
ECHO; |
| 2221 |
suppress_nl = false; |
| 2222 |
if (end_double_brace) { |
| 2223 |
echo = true; |
| 2224 |
begin_double_brace = false; |
| 2225 |
end_double_brace = false; |
| 2226 |
} |
| 2227 |
aprepro.ap_file_list.top().lineno++; |
| 2228 |
} |
| 2229 |
YY_BREAK |
| 2230 |
case 102: |
| 2231 |
YY_RULE_SETUP |
| 2232 |
ECHO; |
| 2233 |
YY_BREAK |
| 2234 |
case YY_STATE_EOF(INITIAL): |
| 2235 |
case YY_STATE_EOF(PARSING): |
| 2236 |
case YY_STATE_EOF(GET_FILENAME): |
| 2237 |
case YY_STATE_EOF(IF_SKIP): |
| 2238 |
case YY_STATE_EOF(GET_VAR): |
| 2239 |
case YY_STATE_EOF(VERBATIM): |
| 2240 |
case YY_STATE_EOF(IF_WHILE_SKIP): |
| 2241 |
case YY_STATE_EOF(GET_LOOP_VAR): |
| 2242 |
case YY_STATE_EOF(LOOP): |
| 2243 |
case YY_STATE_EOF(LOOP_SKIP): |
| 2244 |
case YY_STATE_EOF(END_CASE_SKIP): yyterminate(); |
| 2245 |
|
| 2246 |
case YY_END_OF_BUFFER: { |
| 2247 |
/* Amount of text matched not including the EOB char. */ |
| 2248 |
int yy_amount_of_matched_text = (int)(yy_cp - (yytext_ptr)) - 1; |
| 2249 |
|
| 2250 |
/* Undo the effects of YY_DO_BEFORE_ACTION. */ |
| 2251 |
*yy_cp = (yy_hold_char); |
| 2252 |
YY_RESTORE_YY_MORE_OFFSET |
| 2253 |
|
| 2254 |
if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW) { |
| 2255 |
/* We're scanning a new file or input source. It's |
| 2256 |
* possible that this happened because the user |
| 2257 |
* just pointed yyin at a new source and called |
| 2258 |
* yylex(). If so, then we have to assure |
| 2259 |
* consistency between YY_CURRENT_BUFFER and our |
| 2260 |
* globals. Here is the right place to do so, because |
| 2261 |
* this is the first action (other than possibly a |
| 2262 |
* back-up) that will match for the new input source. |
| 2263 |
*/ |
| 2264 |
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; |
| 2265 |
YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; |
| 2266 |
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; |
| 2267 |
} |
| 2268 |
|
| 2269 |
/* Note that here we test for yy_c_buf_p "<=" to the position |
| 2270 |
* of the first EOB in the buffer, since yy_c_buf_p will |
| 2271 |
* already have been incremented past the NUL character |
| 2272 |
* (since all states make transitions on EOB to the |
| 2273 |
* end-of-buffer state). Contrast this with the test |
| 2274 |
* in input(). |
| 2275 |
*/ |
| 2276 |
if ((yy_c_buf_p) <= |
| 2277 |
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]) { /* This was really a NUL. */ |
| 2278 |
yy_state_type yy_next_state; |
| 2279 |
|
| 2280 |
(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; |
| 2281 |
|
| 2282 |
yy_current_state = yy_get_previous_state(); |
| 2283 |
|
| 2284 |
/* Okay, we're now positioned to make the NUL |
| 2285 |
* transition. We couldn't have |
| 2286 |
* yy_get_previous_state() go ahead and do it |
| 2287 |
* for us because it doesn't know how to deal |
| 2288 |
* with the possibility of jamming (and we don't |
| 2289 |
* want to build jamming into it because then it |
| 2290 |
* will run more slowly). |
| 2291 |
*/ |
| 2292 |
|
| 2293 |
yy_next_state = yy_try_NUL_trans(yy_current_state); |
| 2294 |
|
| 2295 |
yy_bp = (yytext_ptr) + YY_MORE_ADJ; |
| 2296 |
|
| 2297 |
if (yy_next_state) { |
| 2298 |
/* Consume the NUL. */ |
| 2299 |
yy_cp = ++(yy_c_buf_p); |
| 2300 |
yy_current_state = yy_next_state; |
| 2301 |
goto yy_match; |
| 2302 |
} |
| 2303 |
|
| 2304 |
else { |
| 2305 |
/* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */ |
| 2306 |
yy_cp = (yy_c_buf_p); |
| 2307 |
goto yy_find_action; |
| 2308 |
} |
| 2309 |
} |
| 2310 |
|
| 2311 |
else |
| 2312 |
switch (yy_get_next_buffer()) { |
| 2313 |
case EOB_ACT_END_OF_FILE: { |
| 2314 |
(yy_did_buffer_switch_on_eof) = 0; |
| 2315 |
|
| 2316 |
if (yywrap()) { |
| 2317 |
/* Note: because we've taken care in |
| 2318 |
* yy_get_next_buffer() to have set up |
| 2319 |
* yytext, we can now set up |
| 2320 |
* yy_c_buf_p so that if some total |
| 2321 |
* hoser (like flex itself) wants to |
| 2322 |
* call the scanner after we return the |
| 2323 |
* YY_NULL, it'll still work - another |
| 2324 |
* YY_NULL will get returned. |
| 2325 |
*/ |
| 2326 |
(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; |
| 2327 |
|
| 2328 |
yy_act = YY_STATE_EOF(YY_START); |
| 2329 |
goto do_action; |
| 2330 |
} |
| 2331 |
|
| 2332 |
else { |
| 2333 |
if (!(yy_did_buffer_switch_on_eof)) |
| 2334 |
YY_NEW_FILE; |
| 2335 |
} |
| 2336 |
break; |
| 2337 |
} |
| 2338 |
|
| 2339 |
case EOB_ACT_CONTINUE_SCAN: |
| 2340 |
(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; |
| 2341 |
|
| 2342 |
yy_current_state = yy_get_previous_state(); |
| 2343 |
|
| 2344 |
yy_cp = (yy_c_buf_p); |
| 2345 |
yy_bp = (yytext_ptr) + YY_MORE_ADJ; |
| 2346 |
goto yy_match; |
| 2347 |
|
| 2348 |
case EOB_ACT_LAST_MATCH: |
| 2349 |
(yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; |
| 2350 |
|
| 2351 |
yy_current_state = yy_get_previous_state(); |
| 2352 |
|
| 2353 |
yy_cp = (yy_c_buf_p); |
| 2354 |
yy_bp = (yytext_ptr) + YY_MORE_ADJ; |
| 2355 |
goto yy_find_action; |
| 2356 |
} |
| 2357 |
break; |
| 2358 |
} |
| 2359 |
|
| 2360 |
default: YY_FATAL_ERROR("fatal flex scanner internal error--no action found"); |
| 2361 |
} /* end of action switch */ |
| 2362 |
} /* end of scanning one token */ |
| 2363 |
} /* end of user's declarations */ |
| 2364 |
} /* end of yylex */ |
| 2365 |
/* %ok-for-header */ |
| 2366 |
|
| 2367 |
/* %if-c++-only */ |
| 2368 |
/* %not-for-header */ |
| 2369 |
|
| 2370 |
/* The contents of this function are C++ specific, so the () macro is not used. |
| 2371 |
*/ |
| 2372 |
yyFlexLexer::yyFlexLexer(std::istream *arg_yyin, std::ostream *arg_yyout) |
| 2373 |
{ |
| 2374 |
yyin = arg_yyin; |
| 2375 |
yyout = arg_yyout; |
| 2376 |
yy_c_buf_p = 0; |
| 2377 |
yy_init = 0; |
| 2378 |
yy_start = 0; |
| 2379 |
yy_flex_debug = 0; |
| 2380 |
yylineno = 1; // this will only get updated if %option yylineno |
| 2381 |
|
| 2382 |
yy_did_buffer_switch_on_eof = 0; |
| 2383 |
|
| 2384 |
yy_looking_for_trail_begin = 0; |
| 2385 |
yy_more_flag = 0; |
| 2386 |
yy_more_len = 0; |
| 2387 |
yy_more_offset = yy_prev_more_offset = 0; |
| 2388 |
|
| 2389 |
yy_start_stack_ptr = yy_start_stack_depth = 0; |
| 2390 |
yy_start_stack = NULL; |
| 2391 |
|
| 2392 |
yy_buffer_stack = 0; |
| 2393 |
yy_buffer_stack_top = 0; |
| 2394 |
yy_buffer_stack_max = 0; |
| 2395 |
|
| 2396 |
yy_state_buf = 0; |
| 2397 |
} |
| 2398 |
|
| 2399 |
/* The contents of this function are C++ specific, so the () macro is not used. |
| 2400 |
*/ |
| 2401 |
yyFlexLexer::~yyFlexLexer() |
| 2402 |
{ |
| 2403 |
delete[] yy_state_buf; |
| 2404 |
SEAMSfree(yy_start_stack); |
| 2405 |
yy_delete_buffer(YY_CURRENT_BUFFER); |
| 2406 |
SEAMSfree(yy_buffer_stack); |
| 2407 |
} |
| 2408 |
|
| 2409 |
/* The contents of this function are C++ specific, so the () macro is not used. |
| 2410 |
*/ |
| 2411 |
void yyFlexLexer::switch_streams(std::istream *new_in, std::ostream *new_out) |
| 2412 |
{ |
| 2413 |
if (new_in) { |
| 2414 |
yy_delete_buffer(YY_CURRENT_BUFFER); |
| 2415 |
yy_switch_to_buffer(yy_create_buffer(new_in, YY_BUF_SIZE)); |
| 2416 |
} |
| 2417 |
|
| 2418 |
if (new_out) |
| 2419 |
yyout = new_out; |
| 2420 |
} |
| 2421 |
|
| 2422 |
#ifdef YY_INTERACTIVE |
| 2423 |
int yyFlexLexer::LexerInput(char *buf, int /* max_size */) |
| 2424 |
#else |
| 2425 |
int yyFlexLexer::LexerInput(char *buf, int max_size) |
| 2426 |
#endif |
| 2427 |
{ |
| 2428 |
if (yyin->eof() || yyin->fail()) |
| 2429 |
return 0; |
| 2430 |
|
| 2431 |
#ifdef YY_INTERACTIVE |
| 2432 |
yyin->get(buf[0]); |
| 2433 |
|
| 2434 |
if (yyin->eof()) |
| 2435 |
return 0; |
| 2436 |
|
| 2437 |
if (yyin->bad()) |
| 2438 |
return -1; |
| 2439 |
|
| 2440 |
return 1; |
| 2441 |
|
| 2442 |
#else |
| 2443 |
(void)yyin->read(buf, max_size); |
| 2444 |
|
| 2445 |
if (yyin->bad()) |
| 2446 |
return -1; |
| 2447 |
else |
| 2448 |
return yyin->gcount(); |
| 2449 |
#endif |
| 2450 |
} |
| 2451 |
|
| 2452 |
void yyFlexLexer::LexerOutput(const char *buf, int size) { (void)yyout->write(buf, size); } |
| 2453 |
/* %ok-for-header */ |
| 2454 |
|
| 2455 |
/* %endif */ |
| 2456 |
|
| 2457 |
/* yy_get_next_buffer - try to read in a new buffer |
| 2458 |
* |
| 2459 |
* Returns a code representing an action: |
| 2460 |
* EOB_ACT_LAST_MATCH - |
| 2461 |
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position |
| 2462 |
* EOB_ACT_END_OF_FILE - end of file |
| 2463 |
*/ |
| 2464 |
/* %if-c-only */ |
| 2465 |
/* %endif */ |
| 2466 |
/* %if-c++-only */ |
| 2467 |
int yyFlexLexer::yy_get_next_buffer() |
| 2468 |
/* %endif */ |
| 2469 |
{ |
| 2470 |
char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; |
| 2471 |
char *source = (yytext_ptr); |
| 2472 |
int number_to_move, i; |
| 2473 |
int ret_val; |
| 2474 |
|
| 2475 |
if ((yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1]) |
| 2476 |
YY_FATAL_ERROR("fatal flex scanner internal error--end of buffer missed"); |
| 2477 |
|
| 2478 |
if (YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == |
| 2479 |
0) { /* Don't try to fill the buffer, so this is an EOF. */ |
| 2480 |
if ((yy_c_buf_p) - (yytext_ptr)-YY_MORE_ADJ == 1) { |
| 2481 |
/* We matched a single character, the EOB, so |
| 2482 |
* treat this as a final EOF. |
| 2483 |
*/ |
| 2484 |
return EOB_ACT_END_OF_FILE; |
| 2485 |
} |
| 2486 |
|
| 2487 |
else { |
| 2488 |
/* We matched some text prior to the EOB, first |
| 2489 |
* process it. |
| 2490 |
*/ |
| 2491 |
return EOB_ACT_LAST_MATCH; |
| 2492 |
} |
| 2493 |
} |
| 2494 |
|
| 2495 |
/* Try to read more data. */ |
| 2496 |
|
| 2497 |
/* First move last chars to start of buffer. */ |
| 2498 |
number_to_move = (int)((yy_c_buf_p) - (yytext_ptr)) - 1; |
| 2499 |
|
| 2500 |
for (i = 0; i < number_to_move; ++i) |
| 2501 |
*(dest++) = *(source++); |
| 2502 |
|
| 2503 |
if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING) |
| 2504 |
/* don't do the read, it's not guaranteed to return an EOF, |
| 2505 |
* just force an EOF |
| 2506 |
*/ |
| 2507 |
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; |
| 2508 |
|
| 2509 |
else { |
| 2510 |
yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; |
| 2511 |
|
| 2512 |
while (num_to_read <= 0) { /* Not enough room in the buffer - grow it. */ |
| 2513 |
|
| 2514 |
/* just a shorter name for the current buffer */ |
| 2515 |
YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; |
| 2516 |
|
| 2517 |
int yy_c_buf_p_offset = (int)((yy_c_buf_p)-b->yy_ch_buf); |
| 2518 |
|
| 2519 |
if (b->yy_is_our_buffer) { |
| 2520 |
yy_size_t new_size = b->yy_buf_size * 2; |
| 2521 |
|
| 2522 |
if (new_size <= 0) |
| 2523 |
b->yy_buf_size += b->yy_buf_size / 8; |
| 2524 |
else |
| 2525 |
b->yy_buf_size *= 2; |
| 2526 |
|
| 2527 |
b->yy_ch_buf = (char *) |
| 2528 |
/* Include room in for 2 EOB chars. */ |
| 2529 |
SEAMSrealloc((void *)b->yy_ch_buf, b->yy_buf_size + 2); |
| 2530 |
} |
| 2531 |
else |
| 2532 |
/* Can't grow it, we don't own it. */ |
| 2533 |
b->yy_ch_buf = 0; |
| 2534 |
|
| 2535 |
if (!b->yy_ch_buf) |
| 2536 |
YY_FATAL_ERROR("fatal error - scanner input buffer overflow"); |
| 2537 |
|
| 2538 |
(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; |
| 2539 |
|
| 2540 |
num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; |
| 2541 |
} |
| 2542 |
|
| 2543 |
if (num_to_read > YY_READ_BUF_SIZE) |
| 2544 |
num_to_read = YY_READ_BUF_SIZE; |
| 2545 |
|
| 2546 |
/* Read in more data. */ |
| 2547 |
YY_INPUT((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read); |
| 2548 |
|
| 2549 |
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); |
| 2550 |
} |
| 2551 |
|
| 2552 |
if ((yy_n_chars) == 0) { |
| 2553 |
if (number_to_move == YY_MORE_ADJ) { |
| 2554 |
ret_val = EOB_ACT_END_OF_FILE; |
| 2555 |
yyrestart(yyin); |
| 2556 |
} |
| 2557 |
|
| 2558 |
else { |
| 2559 |
ret_val = EOB_ACT_LAST_MATCH; |
| 2560 |
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; |
| 2561 |
} |
| 2562 |
} |
| 2563 |
|
| 2564 |
else |
| 2565 |
ret_val = EOB_ACT_CONTINUE_SCAN; |
| 2566 |
|
| 2567 |
if ((yy_size_t)((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { |
| 2568 |
/* Extend the array by 50%, plus the number we really need. */ |
| 2569 |
yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); |
| 2570 |
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = |
| 2571 |
(char *)SEAMSrealloc((void *)YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, new_size); |
| 2572 |
if (!YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) |
| 2573 |
YY_FATAL_ERROR("out of dynamic memory in yy_get_next_buffer()"); |
| 2574 |
} |
| 2575 |
|
| 2576 |
(yy_n_chars) += number_to_move; |
| 2577 |
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; |
| 2578 |
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; |
| 2579 |
|
| 2580 |
(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; |
| 2581 |
|
| 2582 |
return ret_val; |
| 2583 |
} |
| 2584 |
|
| 2585 |
/* yy_get_previous_state - get the state just before the EOB char was reached */ |
| 2586 |
|
| 2587 |
/* %if-c-only */ |
| 2588 |
/* %not-for-header */ |
| 2589 |
|
| 2590 |
/* %endif */ |
| 2591 |
/* %if-c++-only */ |
| 2592 |
yy_state_type yyFlexLexer::yy_get_previous_state() |
| 2593 |
/* %endif */ |
| 2594 |
{ |
| 2595 |
yy_state_type yy_current_state; |
| 2596 |
char *yy_cp; |
| 2597 |
|
| 2598 |
/* %% [15.0] code to get the start state into yy_current_state goes here */ |
| 2599 |
yy_current_state = (yy_start); |
| 2600 |
|
| 2601 |
for (yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp) { |
| 2602 |
/* %% [16.0] code to find the next state goes here */ |
| 2603 |
YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); |
| 2604 |
if (yy_accept[yy_current_state]) { |
| 2605 |
(yy_last_accepting_state) = yy_current_state; |
| 2606 |
(yy_last_accepting_cpos) = yy_cp; |
| 2607 |
} |
| 2608 |
while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { |
| 2609 |
yy_current_state = (int)yy_def[yy_current_state]; |
| 2610 |
if (yy_current_state >= 685) |
| 2611 |
yy_c = yy_meta[(unsigned int)yy_c]; |
| 2612 |
} |
| 2613 |
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)yy_c]; |
| 2614 |
} |
| 2615 |
|
| 2616 |
return yy_current_state; |
| 2617 |
} |
| 2618 |
|
| 2619 |
/* yy_try_NUL_trans - try to make a transition on the NUL character |
| 2620 |
* |
| 2621 |
* synopsis |
| 2622 |
* next_state = yy_try_NUL_trans( current_state ); |
| 2623 |
*/ |
| 2624 |
/* %if-c-only */ |
| 2625 |
/* %endif */ |
| 2626 |
/* %if-c++-only */ |
| 2627 |
yy_state_type yyFlexLexer::yy_try_NUL_trans(yy_state_type yy_current_state) |
| 2628 |
/* %endif */ |
| 2629 |
{ |
| 2630 |
int yy_is_jam; |
| 2631 |
/* %% [17.0] code to find the next state, and perhaps do backing up, goes here */ |
| 2632 |
char *yy_cp = (yy_c_buf_p); |
| 2633 |
|
| 2634 |
YY_CHAR yy_c = 1; |
| 2635 |
if (yy_accept[yy_current_state]) { |
| 2636 |
(yy_last_accepting_state) = yy_current_state; |
| 2637 |
(yy_last_accepting_cpos) = yy_cp; |
| 2638 |
} |
| 2639 |
while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { |
| 2640 |
yy_current_state = (int)yy_def[yy_current_state]; |
| 2641 |
if (yy_current_state >= 685) |
| 2642 |
yy_c = yy_meta[(unsigned int)yy_c]; |
| 2643 |
} |
| 2644 |
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)yy_c]; |
| 2645 |
yy_is_jam = (yy_current_state == 684); |
| 2646 |
|
| 2647 |
return yy_is_jam ? 0 : yy_current_state; |
| 2648 |
} |
| 2649 |
|
| 2650 |
/* %if-c-only */ |
| 2651 |
/* %endif */ |
| 2652 |
/* %if-c++-only */ |
| 2653 |
void yyFlexLexer::yyunput(int c, char *yy_bp) |
| 2654 |
/* %endif */ |
| 2655 |
{ |
| 2656 |
char *yy_cp; |
| 2657 |
|
| 2658 |
yy_cp = (yy_c_buf_p); |
| 2659 |
|
| 2660 |
/* undo effects of setting up yytext */ |
| 2661 |
*yy_cp = (yy_hold_char); |
| 2662 |
|
| 2663 |
if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2) { /* need to shift things up to make room */ |
| 2664 |
/* +2 for EOB chars. */ |
| 2665 |
yy_size_t number_to_move = (yy_n_chars) + 2; |
| 2666 |
char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; |
| 2667 |
char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; |
| 2668 |
|
| 2669 |
while (source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) |
| 2670 |
*--dest = *--source; |
| 2671 |
|
| 2672 |
yy_cp += (int)(dest - source); |
| 2673 |
yy_bp += (int)(dest - source); |
| 2674 |
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; |
| 2675 |
|
| 2676 |
if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2) |
| 2677 |
YY_FATAL_ERROR("flex scanner push-back overflow"); |
| 2678 |
} |
| 2679 |
|
| 2680 |
*--yy_cp = (char)c; |
| 2681 |
|
| 2682 |
/* %% [18.0] update yylineno here */ |
| 2683 |
|
| 2684 |
(yytext_ptr) = yy_bp; |
| 2685 |
(yy_hold_char) = *yy_cp; |
| 2686 |
(yy_c_buf_p) = yy_cp; |
| 2687 |
} |
| 2688 |
/* %if-c-only */ |
| 2689 |
/* %endif */ |
| 2690 |
|
| 2691 |
/* %if-c-only */ |
| 2692 |
/* %endif */ |
| 2693 |
/* %if-c++-only */ |
| 2694 |
int yyFlexLexer::yyinput() |
| 2695 |
/* %endif */ |
| 2696 |
{ |
| 2697 |
int c; |
| 2698 |
|
| 2699 |
*(yy_c_buf_p) = (yy_hold_char); |
| 2700 |
|
| 2701 |
if (*(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR) { |
| 2702 |
/* yy_c_buf_p now points to the character we want to return. |
| 2703 |
* If this occurs *before* the EOB characters, then it's a |
| 2704 |
* valid NUL; if not, then we've hit the end of the buffer. |
| 2705 |
*/ |
| 2706 |
if ((yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]) |
| 2707 |
/* This was really a NUL. */ |
| 2708 |
*(yy_c_buf_p) = '\0'; |
| 2709 |
|
| 2710 |
else { /* need more input */ |
| 2711 |
yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); |
| 2712 |
++(yy_c_buf_p); |
| 2713 |
|
| 2714 |
switch (yy_get_next_buffer()) { |
| 2715 |
case EOB_ACT_LAST_MATCH: |
| 2716 |
/* This happens because yy_g_n_b() |
| 2717 |
* sees that we've accumulated a |
| 2718 |
* token and flags that we need to |
| 2719 |
* try matching the token before |
| 2720 |
* proceeding. But for input(), |
| 2721 |
* there's no matching to consider. |
| 2722 |
* So convert the EOB_ACT_LAST_MATCH |
| 2723 |
* to EOB_ACT_END_OF_FILE. |
| 2724 |
*/ |
| 2725 |
|
| 2726 |
/* Reset buffer status. */ |
| 2727 |
yyrestart(yyin); |
| 2728 |
|
| 2729 |
/*FALLTHROUGH*/ |
| 2730 |
|
| 2731 |
case EOB_ACT_END_OF_FILE: { |
| 2732 |
if (yywrap()) |
| 2733 |
return EOF; |
| 2734 |
|
| 2735 |
if (!(yy_did_buffer_switch_on_eof)) |
| 2736 |
YY_NEW_FILE; |
| 2737 |
#ifdef __cplusplus |
| 2738 |
return yyinput(); |
| 2739 |
#else |
| 2740 |
return input(); |
| 2741 |
#endif |
| 2742 |
} |
| 2743 |
|
| 2744 |
case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; |
| 2745 |
} |
| 2746 |
} |
| 2747 |
} |
| 2748 |
|
| 2749 |
c = *(unsigned char *)(yy_c_buf_p); /* cast for 8-bit char's */ |
| 2750 |
*(yy_c_buf_p) = '\0'; /* preserve yytext */ |
| 2751 |
(yy_hold_char) = *++(yy_c_buf_p); |
| 2752 |
|
| 2753 |
/* %% [19.0] update BOL and yylineno */ |
| 2754 |
|
| 2755 |
return c; |
| 2756 |
} |
| 2757 |
/* %if-c-only */ |
| 2758 |
/* %endif */ |
| 2759 |
|
| 2760 |
/** Immediately switch to a different input stream. |
| 2761 |
* @param input_file A readable stream. |
| 2762 |
* |
| 2763 |
* @note This function does not reset the start condition to @c INITIAL . |
| 2764 |
*/ |
| 2765 |
/* %if-c-only */ |
| 2766 |
/* %endif */ |
| 2767 |
/* %if-c++-only */ |
| 2768 |
void yyFlexLexer::yyrestart(std::istream *input_file) |
| 2769 |
/* %endif */ |
| 2770 |
{ |
| 2771 |
|
| 2772 |
if (!YY_CURRENT_BUFFER) { |
| 2773 |
yyensure_buffer_stack(); |
| 2774 |
YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE); |
| 2775 |
} |
| 2776 |
|
| 2777 |
yy_init_buffer(YY_CURRENT_BUFFER, input_file); |
| 2778 |
yy_load_buffer_state(); |
| 2779 |
} |
| 2780 |
|
| 2781 |
/** Switch to a different input buffer. |
| 2782 |
* @param new_buffer The new input buffer. |
| 2783 |
* |
| 2784 |
*/ |
| 2785 |
/* %if-c-only */ |
| 2786 |
/* %endif */ |
| 2787 |
/* %if-c++-only */ |
| 2788 |
void yyFlexLexer::yy_switch_to_buffer(YY_BUFFER_STATE new_buffer) |
| 2789 |
/* %endif */ |
| 2790 |
{ |
| 2791 |
|
| 2792 |
/* TODO. We should be able to replace this entire function body |
| 2793 |
* with |
| 2794 |
* yypop_buffer_state(); |
| 2795 |
* yypush_buffer_state(new_buffer); |
| 2796 |
*/ |
| 2797 |
yyensure_buffer_stack(); |
| 2798 |
if (YY_CURRENT_BUFFER == new_buffer) |
| 2799 |
return; |
| 2800 |
|
| 2801 |
if (YY_CURRENT_BUFFER) { |
| 2802 |
/* Flush out information for old buffer. */ |
| 2803 |
*(yy_c_buf_p) = (yy_hold_char); |
| 2804 |
YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); |
| 2805 |
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); |
| 2806 |
} |
| 2807 |
|
| 2808 |
YY_CURRENT_BUFFER_LVALUE = new_buffer; |
| 2809 |
yy_load_buffer_state(); |
| 2810 |
|
| 2811 |
/* We don't actually know whether we did this switch during |
| 2812 |
* EOF (yywrap()) processing, but the only time this flag |
| 2813 |
* is looked at is after yywrap() is called, so it's safe |
| 2814 |
* to go ahead and always set it. |
| 2815 |
*/ |
| 2816 |
(yy_did_buffer_switch_on_eof) = 1; |
| 2817 |
} |
| 2818 |
|
| 2819 |
/* %if-c-only */ |
| 2820 |
/* %endif */ |
| 2821 |
/* %if-c++-only */ |
| 2822 |
void yyFlexLexer::yy_load_buffer_state() |
| 2823 |
/* %endif */ |
| 2824 |
{ |
| 2825 |
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; |
| 2826 |
(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; |
| 2827 |
yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; |
| 2828 |
(yy_hold_char) = *(yy_c_buf_p); |
| 2829 |
} |
| 2830 |
|
| 2831 |
/** Allocate and initialize an input buffer state. |
| 2832 |
* @param file A readable stream. |
| 2833 |
* @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. |
| 2834 |
* |
| 2835 |
* @return the allocated buffer state. |
| 2836 |
*/ |
| 2837 |
/* %if-c-only */ |
| 2838 |
/* %endif */ |
| 2839 |
/* %if-c++-only */ |
| 2840 |
YY_BUFFER_STATE yyFlexLexer::yy_create_buffer(std::istream *file, int size) |
| 2841 |
/* %endif */ |
| 2842 |
{ |
| 2843 |
YY_BUFFER_STATE b; |
| 2844 |
|
| 2845 |
b = (YY_BUFFER_STATE)SEAMSalloc(sizeof(struct yy_buffer_state)); |
| 2846 |
if (!b) |
| 2847 |
YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); |
| 2848 |
|
| 2849 |
b->yy_buf_size = size; |
| 2850 |
|
| 2851 |
/* yy_ch_buf has to be 2 characters longer than the size given because |
| 2852 |
* we need to put in 2 end-of-buffer characters. |
| 2853 |
*/ |
| 2854 |
b->yy_ch_buf = (char *)SEAMSalloc(b->yy_buf_size + 2); |
| 2855 |
if (!b->yy_ch_buf) |
| 2856 |
YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); |
| 2857 |
|
| 2858 |
b->yy_is_our_buffer = 1; |
| 2859 |
|
| 2860 |
yy_init_buffer(b, file); |
| 2861 |
|
| 2862 |
return b; |
| 2863 |
} |
| 2864 |
|
| 2865 |
/** Destroy the buffer. |
| 2866 |
* @param b a buffer created with yy_create_buffer() |
| 2867 |
* |
| 2868 |
*/ |
| 2869 |
/* %if-c-only */ |
| 2870 |
/* %endif */ |
| 2871 |
/* %if-c++-only */ |
| 2872 |
void yyFlexLexer::yy_delete_buffer(YY_BUFFER_STATE b) |
| 2873 |
/* %endif */ |
| 2874 |
{ |
| 2875 |
|
| 2876 |
if (!b) |
| 2877 |
return; |
| 2878 |
|
| 2879 |
if (b == YY_CURRENT_BUFFER) /* Not sure if we should pop here. */ |
| 2880 |
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE)0; |
| 2881 |
|
| 2882 |
if (b->yy_is_our_buffer) |
| 2883 |
SEAMSfree((void *)b->yy_ch_buf); |
| 2884 |
|
| 2885 |
SEAMSfree((void *)b); |
| 2886 |
} |
| 2887 |
|
| 2888 |
/* Initializes or reinitializes a buffer. |
| 2889 |
* This function is sometimes called more than once on the same buffer, |
| 2890 |
* such as during a yyrestart() or at EOF. |
| 2891 |
*/ |
| 2892 |
/* %if-c-only */ |
| 2893 |
/* %endif */ |
| 2894 |
/* %if-c++-only */ |
| 2895 |
void yyFlexLexer::yy_init_buffer(YY_BUFFER_STATE b, std::istream *file) |
| 2896 |
/* %endif */ |
| 2897 |
|
| 2898 |
{ |
| 2899 |
int oerrno = errno; |
| 2900 |
|
| 2901 |
yy_flush_buffer(b); |
| 2902 |
|
| 2903 |
b->yy_input_file = file; |
| 2904 |
b->yy_fill_buffer = 1; |
| 2905 |
|
| 2906 |
/* If b is the current buffer, then yy_init_buffer was _probably_ |
| 2907 |
* called from yyrestart() or through yy_get_next_buffer. |
| 2908 |
* In that case, we don't want to reset the lineno or column. |
| 2909 |
*/ |
| 2910 |
if (b != YY_CURRENT_BUFFER) { |
| 2911 |
b->yy_bs_lineno = 1; |
| 2912 |
b->yy_bs_column = 0; |
| 2913 |
} |
| 2914 |
|
| 2915 |
/* %if-c-only */ |
| 2916 |
/* %endif */ |
| 2917 |
/* %if-c++-only */ |
| 2918 |
b->yy_is_interactive = 0; |
| 2919 |
/* %endif */ |
| 2920 |
errno = oerrno; |
| 2921 |
} |
| 2922 |
|
| 2923 |
/** Discard all buffered characters. On the next scan, YY_INPUT will be called. |
| 2924 |
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. |
| 2925 |
* |
| 2926 |
*/ |
| 2927 |
/* %if-c-only */ |
| 2928 |
/* %endif */ |
| 2929 |
/* %if-c++-only */ |
| 2930 |
void yyFlexLexer::yy_flush_buffer(YY_BUFFER_STATE b) |
| 2931 |
/* %endif */ |
| 2932 |
{ |
| 2933 |
if (!b) |
| 2934 |
return; |
| 2935 |
|
| 2936 |
b->yy_n_chars = 0; |
| 2937 |
|
| 2938 |
/* We always need two end-of-buffer characters. The first causes |
| 2939 |
* a transition to the end-of-buffer state. The second causes |
| 2940 |
* a jam in that state. |
| 2941 |
*/ |
| 2942 |
b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; |
| 2943 |
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; |
| 2944 |
|
| 2945 |
b->yy_buf_pos = &b->yy_ch_buf[0]; |
| 2946 |
|
| 2947 |
b->yy_at_bol = 1; |
| 2948 |
b->yy_buffer_status = YY_BUFFER_NEW; |
| 2949 |
|
| 2950 |
if (b == YY_CURRENT_BUFFER) |
| 2951 |
yy_load_buffer_state(); |
| 2952 |
} |
| 2953 |
|
| 2954 |
/* %if-c-or-c++ */ |
| 2955 |
/** Pushes the new state onto the stack. The new state becomes |
| 2956 |
* the current state. This function will allocate the stack |
| 2957 |
* if necessary. |
| 2958 |
* @param new_buffer The new state. |
| 2959 |
* |
| 2960 |
*/ |
| 2961 |
/* %if-c-only */ |
| 2962 |
/* %endif */ |
| 2963 |
/* %if-c++-only */ |
| 2964 |
void yyFlexLexer::yypush_buffer_state(YY_BUFFER_STATE new_buffer) |
| 2965 |
/* %endif */ |
| 2966 |
{ |
| 2967 |
if (new_buffer == NULL) |
| 2968 |
return; |
| 2969 |
|
| 2970 |
yyensure_buffer_stack(); |
| 2971 |
|
| 2972 |
/* This block is copied from yy_switch_to_buffer. */ |
| 2973 |
if (YY_CURRENT_BUFFER) { |
| 2974 |
/* Flush out information for old buffer. */ |
| 2975 |
*(yy_c_buf_p) = (yy_hold_char); |
| 2976 |
YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); |
| 2977 |
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); |
| 2978 |
} |
| 2979 |
|
| 2980 |
/* Only push if top exists. Otherwise, replace top. */ |
| 2981 |
if (YY_CURRENT_BUFFER) |
| 2982 |
(yy_buffer_stack_top)++; |
| 2983 |
YY_CURRENT_BUFFER_LVALUE = new_buffer; |
| 2984 |
|
| 2985 |
/* copied from yy_switch_to_buffer. */ |
| 2986 |
yy_load_buffer_state(); |
| 2987 |
(yy_did_buffer_switch_on_eof) = 1; |
| 2988 |
} |
| 2989 |
/* %endif */ |
| 2990 |
|
| 2991 |
/* %if-c-or-c++ */ |
| 2992 |
/** Removes and deletes the top of the stack, if present. |
| 2993 |
* The next element becomes the new top. |
| 2994 |
* |
| 2995 |
*/ |
| 2996 |
/* %if-c-only */ |
| 2997 |
/* %endif */ |
| 2998 |
/* %if-c++-only */ |
| 2999 |
void yyFlexLexer::yypop_buffer_state(void) |
| 3000 |
/* %endif */ |
| 3001 |
{ |
| 3002 |
if (!YY_CURRENT_BUFFER) |
| 3003 |
return; |
| 3004 |
|
| 3005 |
yy_delete_buffer(YY_CURRENT_BUFFER); |
| 3006 |
YY_CURRENT_BUFFER_LVALUE = NULL; |
| 3007 |
if ((yy_buffer_stack_top) > 0) |
| 3008 |
--(yy_buffer_stack_top); |
| 3009 |
|
| 3010 |
if (YY_CURRENT_BUFFER) { |
| 3011 |
yy_load_buffer_state(); |
| 3012 |
(yy_did_buffer_switch_on_eof) = 1; |
| 3013 |
} |
| 3014 |
} |
| 3015 |
/* %endif */ |
| 3016 |
|
| 3017 |
/* %if-c-or-c++ */ |
| 3018 |
/* Allocates the stack if it does not exist. |
| 3019 |
* Guarantees space for at least one push. |
| 3020 |
*/ |
| 3021 |
/* %if-c-only */ |
| 3022 |
/* %endif */ |
| 3023 |
/* %if-c++-only */ |
| 3024 |
void yyFlexLexer::yyensure_buffer_stack(void) |
| 3025 |
/* %endif */ |
| 3026 |
{ |
| 3027 |
yy_size_t num_to_alloc; |
| 3028 |
|
| 3029 |
if (!(yy_buffer_stack)) { |
| 3030 |
|
| 3031 |
/* First allocation is just for 2 elements, since we don't know if this |
| 3032 |
* scanner will even need a stack. We use 2 instead of 1 to avoid an |
| 3033 |
* immediate realloc on the next call. |
| 3034 |
*/ |
| 3035 |
num_to_alloc = 1; |
| 3036 |
(yy_buffer_stack) = |
| 3037 |
(struct yy_buffer_state **)SEAMSalloc(num_to_alloc * sizeof(struct yy_buffer_state *)); |
| 3038 |
if (!(yy_buffer_stack)) |
| 3039 |
YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()"); |
| 3040 |
|
| 3041 |
memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state *)); |
| 3042 |
|
| 3043 |
(yy_buffer_stack_max) = num_to_alloc; |
| 3044 |
(yy_buffer_stack_top) = 0; |
| 3045 |
return; |
| 3046 |
} |
| 3047 |
|
| 3048 |
if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1) { |
| 3049 |
|
| 3050 |
/* Increase the buffer to prepare for a possible push. */ |
| 3051 |
int grow_size = 8 /* arbitrary grow size */; |
| 3052 |
|
| 3053 |
num_to_alloc = (yy_buffer_stack_max) + grow_size; |
| 3054 |
(yy_buffer_stack) = (struct yy_buffer_state **)SEAMSrealloc( |
| 3055 |
(yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state *)); |
| 3056 |
if (!(yy_buffer_stack)) |
| 3057 |
YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()"); |
| 3058 |
|
| 3059 |
/* zero only the new slots.*/ |
| 3060 |
memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, |
| 3061 |
grow_size * sizeof(struct yy_buffer_state *)); |
| 3062 |
(yy_buffer_stack_max) = num_to_alloc; |
| 3063 |
} |
| 3064 |
} |
| 3065 |
/* %endif */ |
| 3066 |
|
| 3067 |
/* %if-c-only */ |
| 3068 |
/* %endif */ |
| 3069 |
|
| 3070 |
/* %if-c-only */ |
| 3071 |
/* %endif */ |
| 3072 |
|
| 3073 |
/* %if-c-only */ |
| 3074 |
/* %endif */ |
| 3075 |
|
| 3076 |
/* %if-c-only */ |
| 3077 |
/* %endif */ |
| 3078 |
/* %if-c++-only */ |
| 3079 |
void yyFlexLexer::yy_push_state(int new_state) |
| 3080 |
/* %endif */ |
| 3081 |
{ |
| 3082 |
if ((yy_start_stack_ptr) >= (yy_start_stack_depth)) { |
| 3083 |
yy_size_t new_size; |
| 3084 |
|
| 3085 |
(yy_start_stack_depth) += YY_START_STACK_INCR; |
| 3086 |
new_size = (yy_start_stack_depth) * sizeof(int); |
| 3087 |
|
| 3088 |
if (!(yy_start_stack)) |
| 3089 |
(yy_start_stack) = (int *)SEAMSalloc(new_size); |
| 3090 |
|
| 3091 |
else |
| 3092 |
(yy_start_stack) = (int *)SEAMSrealloc((void *)(yy_start_stack), new_size); |
| 3093 |
|
| 3094 |
if (!(yy_start_stack)) |
| 3095 |
YY_FATAL_ERROR("out of memory expanding start-condition stack"); |
| 3096 |
} |
| 3097 |
|
| 3098 |
(yy_start_stack)[(yy_start_stack_ptr)++] = YY_START; |
| 3099 |
|
| 3100 |
BEGIN(new_state); |
| 3101 |
} |
| 3102 |
|
| 3103 |
/* %if-c-only */ |
| 3104 |
/* %endif */ |
| 3105 |
/* %if-c++-only */ |
| 3106 |
void yyFlexLexer::yy_pop_state() |
| 3107 |
/* %endif */ |
| 3108 |
{ |
| 3109 |
if (--(yy_start_stack_ptr) < 0) |
| 3110 |
YY_FATAL_ERROR("start-condition stack underflow"); |
| 3111 |
|
| 3112 |
BEGIN((yy_start_stack)[(yy_start_stack_ptr)]); |
| 3113 |
} |
| 3114 |
|
| 3115 |
/* %if-c-only */ |
| 3116 |
/* %endif */ |
| 3117 |
/* %if-c++-only */ |
| 3118 |
int yyFlexLexer::yy_top_state() |
| 3119 |
/* %endif */ |
| 3120 |
{ |
| 3121 |
return (yy_start_stack)[(yy_start_stack_ptr)-1]; |
| 3122 |
} |
| 3123 |
|
| 3124 |
#ifndef YY_EXIT_FAILURE |
| 3125 |
#define YY_EXIT_FAILURE 2 |
| 3126 |
#endif |
| 3127 |
|
| 3128 |
/* %if-c-only */ |
| 3129 |
/* %endif */ |
| 3130 |
/* %if-c++-only */ |
| 3131 |
void yyFlexLexer::LexerError(yyconst char msg[]) |
| 3132 |
{ |
| 3133 |
std::cerr << msg << std::endl; |
| 3134 |
exit(YY_EXIT_FAILURE); |
| 3135 |
} |
| 3136 |
/* %endif */ |
| 3137 |
|
| 3138 |
/* Redefine yyless() so it works in section 3 code. */ |
| 3139 |
|
| 3140 |
#undef yyless |
| 3141 |
#define yyless(n) \ |
| 3142 |
do { \ |
| 3143 |
/* Undo effects of setting up yytext. */ \ |
| 3144 |
int yyless_macro_arg = (n); \ |
| 3145 |
YY_LESS_LINENO(yyless_macro_arg); \ |
| 3146 |
yytext[yyleng] = (yy_hold_char); \ |
| 3147 |
(yy_c_buf_p) = yytext + yyless_macro_arg; \ |
| 3148 |
(yy_hold_char) = *(yy_c_buf_p); \ |
| 3149 |
*(yy_c_buf_p) = '\0'; \ |
| 3150 |
yyleng = yyless_macro_arg; \ |
| 3151 |
} while (0) |
| 3152 |
|
| 3153 |
/* Accessor methods (get/set functions) to struct members. */ |
| 3154 |
|
| 3155 |
/* %if-c-only */ |
| 3156 |
/* %if-reentrant */ |
| 3157 |
/* %endif */ |
| 3158 |
/* %if-reentrant */ |
| 3159 |
/* %endif */ |
| 3160 |
/* %endif */ |
| 3161 |
|
| 3162 |
/* %if-reentrant */ |
| 3163 |
/* %if-bison-bridge */ |
| 3164 |
/* %endif */ |
| 3165 |
/* %endif if-c-only */ |
| 3166 |
|
| 3167 |
/* %if-c-only */ |
| 3168 |
/* %endif */ |
| 3169 |
|
| 3170 |
/* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */ |
| 3171 |
/* %if-reentrant */ |
| 3172 |
/* %endif */ |
| 3173 |
/* %endif */ |
| 3174 |
|
| 3175 |
/* |
| 3176 |
* Internal utility routines. |
| 3177 |
*/ |
| 3178 |
|
| 3179 |
#ifndef yytext_ptr |
| 3180 |
static void yy_flex_strncpy(char *s1, yyconst char *s2, int n) |
| 3181 |
{ |
| 3182 |
int i; |
| 3183 |
for (i = 0; i < n; ++i) |
| 3184 |
s1[i] = s2[i]; |
| 3185 |
} |
| 3186 |
#endif |
| 3187 |
|
| 3188 |
#ifdef YY_NEED_STRLEN |
| 3189 |
static int yy_flex_strlen(yyconst char *s) |
| 3190 |
{ |
| 3191 |
int n; |
| 3192 |
for (n = 0; s[n]; ++n) |
| 3193 |
; |
| 3194 |
|
| 3195 |
return n; |
| 3196 |
} |
| 3197 |
#endif |
| 3198 |
|
| 3199 |
void *SEAMSalloc(yy_size_t size) { return (void *)malloc(size); } |
| 3200 |
|
| 3201 |
void *SEAMSrealloc(void *ptr, yy_size_t size) |
| 3202 |
{ |
| 3203 |
/* The cast to (char *) in the following accommodates both |
| 3204 |
* implementations that use char* generic pointers, and those |
| 3205 |
* that use void* generic pointers. It works with the latter |
| 3206 |
* because both ANSI C and C++ allow castless assignment from |
| 3207 |
* any pointer type to void*, and deal with argument conversions |
| 3208 |
* as though doing an assignment. |
| 3209 |
*/ |
| 3210 |
return (void *)realloc((char *)ptr, size); |
| 3211 |
} |
| 3212 |
|
| 3213 |
void SEAMSfree(void *ptr) { free((char *)ptr); /* see SEAMSrealloc() for (char *) cast */ } |
| 3214 |
|
| 3215 |
/* %if-tables-serialization definitions */ |
| 3216 |
/* %define-yytables The name for this specific scanner's tables. */ |
| 3217 |
#define YYTABLES_NAME "yytables" |
| 3218 |
/* %endif */ |
| 3219 |
|
| 3220 |
/* %ok-for-header */ |
| 3221 |
|
| 3222 |
/* When the scanner receives an end-of-file indication from YY_INPUT, it then |
| 3223 |
* checks the yywrap() function. If yywrap() returns false (zero), then it is |
| 3224 |
* assumed that the function has gone ahead and set up `yyin' to point to |
| 3225 |
* another input file, and scanning continues. If it returns true (non-zero), |
| 3226 |
* then the scanner terminates, returning 0 to its caller. */ |
| 3227 |
|
| 3228 |
namespace SEAMS { |
| 3229 |
|
| 3230 |
Scanner::Scanner(Aprepro &aprepro_yyarg, std::istream *in, std::ostream *out) |
| 3231 |
: SEAMSFlexLexer(in, out), aprepro(aprepro_yyarg) |
| 3232 |
{ |
| 3233 |
aprepro.outputStream.push(out); |
| 3234 |
} |
| 3235 |
|
| 3236 |
Scanner::~Scanner() |
| 3237 |
{ |
| 3238 |
while (aprepro.ap_file_list.size() > 1) { |
| 3239 |
auto kk = aprepro.ap_file_list.top(); |
| 3240 |
if (kk.name != "STDIN") { |
| 3241 |
yyFlexLexer::yy_load_buffer_state(); |
| 3242 |
delete yyin; |
| 3243 |
yyin = nullptr; |
| 3244 |
} |
| 3245 |
aprepro.ap_file_list.pop(); |
| 3246 |
yyFlexLexer::yypop_buffer_state(); |
| 3247 |
}; |
| 3248 |
} |
| 3249 |
|
| 3250 |
bool Scanner::add_include_file(const std::string &filename, bool must_exist) |
| 3251 |
{ |
| 3252 |
std::fstream *yytmp = nullptr; |
| 3253 |
if (must_exist) |
| 3254 |
yytmp = aprepro.open_file(filename, "r"); |
| 3255 |
else |
| 3256 |
yytmp = aprepro.check_open_file(filename, "r"); |
| 3257 |
|
| 3258 |
if (yytmp) { |
| 3259 |
if (yyin && !yy_init) { |
| 3260 |
yyFlexLexer::yypush_buffer_state(yyFlexLexer::yy_create_buffer(yyin, YY_BUF_SIZE)); |
| 3261 |
} |
| 3262 |
|
| 3263 |
yyin = yytmp; |
| 3264 |
aprepro.info("Included File: '" + filename + "'", true); |
| 3265 |
|
| 3266 |
SEAMS::file_rec new_file(filename.c_str(), 0, false, 0); |
| 3267 |
aprepro.ap_file_list.push(new_file); |
| 3268 |
|
| 3269 |
yyFlexLexer::yypush_buffer_state(yyFlexLexer::yy_create_buffer(yytmp, YY_BUF_SIZE)); |
| 3270 |
curr_index = 0; |
| 3271 |
} |
| 3272 |
return yytmp != nullptr; |
| 3273 |
} |
| 3274 |
|
| 3275 |
void Scanner::LexerOutput(const char *buf, int size) |
| 3276 |
{ |
| 3277 |
// Do this before writing so that we have the correct index in the |
| 3278 |
// output stream. |
| 3279 |
if (aprepro.ap_options.keep_history) { |
| 3280 |
aprepro.add_history(history_string, buf); |
| 3281 |
history_string.clear(); |
| 3282 |
hist_start = 0; |
| 3283 |
} |
| 3284 |
|
| 3285 |
aprepro.outputStream.top()->write(buf, size); |
| 3286 |
if (aprepro.ap_options.interactive && aprepro.outputStream.size() == 1) { |
| 3287 |
// In interactive mode, output to stdout in addition to the |
| 3288 |
// output stream, unless user has redirected output... |
| 3289 |
std::cout << buf; |
| 3290 |
} |
| 3291 |
} |
| 3292 |
|
| 3293 |
int Scanner::LexerInput(char *buf, int max_size) |
| 3294 |
{ |
| 3295 |
if (yyin->eof() || yyin->fail()) { |
| 3296 |
return 0; |
| 3297 |
} |
| 3298 |
|
| 3299 |
if (aprepro.ap_options.interactive && yyin == &std::cin && isatty(0) != 0 && isatty(1) != 0) { |
| 3300 |
char *line = SEAMS::getline_int(nullptr); |
| 3301 |
|
| 3302 |
if (strlen(line) == 0) { |
| 3303 |
return 0; |
| 3304 |
} |
| 3305 |
|
| 3306 |
if (!string_is_ascii(line, strlen(line))) { |
| 3307 |
aprepro.warning("input line contains non-ASCII (probably UTF-8) characters which might be " |
| 3308 |
"parsed incorrectly."); |
| 3309 |
} |
| 3310 |
|
| 3311 |
SEAMS::gl_histadd(line); |
| 3312 |
|
| 3313 |
if (strlen(line) > (size_t)max_size - 2) { |
| 3314 |
yyerror("input line is too long"); |
| 3315 |
return 0; |
| 3316 |
} |
| 3317 |
|
| 3318 |
strcpy(buf, line); |
| 3319 |
strcat(buf, "\n"); |
| 3320 |
|
| 3321 |
return strlen(buf); |
| 3322 |
} |
| 3323 |
else { |
| 3324 |
(void)yyin->read(buf, max_size); |
| 3325 |
|
| 3326 |
if (yyin->bad()) { |
| 3327 |
return -1; |
| 3328 |
} |
| 3329 |
else { |
| 3330 |
if (!string_is_ascii(buf, yyin->gcount())) { |
| 3331 |
aprepro.warning("input file contains non-ASCII (probably UTF-8) characters which might " |
| 3332 |
"be parsed incorrectly."); |
| 3333 |
} |
| 3334 |
return yyin->gcount(); |
| 3335 |
} |
| 3336 |
} |
| 3337 |
} |
| 3338 |
|
| 3339 |
int Scanner::yywrap() |
| 3340 |
{ |
| 3341 |
// Clear the history string. |
| 3342 |
history_string.clear(); |
| 3343 |
hist_start = 0; |
| 3344 |
curr_index = 0; |
| 3345 |
|
| 3346 |
// If we are using the string interactive method, we want to return to |
| 3347 |
// our original state if parsing was cutoff prematurely. |
| 3348 |
if (aprepro.string_interactive() && YY_START == PARSING) { |
| 3349 |
if (switch_skip_to_endcase) { |
| 3350 |
BEGIN(END_CASE_SKIP); |
| 3351 |
} |
| 3352 |
else { |
| 3353 |
BEGIN(if_state[if_lvl]); |
| 3354 |
} |
| 3355 |
} |
| 3356 |
|
| 3357 |
if (aprepro.ap_file_list.size() <= 1) { /* End of main file, not in nested include */ |
| 3358 |
return (1); |
| 3359 |
} |
| 3360 |
else if (aprepro.string_interactive() && loop_lvl) { |
| 3361 |
return (1); |
| 3362 |
} |
| 3363 |
else if (aprepro.isCollectingLoop) { |
| 3364 |
yyerror("End-of-file detected inside loop. Check loop syntax. {endloop} must be on line by " |
| 3365 |
"itself."); |
| 3366 |
return (1); |
| 3367 |
} |
| 3368 |
else { |
| 3369 |
/* We are in an included or looping file */ |
| 3370 |
if (aprepro.ap_file_list.top().tmp_file) { |
| 3371 |
if (aprepro.ap_options.debugging) { |
| 3372 |
std::cerr << "DEBUG LOOP: Loop count = " << aprepro.ap_file_list.top().loop_count << "\n"; |
| 3373 |
} |
| 3374 |
if (--aprepro.ap_file_list.top().loop_count <= 0) { |
| 3375 |
// On Windows, you can't remove the temp file until all the references to the |
| 3376 |
// file object have been released, so we will delete it here. |
| 3377 |
delete yyin; |
| 3378 |
yyin = nullptr; |
| 3379 |
|
| 3380 |
if (aprepro.ap_file_list.top().name != "_string_") { |
| 3381 |
if (!aprepro.ap_options.debugging) { |
| 3382 |
remove(aprepro.ap_file_list.top().name.c_str()); /* Delete file if temporary */ |
| 3383 |
} |
| 3384 |
if (!aprepro.doLoopSubstitution) { |
| 3385 |
yy_pop_state(); |
| 3386 |
} |
| 3387 |
} |
| 3388 |
|
| 3389 |
aprepro.ap_file_list.pop(); |
| 3390 |
yyFlexLexer::yypop_buffer_state(); |
| 3391 |
} |
| 3392 |
else { |
| 3393 |
// Do not pop ap_file_list; we are rereading that file... |
| 3394 |
delete yyin; |
| 3395 |
yyin = nullptr; |
| 3396 |
yyFlexLexer::yypop_buffer_state(); |
| 3397 |
yyin = aprepro.open_file(aprepro.ap_file_list.top().name, "r"); |
| 3398 |
yyFlexLexer::yypush_buffer_state(yyFlexLexer::yy_create_buffer(yyin, YY_BUF_SIZE)); |
| 3399 |
aprepro.ap_file_list.top().lineno = 0; |
| 3400 |
|
| 3401 |
if (aprepro.ap_file_list.top().loop_index != nullptr) { |
| 3402 |
aprepro.ap_file_list.top().loop_index->value.var += |
| 3403 |
aprepro.ap_file_list.top().loop_increment; |
| 3404 |
} |
| 3405 |
} |
| 3406 |
} |
| 3407 |
else { |
| 3408 |
delete yyin; |
| 3409 |
yyin = nullptr; |
| 3410 |
aprepro.ap_file_list.pop(); |
| 3411 |
yyFlexLexer::yypop_buffer_state(); |
| 3412 |
|
| 3413 |
if (aprepro.ap_file_list.top().name == "standard input") { |
| 3414 |
yyin = &std::cin; |
| 3415 |
} |
| 3416 |
|
| 3417 |
/* Turn echoing back on at end of included files. */ |
| 3418 |
echo = true; |
| 3419 |
|
| 3420 |
// If we are not doing aprepro substitutions for the included file, but |
| 3421 |
// just collecting lines, pop the state from VERBATIM back to what it |
| 3422 |
// was previously. |
| 3423 |
if (!aprepro.doIncludeSubstitution) { |
| 3424 |
yy_pop_state(); |
| 3425 |
} |
| 3426 |
|
| 3427 |
/* Set immutable mode back to global immutable |
| 3428 |
* state at end of included file*/ |
| 3429 |
aprepro.stateImmutable = aprepro.ap_options.immutable; |
| 3430 |
} |
| 3431 |
|
| 3432 |
// Reset the current character index. |
| 3433 |
curr_index = 0; |
| 3434 |
if (yyin != nullptr) { |
| 3435 |
curr_index = yyin->tellg(); |
| 3436 |
} |
| 3437 |
|
| 3438 |
return (0); |
| 3439 |
} |
| 3440 |
} |
| 3441 |
|
| 3442 |
/* Print error message to standard error and return. Note: internally |
| 3443 |
* 'lineno' starts at zero. To avoid confusion, we add 1 to value |
| 3444 |
* when it is output. |
| 3445 |
*/ |
| 3446 |
|
| 3447 |
void Scanner::yyerror(const char *s) { aprepro.error(s); } |
| 3448 |
|
| 3449 |
char *Scanner::execute(char string[]) |
| 3450 |
{ |
| 3451 |
/* Push the contents of 'string' onto the stack to be reread. |
| 3452 |
* 'string' will be surrounded by {} so it must be a valid expression. |
| 3453 |
*/ |
| 3454 |
|
| 3455 |
/* |
| 3456 |
* NOTE: The closing } has not yet been scanned in the call to execute(); |
| 3457 |
* therefore, we read it ourselves using input(), then we push: |
| 3458 |
* '}{' + our string + '}' |
| 3459 |
*/ |
| 3460 |
int i; |
| 3461 |
while ((i = yyFlexLexer::yyinput()) != '}' && i != EOF) |
| 3462 |
curr_index++; /* eat up values */ |
| 3463 |
|
| 3464 |
// Increment curr_index to account for the '}' and save history |
| 3465 |
curr_index++; |
| 3466 |
save_history_string(); |
| 3467 |
|
| 3468 |
/* Allocate space for string + '}' + '{' + end_of_string */ |
| 3469 |
std::string new_string; |
| 3470 |
new_string += "}{"; |
| 3471 |
new_string += string; |
| 3472 |
new_string += "}"; |
| 3473 |
|
| 3474 |
aprepro.ap_file_list.push(SEAMS::file_rec("_string_", 0, true, -1)); |
| 3475 |
|
| 3476 |
auto ins = new std::istringstream(new_string); // Declare an input string stream. |
| 3477 |
yyFlexLexer::yypush_buffer_state(yyFlexLexer::yy_create_buffer(ins, new_string.size())); |
| 3478 |
return (nullptr); |
| 3479 |
} |
| 3480 |
|
| 3481 |
/* Push the contents of 'string' onto the stack to be reread. |
| 3482 |
* 'string' will not be surrounded by {}. |
| 3483 |
*/ |
| 3484 |
|
| 3485 |
char *Scanner::rescan(char *string) |
| 3486 |
{ |
| 3487 |
int i; |
| 3488 |
/* |
| 3489 |
* NOTE: The closing } has not yet been scanned in the call to rescan(); |
| 3490 |
* therefore, we read it ourselves using input(), then we push our |
| 3491 |
* string and then put the closing } back on the stack last |
| 3492 |
* (to be read first), |
| 3493 |
*/ |
| 3494 |
while ((i = yyFlexLexer::yyinput()) != '}' && i != EOF) |
| 3495 |
curr_index++; /* eat up values */ |
| 3496 |
|
| 3497 |
// Increment curr_index to account for the '}' and save history |
| 3498 |
curr_index++; |
| 3499 |
save_history_string(); |
| 3500 |
|
| 3501 |
{ |
| 3502 |
aprepro.ap_file_list.push(SEAMS::file_rec("_string_", 0, true, -1)); |
| 3503 |
std::string new_string("}"); |
| 3504 |
new_string += string; |
| 3505 |
|
| 3506 |
auto ins = new std::istringstream(new_string); // Declare an input string stream. |
| 3507 |
yyFlexLexer::yypush_buffer_state(yyFlexLexer::yy_create_buffer(ins, new_string.size())); |
| 3508 |
} |
| 3509 |
return (nullptr); |
| 3510 |
} |
| 3511 |
|
| 3512 |
char *Scanner::import_handler(char *string) |
| 3513 |
{ |
| 3514 |
/* |
| 3515 |
* NOTE: The closing } has not yet been scanned in the call to rescan(); |
| 3516 |
* therefore, we read it ourselves using input(). |
| 3517 |
*/ |
| 3518 |
int i = 0; |
| 3519 |
while ((i = yyFlexLexer::yyinput()) != '}' && i != EOF) |
| 3520 |
curr_index++; /* eat up values */ |
| 3521 |
|
| 3522 |
add_include_file(string, true); |
| 3523 |
std::string info_string = std::string("Imported File: '") + string + "'"; |
| 3524 |
aprepro.info(info_string, true); |
| 3525 |
|
| 3526 |
if (!aprepro.doIncludeSubstitution) { |
| 3527 |
yy_push_state(VERBATIM); |
| 3528 |
} |
| 3529 |
|
| 3530 |
/* |
| 3531 |
* Now we need to push back the closing } so it is the first thing read. |
| 3532 |
* We no longer have the initial file stream (is is pushed down on stack) |
| 3533 |
* so we need to add a new file stream consisting of just a single character. |
| 3534 |
* Wasteful, but best I can come up with at this time. |
| 3535 |
*/ |
| 3536 |
aprepro.ap_file_list.push(SEAMS::file_rec("_string_", 0, true, -1)); |
| 3537 |
std::string new_string("}"); |
| 3538 |
auto ins = new std::istringstream(new_string); // Declare an input string stream. |
| 3539 |
yyFlexLexer::yypush_buffer_state(yyFlexLexer::yy_create_buffer(ins, new_string.size())); |
| 3540 |
|
| 3541 |
if (aprepro.ap_options.debugging) { |
| 3542 |
std::cerr << "DEBUG IMPORT: " << string << "\n"; |
| 3543 |
} |
| 3544 |
return (nullptr); |
| 3545 |
} |
| 3546 |
|
| 3547 |
char *Scanner::if_handler(double x) |
| 3548 |
{ |
| 3549 |
if_lvl++; |
| 3550 |
if (if_lvl >= MAX_IF_NESTING) { |
| 3551 |
yyerror("Too many nested if statements"); |
| 3552 |
} |
| 3553 |
else { |
| 3554 |
if (x == 0) { |
| 3555 |
if_state[if_lvl] = IF_SKIP; |
| 3556 |
if_case_run[if_lvl] = false; |
| 3557 |
} |
| 3558 |
else { |
| 3559 |
suppress_nl = true; |
| 3560 |
if_state[if_lvl] = INITIAL; |
| 3561 |
if_case_run[if_lvl] = true; |
| 3562 |
} |
| 3563 |
if (aprepro.ap_options.debugging) { |
| 3564 |
std::cerr << "DEBUG IF: If level " << if_lvl << " " << if_state[if_lvl] << "\n"; |
| 3565 |
} |
| 3566 |
} |
| 3567 |
return (nullptr); |
| 3568 |
} |
| 3569 |
|
| 3570 |
char *Scanner::elseif_handler(double x) |
| 3571 |
{ |
| 3572 |
if (x == 0 || if_case_run[if_lvl]) { |
| 3573 |
if_state[if_lvl] = IF_SKIP; |
| 3574 |
} |
| 3575 |
else { |
| 3576 |
suppress_nl = 1; |
| 3577 |
if_state[if_lvl] = INITIAL; |
| 3578 |
if_case_run[if_lvl] = true; |
| 3579 |
} |
| 3580 |
if (aprepro.ap_options.debugging) { |
| 3581 |
std::cerr << "DEBUG IF: elseif at level " << if_lvl << " " << if_state[if_lvl] << "\n"; |
| 3582 |
} |
| 3583 |
return (nullptr); |
| 3584 |
} |
| 3585 |
|
| 3586 |
char *Scanner::switch_handler(double x) |
| 3587 |
{ |
| 3588 |
// save that we are in a switch statement |
| 3589 |
// save the value of 'x' for use in deciding which case to execute |
| 3590 |
if (switch_active) { |
| 3591 |
yyerror("switch statement found while switch already active. Nested switch not supported."); |
| 3592 |
} |
| 3593 |
|
| 3594 |
switch_active = true; |
| 3595 |
switch_case_run = false; |
| 3596 |
switch_condition = x; |
| 3597 |
switch_skip_to_endcase = true; /* Skip everything until first case */ |
| 3598 |
suppress_nl = true; |
| 3599 |
|
| 3600 |
if (aprepro.ap_options.debugging) { |
| 3601 |
std::cerr << "DEBUG SWITCH: 'switch' with condition = " << switch_condition << " at line " |
| 3602 |
<< aprepro.ap_file_list.top().lineno << "\n"; |
| 3603 |
} |
| 3604 |
return (nullptr); |
| 3605 |
} |
| 3606 |
|
| 3607 |
char *Scanner::case_handler(double x) |
| 3608 |
{ |
| 3609 |
// make sure we are in a switch statement |
| 3610 |
// if 'x' matches the value saved in the switch statement |
| 3611 |
// and no other case has been executed, then |
| 3612 |
// execute the code in the case and set a flag indicating |
| 3613 |
// the switch has run; |
| 3614 |
// if 'x' does not match the value saved, then skip to endcase |
| 3615 |
suppress_nl = true; |
| 3616 |
|
| 3617 |
if (!switch_active) { |
| 3618 |
yyerror("case statement found outside switch statement."); |
| 3619 |
} |
| 3620 |
|
| 3621 |
if (!switch_case_run && x == switch_condition) { |
| 3622 |
switch_case_run = true; |
| 3623 |
if (aprepro.ap_options.debugging) { |
| 3624 |
fprintf(stderr, |
| 3625 |
"DEBUG SWITCH: 'case' condition = %g matches switch condition = %g at line %d\n", x, |
| 3626 |
switch_condition, aprepro.ap_file_list.top().lineno); |
| 3627 |
} |
| 3628 |
} |
| 3629 |
else { |
| 3630 |
if (aprepro.ap_options.debugging) { |
| 3631 |
fprintf(stderr, |
| 3632 |
"DEBUG SWITCH: 'case' condition = %g does not match switch condition = %g " |
| 3633 |
"(or case already matched) at line %d\n", |
| 3634 |
x, switch_condition, aprepro.ap_file_list.top().lineno); |
| 3635 |
} |
| 3636 |
|
| 3637 |
// Need to skip all code until end of case |
| 3638 |
switch_skip_to_endcase = true; |
| 3639 |
} |
| 3640 |
return (nullptr); |
| 3641 |
} |
| 3642 |
|
| 3643 |
void Scanner::save_history_string() |
| 3644 |
{ |
| 3645 |
if (!aprepro.ap_options.keep_history) { |
| 3646 |
return; |
| 3647 |
} |
| 3648 |
|
| 3649 |
// Don't do it if the file is the one used by execute and rescan. |
| 3650 |
if (aprepro.ap_file_list.top().name == "_string_" || |
| 3651 |
aprepro.ap_file_list.top().name == "standard input") { |
| 3652 |
return; |
| 3653 |
} |
| 3654 |
|
| 3655 |
size_t hist_end = curr_index; |
| 3656 |
size_t len = hist_end - hist_start; |
| 3657 |
|
| 3658 |
if (len <= 0) |
| 3659 |
return; |
| 3660 |
|
| 3661 |
// Clear any possible end-of-stream if e.g., reading from a istringstream. |
| 3662 |
std::ios::iostate state = yyin->rdstate(); |
| 3663 |
size_t loc = yyin->tellg(); |
| 3664 |
yyin->clear(); |
| 3665 |
|
| 3666 |
// Go back in the stream to where we started keeping history. |
| 3667 |
yyin->seekg(hist_start); |
| 3668 |
if (!yyin->good()) { |
| 3669 |
yyerror("Stream state bad in `save_history_string` seekg"); |
| 3670 |
return; |
| 3671 |
} |
| 3672 |
|
| 3673 |
// Read everything up to this point again and save it. |
| 3674 |
auto tmp = new char[len + 1]; |
| 3675 |
yyin->read(tmp, len); |
| 3676 |
if (!yyin->good()) { |
| 3677 |
yyerror("Stream state bad in `save_history_string` read"); |
| 3678 |
return; |
| 3679 |
} |
| 3680 |
tmp[len] = '\0'; |
| 3681 |
|
| 3682 |
history_string = tmp; |
| 3683 |
delete[] tmp; |
| 3684 |
hist_start = 0; |
| 3685 |
|
| 3686 |
// restore stream state |
| 3687 |
yyin->seekg(loc); |
| 3688 |
yyin->setstate(state); |
| 3689 |
} |
| 3690 |
} // namespace SEAMS |
| 3691 |
|
| 3692 |
/* This implementation of SEAMSFlexLexer::yylex() is required to fill the |
| 3693 |
* vtable of the class SEAMSFlexLexer. We define the scanner's main yylex |
| 3694 |
* function via YY_DECL to reside in the Scanner class instead. */ |
| 3695 |
|
| 3696 |
#ifdef yylex |
| 3697 |
#undef yylex |
| 3698 |
#endif |
| 3699 |
int SEAMSFlexLexer::yylex() |
| 3700 |
{ |
| 3701 |
std::cerr << "in SEAMSFlexLexer::yylex() !" << '\n'; |
| 3702 |
return 0; |
| 3703 |
} |
| 3704 |
|
| 3705 |
/* When the scanner receives an end-of-file indication from YY_INPUT, it then |
| 3706 |
* checks the yywrap() function. If yywrap() returns false (zero), then it is |
| 3707 |
* assumed that the function has gone ahead and set up `yyin' to point to |
| 3708 |
* another input file, and scanning continues. If it returns true (non-zero), |
| 3709 |
* then the scanner terminates, returning 0 to its caller. */ |
| 3710 |
|
| 3711 |
int SEAMSFlexLexer::yywrap() { return 1; } |