#line 3 "apr_scanner.cc" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ /* %not-for-header */ /* %if-c-only */ /* %if-not-reentrant */ /* %endif */ /* %endif */ /* %ok-for-header */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 39 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* %if-c++-only */ /* The c++ scanner is a mess. The FlexLexer.h header file relies on the * following macro. This is required in order to pass the c++-multiple-scanners * test in the regression suite. We get reports that it breaks inheritance. * We will address this in a future release of flex, or omit the C++ scanner * altogether. */ #define yyFlexLexer SEAMSFlexLexer /* %endif */ /* %if-c-only */ /* %endif */ /* %if-c-only */ /* %endif */ /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ /* %if-c-only */ /* %endif */ /* %if-tables-serialization */ /* %endif */ /* end standard C headers. */ /* %if-c-or-c++ */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767 - 1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647 - 1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ /* %endif */ /* %if-c++-only */ /* begin standard C++ headers. */ #include #include #include #include #include /* end standard C++ headers. */ /* %endif */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined(__STDC__) #define YY_USE_CONST #endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* %not-for-header */ /* Returned upon end-of-file. */ #define YY_NULL 0 /* %ok-for-header */ /* %not-for-header */ /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int)(unsigned char)c) /* %ok-for-header */ /* %if-reentrant */ /* %endif */ /* %if-not-reentrant */ /* %endif */ /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart(yyin) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #define YY_BUF_SIZE 16384 #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif /* %if-not-reentrant */ extern int yyleng; /* %endif */ /* %if-c-only */ /* %if-not-reentrant */ /* %endif */ /* %endif */ #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg); \ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } while (0) #define unput(c) yyunput(c, (yytext_ptr)) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { /* %if-c-only */ /* %endif */ /* %if-c++-only */ std::istream *yy_input_file; /* %endif */ char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* %if-c-only Standard (non-C++) definition */ /* %not-for-header */ /* %if-not-reentrant */ /* %endif */ /* %ok-for-header */ /* %endif */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ((yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)] : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* %if-c-only Standard (non-C++) definition */ /* %if-not-reentrant */ /* %not-for-header */ /* %ok-for-header */ /* %endif */ /* %endif */ void *SEAMSalloc(yy_size_t); void *SEAMSrealloc(void *, yy_size_t); void SEAMSfree(void *); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if (!YY_CURRENT_BUFFER) { \ yyensure_buffer_stack(); \ YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if (!YY_CURRENT_BUFFER) { \ yyensure_buffer_stack(); \ YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */ /* Begin user sect3 */ #define FLEX_DEBUG typedef unsigned char YY_CHAR; #define yytext_ptr yytext #define YY_INTERACTIVE #include /* %% [1.5] DFA */ /* %if-c-only Standard (non-C++) definition */ /* %endif */ /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ /* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */ \ yyleng = (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ /* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */ \ (yy_c_buf_p) = yy_cp; /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */ #define YY_NUM_RULES 102 #define YY_END_OF_BUFFER 103 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static yyconst flex_int16_t yy_accept[685] = { 0, 0, 0, 50, 50, 0, 0, 39, 39, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 103, 100, 100, 101, 98, 99, 99, 99, 100, 95, 50, 70, 85, 100, 67, 100, 100, 71, 72, 63, 61, 73, 62, 49, 66, 48, 75, 74, 77, 52, 78, 76, 51, 51, 51, 86, 87, 68, 95, 100, 90, 64, 100, 100, 98, 99, 99, 99, 100, 95, 42, 42, 43, 39, 42, 39, 39, 39, 39, 42, 42, 100, 3, 3, 4, 2, 3, 2, 2, 2, 2, 3, 3, 100, 100, 33, 98, 99, 99, 99, 100, 95, 100, 100, 98, 99, 99, 99, 100, 95, 100, 100, 17, 98, 99, 99, 99, 100, 95, 100, 100, 21, 98, 99, 99, 99, 100, 95, 100, 100, 25, 98, 99, 99, 99, 100, 95, 0, 0, 99, 99, 99, 92, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 50, 0, 82, 0, 88, 83, 0, 89, 69, 55, 59, 53, 60, 54, 49, 0, 65, 56, 49, 48, 0, 79, 81, 80, 51, 51, 51, 57, 0, 84, 91, 0, 0, 0, 0, 99, 99, 99, 92, 93, 0, 94, 0, 0, 39, 39, 39, 39, 39, 40, 41, 0, 0, 0, 0, 2, 2, 2, 2, 2, 0, 0, 33, 0, 0, 99, 99, 99, 92, 93, 0, 0, 94, 0, 0, 0, 0, 99, 99, 99, 92, 93, 0, 94, 0, 17, 0, 0, 99, 99, 99, 92, 93, 0, 0, 0, 94, 0, 21, 0, 0, 99, 99, 99, 92, 93, 0, 0, 0, 94, 0, 25, 0, 0, 99, 99, 99, 92, 93, 0, 0, 0, 0, 0, 94, 99, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, 0, 49, 0, 48, 51, 51, 0, 47, 99, 99, 0, 0, 39, 39, 0, 0, 0, 2, 2, 0, 99, 99, 0, 0, 0, 0, 99, 99, 0, 0, 99, 99, 0, 0, 0, 0, 99, 99, 0, 0, 0, 0, 99, 99, 0, 0, 0, 0, 0, 0, 96, 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 51, 47, 96, 97, 0, 0, 39, 39, 0, 0, 0, 35, 0, 0, 2, 2, 0, 96, 97, 0, 0, 0, 0, 0, 0, 0, 13, 0, 96, 97, 0, 0, 96, 97, 0, 0, 0, 0, 96, 97, 0, 0, 0, 0, 96, 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 37, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 15, 0, 0, 21, 0, 0, 0, 19, 0, 25, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, 28, 0, 8, 0, 0, 0, 0, 47, 0, 0, 0, 38, 0, 36, 0, 0, 29, 0, 30, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 21, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 37, 0, 47, 0, 0, 32, 0, 13, 0, 0, 0, 0, 14, 0, 0, 18, 0, 0, 0, 0, 46, 0, 7, 0, 0, 0, 23, 0, 44, 0, 0, 0, 13, 0, 0, 0, 0, 23, 0, 9, 0, 0, 0, 0, 0, 0, 0, 16, 0, 20, 0, 0, 0, 0, 0, 26, 0, 0, 24, 0, 0, 0, 0, 0, 0, 5, 0, 0, 10, 1, 11, 0}; static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 5, 6, 1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 21, 22, 23, 24, 25, 1, 26, 27, 28, 29, 30, 31, 29, 32, 33, 29, 29, 34, 35, 36, 37, 29, 38, 39, 29, 40, 41, 42, 29, 43, 29, 29, 44, 45, 46, 47, 29, 1, 48, 49, 50, 51, 52, 53, 29, 54, 55, 29, 29, 56, 29, 57, 58, 59, 38, 60, 61, 62, 63, 29, 64, 43, 29, 29, 65, 66, 67, 68, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; 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, 1, 5, 6, 1, 1, 1, 1, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, 1, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 2, 1, 1, 1}; static yyconst flex_int16_t yy_base[731] = { 0, 0, 0, 68, 0, 136, 0, 204, 0, 271, 272, 337, 0, 405, 0, 473, 0, 541, 0, 609, 0, 677, 0, 2445, 2446, 744, 2446, 2446, 0, 2401, 236, 213, 808, 748, 2446, 2420, 276, 2446, 2433, 2431, 2446, 2446, 268, 269, 2446, 270, 265, 267, 270, 2446, 2446, 2417, 2416, 2415, 2446, 0, 2394, 247, 2446, 2446, 2413, 264, 2369, 2367, 2446, 2421, 749, 2420, 873, 2388, 255, 735, 742, 2446, 753, 2446, 754, 2446, 757, 293, 745, 758, 236, 765, 762, 2446, 766, 2446, 769, 2446, 758, 294, 772, 770, 237, 751, 2427, 780, 2446, 2426, 941, 2385, 264, 772, 802, 2415, 775, 2414, 1009, 2382, 265, 784, 796, 2421, 1076, 2446, 2420, 1141, 2379, 267, 788, 1207, 2418, 1209, 2446, 2417, 1274, 2376, 268, 801, 1340, 2415, 1342, 2446, 2414, 1407, 2373, 270, 1473, 1476, 1479, 270, 0, 730, 773, 2446, 2446, 1079, 2360, 815, 812, 2356, 2376, 2382, 2359, 263, 268, 2446, 1480, 794, 2446, 320, 2446, 2446, 2400, 2446, 2386, 2446, 2446, 2446, 2446, 2446, 1063, 1070, 2446, 2446, 1066, 1071, 1078, 2446, 2446, 2446, 0, 1054, 1058, 2446, 1042, 2446, 2446, 2396, 1483, 1484, 1202, 0, 1062, 1067, 2395, 2394, 1204, 2393, 1487, 1213, 1488, 787, 1099, 1214, 1215, 2446, 2446, 1219, 1048, 2351, 1495, 1496, 1491, 1104, 1218, 1343, 2373, 2399, 2446, 1499, 1345, 0, 1073, 1074, 2398, 2397, 1346, 1348, 2396, 2386, 789, 1503, 1212, 0, 1077, 1078, 2385, 2384, 1338, 2383, 2391, 2446, 1506, 1491, 0, 1079, 1081, 2390, 2389, 1217, 1474, 1501, 2388, 2387, 2446, 1509, 1532, 0, 1083, 1195, 2386, 2385, 1350, 1513, 1515, 2384, 2383, 2446, 1520, 1573, 0, 1197, 1198, 2382, 2381, 1579, 1530, 777, 1352, 1533, 2380, 1196, 1200, 2325, 2324, 2348, 2318, 2327, 2342, 819, 2326, 2317, 2344, 2334, 2319, 2320, 2446, 2351, 2350, 2349, 2348, 1205, 1317, 1530, 312, 1318, 1319, 1502, 1340, 1574, 1575, 2310, 2304, 1589, 1588, 1592, 2325, 1320, 1321, 1543, 1516, 1607, 1123, 1322, 1324, 1545, 1342, 1325, 1327, 1562, 1552, 1548, 1569, 1328, 1576, 1595, 1598, 1551, 1602, 1577, 1579, 1604, 1618, 1619, 1623, 1353, 1630, 0, 0, 2312, 2312, 2324, 2308, 1601, 2318, 2306, 2306, 2300, 2296, 2326, 2326, 2304, 1602, 0, 0, 2348, 0, 0, 1630, 1632, 1117, 1365, 2289, 2297, 1641, 2446, 2296, 2296, 1647, 1651, 2319, 0, 0, 1644, 1645, 1672, 2342, 1646, 1659, 1517, 2446, 1665, 0, 0, 1654, 1657, 0, 0, 1669, 1670, 1682, 1677, 0, 0, 1683, 1688, 1686, 1685, 0, 0, 1694, 1696, 1691, 1698, 1699, 1700, 2283, 2287, 1682, 2275, 2288, 2300, 2286, 2286, 2274, 1703, 2304, 2309, 2271, 2269, 1692, 1699, 2280, 1684, 2278, 2278, 2303, 1689, 1705, 2325, 2446, 1710, 1715, 1718, 1697, 1713, 1692, 1720, 1723, 1724, 1766, 1728, 1725, 1731, 1750, 1769, 1732, 1754, 1757, 2324, 1759, 1762, 2263, 2288, 2446, 2321, 2256, 2296, 1777, 2268, 2269, 1787, 2446, 2282, 2278, 2261, 2261, 1771, 1763, 1745, 2262, 1792, 2261, 2060, 2083, 1782, 1802, 1783, 1799, 1783, 1798, 2076, 1794, 1804, 1812, 2071, 1809, 2051, 1796, 1806, 1816, 2050, 2049, 1814, 2048, 2446, 1821, 1825, 1999, 1089, 2045, 2446, 2044, 2019, 1827, 2446, 1831, 1993, 1977, 2010, 1980, 1979, 1822, 1843, 1836, 2037, 1849, 2446, 1855, 2005, 2034, 2446, 2033, 1865, 2032, 1868, 1870, 1871, 1872, 1834, 2031, 2446, 2029, 1837, 2028, 2446, 1841, 2027, 2446, 2026, 1838, 2025, 2446, 2023, 2446, 2022, 1849, 1853, 1971, 1991, 2009, 2017, 2446, 1985, 1883, 2446, 1884, 2446, 1983, 1887, 1967, 1900, 1895, 1897, 1914, 2013, 2446, 1917, 2446, 1980, 2011, 2446, 2010, 2446, 1920, 2008, 1902, 1917, 1922, 1855, 2006, 2446, 2003, 1875, 2002, 2446, 2001, 2000, 2446, 1933, 1890, 1928, 1990, 1934, 1969, 1939, 2446, 1987, 1904, 1994, 1942, 1992, 1943, 1939, 1983, 1990, 2446, 1941, 2446, 1945, 1946, 1924, 1985, 2446, 1949, 1984, 2446, 1957, 1979, 1953, 1961, 2446, 1913, 2446, 1962, 1864, 1887, 2446, 1960, 1545, 1500, 1963, 1965, 2446, 1966, 1374, 1370, 1369, 2446, 1982, 2446, 1334, 1221, 1972, 1253, 1198, 1967, 1224, 2446, 1223, 2446, 1988, 1222, 1208, 1128, 1136, 2446, 1096, 1099, 2446, 981, 850, 762, 785, 774, 267, 2446, 265, 240, 2446, 2446, 2446, 2446, 2051, 2057, 2063, 2065, 2071, 2076, 2078, 2083, 2085, 2091, 2097, 2103, 2109, 2115, 2121, 2127, 2133, 2139, 2145, 2151, 2157, 2163, 2169, 2175, 2181, 2187, 2193, 2199, 2205, 2211, 2217, 2223, 2229, 2235, 2241, 2247, 2253, 2259, 2265, 2271, 2277, 2283, 2289, 2295, 2301, 2307}; static yyconst flex_int16_t yy_def[731] = { 0, 684, 1, 684, 3, 684, 5, 684, 7, 1, 1, 684, 11, 684, 13, 684, 15, 684, 17, 684, 19, 684, 21, 684, 684, 684, 684, 684, 685, 685, 685, 684, 684, 684, 684, 684, 686, 684, 684, 687, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 688, 688, 688, 684, 684, 684, 684, 684, 684, 684, 689, 689, 689, 684, 68, 68, 689, 689, 684, 684, 684, 690, 684, 690, 691, 691, 691, 684, 684, 684, 684, 684, 684, 692, 684, 692, 693, 693, 693, 684, 684, 694, 694, 684, 694, 684, 100, 100, 694, 694, 695, 695, 695, 684, 108, 108, 695, 695, 696, 696, 684, 696, 684, 117, 117, 696, 696, 697, 697, 684, 697, 684, 126, 126, 697, 697, 698, 698, 684, 698, 684, 135, 135, 698, 698, 684, 32, 685, 685, 685, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 686, 684, 684, 687, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 688, 688, 688, 684, 684, 684, 684, 689, 689, 689, 689, 68, 68, 68, 689, 689, 689, 689, 684, 684, 690, 690, 691, 691, 691, 684, 684, 684, 684, 684, 684, 692, 692, 693, 693, 693, 684, 694, 684, 694, 694, 100, 100, 100, 694, 694, 694, 694, 694, 695, 695, 695, 695, 108, 108, 108, 695, 695, 695, 695, 696, 684, 696, 696, 117, 117, 117, 696, 696, 696, 696, 696, 696, 697, 684, 697, 697, 126, 126, 126, 697, 697, 697, 697, 697, 697, 698, 684, 698, 698, 135, 135, 135, 698, 698, 698, 698, 698, 698, 698, 698, 685, 685, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 688, 688, 689, 689, 68, 68, 689, 689, 691, 691, 684, 684, 684, 693, 693, 684, 100, 100, 694, 694, 694, 699, 108, 108, 695, 695, 117, 117, 696, 696, 696, 696, 126, 126, 697, 697, 697, 697, 135, 135, 698, 698, 698, 698, 698, 698, 685, 685, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 688, 688, 684, 68, 68, 689, 689, 691, 691, 684, 684, 684, 684, 684, 684, 693, 693, 684, 100, 100, 694, 694, 694, 700, 694, 694, 699, 684, 699, 108, 108, 695, 695, 117, 117, 696, 696, 696, 696, 126, 126, 697, 697, 697, 697, 135, 135, 698, 698, 698, 698, 698, 698, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 689, 689, 684, 684, 684, 684, 684, 694, 694, 700, 684, 694, 694, 699, 695, 695, 696, 696, 696, 696, 696, 697, 697, 697, 697, 697, 698, 698, 698, 701, 698, 698, 684, 684, 684, 702, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 703, 689, 684, 684, 684, 684, 684, 704, 694, 694, 694, 705, 695, 696, 706, 696, 696, 696, 707, 697, 708, 697, 697, 697, 709, 710, 698, 701, 684, 698, 698, 684, 684, 702, 684, 711, 684, 684, 684, 684, 684, 684, 684, 684, 684, 703, 703, 712, 713, 684, 684, 684, 684, 704, 684, 714, 694, 715, 694, 705, 705, 716, 696, 706, 684, 717, 696, 707, 684, 697, 708, 684, 718, 697, 709, 684, 710, 684, 719, 698, 698, 684, 684, 684, 711, 684, 684, 684, 684, 684, 684, 684, 684, 684, 703, 703, 712, 712, 713, 684, 684, 684, 684, 714, 684, 715, 684, 694, 720, 721, 716, 716, 696, 717, 684, 722, 697, 718, 684, 723, 719, 684, 698, 698, 684, 684, 684, 684, 684, 684, 684, 684, 724, 684, 684, 712, 712, 684, 720, 684, 721, 684, 721, 725, 696, 722, 684, 697, 723, 684, 698, 726, 698, 684, 684, 684, 684, 684, 684, 724, 684, 684, 684, 684, 721, 725, 684, 725, 727, 728, 726, 684, 698, 684, 684, 684, 684, 729, 684, 725, 727, 684, 728, 684, 698, 730, 684, 684, 729, 684, 684, 730, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 0, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684}; static yyconst flex_int16_t yy_nxt[2515] = { 0, 24, 25, 26, 25, 24, 24, 27, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 28, 28, 28, 28, 29, 28, 28, 28, 28, 28, 28, 28, 30, 28, 28, 28, 28, 28, 24, 31, 24, 24, 28, 28, 28, 28, 29, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 32, 24, 24, 24, 24, 33, 34, 33, 35, 36, 27, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 55, 55, 55, 56, 55, 55, 55, 55, 55, 55, 55, 57, 55, 55, 55, 55, 55, 58, 31, 59, 60, 55, 55, 55, 55, 56, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 61, 62, 63, 64, 65, 66, 26, 66, 65, 65, 67, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 68, 68, 68, 68, 69, 68, 68, 68, 68, 68, 68, 68, 70, 68, 68, 68, 68, 68, 65, 71, 65, 65, 68, 68, 68, 68, 69, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 72, 65, 65, 65, 73, 74, 75, 76, 73, 73, 77, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 78, 73, 73, 73, 73, 73, 73, 79, 79, 79, 79, 80, 79, 79, 79, 79, 79, 79, 79, 81, 79, 79, 79, 79, 79, 73, 82, 73, 73, 79, 79, 79, 79, 80, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 83, 73, 73, 73, 84, 84, 84, 84, 144, 145, 162, 146, 166, 162, 168, 172, 174, 170, 176, 184, 177, 175, 167, 169, 171, 186, 173, 195, 203, 214, 144, 178, 207, 145, 208, 146, 225, 237, 683, 248, 261, 184, 274, 684, 142, 142, 367, 186, 173, 195, 288, 297, 291, 178, 162, 190, 292, 162, 225, 237, 157, 248, 261, 682, 274, 681, 684, 61, 61, 85, 86, 87, 88, 85, 85, 89, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 90, 85, 85, 85, 85, 85, 85, 91, 91, 91, 91, 92, 91, 91, 91, 91, 91, 91, 91, 93, 91, 91, 91, 91, 91, 85, 94, 85, 85, 91, 91, 91, 91, 92, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 95, 85, 85, 85, 96, 97, 98, 97, 96, 96, 99, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 100, 100, 100, 100, 101, 100, 100, 100, 100, 100, 100, 100, 102, 100, 100, 100, 100, 100, 96, 103, 96, 96, 100, 100, 100, 100, 101, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 104, 96, 96, 96, 105, 106, 26, 106, 105, 105, 107, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 108, 108, 108, 108, 109, 108, 108, 108, 108, 108, 108, 108, 110, 108, 108, 108, 108, 108, 105, 111, 105, 105, 108, 108, 108, 108, 109, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 112, 105, 105, 105, 113, 114, 115, 114, 113, 113, 116, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 117, 117, 117, 117, 118, 117, 117, 117, 117, 117, 117, 117, 119, 117, 117, 117, 117, 117, 113, 120, 113, 113, 117, 117, 117, 117, 118, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 121, 113, 113, 113, 122, 123, 124, 123, 122, 122, 125, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 126, 126, 126, 126, 127, 126, 126, 126, 126, 126, 126, 126, 128, 126, 126, 126, 126, 126, 122, 129, 122, 122, 126, 126, 126, 126, 127, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 130, 122, 122, 122, 131, 132, 133, 132, 131, 131, 134, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 135, 135, 135, 135, 136, 135, 135, 135, 135, 135, 135, 135, 137, 135, 135, 135, 135, 135, 131, 138, 131, 131, 135, 135, 135, 135, 136, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 139, 131, 131, 131, 140, 190, 140, 203, 158, 191, 158, 191, 190, 200, 200, 200, 202, 684, 684, 190, 203, 283, 212, 142, 212, 209, 212, 209, 212, 212, 198, 213, 214, 220, 214, 233, 142, 233, 269, 186, 221, 220, 221, 283, 680, 232, 205, 684, 142, 243, 142, 218, 198, 210, 232, 679, 211, 206, 196, 232, 197, 186, 256, 220, 284, 199, 232, 141, 147, 217, 147, 159, 192, 216, 157, 210, 201, 201, 211, 206, 684, 684, 186, 346, 240, 159, 284, 678, 157, 159, 228, 217, 159, 229, 148, 226, 149, 227, 234, 150, 151, 287, 152, 222, 186, 290, 240, 238, 153, 239, 684, 249, 228, 250, 324, 229, 148, 154, 155, 241, 677, 156, 151, 291, 262, 230, 263, 292, 357, 288, 289, 157, 189, 189, 358, 189, 189, 189, 189, 189, 189, 189, 189, 190, 189, 189, 189, 189, 189, 189, 193, 193, 189, 189, 189, 189, 189, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 189, 189, 189, 189, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 189, 189, 189, 189, 219, 219, 220, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 223, 223, 219, 219, 219, 219, 219, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 219, 219, 219, 219, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 219, 219, 219, 219, 231, 231, 676, 231, 231, 231, 231, 231, 231, 231, 231, 232, 231, 231, 231, 231, 231, 231, 235, 235, 231, 231, 231, 231, 231, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 231, 231, 231, 231, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 231, 231, 231, 231, 244, 243, 244, 147, 172, 147, 299, 172, 299, 303, 176, 300, 177, 304, 301, 173, 301, 307, 173, 302, 288, 289, 308, 178, 671, 203, 314, 289, 319, 320, 214, 303, 325, 326, 329, 304, 330, 173, 335, 307, 173, 142, 561, 203, 308, 178, 142, 562, 392, 675, 319, 320, 154, 285, 325, 326, 329, 393, 330, 142, 335, 668, 674, 245, 242, 242, 243, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 246, 246, 242, 242, 242, 242, 242, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 242, 242, 242, 242, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 242, 242, 242, 242, 243, 257, 256, 257, 190, 209, 190, 209, 203, 203, 243, 209, 214, 209, 232, 671, 662, 660, 336, 669, 341, 342, 198, 251, 142, 142, 349, 252, 142, 672, 350, 253, 240, 210, 673, 365, 211, 311, 312, 313, 336, 316, 341, 342, 198, 251, 668, 666, 349, 252, 309, 310, 350, 253, 240, 210, 331, 365, 211, 311, 312, 313, 254, 316, 258, 255, 255, 256, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 259, 259, 255, 255, 255, 255, 255, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 255, 255, 255, 255, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 255, 255, 255, 255, 256, 270, 269, 270, 214, 220, 220, 232, 220, 190, 256, 232, 269, 269, 366, 368, 369, 383, 384, 394, 142, 395, 398, 264, 399, 404, 203, 265, 665, 650, 662, 266, 228, 317, 660, 229, 366, 368, 369, 383, 384, 394, 142, 395, 398, 264, 399, 404, 371, 265, 397, 327, 328, 266, 228, 317, 337, 229, 323, 321, 322, 347, 267, 416, 271, 268, 268, 269, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 272, 272, 268, 268, 268, 268, 268, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 268, 268, 268, 268, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 268, 268, 268, 268, 269, 243, 277, 269, 277, 140, 158, 140, 158, 305, 191, 305, 191, 200, 200, 200, 202, 684, 243, 190, 190, 212, 212, 212, 213, 221, 220, 221, 243, 233, 278, 233, 244, 243, 244, 257, 256, 257, 190, 232, 256, 251, 256, 220, 392, 252, 270, 269, 270, 253, 279, 280, 281, 393, 332, 333, 305, 269, 305, 256, 269, 657, 275, 251, 276, 282, 190, 252, 141, 159, 220, 253, 367, 192, 306, 243, 201, 201, 256, 243, 684, 232, 264, 334, 159, 159, 265, 370, 222, 243, 266, 386, 234, 338, 339, 245, 243, 340, 258, 277, 269, 277, 203, 203, 264, 277, 269, 277, 265, 271, 344, 345, 266, 344, 348, 376, 214, 376, 142, 142, 214, 306, 256, 402, 377, 256, 408, 278, 385, 256, 396, 269, 142, 387, 220, 387, 142, 401, 372, 373, 405, 410, 388, 411, 400, 269, 269, 279, 280, 281, 269, 403, 380, 279, 280, 343, 381, 269, 422, 422, 372, 373, 405, 410, 378, 411, 190, 376, 190, 376, 379, 220, 220, 220, 380, 214, 377, 406, 381, 214, 422, 422, 389, 407, 409, 412, 220, 431, 390, 433, 232, 142, 392, 232, 414, 142, 243, 243, 387, 220, 387, 393, 440, 413, 243, 417, 432, 388, 415, 243, 256, 433, 256, 256, 447, 256, 220, 465, 269, 243, 439, 269, 443, 269, 440, 269, 269, 269, 190, 473, 446, 473, 220, 232, 444, 190, 447, 220, 474, 450, 451, 482, 220, 455, 456, 392, 449, 243, 460, 232, 243, 243, 256, 448, 393, 256, 445, 460, 256, 269, 452, 450, 451, 482, 454, 455, 456, 453, 457, 458, 460, 462, 459, 466, 461, 467, 480, 256, 492, 460, 486, 269, 487, 479, 269, 463, 269, 488, 490, 269, 491, 489, 496, 243, 496, 502, 256, 502, 513, 190, 494, 497, 482, 516, 503, 516, 495, 525, 500, 220, 220, 493, 517, 473, 498, 473, 499, 463, 528, 232, 528, 243, 474, 256, 482, 243, 513, 529, 535, 220, 535, 243, 501, 256, 505, 539, 256, 536, 496, 243, 496, 269, 502, 256, 502, 504, 508, 497, 269, 513, 509, 503, 269, 516, 526, 516, 541, 566, 525, 566, 537, 243, 517, 564, 243, 256, 567, 548, 256, 573, 513, 573, 576, 534, 540, 528, 269, 528, 541, 525, 269, 579, 243, 579, 529, 544, 545, 551, 552, 548, 580, 535, 220, 535, 586, 220, 586, 513, 513, 564, 536, 558, 256, 587, 559, 557, 539, 539, 590, 566, 607, 566, 607, 610, 639, 610, 591, 269, 567, 608, 594, 598, 613, 595, 564, 654, 573, 513, 573, 620, 610, 525, 610, 576, 574, 601, 525, 623, 621, 602, 614, 564, 614, 579, 564, 579, 586, 220, 586, 564, 576, 243, 580, 590, 632, 587, 632, 626, 590, 629, 269, 629, 588, 633, 631, 607, 641, 607, 620, 614, 564, 614, 620, 645, 608, 576, 256, 621, 611, 576, 269, 621, 646, 629, 269, 629, 655, 632, 655, 632, 620, 574, 645, 645, 645, 611, 633, 653, 655, 621, 655, 646, 646, 646, 652, 615, 650, 647, 663, 269, 663, 628, 625, 622, 663, 269, 663, 618, 642, 367, 640, 639, 637, 636, 630, 635, 634, 600, 628, 597, 625, 651, 648, 593, 615, 618, 643, 585, 583, 616, 578, 612, 609, 606, 564, 605, 604, 603, 630, 600, 556, 656, 554, 597, 550, 547, 593, 658, 543, 585, 583, 533, 581, 656, 578, 572, 571, 570, 569, 568, 565, 564, 513, 664, 560, 507, 556, 554, 550, 664, 142, 142, 161, 161, 161, 161, 161, 161, 164, 164, 164, 164, 164, 164, 182, 182, 189, 189, 547, 189, 189, 189, 203, 543, 203, 203, 204, 204, 204, 214, 533, 214, 214, 215, 215, 215, 219, 219, 219, 219, 219, 219, 231, 231, 531, 231, 231, 231, 242, 242, 242, 242, 242, 242, 255, 255, 255, 255, 255, 255, 268, 268, 268, 268, 268, 268, 391, 391, 391, 391, 391, 391, 441, 441, 441, 441, 441, 441, 506, 506, 506, 506, 506, 506, 512, 512, 512, 512, 512, 512, 524, 524, 524, 524, 524, 524, 532, 532, 532, 532, 532, 532, 538, 538, 538, 538, 538, 538, 542, 542, 542, 542, 542, 542, 546, 546, 546, 546, 546, 546, 549, 549, 549, 549, 549, 549, 553, 553, 553, 553, 553, 553, 555, 555, 555, 555, 555, 555, 563, 563, 563, 563, 563, 563, 575, 575, 575, 575, 575, 575, 577, 577, 577, 577, 577, 577, 582, 582, 582, 582, 582, 582, 584, 584, 584, 584, 584, 584, 589, 589, 589, 589, 589, 589, 592, 592, 592, 592, 592, 592, 596, 596, 596, 596, 596, 596, 599, 599, 599, 599, 599, 599, 617, 617, 617, 617, 617, 617, 619, 619, 619, 619, 619, 619, 624, 624, 624, 624, 624, 624, 627, 627, 627, 627, 627, 627, 638, 638, 638, 638, 638, 638, 644, 644, 644, 644, 644, 644, 649, 649, 649, 649, 649, 649, 659, 659, 659, 659, 659, 659, 661, 661, 661, 661, 661, 661, 667, 667, 667, 667, 667, 667, 670, 670, 670, 670, 670, 670, 530, 527, 523, 522, 521, 520, 519, 518, 515, 514, 513, 511, 510, 507, 442, 485, 484, 483, 481, 478, 477, 476, 475, 472, 471, 470, 469, 468, 467, 464, 431, 442, 438, 437, 436, 435, 434, 367, 430, 429, 428, 427, 426, 425, 424, 423, 421, 420, 419, 418, 382, 375, 374, 302, 302, 300, 300, 364, 363, 362, 361, 360, 359, 356, 355, 354, 353, 352, 351, 269, 269, 269, 269, 256, 256, 256, 256, 243, 243, 243, 243, 232, 232, 232, 232, 220, 220, 220, 220, 318, 315, 190, 190, 190, 190, 298, 165, 296, 295, 294, 293, 286, 273, 269, 269, 260, 256, 256, 247, 243, 243, 236, 232, 232, 224, 220, 220, 194, 190, 190, 188, 187, 185, 183, 181, 180, 179, 165, 163, 160, 143, 684, 23, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684}; static yyconst flex_int16_t yy_chk[2515] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 9, 10, 9, 10, 30, 31, 36, 31, 42, 36, 43, 46, 47, 45, 48, 57, 48, 47, 42, 43, 45, 61, 46, 70, 79, 91, 30, 48, 82, 94, 82, 94, 102, 110, 680, 119, 128, 57, 137, 141, 79, 91, 306, 61, 46, 70, 155, 155, 156, 48, 161, 306, 156, 161, 102, 110, 61, 119, 128, 679, 137, 677, 141, 9, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 25, 71, 25, 80, 33, 66, 33, 66, 72, 74, 76, 74, 76, 78, 90, 66, 81, 143, 84, 80, 84, 83, 86, 83, 86, 88, 72, 88, 93, 103, 92, 106, 81, 106, 279, 95, 97, 97, 97, 143, 676, 106, 80, 203, 93, 120, 92, 95, 72, 83, 111, 675, 83, 81, 71, 232, 71, 95, 129, 104, 144, 72, 112, 25, 32, 93, 32, 33, 66, 92, 95, 83, 74, 76, 83, 81, 78, 90, 159, 279, 112, 84, 144, 674, 83, 86, 104, 93, 88, 104, 32, 103, 32, 103, 106, 32, 32, 149, 32, 97, 159, 150, 112, 111, 32, 111, 203, 120, 104, 120, 232, 104, 32, 32, 32, 112, 673, 32, 32, 150, 129, 104, 129, 150, 291, 149, 149, 32, 68, 68, 291, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 108, 108, 672, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 114, 114, 114, 147, 172, 147, 173, 176, 173, 183, 177, 173, 177, 184, 178, 172, 178, 194, 176, 178, 186, 186, 195, 177, 670, 204, 210, 210, 224, 225, 215, 183, 236, 237, 247, 184, 248, 172, 260, 194, 176, 204, 511, 372, 195, 177, 215, 511, 324, 669, 224, 225, 147, 147, 236, 237, 247, 324, 248, 372, 260, 667, 666, 114, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 121, 123, 123, 123, 192, 201, 198, 201, 205, 206, 251, 209, 216, 209, 234, 664, 661, 659, 261, 657, 273, 274, 192, 121, 205, 206, 283, 121, 216, 665, 284, 121, 234, 201, 665, 303, 201, 205, 206, 209, 261, 216, 273, 274, 192, 121, 656, 654, 283, 121, 198, 198, 284, 121, 234, 201, 251, 303, 201, 205, 206, 209, 121, 216, 123, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 130, 132, 132, 132, 217, 222, 228, 240, 229, 310, 264, 328, 280, 347, 304, 307, 308, 319, 320, 325, 217, 326, 329, 130, 330, 335, 373, 130, 653, 649, 648, 130, 222, 217, 647, 222, 304, 307, 308, 319, 320, 325, 373, 326, 329, 130, 330, 335, 310, 130, 328, 240, 240, 130, 222, 217, 264, 222, 229, 228, 228, 280, 130, 347, 132, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 138, 252, 139, 139, 139, 140, 158, 140, 158, 190, 191, 190, 191, 200, 202, 200, 202, 214, 245, 190, 191, 212, 213, 212, 213, 221, 221, 221, 253, 233, 139, 233, 244, 244, 244, 257, 257, 257, 309, 233, 265, 245, 266, 322, 391, 245, 270, 270, 270, 245, 139, 139, 139, 391, 252, 252, 305, 278, 305, 258, 281, 642, 138, 245, 138, 139, 305, 245, 140, 158, 321, 245, 641, 191, 190, 333, 200, 202, 339, 332, 214, 327, 258, 253, 212, 213, 258, 309, 221, 331, 258, 322, 233, 265, 265, 244, 334, 266, 257, 271, 271, 271, 311, 312, 258, 277, 277, 277, 258, 270, 278, 278, 258, 281, 281, 315, 316, 315, 311, 312, 317, 305, 337, 333, 315, 338, 339, 271, 321, 340, 327, 343, 316, 323, 323, 323, 317, 332, 311, 312, 336, 341, 323, 342, 331, 344, 345, 271, 271, 271, 346, 334, 316, 277, 277, 277, 317, 348, 355, 364, 311, 312, 336, 341, 315, 342, 370, 376, 371, 376, 315, 385, 386, 389, 316, 380, 376, 337, 317, 381, 355, 364, 323, 338, 340, 343, 390, 364, 323, 371, 396, 380, 393, 397, 345, 381, 400, 401, 387, 387, 387, 393, 386, 344, 403, 348, 370, 387, 346, 402, 406, 371, 409, 408, 397, 407, 439, 420, 414, 448, 385, 412, 389, 413, 386, 415, 416, 417, 432, 427, 396, 427, 440, 446, 390, 433, 397, 443, 427, 402, 402, 435, 444, 408, 408, 445, 401, 449, 414, 447, 450, 451, 454, 400, 445, 453, 393, 417, 455, 458, 403, 402, 402, 435, 407, 408, 408, 406, 409, 412, 414, 416, 413, 420, 415, 435, 433, 456, 448, 417, 439, 459, 440, 432, 460, 417, 462, 443, 446, 463, 447, 444, 452, 452, 452, 457, 457, 457, 479, 480, 450, 452, 481, 470, 457, 470, 451, 479, 455, 487, 489, 449, 470, 473, 453, 473, 454, 458, 483, 491, 483, 494, 473, 500, 481, 492, 490, 483, 488, 488, 488, 495, 456, 501, 460, 490, 498, 488, 496, 496, 496, 505, 502, 502, 502, 459, 462, 496, 508, 524, 463, 502, 509, 516, 480, 516, 492, 518, 524, 518, 489, 541, 516, 526, 545, 552, 518, 498, 548, 525, 525, 525, 526, 487, 491, 528, 558, 528, 492, 525, 559, 530, 591, 530, 528, 494, 495, 500, 501, 498, 530, 535, 535, 535, 537, 537, 537, 538, 539, 540, 535, 508, 595, 537, 509, 505, 538, 539, 540, 566, 568, 566, 568, 571, 638, 571, 541, 602, 566, 568, 545, 552, 574, 548, 575, 637, 573, 573, 573, 588, 610, 574, 610, 575, 525, 558, 573, 591, 588, 559, 576, 576, 576, 579, 589, 579, 586, 586, 586, 590, 576, 623, 579, 589, 603, 586, 603, 595, 590, 601, 601, 601, 539, 603, 602, 607, 615, 607, 619, 614, 614, 614, 621, 622, 607, 615, 626, 619, 571, 614, 631, 621, 622, 629, 629, 629, 640, 632, 640, 632, 643, 573, 644, 646, 658, 610, 632, 636, 655, 643, 655, 644, 646, 658, 634, 576, 630, 623, 651, 651, 651, 627, 624, 590, 663, 663, 663, 617, 616, 613, 612, 611, 609, 606, 601, 605, 604, 599, 598, 596, 594, 631, 626, 592, 614, 587, 621, 584, 582, 581, 577, 572, 570, 565, 563, 562, 561, 560, 629, 557, 555, 640, 553, 551, 549, 546, 544, 646, 542, 536, 534, 532, 531, 655, 527, 523, 522, 521, 520, 519, 515, 514, 512, 651, 510, 506, 504, 503, 499, 663, 685, 685, 686, 686, 686, 686, 686, 686, 687, 687, 687, 687, 687, 687, 688, 688, 689, 689, 497, 689, 689, 689, 690, 493, 690, 690, 691, 691, 691, 692, 486, 692, 692, 693, 693, 693, 694, 694, 694, 694, 694, 694, 695, 695, 485, 695, 695, 695, 696, 696, 696, 696, 696, 696, 697, 697, 697, 697, 697, 697, 698, 698, 698, 698, 698, 698, 699, 699, 699, 699, 699, 699, 700, 700, 700, 700, 700, 700, 701, 701, 701, 701, 701, 701, 702, 702, 702, 702, 702, 702, 703, 703, 703, 703, 703, 703, 704, 704, 704, 704, 704, 704, 705, 705, 705, 705, 705, 705, 706, 706, 706, 706, 706, 706, 707, 707, 707, 707, 707, 707, 708, 708, 708, 708, 708, 708, 709, 709, 709, 709, 709, 709, 710, 710, 710, 710, 710, 710, 711, 711, 711, 711, 711, 711, 712, 712, 712, 712, 712, 712, 713, 713, 713, 713, 713, 713, 714, 714, 714, 714, 714, 714, 715, 715, 715, 715, 715, 715, 716, 716, 716, 716, 716, 716, 717, 717, 717, 717, 717, 717, 718, 718, 718, 718, 718, 718, 719, 719, 719, 719, 719, 719, 720, 720, 720, 720, 720, 720, 721, 721, 721, 721, 721, 721, 722, 722, 722, 722, 722, 722, 723, 723, 723, 723, 723, 723, 724, 724, 724, 724, 724, 724, 725, 725, 725, 725, 725, 725, 726, 726, 726, 726, 726, 726, 727, 727, 727, 727, 727, 727, 728, 728, 728, 728, 728, 728, 729, 729, 729, 729, 729, 729, 730, 730, 730, 730, 730, 730, 484, 482, 478, 477, 476, 475, 472, 471, 469, 468, 467, 465, 464, 461, 441, 438, 437, 436, 434, 431, 430, 429, 428, 426, 425, 424, 423, 422, 421, 419, 418, 388, 382, 379, 378, 375, 374, 367, 363, 362, 361, 360, 359, 358, 357, 356, 354, 353, 352, 351, 318, 314, 313, 302, 301, 300, 299, 297, 296, 295, 294, 293, 292, 290, 289, 288, 287, 286, 285, 282, 276, 275, 268, 267, 263, 262, 255, 254, 250, 249, 242, 241, 239, 238, 231, 230, 227, 226, 219, 218, 211, 199, 197, 196, 189, 166, 164, 154, 153, 152, 151, 148, 136, 134, 131, 127, 125, 122, 118, 116, 113, 109, 107, 105, 101, 99, 96, 69, 67, 65, 63, 62, 60, 56, 53, 52, 51, 39, 38, 35, 29, 23, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684, 684}; static yyconst flex_int16_t yy_rule_linenum[102] = { 0, 124, 125, 126, 127, 131, 132, 133, 134, 135, 137, 138, 140, 146, 227, 251, 257, 278, 285, 296, 301, 315, 320, 327, 350, 361, 363, 377, 390, 415, 421, 426, 431, 436, 446, 454, 462, 471, 499, 520, 521, 522, 523, 525, 530, 555, 557, 559, 598, 599, 602, 604, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 654, 660, 672, 692, 694, 696, 713, 729, 730, 740, 743, 744, 746}; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET /* -*- Mode: c++ -*- */ /* * Copyright(C) 1999-2022 National Technology & Engineering Solutions * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with * NTESS, the U.S. Government retains certain rights in this software. * * See packages/seacas/LICENSE for details */ #include #include #include #include #include #include #include #include #include #include "apr_getline.h" #include "apr_scanner.h" #include "apr_tokenize.h" #include "apr_util.h" #include "aprepro.h" #include "fmt/format.h" #include "fmt/ostream.h" #include "fmt/ranges.h" #define YY_NO_UNISTD_H /* import the parser's token type into a local typedef */ typedef SEAMS::Parser::token token; typedef SEAMS::Parser::token_type token_type; /* By default yylex returns int, we use token_type. Unfortunately yyterminate * by default returns 0, which is not of token_type. */ #define yyterminate() return token::END #define show(x) *(aprepro->infoStream) << "<" << x << ">" << std::flush; namespace SEAMS { extern bool echo; void yyerror(const char *s); } // namespace SEAMS namespace { bool begin_double_brace = false; bool end_double_brace = false; bool string_is_ascii(const char *line, size_t len) { for (size_t i = 0; i < len; i++) { if (!(std::isspace(static_cast(line[i])) || std::isprint(static_cast(line[i])))) { return false; } } return true; } } // namespace int file_must_exist = 0; /* Global used by include/conditional include */ /* Global variables used by the looping mechanism */ SEAMS::file_rec *outer_file = nullptr; int loop_lvl = 0; std::fstream *tmp_file; const char *temp_f; #if defined __NVCC__ #pragma diag_suppress code_is_unreachable #endif #define MAX_IF_NESTING 1024 int if_state[MAX_IF_NESTING] = {0}; // INITIAL int if_case_run[MAX_IF_NESTING] = {false}; /* Has any if or elseif condition executed */ int if_lvl = 0; int if_skip_level = 0; bool suppress_nl = false; bool switch_active = false; // Are we in a switch bool switch_case_run = false; // has there been a case which matched condition run? bool switch_skip_to_endcase = false; double switch_condition = 0.0; // Value specified in "switch(condition)" // For substitution history int curr_index = 0; std::string history_string; size_t hist_start = 0; #define YY_USER_ACTION curr_index += yyleng; /*** Flex Declarations and Options ***/ /* enable c++ scanner class generation */ /* change the name of the scanner class. results in "SEAMSFlexLexer" */ /* enable scanner to generate debug output. disable this for release * versions. */ /* enables the use of start condition stacks */ #define INITIAL 0 #define PARSING 1 #define GET_FILENAME 2 #define IF_SKIP 3 #define GET_VAR 4 #define VERBATIM 5 #define IF_WHILE_SKIP 6 #define GET_LOOP_VAR 7 #define LOOP 8 #define LOOP_SKIP 9 #define END_CASE_SKIP 10 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ /* %if-c-only */ /* %endif */ /* %if-c++-only */ #include /* %endif */ #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif /* %if-c-only Reentrant structure and macros (non-C++). */ /* %if-reentrant */ /* %if-c-only */ /* %endif */ /* %if-reentrant */ /* %endif */ /* %endif End reentrant structures and macros. */ /* %if-bison-bridge */ /* %endif */ /* %not-for-header */ /* %ok-for-header */ /* %endif */ #ifndef yytext_ptr static void yy_flex_strncpy(char *, yyconst char *, int); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen(yyconst char *); #endif #ifndef YY_NO_INPUT /* %if-c-only Standard (non-C++) definition */ /* %not-for-header */ /* %ok-for-header */ /* %endif */ #endif /* %if-c-only */ /* %endif */ /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* %if-c-only Standard (non-C++) definition */ /* %endif */ /* %if-c++-only C++ definition */ #define ECHO LexerOutput(yytext, yyleng) /* %endif */ #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf, result, max_size) \ /* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */ \ \ /* %if-c++-only C++ definition \ */ \ if ((result = LexerInput((char *)buf, max_size)) < 0) \ YY_FATAL_ERROR("input in flex scanner failed"); /* %endif */ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR /* %if-c-only */ /* %endif */ /* %if-c++-only */ #define YY_FATAL_ERROR(msg) LexerError(msg) /* %endif */ #endif /* %if-tables-serialization structures and prototypes */ /* %not-for-header */ /* %ok-for-header */ /* %not-for-header */ /* %tables-yydmap generated elements */ /* %endif */ /* end tables serialization structures and prototypes */ /* %ok-for-header */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 /* %if-c-only Standard (non-C++) definition */ /* %endif */ /* %if-c++-only C++ definition */ #define YY_DECL int yyFlexLexer::yylex() /* %endif */ #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif /* %% [6.0] YY_RULE_SETUP definition goes here */ #define YY_RULE_SETUP YY_USER_ACTION /* %not-for-header */ /** The main scanner function which does all the work. */ YY_DECL { yy_state_type yy_current_state; char *yy_cp, *yy_bp; int yy_act; if (!(yy_init)) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif if (!(yy_start)) (yy_start) = 1; /* first start state */ if (!yyin) /* %if-c-only */ /* %endif */ /* %if-c++-only */ yyin = &std::cin; /* %endif */ if (!yyout) /* %if-c-only */ /* %endif */ /* %if-c++-only */ yyout = &std::cout; /* %endif */ if (!YY_CURRENT_BUFFER) { yyensure_buffer_stack(); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE); } yy_load_buffer_state(); } { /* %% [7.0] user's declarations go here */ while (1) /* loops until end-of-file is reached */ { /* %% [8.0] yymore()-related code goes here */ yy_cp = (yy_c_buf_p); /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; /* %% [9.0] code to set up and find next match goes here */ yy_current_state = (yy_start); yy_match: do { YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if (yy_accept[yy_current_state]) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { yy_current_state = (int)yy_def[yy_current_state]; if (yy_current_state >= 685) yy_c = yy_meta[(unsigned int)yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)yy_c]; ++yy_cp; } while (yy_base[yy_current_state] != 2446); yy_find_action: /* %% [10.0] code to find the action number goes here */ yy_act = yy_accept[yy_current_state]; if (yy_act == 0) { /* have to back up */ yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; /* %% [11.0] code for yylineno update goes here */ do_action: /* This label is used only to access EOF actions. */ /* %% [12.0] debug code goes here */ if (yy_flex_debug) { if (yy_act == 0) std::cerr << "--scanner backing up\n"; else if (yy_act < 102) std::cerr << "--accepting rule at line " << yy_rule_linenum[yy_act] << "(\"" << yytext << "\")\n"; else if (yy_act == 102) std::cerr << "--accepting default rule (\"" << yytext << "\")\n"; else if (yy_act == 103) std::cerr << "--(end of buffer or a NUL)\n"; else std::cerr << "--EOF (start condition " << YY_START << ")\n"; } switch (yy_act) { /* beginning of action switch */ /* %% [13.0] actions go here */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = (yy_hold_char); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); goto yy_find_action; case 1: YY_RULE_SETUP { BEGIN(INITIAL); } YY_BREAK case 2: case 3: YY_RULE_SETUP { if (echo) ECHO; } YY_BREAK case 4: /* rule 4 can match eol */ YY_RULE_SETUP { if (echo) ECHO; aprepro.ap_file_list.top().lineno++; } YY_BREAK case 5: YY_RULE_SETUP { BEGIN(VERBATIM); } YY_BREAK case 6: case 7: YY_RULE_SETUP { echo = true; } YY_BREAK case 8: case 9: YY_RULE_SETUP { echo = false; } YY_BREAK case 10: YY_RULE_SETUP { aprepro.stateImmutable = true; } YY_BREAK case 11: YY_RULE_SETUP { aprepro.stateImmutable = aprepro.ap_options.immutable; } YY_BREAK case 12: YY_RULE_SETUP { BEGIN(GET_LOOP_VAR); } YY_BREAK case 13: /* rule 13 can match eol */ YY_RULE_SETUP { aprepro.ap_file_list.top().lineno++; /* `yytext` includes closing `)}` and newline... Strip these */ char *pt = strchr(yytext, ')'); *pt = '\0'; auto tokens = tokenize(yytext, " ,\t"); if (aprepro.ap_options.debugging) { fmt::print(stderr, "DEBUG LOOP: tokens = {}\n", fmt::join(tokens, ", ")); } /* Determine if the first token is a symbol or an explicit number... */ auto count = tokens[0]; bool all_dig = count.find_first_not_of("0123456789") == std::string::npos; int loop_iterations = 0; if (all_dig) { loop_iterations = std::stoi(count); } else { symrec *s; if (!check_valid_var(tokens[0].c_str())) { aprepro.warning("Invalid variable name syntax '" + tokens[0] + "'"); BEGIN(LOOP_SKIP); } else { s = aprepro.getsym(tokens[0]); if (s == nullptr || (s->type != token::SVAR && s->type != token::IMMSVAR && s->value.var == 0.)) { BEGIN(LOOP_SKIP); } else { loop_iterations = (int)s->value.var; } } } if (loop_iterations <= 0) { BEGIN(LOOP_SKIP); if (aprepro.ap_options.debugging) { fmt::print(stderr, "DEBUG LOOP: iteration count = {}, Skipping loop...\n", loop_iterations); } } else { temp_f = get_temp_filename(); SEAMS::file_rec new_file(temp_f, 0, true, loop_iterations); outer_file = &aprepro.ap_file_list.top(); new_file.loop_level = outer_file->loop_level + 1; // Get optional loop index... std::string sym_name; if (tokens.size() == 1) { // Default loop index variable name if not specified in loop command. sym_name = fmt::format("__loop_{}", new_file.loop_level); } else { sym_name = tokens[1]; } SEAMS::symrec *li = aprepro.getsym(sym_name); if (li == nullptr) { li = aprepro.putsym(sym_name, SEAMS::Aprepro::SYMBOL_TYPE::VARIABLE, true); } // Get optional loop index initial value. Default to 0 if not specified. double init = 0.0; if (tokens.size() >= 3) { init = std::stod(tokens[2]); } li->value.var = init; // Get optional loop index increment value. Default to 1 if not specified. if (tokens.size() >= 4) { double increment = std::stod(tokens[3]); new_file.loop_increment = increment; } new_file.loop_index = li; aprepro.ap_file_list.push(new_file); tmp_file = new std::fstream(temp_f, std::ios::out); loop_lvl++; BEGIN(LOOP); aprepro.isCollectingLoop = true; if (aprepro.ap_options.debugging) { fmt::print( stderr, "DEBUG LOOP: iteration count = {}, loop_index variable = {}, initial value = " "{}, increment = {}\n", loop_iterations, sym_name, init, new_file.loop_increment); } } } YY_BREAK case 14: /* rule 14 can match eol */ YY_RULE_SETUP { outer_file->lineno++; if (loop_lvl > 0) --loop_lvl; if (loop_lvl == 0) { BEGIN(INITIAL); tmp_file->close(); delete tmp_file; if (!aprepro.doLoopSubstitution) yy_push_state(VERBATIM); aprepro.isCollectingLoop = false; yyin = aprepro.open_file(aprepro.ap_file_list.top().name, "r"); yyFlexLexer::yypush_buffer_state(yyFlexLexer::yy_create_buffer(yyin, YY_BUF_SIZE)); curr_index = 0; } else { (*tmp_file) << yytext; } } YY_BREAK case 15: /* rule 15 can match eol */ YY_RULE_SETUP { loop_lvl++; /* Nested Loop */ (*tmp_file) << yytext; outer_file->lineno++; } YY_BREAK case 16: /* rule 16 can match eol */ YY_RULE_SETUP { if (aprepro.ap_options.interactive || aprepro.string_interactive()) { aprepro.warning("Aborting loop(s).", false); // Leave the looping state and remove the loop file BEGIN(INITIAL); tmp_file->close(); delete tmp_file; if (aprepro.ap_file_list.top().tmp_file) { remove(aprepro.ap_file_list.top().name.c_str()); aprepro.ap_file_list.pop(); } loop_lvl = 0; aprepro.isCollectingLoop = false; } } YY_BREAK case 17: /* rule 17 can match eol */ YY_RULE_SETUP { (*tmp_file) << yytext; outer_file->lineno++; } YY_BREAK case 18: /* rule 18 can match eol */ YY_RULE_SETUP { aprepro.ap_file_list.top().lineno++; if (loop_lvl > 0) --loop_lvl; if (loop_lvl == 0) { BEGIN(INITIAL); aprepro.isCollectingLoop = false; } } YY_BREAK case 19: /* rule 19 can match eol */ YY_RULE_SETUP { loop_lvl++; /* Nested Loop */ aprepro.ap_file_list.top().lineno++; } YY_BREAK case 20: /* rule 20 can match eol */ YY_RULE_SETUP { if (aprepro.ap_options.interactive || aprepro.string_interactive()) { aprepro.warning("Aborting loops(s).", false); // Leave the looping state BEGIN(INITIAL); loop_lvl = 0; aprepro.isCollectingLoop = false; } } YY_BREAK case 21: /* rule 21 can match eol */ YY_RULE_SETUP { /* Do not increment line count */ ; } YY_BREAK case 22: /* rule 22 can match eol */ YY_RULE_SETUP { yyless(0); curr_index = 0; BEGIN(INITIAL); switch_skip_to_endcase = false; } YY_BREAK case 23: /* rule 23 can match eol */ YY_RULE_SETUP { if (!switch_active) { yyerror("default statement found outside switch statement."); } if (!switch_case_run) { switch_case_run = true; BEGIN(INITIAL); switch_skip_to_endcase = false; if (aprepro.ap_options.debugging) fprintf(stderr, "DEBUG SWITCH: 'default' code executing at line %d\n", aprepro.ap_file_list.top().lineno); } else { if (aprepro.ap_options.debugging) fprintf(stderr, "DEBUG SWITCH: 'default' not executing since a previous case already ran at " "line %d\n", aprepro.ap_file_list.top().lineno); /* Need to skip all code until end of case */ BEGIN(END_CASE_SKIP); } } YY_BREAK case 24: /* rule 24 can match eol */ YY_RULE_SETUP { aprepro.ap_file_list.top().lineno++; BEGIN(INITIAL); switch_active = false; switch_skip_to_endcase = false; suppress_nl = false; if (aprepro.ap_options.debugging) fprintf(stderr, "DEBUG SWITCH: 'endswitch' at line %d\n", aprepro.ap_file_list.top().lineno); } YY_BREAK case 25: /* rule 25 can match eol */ YY_RULE_SETUP { aprepro.ap_file_list.top().lineno++; } YY_BREAK case 26: /* rule 26 can match eol */ YY_RULE_SETUP { aprepro.ap_file_list.top().lineno++; if (!switch_active) { yyerror("endswitch statement found without matching switch."); } switch_active = false; switch_skip_to_endcase = false; } YY_BREAK /* This restores the old behavior of ifdef and ifndef * where they would eat up any leading whitespace on * a line. */ case 27: YY_RULE_SETUP { // Used to avoid undefined variable warnings in old ifdef/ifndef construct aprepro.inIfdefGetvar = true; unput('('); unput('f'); unput('e'); unput('d'); unput('f'); unput('i'); unput('_'); unput('{'); curr_index = 0; } YY_BREAK case 28: YY_RULE_SETUP { // Used to avoid undefined variable warnings in old ifdef/ifndef construct aprepro.inIfdefGetvar = true; unput('('); unput('f'); unput('e'); unput('d'); unput('n'); unput('f'); unput('i'); unput('_'); unput('{'); curr_index = 0; } YY_BREAK /* If an if was found while skipping, then eat * that entire if block until endif * found since there is no way that * any of the code in that if block could be executed. * Make sure to handle multiple levels of skipped ifs... * * NOTE: if_lvl was not incremented, so don't need to decrement when * endif found. */ case 29: /* rule 29 can match eol */ YY_RULE_SETUP { aprepro.ap_file_list.top().lineno++; if (--if_skip_level == 0) BEGIN(IF_SKIP); } YY_BREAK case 30: /* rule 30 can match eol */ YY_RULE_SETUP { aprepro.ap_file_list.top().lineno++; if_skip_level++; } YY_BREAK case 31: /* rule 31 can match eol */ YY_RULE_SETUP { aprepro.ap_file_list.top().lineno++; if_skip_level++; } YY_BREAK case 32: /* rule 32 can match eol */ YY_RULE_SETUP { aprepro.ap_file_list.top().lineno++; if_skip_level++; } YY_BREAK case 33: /* rule 33 can match eol */ YY_RULE_SETUP { aprepro.ap_file_list.top().lineno++; } YY_BREAK /* IF an if, ifdef, or ifndef found while skipping, then * skip the entire block up and including the endif. * The (IF_WHILE_SKIP) start condition handles this skipping. */ case 34: YY_RULE_SETUP { if (aprepro.ap_options.debugging) fprintf(stderr, "DEBUG IF: 'ifdef' found while skipping at line %d\n", aprepro.ap_file_list.top().lineno); if_skip_level = 1; BEGIN(IF_WHILE_SKIP); } YY_BREAK case 35: YY_RULE_SETUP { if (aprepro.ap_options.debugging) fprintf(stderr, "DEBUG IF: 'ifdef' found while skipping at line %d\n", aprepro.ap_file_list.top().lineno); if_skip_level = 1; BEGIN(IF_WHILE_SKIP); } YY_BREAK case 36: YY_RULE_SETUP { if (aprepro.ap_options.debugging) fprintf(stderr, "DEBUG IF: 'ifndef' found while skipping at line %d\n", aprepro.ap_file_list.top().lineno); if_skip_level = 1; BEGIN(IF_WHILE_SKIP); } YY_BREAK case 37: /* rule 37 can match eol */ YY_RULE_SETUP { aprepro.ap_file_list.top().lineno++; if (aprepro.ap_options.debugging) fprintf(stderr, "DEBUG IF: 'else' at level = %d at line %d\n", if_lvl, aprepro.ap_file_list.top().lineno); if (YY_START == VERBATIM) { if (echo) ECHO; } else if (if_state[if_lvl] == IF_SKIP) { if (!if_case_run[if_lvl]) { BEGIN(INITIAL); if_state[if_lvl] = INITIAL; if_case_run[if_lvl] = true; } else { BEGIN(IF_SKIP); if_state[if_lvl] = IF_SKIP; } } else if (if_state[if_lvl] == INITIAL) { BEGIN(IF_SKIP); if_state[if_lvl] = IF_SKIP; } /* If neither is true, this is a nested if that should be skipped */ } YY_BREAK case 38: /* rule 38 can match eol */ YY_RULE_SETUP { /* If any previous 'block' of this if has executed, then * just skip this block; otherwise see if condition is * true and execute this block */ if (aprepro.ap_options.debugging) fprintf(stderr, "DEBUG IF: 'elseif' at level = %d at line %d\n", if_lvl, aprepro.ap_file_list.top().lineno); if (if_case_run[if_lvl]) { /* A previous else/elseif has run */ aprepro.ap_file_list.top().lineno++; /* Already in IF_SKIP, so don't need to change state */ } else { /* Need to check the elseif condition; push back and parse */ yyless(0); curr_index = 0; BEGIN(INITIAL); if_state[if_lvl] = INITIAL; } } YY_BREAK case 39: case 40: case 41: case 42: YY_RULE_SETUP { ; } YY_BREAK case 43: /* rule 43 can match eol */ YY_RULE_SETUP { aprepro.ap_file_list.top().lineno++; } YY_BREAK case 44: /* rule 44 can match eol */ YY_RULE_SETUP { if (YY_START == VERBATIM) { if (echo) ECHO; } else { if (if_state[if_lvl] == IF_SKIP || if_state[if_lvl] == INITIAL) { BEGIN(INITIAL); suppress_nl = false; } /* If neither is true, this is a nested if that should be skipped */ if (aprepro.ap_options.debugging) printf("DEBUG IF: 'endif' at level = %d at line %d\n", if_lvl, aprepro.ap_file_list.top().lineno); if (--if_lvl < 0) { if_lvl = 0; yyerror("Improperly Nested ifdef/ifndef statements"); } /* Ignore endif if not skipping */ } aprepro.ap_file_list.top().lineno++; } YY_BREAK case 45: YY_RULE_SETUP { BEGIN(GET_FILENAME); file_must_exist = true; } YY_BREAK case 46: YY_RULE_SETUP { BEGIN(GET_FILENAME); file_must_exist = false; } YY_BREAK case 47: /* rule 47 can match eol */ YY_RULE_SETUP { aprepro.ap_file_list.top().lineno++; BEGIN(INITIAL); { symrec *s; int quoted = 0; char *pt = strchr(yytext, ')'); *pt = '\0'; /* Check to see if surrounded by double quote */ if ((pt = strchr(yytext, '"')) != nullptr) { yytext++; quoted = 1; } if ((pt = strrchr(yytext, '"')) != nullptr) { *pt = '\0'; quoted = 1; } if (quoted == 0) { /* See if this is an aprepro variable referring to a name */ s = aprepro.getsym(yytext); if (s == nullptr || (s->type != token::SVAR && s->type != token::IMMSVAR)) { pt = yytext; } else { pt = (char *)s->value.svar.c_str(); } } else { pt = yytext; } bool added = add_include_file(pt, file_must_exist); if (added && !aprepro.doIncludeSubstitution) yy_push_state(VERBATIM); aprepro.ap_file_list.top().lineno++; } } YY_BREAK case 48: case 49: YY_RULE_SETUP { sscanf(yytext, "%lf", &yylval->val); return (token::NUM); } YY_BREAK case 50: YY_RULE_SETUP; // Empty rule YY_BREAK case 51: YY_RULE_SETUP { symrec *s; s = aprepro.getsym(yytext); if (s == nullptr) s = aprepro.putsym(yytext, SEAMS::Aprepro::SYMBOL_TYPE::UNDEFINED_VARIABLE, false); yylval->tptr = s; return ((token::yytokentype)s->type); } YY_BREAK case 52: YY_RULE_SETUP return (token::EQUAL); YY_BREAK case 53: YY_RULE_SETUP return (token::EQ_PLUS); YY_BREAK case 54: YY_RULE_SETUP return (token::EQ_MINUS); YY_BREAK case 55: YY_RULE_SETUP return (token::EQ_TIME); YY_BREAK case 56: YY_RULE_SETUP return (token::EQ_DIV); YY_BREAK case 57: YY_RULE_SETUP return (token::EQ_POW); YY_BREAK case 58: YY_RULE_SETUP return (token::EQ_POW); YY_BREAK case 59: YY_RULE_SETUP return (token::INC); YY_BREAK case 60: YY_RULE_SETUP return (token::DEC); YY_BREAK case 61: YY_RULE_SETUP return (token::PLU); YY_BREAK case 62: YY_RULE_SETUP return (token::SUB); YY_BREAK case 63: YY_RULE_SETUP return (token::TIM); YY_BREAK case 64: YY_RULE_SETUP return (token::TIM); /* ~ is same as multiply */ YY_BREAK case 65: YY_RULE_SETUP return (token::CONCAT); /* String concatenation */ YY_BREAK case 66: YY_RULE_SETUP return (token::DIV); YY_BREAK case 67: YY_RULE_SETUP return (token::MOD); YY_BREAK case 68: YY_RULE_SETUP return (token::POW); YY_BREAK case 69: YY_RULE_SETUP return (token::POW); YY_BREAK case 70: /* rule 70 can match eol */ YY_RULE_SETUP aprepro.ap_file_list.top().lineno++; YY_BREAK case 71: YY_RULE_SETUP return (token::LPAR); YY_BREAK case 72: YY_RULE_SETUP return (token::RPAR); YY_BREAK case 73: YY_RULE_SETUP return (token::COMMA); YY_BREAK case 74: YY_RULE_SETUP return (token::SEMI); YY_BREAK case 75: YY_RULE_SETUP return (token::COLON); YY_BREAK case 76: YY_RULE_SETUP return (token::QUEST); YY_BREAK case 77: YY_RULE_SETUP return (token::LT); YY_BREAK case 78: YY_RULE_SETUP return (token::GT); YY_BREAK case 79: YY_RULE_SETUP return (token::LE); YY_BREAK case 80: YY_RULE_SETUP return (token::GE); YY_BREAK case 81: YY_RULE_SETUP return (token::EQ); YY_BREAK case 82: YY_RULE_SETUP return (token::NE); YY_BREAK case 83: YY_RULE_SETUP return (token::LAND); YY_BREAK case 84: YY_RULE_SETUP return (token::LOR); YY_BREAK case 85: YY_RULE_SETUP return (token::NOT); YY_BREAK case 86: YY_RULE_SETUP return (token::LBRACK); YY_BREAK case 87: YY_RULE_SETUP return (token::RBRACK); YY_BREAK case 88: /* rule 88 can match eol */ YY_RULE_SETUP { char *pt = strrchr(yytext, '"'); *pt = '\0'; new_string(yytext + 1, &yylval->string); return token::QSTRING; } YY_BREAK case 89: /* rule 89 can match eol */ YY_RULE_SETUP { char *pt = strrchr(yytext, '\''); *pt = '\0'; new_string(yytext + 1, &yylval->string); return token::QSTRING; } YY_BREAK case 90: YY_RULE_SETUP { // Add to the history string save_history_string(); if (switch_skip_to_endcase) BEGIN(END_CASE_SKIP); else BEGIN(if_state[if_lvl]); return (token::RBRACE); } YY_BREAK case 91: YY_RULE_SETUP { if (begin_double_brace) { end_double_brace = true; } else { yyerror("Found an unexpected double end brace ('}}').\n\t" "It can only end an expression started with a double brace ('{{').\n\tCheck " "syntax."); } // Add to the history string save_history_string(); if (switch_skip_to_endcase) BEGIN(END_CASE_SKIP); else BEGIN(if_state[if_lvl]); unput('}'); unput('O'); unput('H'); unput('C'); unput('E'); unput('{'); return (token::RBRACE); } YY_BREAK case 92: YY_RULE_SETUP { if (echo) LexerOutput("{", 1); } YY_BREAK case 93: YY_RULE_SETUP { if (echo) LexerOutput("}", 1); } YY_BREAK case 94: YY_RULE_SETUP { // Check if we need to save the substitution history first. if (aprepro.ap_options.keep_history && (aprepro.ap_file_list.top().name != "_string_")) { if (curr_index > yyleng) hist_start = curr_index - yyleng; else hist_start = 0; } BEGIN(PARSING); echo = false; begin_double_brace = true; return (token::LBRACE); } YY_BREAK case 95: YY_RULE_SETUP { // Check if we need to save the substitution history first. if (aprepro.ap_options.keep_history && (aprepro.ap_file_list.top().name != "_string_")) { if (curr_index > yyleng) hist_start = curr_index - yyleng; else hist_start = 0; } BEGIN(PARSING); return (token::LBRACE); } YY_BREAK case 96: case 97: YY_RULE_SETUP { if (aprepro.ap_options.end_on_exit) { if (echo) ECHO; return ((token::yytokentype)-1); } else if (echo) ECHO; } YY_BREAK case 98: YY_RULE_SETUP { if (echo) ECHO; } YY_BREAK case 99: case 100: YY_RULE_SETUP { if (echo && if_state[if_lvl] != IF_SKIP) ECHO; } YY_BREAK case 101: /* rule 101 can match eol */ YY_RULE_SETUP { if (echo && !suppress_nl) ECHO; suppress_nl = false; if (end_double_brace) { echo = true; begin_double_brace = false; end_double_brace = false; } aprepro.ap_file_list.top().lineno++; } YY_BREAK case 102: YY_RULE_SETUP ECHO; YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(PARSING): case YY_STATE_EOF(GET_FILENAME): case YY_STATE_EOF(IF_SKIP): case YY_STATE_EOF(GET_VAR): case YY_STATE_EOF(VERBATIM): case YY_STATE_EOF(IF_WHILE_SKIP): case YY_STATE_EOF(GET_LOOP_VAR): case YY_STATE_EOF(LOOP): case YY_STATE_EOF(LOOP_SKIP): case YY_STATE_EOF(END_CASE_SKIP): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int)(yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ((yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans(yy_current_state); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if (yy_next_state) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { /* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */ yy_cp = (yy_c_buf_p); goto yy_find_action; } } else switch (yy_get_next_buffer()) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if (yywrap()) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if (!(yy_did_buffer_switch_on_eof)) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state(); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR("fatal flex scanner internal error--no action found"); } /* end of action switch */ } /* end of scanning one token */ } /* end of user's declarations */ } /* end of yylex */ /* %ok-for-header */ /* %if-c++-only */ /* %not-for-header */ /* The contents of this function are C++ specific, so the () macro is not used. */ yyFlexLexer::yyFlexLexer(std::istream *arg_yyin, std::ostream *arg_yyout) { yyin = arg_yyin; yyout = arg_yyout; yy_c_buf_p = 0; yy_init = 0; yy_start = 0; yy_flex_debug = 0; yylineno = 1; // this will only get updated if %option yylineno yy_did_buffer_switch_on_eof = 0; yy_looking_for_trail_begin = 0; yy_more_flag = 0; yy_more_len = 0; yy_more_offset = yy_prev_more_offset = 0; yy_start_stack_ptr = yy_start_stack_depth = 0; yy_start_stack = NULL; yy_buffer_stack = 0; yy_buffer_stack_top = 0; yy_buffer_stack_max = 0; yy_state_buf = 0; } /* The contents of this function are C++ specific, so the () macro is not used. */ yyFlexLexer::~yyFlexLexer() { delete[] yy_state_buf; SEAMSfree(yy_start_stack); yy_delete_buffer(YY_CURRENT_BUFFER); SEAMSfree(yy_buffer_stack); } /* The contents of this function are C++ specific, so the () macro is not used. */ void yyFlexLexer::switch_streams(std::istream *new_in, std::ostream *new_out) { if (new_in) { yy_delete_buffer(YY_CURRENT_BUFFER); yy_switch_to_buffer(yy_create_buffer(new_in, YY_BUF_SIZE)); } if (new_out) yyout = new_out; } #ifdef YY_INTERACTIVE int yyFlexLexer::LexerInput(char *buf, int /* max_size */) #else int yyFlexLexer::LexerInput(char *buf, int max_size) #endif { if (yyin->eof() || yyin->fail()) return 0; #ifdef YY_INTERACTIVE yyin->get(buf[0]); if (yyin->eof()) return 0; if (yyin->bad()) return -1; return 1; #else (void)yyin->read(buf, max_size); if (yyin->bad()) return -1; else return yyin->gcount(); #endif } void yyFlexLexer::LexerOutput(const char *buf, int size) { (void)yyout->write(buf, size); } /* %ok-for-header */ /* %endif */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ /* %if-c-only */ /* %endif */ /* %if-c++-only */ int yyFlexLexer::yy_get_next_buffer() /* %endif */ { char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = (yytext_ptr); int number_to_move, i; int ret_val; if ((yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1]) YY_FATAL_ERROR("fatal flex scanner internal error--end of buffer missed"); if (YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0) { /* Don't try to fill the buffer, so this is an EOF. */ if ((yy_c_buf_p) - (yytext_ptr)-YY_MORE_ADJ == 1) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int)((yy_c_buf_p) - (yytext_ptr)) - 1; for (i = 0; i < number_to_move; ++i) *(dest++) = *(source++); if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while (num_to_read <= 0) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int)((yy_c_buf_p)-b->yy_ch_buf); if (b->yy_is_our_buffer) { yy_size_t new_size = b->yy_buf_size * 2; if (new_size <= 0) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ SEAMSrealloc((void *)b->yy_ch_buf, b->yy_buf_size + 2); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if (!b->yy_ch_buf) YY_FATAL_ERROR("fatal error - scanner input buffer overflow"); (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } if (num_to_read > YY_READ_BUF_SIZE) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ((yy_n_chars) == 0) { if (number_to_move == YY_MORE_ADJ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart(yyin); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if ((yy_size_t)((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *)SEAMSrealloc((void *)YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, new_size); if (!YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) YY_FATAL_ERROR("out of dynamic memory in yy_get_next_buffer()"); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ /* %if-c-only */ /* %not-for-header */ /* %endif */ /* %if-c++-only */ yy_state_type yyFlexLexer::yy_get_previous_state() /* %endif */ { yy_state_type yy_current_state; char *yy_cp; /* %% [15.0] code to get the start state into yy_current_state goes here */ yy_current_state = (yy_start); for (yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp) { /* %% [16.0] code to find the next state goes here */ YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if (yy_accept[yy_current_state]) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { yy_current_state = (int)yy_def[yy_current_state]; if (yy_current_state >= 685) yy_c = yy_meta[(unsigned int)yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ /* %if-c-only */ /* %endif */ /* %if-c++-only */ yy_state_type yyFlexLexer::yy_try_NUL_trans(yy_state_type yy_current_state) /* %endif */ { int yy_is_jam; /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */ char *yy_cp = (yy_c_buf_p); YY_CHAR yy_c = 1; if (yy_accept[yy_current_state]) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { yy_current_state = (int)yy_def[yy_current_state]; if (yy_current_state >= 685) yy_c = yy_meta[(unsigned int)yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)yy_c]; yy_is_jam = (yy_current_state == 684); return yy_is_jam ? 0 : yy_current_state; } /* %if-c-only */ /* %endif */ /* %if-c++-only */ void yyFlexLexer::yyunput(int c, char *yy_bp) /* %endif */ { char *yy_cp; yy_cp = (yy_c_buf_p); /* undo effects of setting up yytext */ *yy_cp = (yy_hold_char); if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2) { /* need to shift things up to make room */ /* +2 for EOB chars. */ yy_size_t number_to_move = (yy_n_chars) + 2; char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while (source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) *--dest = *--source; yy_cp += (int)(dest - source); yy_bp += (int)(dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2) YY_FATAL_ERROR("flex scanner push-back overflow"); } *--yy_cp = (char)c; /* %% [18.0] update yylineno here */ (yytext_ptr) = yy_bp; (yy_hold_char) = *yy_cp; (yy_c_buf_p) = yy_cp; } /* %if-c-only */ /* %endif */ /* %if-c-only */ /* %endif */ /* %if-c++-only */ int yyFlexLexer::yyinput() /* %endif */ { int c; *(yy_c_buf_p) = (yy_hold_char); if (*(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ((yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch (yy_get_next_buffer()) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart(yyin); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if (yywrap()) return EOF; if (!(yy_did_buffer_switch_on_eof)) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *)(yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); /* %% [19.0] update BOL and yylineno */ return c; } /* %if-c-only */ /* %endif */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ /* %if-c-only */ /* %endif */ /* %if-c++-only */ void yyFlexLexer::yyrestart(std::istream *input_file) /* %endif */ { if (!YY_CURRENT_BUFFER) { yyensure_buffer_stack(); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE); } yy_init_buffer(YY_CURRENT_BUFFER, input_file); yy_load_buffer_state(); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ /* %if-c-only */ /* %endif */ /* %if-c++-only */ void yyFlexLexer::yy_switch_to_buffer(YY_BUFFER_STATE new_buffer) /* %endif */ { /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); */ yyensure_buffer_stack(); if (YY_CURRENT_BUFFER == new_buffer) return; if (YY_CURRENT_BUFFER) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; yy_load_buffer_state(); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } /* %if-c-only */ /* %endif */ /* %if-c++-only */ void yyFlexLexer::yy_load_buffer_state() /* %endif */ { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ /* %if-c-only */ /* %endif */ /* %if-c++-only */ YY_BUFFER_STATE yyFlexLexer::yy_create_buffer(std::istream *file, int size) /* %endif */ { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE)SEAMSalloc(sizeof(struct yy_buffer_state)); if (!b) YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *)SEAMSalloc(b->yy_buf_size + 2); if (!b->yy_ch_buf) YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); b->yy_is_our_buffer = 1; yy_init_buffer(b, file); return b; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ /* %if-c-only */ /* %endif */ /* %if-c++-only */ void yyFlexLexer::yy_delete_buffer(YY_BUFFER_STATE b) /* %endif */ { if (!b) return; if (b == YY_CURRENT_BUFFER) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE)0; if (b->yy_is_our_buffer) SEAMSfree((void *)b->yy_ch_buf); SEAMSfree((void *)b); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ /* %if-c-only */ /* %endif */ /* %if-c++-only */ void yyFlexLexer::yy_init_buffer(YY_BUFFER_STATE b, std::istream *file) /* %endif */ { int oerrno = errno; yy_flush_buffer(b); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER) { b->yy_bs_lineno = 1; b->yy_bs_column = 0; } /* %if-c-only */ /* %endif */ /* %if-c++-only */ b->yy_is_interactive = 0; /* %endif */ errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ /* %if-c-only */ /* %endif */ /* %if-c++-only */ void yyFlexLexer::yy_flush_buffer(YY_BUFFER_STATE b) /* %endif */ { if (!b) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if (b == YY_CURRENT_BUFFER) yy_load_buffer_state(); } /* %if-c-or-c++ */ /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ /* %if-c-only */ /* %endif */ /* %if-c++-only */ void yyFlexLexer::yypush_buffer_state(YY_BUFFER_STATE new_buffer) /* %endif */ { if (new_buffer == NULL) return; yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ if (YY_CURRENT_BUFFER) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ yy_load_buffer_state(); (yy_did_buffer_switch_on_eof) = 1; } /* %endif */ /* %if-c-or-c++ */ /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ /* %if-c-only */ /* %endif */ /* %if-c++-only */ void yyFlexLexer::yypop_buffer_state(void) /* %endif */ { if (!YY_CURRENT_BUFFER) return; yy_delete_buffer(YY_CURRENT_BUFFER); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { yy_load_buffer_state(); (yy_did_buffer_switch_on_eof) = 1; } } /* %endif */ /* %if-c-or-c++ */ /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ /* %if-c-only */ /* %endif */ /* %if-c++-only */ void yyFlexLexer::yyensure_buffer_stack(void) /* %endif */ { yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state **)SEAMSalloc(num_to_alloc * sizeof(struct yy_buffer_state *)); if (!(yy_buffer_stack)) YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()"); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state *)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1) { /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state **)SEAMSrealloc( (yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state *)); if (!(yy_buffer_stack)) YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()"); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state *)); (yy_buffer_stack_max) = num_to_alloc; } } /* %endif */ /* %if-c-only */ /* %endif */ /* %if-c-only */ /* %endif */ /* %if-c-only */ /* %endif */ /* %if-c-only */ /* %endif */ /* %if-c++-only */ void yyFlexLexer::yy_push_state(int new_state) /* %endif */ { if ((yy_start_stack_ptr) >= (yy_start_stack_depth)) { yy_size_t new_size; (yy_start_stack_depth) += YY_START_STACK_INCR; new_size = (yy_start_stack_depth) * sizeof(int); if (!(yy_start_stack)) (yy_start_stack) = (int *)SEAMSalloc(new_size); else (yy_start_stack) = (int *)SEAMSrealloc((void *)(yy_start_stack), new_size); if (!(yy_start_stack)) YY_FATAL_ERROR("out of memory expanding start-condition stack"); } (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START; BEGIN(new_state); } /* %if-c-only */ /* %endif */ /* %if-c++-only */ void yyFlexLexer::yy_pop_state() /* %endif */ { if (--(yy_start_stack_ptr) < 0) YY_FATAL_ERROR("start-condition stack underflow"); BEGIN((yy_start_stack)[(yy_start_stack_ptr)]); } /* %if-c-only */ /* %endif */ /* %if-c++-only */ int yyFlexLexer::yy_top_state() /* %endif */ { return (yy_start_stack)[(yy_start_stack_ptr)-1]; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif /* %if-c-only */ /* %endif */ /* %if-c++-only */ void yyFlexLexer::LexerError(yyconst char msg[]) { std::cerr << msg << std::endl; exit(YY_EXIT_FAILURE); } /* %endif */ /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg); \ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ yyleng = yyless_macro_arg; \ } while (0) /* Accessor methods (get/set functions) to struct members. */ /* %if-c-only */ /* %if-reentrant */ /* %endif */ /* %if-reentrant */ /* %endif */ /* %endif */ /* %if-reentrant */ /* %if-bison-bridge */ /* %endif */ /* %endif if-c-only */ /* %if-c-only */ /* %endif */ /* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */ /* %if-reentrant */ /* %endif */ /* %endif */ /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy(char *s1, yyconst char *s2, int n) { int i; for (i = 0; i < n; ++i) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen(yyconst char *s) { int n; for (n = 0; s[n]; ++n) ; return n; } #endif void *SEAMSalloc(yy_size_t size) { return (void *)malloc(size); } void *SEAMSrealloc(void *ptr, yy_size_t size) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *)realloc((char *)ptr, size); } void SEAMSfree(void *ptr) { free((char *)ptr); /* see SEAMSrealloc() for (char *) cast */ } /* %if-tables-serialization definitions */ /* %define-yytables The name for this specific scanner's tables. */ #define YYTABLES_NAME "yytables" /* %endif */ /* %ok-for-header */ /* When the scanner receives an end-of-file indication from YY_INPUT, it then * checks the yywrap() function. If yywrap() returns false (zero), then it is * assumed that the function has gone ahead and set up `yyin' to point to * another input file, and scanning continues. If it returns true (non-zero), * then the scanner terminates, returning 0 to its caller. */ namespace SEAMS { Scanner::Scanner(Aprepro &aprepro_yyarg, std::istream *in, std::ostream *out) : SEAMSFlexLexer(in, out), aprepro(aprepro_yyarg) { aprepro.outputStream.push(out); } Scanner::~Scanner() { while (aprepro.ap_file_list.size() > 1) { auto kk = aprepro.ap_file_list.top(); if (kk.name != "STDIN") { yyFlexLexer::yy_load_buffer_state(); delete yyin; yyin = nullptr; } aprepro.ap_file_list.pop(); yyFlexLexer::yypop_buffer_state(); }; } bool Scanner::add_include_file(const std::string &filename, bool must_exist) { std::fstream *yytmp = nullptr; if (must_exist) yytmp = aprepro.open_file(filename, "r"); else yytmp = aprepro.check_open_file(filename, "r"); if (yytmp) { if (yyin && !yy_init) { yyFlexLexer::yypush_buffer_state(yyFlexLexer::yy_create_buffer(yyin, YY_BUF_SIZE)); } yyin = yytmp; aprepro.info("Included File: '" + filename + "'", true); SEAMS::file_rec new_file(filename.c_str(), 0, false, 0); aprepro.ap_file_list.push(new_file); yyFlexLexer::yypush_buffer_state(yyFlexLexer::yy_create_buffer(yytmp, YY_BUF_SIZE)); curr_index = 0; } return yytmp != nullptr; } void Scanner::LexerOutput(const char *buf, int size) { // Do this before writing so that we have the correct index in the // output stream. if (aprepro.ap_options.keep_history) { aprepro.add_history(history_string, buf); history_string.clear(); hist_start = 0; } aprepro.outputStream.top()->write(buf, size); if (aprepro.ap_options.interactive && aprepro.outputStream.size() == 1) { // In interactive mode, output to stdout in addition to the // output stream, unless user has redirected output... std::cout << buf; } } int Scanner::LexerInput(char *buf, int max_size) { if (yyin->eof() || yyin->fail()) { return 0; } if (aprepro.ap_options.interactive && yyin == &std::cin && isatty(0) != 0 && isatty(1) != 0) { char *line = SEAMS::getline_int(nullptr); if (strlen(line) == 0) { return 0; } if (!string_is_ascii(line, strlen(line))) { aprepro.warning("input line contains non-ASCII (probably UTF-8) characters which might be " "parsed incorrectly."); } SEAMS::gl_histadd(line); if (strlen(line) > (size_t)max_size - 2) { yyerror("input line is too long"); return 0; } strcpy(buf, line); strcat(buf, "\n"); return strlen(buf); } else { (void)yyin->read(buf, max_size); if (yyin->bad()) { return -1; } else { if (!string_is_ascii(buf, yyin->gcount())) { aprepro.warning("input file contains non-ASCII (probably UTF-8) characters which might " "be parsed incorrectly."); } return yyin->gcount(); } } } int Scanner::yywrap() { // Clear the history string. history_string.clear(); hist_start = 0; curr_index = 0; // If we are using the string interactive method, we want to return to // our original state if parsing was cutoff prematurely. if (aprepro.string_interactive() && YY_START == PARSING) { if (switch_skip_to_endcase) { BEGIN(END_CASE_SKIP); } else { BEGIN(if_state[if_lvl]); } } if (aprepro.ap_file_list.size() <= 1) { /* End of main file, not in nested include */ return (1); } else if (aprepro.string_interactive() && loop_lvl) { return (1); } else if (aprepro.isCollectingLoop) { yyerror("End-of-file detected inside loop. Check loop syntax. {endloop} must be on line by " "itself."); return (1); } else { /* We are in an included or looping file */ if (aprepro.ap_file_list.top().tmp_file) { if (aprepro.ap_options.debugging) { std::cerr << "DEBUG LOOP: Loop count = " << aprepro.ap_file_list.top().loop_count << "\n"; } if (--aprepro.ap_file_list.top().loop_count <= 0) { // On Windows, you can't remove the temp file until all the references to the // file object have been released, so we will delete it here. delete yyin; yyin = nullptr; if (aprepro.ap_file_list.top().name != "_string_") { if (!aprepro.ap_options.debugging) { remove(aprepro.ap_file_list.top().name.c_str()); /* Delete file if temporary */ } if (!aprepro.doLoopSubstitution) { yy_pop_state(); } } aprepro.ap_file_list.pop(); yyFlexLexer::yypop_buffer_state(); } else { // Do not pop ap_file_list; we are rereading that file... delete yyin; yyin = nullptr; yyFlexLexer::yypop_buffer_state(); yyin = aprepro.open_file(aprepro.ap_file_list.top().name, "r"); yyFlexLexer::yypush_buffer_state(yyFlexLexer::yy_create_buffer(yyin, YY_BUF_SIZE)); aprepro.ap_file_list.top().lineno = 0; if (aprepro.ap_file_list.top().loop_index != nullptr) { aprepro.ap_file_list.top().loop_index->value.var += aprepro.ap_file_list.top().loop_increment; } } } else { delete yyin; yyin = nullptr; aprepro.ap_file_list.pop(); yyFlexLexer::yypop_buffer_state(); if (aprepro.ap_file_list.top().name == "standard input") { yyin = &std::cin; } /* Turn echoing back on at end of included files. */ echo = true; // If we are not doing aprepro substitutions for the included file, but // just collecting lines, pop the state from VERBATIM back to what it // was previously. if (!aprepro.doIncludeSubstitution) { yy_pop_state(); } /* Set immutable mode back to global immutable * state at end of included file*/ aprepro.stateImmutable = aprepro.ap_options.immutable; } // Reset the current character index. curr_index = 0; if (yyin != nullptr) { curr_index = yyin->tellg(); } return (0); } } /* Print error message to standard error and return. Note: internally * 'lineno' starts at zero. To avoid confusion, we add 1 to value * when it is output. */ void Scanner::yyerror(const char *s) { aprepro.error(s); } char *Scanner::execute(char string[]) { /* Push the contents of 'string' onto the stack to be reread. * 'string' will be surrounded by {} so it must be a valid expression. */ /* * NOTE: The closing } has not yet been scanned in the call to execute(); * therefore, we read it ourselves using input(), then we push: * '}{' + our string + '}' */ int i; while ((i = yyFlexLexer::yyinput()) != '}' && i != EOF) curr_index++; /* eat up values */ // Increment curr_index to account for the '}' and save history curr_index++; save_history_string(); /* Allocate space for string + '}' + '{' + end_of_string */ std::string new_string; new_string += "}{"; new_string += string; new_string += "}"; aprepro.ap_file_list.push(SEAMS::file_rec("_string_", 0, true, -1)); auto ins = new std::istringstream(new_string); // Declare an input string stream. yyFlexLexer::yypush_buffer_state(yyFlexLexer::yy_create_buffer(ins, new_string.size())); return (nullptr); } /* Push the contents of 'string' onto the stack to be reread. * 'string' will not be surrounded by {}. */ char *Scanner::rescan(char *string) { int i; /* * NOTE: The closing } has not yet been scanned in the call to rescan(); * therefore, we read it ourselves using input(), then we push our * string and then put the closing } back on the stack last * (to be read first), */ while ((i = yyFlexLexer::yyinput()) != '}' && i != EOF) curr_index++; /* eat up values */ // Increment curr_index to account for the '}' and save history curr_index++; save_history_string(); { aprepro.ap_file_list.push(SEAMS::file_rec("_string_", 0, true, -1)); std::string new_string("}"); new_string += string; auto ins = new std::istringstream(new_string); // Declare an input string stream. yyFlexLexer::yypush_buffer_state(yyFlexLexer::yy_create_buffer(ins, new_string.size())); } return (nullptr); } char *Scanner::import_handler(char *string) { /* * NOTE: The closing } has not yet been scanned in the call to rescan(); * therefore, we read it ourselves using input(). */ int i = 0; while ((i = yyFlexLexer::yyinput()) != '}' && i != EOF) curr_index++; /* eat up values */ add_include_file(string, true); std::string info_string = std::string("Imported File: '") + string + "'"; aprepro.info(info_string, true); if (!aprepro.doIncludeSubstitution) { yy_push_state(VERBATIM); } /* * Now we need to push back the closing } so it is the first thing read. * We no longer have the initial file stream (is is pushed down on stack) * so we need to add a new file stream consisting of just a single character. * Wasteful, but best I can come up with at this time. */ aprepro.ap_file_list.push(SEAMS::file_rec("_string_", 0, true, -1)); std::string new_string("}"); auto ins = new std::istringstream(new_string); // Declare an input string stream. yyFlexLexer::yypush_buffer_state(yyFlexLexer::yy_create_buffer(ins, new_string.size())); if (aprepro.ap_options.debugging) { std::cerr << "DEBUG IMPORT: " << string << "\n"; } return (nullptr); } char *Scanner::if_handler(double x) { if_lvl++; if (if_lvl >= MAX_IF_NESTING) { yyerror("Too many nested if statements"); } else { if (x == 0) { if_state[if_lvl] = IF_SKIP; if_case_run[if_lvl] = false; } else { suppress_nl = true; if_state[if_lvl] = INITIAL; if_case_run[if_lvl] = true; } if (aprepro.ap_options.debugging) { std::cerr << "DEBUG IF: If level " << if_lvl << " " << if_state[if_lvl] << "\n"; } } return (nullptr); } char *Scanner::elseif_handler(double x) { if (x == 0 || if_case_run[if_lvl]) { if_state[if_lvl] = IF_SKIP; } else { suppress_nl = 1; if_state[if_lvl] = INITIAL; if_case_run[if_lvl] = true; } if (aprepro.ap_options.debugging) { std::cerr << "DEBUG IF: elseif at level " << if_lvl << " " << if_state[if_lvl] << "\n"; } return (nullptr); } char *Scanner::switch_handler(double x) { // save that we are in a switch statement // save the value of 'x' for use in deciding which case to execute if (switch_active) { yyerror("switch statement found while switch already active. Nested switch not supported."); } switch_active = true; switch_case_run = false; switch_condition = x; switch_skip_to_endcase = true; /* Skip everything until first case */ suppress_nl = true; if (aprepro.ap_options.debugging) { std::cerr << "DEBUG SWITCH: 'switch' with condition = " << switch_condition << " at line " << aprepro.ap_file_list.top().lineno << "\n"; } return (nullptr); } char *Scanner::case_handler(double x) { // make sure we are in a switch statement // if 'x' matches the value saved in the switch statement // and no other case has been executed, then // execute the code in the case and set a flag indicating // the switch has run; // if 'x' does not match the value saved, then skip to endcase suppress_nl = true; if (!switch_active) { yyerror("case statement found outside switch statement."); } if (!switch_case_run && x == switch_condition) { switch_case_run = true; if (aprepro.ap_options.debugging) { fprintf(stderr, "DEBUG SWITCH: 'case' condition = %g matches switch condition = %g at line %d\n", x, switch_condition, aprepro.ap_file_list.top().lineno); } } else { if (aprepro.ap_options.debugging) { fprintf(stderr, "DEBUG SWITCH: 'case' condition = %g does not match switch condition = %g " "(or case already matched) at line %d\n", x, switch_condition, aprepro.ap_file_list.top().lineno); } // Need to skip all code until end of case switch_skip_to_endcase = true; } return (nullptr); } void Scanner::save_history_string() { if (!aprepro.ap_options.keep_history) { return; } // Don't do it if the file is the one used by execute and rescan. if (aprepro.ap_file_list.top().name == "_string_" || aprepro.ap_file_list.top().name == "standard input") { return; } size_t hist_end = curr_index; size_t len = hist_end - hist_start; if (len <= 0) return; // Clear any possible end-of-stream if e.g., reading from a istringstream. std::ios::iostate state = yyin->rdstate(); size_t loc = yyin->tellg(); yyin->clear(); // Go back in the stream to where we started keeping history. yyin->seekg(hist_start); if (!yyin->good()) { yyerror("Stream state bad in `save_history_string` seekg"); return; } // Read everything up to this point again and save it. auto tmp = new char[len + 1]; yyin->read(tmp, len); if (!yyin->good()) { yyerror("Stream state bad in `save_history_string` read"); return; } tmp[len] = '\0'; history_string = tmp; delete[] tmp; hist_start = 0; // restore stream state yyin->seekg(loc); yyin->setstate(state); } } // namespace SEAMS /* This implementation of SEAMSFlexLexer::yylex() is required to fill the * vtable of the class SEAMSFlexLexer. We define the scanner's main yylex * function via YY_DECL to reside in the Scanner class instead. */ #ifdef yylex #undef yylex #endif int SEAMSFlexLexer::yylex() { std::cerr << "in SEAMSFlexLexer::yylex() !" << '\n'; return 0; } /* When the scanner receives an end-of-file indication from YY_INPUT, it then * checks the yywrap() function. If yywrap() returns false (zero), then it is * assumed that the function has gone ahead and set up `yyin' to point to * another input file, and scanning continues. If it returns true (non-zero), * then the scanner terminates, returning 0 to its caller. */ int SEAMSFlexLexer::yywrap() { return 1; }