[0b990d] | 1 | #ifdef HAVE_CONFIG_H
|
---|
| 2 | #include <scconfig.h>
|
---|
| 3 | #endif
|
---|
| 4 | #include <iostream>
|
---|
| 5 | #ifdef USING_NAMESPACE_STD
|
---|
| 6 | using namespace std;
|
---|
| 7 | #endif
|
---|
| 8 |
|
---|
| 9 | #line 3 "<stdout>"
|
---|
| 10 |
|
---|
| 11 | #define YY_INT_ALIGNED short int
|
---|
| 12 |
|
---|
| 13 | /* A lexical scanner generated by flex */
|
---|
| 14 |
|
---|
| 15 | #define FLEX_SCANNER
|
---|
| 16 | #define YY_FLEX_MAJOR_VERSION 2
|
---|
| 17 | #define YY_FLEX_MINOR_VERSION 5
|
---|
| 18 | #define YY_FLEX_SUBMINOR_VERSION 31
|
---|
| 19 | #if YY_FLEX_SUBMINOR_VERSION > 0
|
---|
| 20 | #define FLEX_BETA
|
---|
| 21 | #endif
|
---|
| 22 |
|
---|
| 23 | /* The c++ scanner is a mess. The FlexLexer.h header file relies on the
|
---|
| 24 | * following macro.
|
---|
| 25 | */
|
---|
| 26 | #define yyFlexLexer MPQCInFlexLexer
|
---|
| 27 |
|
---|
| 28 | /* First, we deal with platform-specific or compiler-specific issues. */
|
---|
| 29 |
|
---|
| 30 | /* begin standard C headers. */
|
---|
| 31 |
|
---|
| 32 | /* end standard C headers. */
|
---|
| 33 |
|
---|
| 34 | /* flex integer type definitions */
|
---|
| 35 |
|
---|
| 36 | #ifndef FLEXINT_H
|
---|
| 37 | #define FLEXINT_H
|
---|
| 38 |
|
---|
| 39 | /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
|
---|
| 40 |
|
---|
| 41 | #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
|
---|
| 42 | #include <inttypes.h>
|
---|
| 43 | typedef int8_t flex_int8_t;
|
---|
| 44 | typedef uint8_t flex_uint8_t;
|
---|
| 45 | typedef int16_t flex_int16_t;
|
---|
| 46 | typedef uint16_t flex_uint16_t;
|
---|
| 47 | typedef int32_t flex_int32_t;
|
---|
| 48 | typedef uint32_t flex_uint32_t;
|
---|
| 49 | #else
|
---|
| 50 | typedef signed char flex_int8_t;
|
---|
| 51 | typedef short int flex_int16_t;
|
---|
| 52 | typedef int flex_int32_t;
|
---|
| 53 | typedef unsigned char flex_uint8_t;
|
---|
| 54 | typedef unsigned short int flex_uint16_t;
|
---|
| 55 | typedef unsigned int flex_uint32_t;
|
---|
| 56 | #endif /* ! C99 */
|
---|
| 57 |
|
---|
| 58 | /* Limits of integral types. */
|
---|
| 59 | #ifndef INT8_MIN
|
---|
| 60 | #define INT8_MIN (-128)
|
---|
| 61 | #endif
|
---|
| 62 | #ifndef INT16_MIN
|
---|
| 63 | #define INT16_MIN (-32767-1)
|
---|
| 64 | #endif
|
---|
| 65 | #ifndef INT32_MIN
|
---|
| 66 | #define INT32_MIN (-2147483647-1)
|
---|
| 67 | #endif
|
---|
| 68 | #ifndef INT8_MAX
|
---|
| 69 | #define INT8_MAX (127)
|
---|
| 70 | #endif
|
---|
| 71 | #ifndef INT16_MAX
|
---|
| 72 | #define INT16_MAX (32767)
|
---|
| 73 | #endif
|
---|
| 74 | #ifndef INT32_MAX
|
---|
| 75 | #define INT32_MAX (2147483647)
|
---|
| 76 | #endif
|
---|
| 77 | #ifndef UINT8_MAX
|
---|
| 78 | #define UINT8_MAX (255U)
|
---|
| 79 | #endif
|
---|
| 80 | #ifndef UINT16_MAX
|
---|
| 81 | #define UINT16_MAX (65535U)
|
---|
| 82 | #endif
|
---|
| 83 | #ifndef UINT32_MAX
|
---|
| 84 | #define UINT32_MAX (4294967295U)
|
---|
| 85 | #endif
|
---|
| 86 |
|
---|
| 87 | #endif /* ! FLEXINT_H */
|
---|
| 88 |
|
---|
| 89 | /* begin standard C++ headers. */
|
---|
| 90 | #include <iostream>
|
---|
| 91 | #include <errno.h>
|
---|
| 92 | #include <cstdlib>
|
---|
| 93 | #include <cstring>
|
---|
| 94 | /* end standard C++ headers. */
|
---|
| 95 |
|
---|
| 96 | #ifdef __cplusplus
|
---|
| 97 |
|
---|
| 98 | /* The "const" storage-class-modifier is valid. */
|
---|
| 99 | #define YY_USE_CONST
|
---|
| 100 |
|
---|
| 101 | #else /* ! __cplusplus */
|
---|
| 102 |
|
---|
| 103 | #if __STDC__
|
---|
| 104 |
|
---|
| 105 | #define YY_USE_CONST
|
---|
| 106 |
|
---|
| 107 | #endif /* __STDC__ */
|
---|
| 108 | #endif /* ! __cplusplus */
|
---|
| 109 |
|
---|
| 110 | #ifdef YY_USE_CONST
|
---|
| 111 | #define yyconst const
|
---|
| 112 | #else
|
---|
| 113 | #define yyconst
|
---|
| 114 | #endif
|
---|
| 115 |
|
---|
| 116 | /* Returned upon end-of-file. */
|
---|
| 117 | #define YY_NULL 0
|
---|
| 118 |
|
---|
| 119 | /* Promotes a possibly negative, possibly signed char to an unsigned
|
---|
| 120 | * integer for use as an array index. If the signed char is negative,
|
---|
| 121 | * we want to instead treat it as an 8-bit unsigned char, hence the
|
---|
| 122 | * double cast.
|
---|
| 123 | */
|
---|
| 124 | #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
|
---|
| 125 |
|
---|
| 126 | /* Enter a start condition. This macro really ought to take a parameter,
|
---|
| 127 | * but we do it the disgusting crufty way forced on us by the ()-less
|
---|
| 128 | * definition of BEGIN.
|
---|
| 129 | */
|
---|
| 130 | #define BEGIN (yy_start) = 1 + 2 *
|
---|
| 131 |
|
---|
| 132 | /* Translate the current start state into a value that can be later handed
|
---|
| 133 | * to BEGIN to return to the state. The YYSTATE alias is for lex
|
---|
| 134 | * compatibility.
|
---|
| 135 | */
|
---|
| 136 | #define YY_START (((yy_start) - 1) / 2)
|
---|
| 137 | #define YYSTATE YY_START
|
---|
| 138 |
|
---|
| 139 | /* Action number for EOF rule of a given start state. */
|
---|
| 140 | #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
|
---|
| 141 |
|
---|
| 142 | /* Special action meaning "start processing a new file". */
|
---|
| 143 | #define YY_NEW_FILE yyrestart( yyin )
|
---|
| 144 |
|
---|
| 145 | #define YY_END_OF_BUFFER_CHAR 0
|
---|
| 146 |
|
---|
| 147 | /* Size of default input buffer. */
|
---|
| 148 | #ifndef YY_BUF_SIZE
|
---|
| 149 | #define YY_BUF_SIZE 16384
|
---|
| 150 | #endif
|
---|
| 151 |
|
---|
| 152 | #ifndef YY_TYPEDEF_YY_BUFFER_STATE
|
---|
| 153 | #define YY_TYPEDEF_YY_BUFFER_STATE
|
---|
| 154 | typedef struct yy_buffer_state *YY_BUFFER_STATE;
|
---|
| 155 | #endif
|
---|
| 156 |
|
---|
| 157 | extern int yyleng;
|
---|
| 158 |
|
---|
| 159 | #define EOB_ACT_CONTINUE_SCAN 0
|
---|
| 160 | #define EOB_ACT_END_OF_FILE 1
|
---|
| 161 | #define EOB_ACT_LAST_MATCH 2
|
---|
| 162 |
|
---|
| 163 | /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
|
---|
| 164 | * access to the local variable yy_act. Since yyless() is a macro, it would break
|
---|
| 165 | * existing scanners that call yyless() from OUTSIDE yylex.
|
---|
| 166 | * One obvious solution it to make yy_act a global. I tried that, and saw
|
---|
| 167 | * a 5% performance hit in a non-yylineno scanner, because yy_act is
|
---|
| 168 | * normally declared as a register variable-- so it is not worth it.
|
---|
| 169 | */
|
---|
| 170 | #define YY_LESS_LINENO(n) \
|
---|
| 171 | do { \
|
---|
| 172 | int yyl;\
|
---|
| 173 | for ( yyl = n; yyl < yyleng; ++yyl )\
|
---|
| 174 | if ( yytext[yyl] == '\n' )\
|
---|
| 175 | --yylineno;\
|
---|
| 176 | }while(0)
|
---|
| 177 |
|
---|
| 178 | /* Return all but the first "n" matched characters back to the input stream. */
|
---|
| 179 | #define yyless(n) \
|
---|
| 180 | do \
|
---|
| 181 | { \
|
---|
| 182 | /* Undo effects of setting up yytext. */ \
|
---|
| 183 | int yyless_macro_arg = (n); \
|
---|
| 184 | YY_LESS_LINENO(yyless_macro_arg);\
|
---|
| 185 | *yy_cp = (yy_hold_char); \
|
---|
| 186 | YY_RESTORE_YY_MORE_OFFSET \
|
---|
| 187 | (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
|
---|
| 188 | YY_DO_BEFORE_ACTION; /* set up yytext again */ \
|
---|
| 189 | } \
|
---|
| 190 | while ( 0 )
|
---|
| 191 |
|
---|
| 192 | #define unput(c) yyunput( c, (yytext_ptr) )
|
---|
| 193 |
|
---|
| 194 | /* The following is because we cannot portably get our hands on size_t
|
---|
| 195 | * (without autoconf's help, which isn't available because we want
|
---|
| 196 | * flex-generated scanners to compile on their own).
|
---|
| 197 | */
|
---|
| 198 |
|
---|
| 199 | #ifndef YY_TYPEDEF_YY_SIZE_T
|
---|
| 200 | #define YY_TYPEDEF_YY_SIZE_T
|
---|
| 201 | typedef unsigned int yy_size_t;
|
---|
| 202 | #endif
|
---|
| 203 |
|
---|
| 204 | #ifndef YY_STRUCT_YY_BUFFER_STATE
|
---|
| 205 | #define YY_STRUCT_YY_BUFFER_STATE
|
---|
| 206 | struct yy_buffer_state
|
---|
| 207 | {
|
---|
| 208 |
|
---|
| 209 | std::istream* yy_input_file;
|
---|
| 210 |
|
---|
| 211 | char *yy_ch_buf; /* input buffer */
|
---|
| 212 | char *yy_buf_pos; /* current position in input buffer */
|
---|
| 213 |
|
---|
| 214 | /* Size of input buffer in bytes, not including room for EOB
|
---|
| 215 | * characters.
|
---|
| 216 | */
|
---|
| 217 | yy_size_t yy_buf_size;
|
---|
| 218 |
|
---|
| 219 | /* Number of characters read into yy_ch_buf, not including EOB
|
---|
| 220 | * characters.
|
---|
| 221 | */
|
---|
| 222 | int yy_n_chars;
|
---|
| 223 |
|
---|
| 224 | /* Whether we "own" the buffer - i.e., we know we created it,
|
---|
| 225 | * and can realloc() it to grow it, and should free() it to
|
---|
| 226 | * delete it.
|
---|
| 227 | */
|
---|
| 228 | int yy_is_our_buffer;
|
---|
| 229 |
|
---|
| 230 | /* Whether this is an "interactive" input source; if so, and
|
---|
| 231 | * if we're using stdio for input, then we want to use getc()
|
---|
| 232 | * instead of fread(), to make sure we stop fetching input after
|
---|
| 233 | * each newline.
|
---|
| 234 | */
|
---|
| 235 | int yy_is_interactive;
|
---|
| 236 |
|
---|
| 237 | /* Whether we're considered to be at the beginning of a line.
|
---|
| 238 | * If so, '^' rules will be active on the next match, otherwise
|
---|
| 239 | * not.
|
---|
| 240 | */
|
---|
| 241 | int yy_at_bol;
|
---|
| 242 |
|
---|
| 243 | int yy_bs_lineno; /**< The line count. */
|
---|
| 244 | int yy_bs_column; /**< The column count. */
|
---|
| 245 |
|
---|
| 246 | /* Whether to try to fill the input buffer when we reach the
|
---|
| 247 | * end of it.
|
---|
| 248 | */
|
---|
| 249 | int yy_fill_buffer;
|
---|
| 250 |
|
---|
| 251 | int yy_buffer_status;
|
---|
| 252 |
|
---|
| 253 | #define YY_BUFFER_NEW 0
|
---|
| 254 | #define YY_BUFFER_NORMAL 1
|
---|
| 255 | /* When an EOF's been seen but there's still some text to process
|
---|
| 256 | * then we mark the buffer as YY_EOF_PENDING, to indicate that we
|
---|
| 257 | * shouldn't try reading from the input source any more. We might
|
---|
| 258 | * still have a bunch of tokens to match, though, because of
|
---|
| 259 | * possible backing-up.
|
---|
| 260 | *
|
---|
| 261 | * When we actually see the EOF, we change the status to "new"
|
---|
| 262 | * (via yyrestart()), so that the user can continue scanning by
|
---|
| 263 | * just pointing yyin at a new input file.
|
---|
| 264 | */
|
---|
| 265 | #define YY_BUFFER_EOF_PENDING 2
|
---|
| 266 |
|
---|
| 267 | };
|
---|
| 268 | #endif /* !YY_STRUCT_YY_BUFFER_STATE */
|
---|
| 269 |
|
---|
| 270 | /* We provide macros for accessing buffer states in case in the
|
---|
| 271 | * future we want to put the buffer states in a more general
|
---|
| 272 | * "scanner state".
|
---|
| 273 | *
|
---|
| 274 | * Returns the top of the stack, or NULL.
|
---|
| 275 | */
|
---|
| 276 | #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
|
---|
| 277 | ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
|
---|
| 278 | : NULL)
|
---|
| 279 |
|
---|
| 280 | /* Same as previous macro, but useful when we know that the buffer stack is not
|
---|
| 281 | * NULL or when we need an lvalue. For internal use only.
|
---|
| 282 | */
|
---|
| 283 | #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
|
---|
| 284 |
|
---|
| 285 | void *MPQCInalloc (yy_size_t );
|
---|
| 286 | void *MPQCInrealloc (void *,yy_size_t );
|
---|
| 287 | void MPQCInfree (void * );
|
---|
| 288 |
|
---|
| 289 | #define yy_new_buffer yy_create_buffer
|
---|
| 290 |
|
---|
| 291 | #define yy_set_interactive(is_interactive) \
|
---|
| 292 | { \
|
---|
| 293 | if ( ! YY_CURRENT_BUFFER ){ \
|
---|
| 294 | yyensure_buffer_stack (); \
|
---|
| 295 | YY_CURRENT_BUFFER_LVALUE = \
|
---|
| 296 | yy_create_buffer( yyin, YY_BUF_SIZE ); \
|
---|
| 297 | } \
|
---|
| 298 | YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
|
---|
| 299 | }
|
---|
| 300 |
|
---|
| 301 | #define yy_set_bol(at_bol) \
|
---|
| 302 | { \
|
---|
| 303 | if ( ! YY_CURRENT_BUFFER ){\
|
---|
| 304 | yyensure_buffer_stack (); \
|
---|
| 305 | YY_CURRENT_BUFFER_LVALUE = \
|
---|
| 306 | yy_create_buffer( yyin, YY_BUF_SIZE ); \
|
---|
| 307 | } \
|
---|
| 308 | YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
|
---|
| 309 | }
|
---|
| 310 |
|
---|
| 311 | #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
|
---|
| 312 |
|
---|
| 313 | /* Begin user sect3 */
|
---|
| 314 |
|
---|
| 315 | typedef unsigned char YY_CHAR;
|
---|
| 316 |
|
---|
| 317 | #define yytext_ptr yytext
|
---|
| 318 | #define YY_INTERACTIVE
|
---|
| 319 |
|
---|
| 320 | #include <FlexLexer.h>
|
---|
| 321 |
|
---|
| 322 | /* Done after the current pattern has been matched and before the
|
---|
| 323 | * corresponding action - sets up yytext.
|
---|
| 324 | */
|
---|
| 325 | #define YY_DO_BEFORE_ACTION \
|
---|
| 326 | (yytext_ptr) = yy_bp; \
|
---|
| 327 | yyleng = (size_t) (yy_cp - yy_bp); \
|
---|
| 328 | (yy_hold_char) = *yy_cp; \
|
---|
| 329 | *yy_cp = '\0'; \
|
---|
| 330 | (yy_c_buf_p) = yy_cp;
|
---|
| 331 |
|
---|
| 332 | #define YY_NUM_RULES 48
|
---|
| 333 | #define YY_END_OF_BUFFER 49
|
---|
| 334 | /* This struct is not used in this scanner,
|
---|
| 335 | but its presence is necessary. */
|
---|
| 336 | struct yy_trans_info
|
---|
| 337 | {
|
---|
| 338 | flex_int32_t yy_verify;
|
---|
| 339 | flex_int32_t yy_nxt;
|
---|
| 340 | };
|
---|
| 341 | static yyconst flex_int16_t yy_accept[204] =
|
---|
| 342 | { 0,
|
---|
| 343 | 42, 42, 49, 47, 44, 46, 46, 1, 47, 47,
|
---|
| 344 | 42, 38, 39, 37, 40, 36, 42, 42, 42, 42,
|
---|
| 345 | 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
|
---|
| 346 | 42, 44, 0, 0, 45, 42, 42, 42, 42, 42,
|
---|
| 347 | 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
|
---|
| 348 | 42, 42, 42, 42, 42, 15, 42, 42, 42, 42,
|
---|
| 349 | 25, 42, 43, 6, 42, 42, 42, 42, 42, 42,
|
---|
| 350 | 42, 42, 42, 42, 42, 2, 42, 42, 3, 42,
|
---|
| 351 | 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
|
---|
| 352 | 42, 42, 14, 7, 42, 42, 42, 42, 32, 27,
|
---|
| 353 |
|
---|
| 354 | 4, 42, 42, 42, 29, 42, 42, 42, 35, 42,
|
---|
| 355 | 42, 42, 42, 41, 42, 42, 42, 42, 30, 42,
|
---|
| 356 | 31, 42, 42, 18, 5, 42, 42, 42, 42, 42,
|
---|
| 357 | 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
|
---|
| 358 | 42, 42, 42, 16, 42, 42, 42, 42, 42, 8,
|
---|
| 359 | 17, 42, 42, 42, 42, 42, 42, 42, 42, 42,
|
---|
| 360 | 42, 42, 42, 42, 42, 42, 42, 42, 42, 23,
|
---|
| 361 | 42, 28, 19, 42, 42, 42, 42, 42, 12, 21,
|
---|
| 362 | 9, 42, 11, 42, 26, 20, 42, 42, 42, 42,
|
---|
| 363 | 42, 22, 24, 42, 42, 42, 42, 13, 33, 34,
|
---|
| 364 |
|
---|
| 365 | 42, 10, 0
|
---|
| 366 | } ;
|
---|
| 367 |
|
---|
| 368 | static yyconst flex_int32_t yy_ec[256] =
|
---|
| 369 | { 0,
|
---|
| 370 | 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
|
---|
| 371 | 1, 4, 4, 1, 1, 1, 1, 1, 1, 1,
|
---|
| 372 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
---|
| 373 | 1, 2, 5, 6, 1, 1, 7, 1, 8, 9,
|
---|
| 374 | 10, 8, 11, 8, 8, 8, 8, 8, 8, 8,
|
---|
| 375 | 8, 8, 8, 8, 8, 8, 8, 12, 1, 13,
|
---|
| 376 | 14, 1, 1, 1, 8, 8, 8, 8, 8, 8,
|
---|
| 377 | 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
|
---|
| 378 | 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
|
---|
| 379 | 1, 1, 1, 1, 15, 1, 16, 17, 18, 19,
|
---|
| 380 |
|
---|
| 381 | 20, 21, 22, 23, 24, 8, 25, 26, 27, 28,
|
---|
| 382 | 29, 30, 31, 32, 33, 34, 35, 8, 8, 36,
|
---|
| 383 | 37, 38, 1, 1, 1, 1, 1, 1, 1, 1,
|
---|
| 384 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
---|
| 385 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
---|
| 386 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
---|
| 387 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
---|
| 388 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
---|
| 389 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
---|
| 390 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
---|
| 391 |
|
---|
| 392 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
---|
| 393 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
---|
| 394 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
---|
| 395 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
---|
| 396 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
---|
| 397 | 1, 1, 1, 1, 1
|
---|
| 398 | } ;
|
---|
| 399 |
|
---|
| 400 | static yyconst flex_int32_t yy_meta[39] =
|
---|
| 401 | { 0,
|
---|
| 402 | 1, 1, 2, 1, 1, 2, 1, 3, 1, 1,
|
---|
| 403 | 3, 1, 1, 1, 3, 3, 3, 3, 3, 3,
|
---|
| 404 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
---|
| 405 | 3, 3, 3, 3, 3, 3, 3, 3
|
---|
| 406 | } ;
|
---|
| 407 |
|
---|
| 408 | static yyconst flex_int16_t yy_base[207] =
|
---|
| 409 | { 0,
|
---|
| 410 | 0, 0, 215, 216, 212, 216, 216, 216, 0, 210,
|
---|
| 411 | 0, 216, 216, 216, 216, 216, 22, 24, 26, 183,
|
---|
| 412 | 194, 178, 24, 181, 25, 179, 177, 186, 14, 187,
|
---|
| 413 | 184, 201, 196, 198, 216, 0, 167, 169, 176, 161,
|
---|
| 414 | 163, 161, 171, 29, 42, 175, 174, 39, 173, 47,
|
---|
| 415 | 156, 38, 163, 157, 161, 0, 152, 33, 167, 157,
|
---|
| 416 | 0, 150, 216, 171, 158, 147, 162, 154, 161, 144,
|
---|
| 417 | 142, 140, 141, 154, 153, 0, 139, 131, 0, 149,
|
---|
| 418 | 148, 146, 136, 141, 143, 144, 127, 136, 124, 124,
|
---|
| 419 | 139, 129, 0, 0, 139, 120, 137, 119, 0, 0,
|
---|
| 420 |
|
---|
| 421 | 140, 130, 127, 123, 0, 112, 126, 121, 0, 112,
|
---|
| 422 | 111, 113, 123, 0, 116, 112, 110, 121, 0, 116,
|
---|
| 423 | 0, 103, 101, 0, 0, 100, 112, 101, 110, 101,
|
---|
| 424 | 108, 99, 89, 106, 89, 93, 98, 102, 88, 85,
|
---|
| 425 | 89, 93, 92, 0, 86, 86, 98, 84, 95, 0,
|
---|
| 426 | 0, 84, 83, 70, 91, 72, 73, 77, 70, 86,
|
---|
| 427 | 77, 82, 45, 65, 72, 77, 72, 75, 66, 0,
|
---|
| 428 | 56, 0, 0, 64, 63, 66, 60, 59, 0, 0,
|
---|
| 429 | 0, 69, 0, 48, 0, 0, 45, 58, 59, 58,
|
---|
| 430 | 51, 0, 0, 41, 55, 52, 35, 0, 0, 0,
|
---|
| 431 |
|
---|
| 432 | 30, 0, 216, 80, 83, 44
|
---|
| 433 | } ;
|
---|
| 434 |
|
---|
| 435 | static yyconst flex_int16_t yy_def[207] =
|
---|
| 436 | { 0,
|
---|
| 437 | 203, 1, 203, 203, 203, 203, 203, 203, 204, 205,
|
---|
| 438 | 206, 203, 203, 203, 203, 203, 206, 206, 206, 206,
|
---|
| 439 | 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
|
---|
| 440 | 206, 203, 204, 205, 203, 206, 206, 206, 206, 206,
|
---|
| 441 | 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
|
---|
| 442 | 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
|
---|
| 443 | 206, 206, 203, 206, 206, 206, 206, 206, 206, 206,
|
---|
| 444 | 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
|
---|
| 445 | 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
|
---|
| 446 | 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
|
---|
| 447 |
|
---|
| 448 | 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
|
---|
| 449 | 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
|
---|
| 450 | 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
|
---|
| 451 | 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
|
---|
| 452 | 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
|
---|
| 453 | 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
|
---|
| 454 | 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
|
---|
| 455 | 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
|
---|
| 456 | 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
|
---|
| 457 | 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
|
---|
| 458 |
|
---|
| 459 | 206, 206, 0, 203, 203, 203
|
---|
| 460 | } ;
|
---|
| 461 |
|
---|
| 462 | static yyconst flex_int16_t yy_nxt[255] =
|
---|
| 463 | { 0,
|
---|
| 464 | 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
|
---|
| 465 | 11, 14, 15, 16, 11, 17, 18, 19, 20, 21,
|
---|
| 466 | 22, 23, 11, 24, 11, 11, 25, 26, 27, 11,
|
---|
| 467 | 11, 28, 29, 11, 11, 30, 31, 11, 37, 41,
|
---|
| 468 | 49, 44, 59, 42, 52, 71, 36, 38, 45, 39,
|
---|
| 469 | 60, 89, 43, 53, 54, 50, 40, 73, 77, 55,
|
---|
| 470 | 72, 74, 80, 177, 83, 90, 202, 78, 201, 200,
|
---|
| 471 | 81, 84, 199, 198, 197, 196, 195, 194, 193, 178,
|
---|
| 472 | 33, 192, 33, 34, 34, 34, 191, 190, 189, 188,
|
---|
| 473 | 187, 186, 185, 184, 183, 182, 181, 180, 179, 176,
|
---|
| 474 |
|
---|
| 475 | 175, 174, 173, 172, 171, 170, 169, 168, 167, 166,
|
---|
| 476 | 165, 164, 163, 162, 161, 160, 159, 158, 157, 156,
|
---|
| 477 | 155, 154, 153, 152, 151, 150, 149, 148, 147, 146,
|
---|
| 478 | 145, 144, 143, 142, 141, 140, 139, 138, 137, 136,
|
---|
| 479 | 135, 134, 133, 132, 131, 130, 129, 128, 127, 126,
|
---|
| 480 | 125, 124, 123, 122, 121, 120, 119, 118, 117, 116,
|
---|
| 481 | 115, 114, 113, 112, 111, 110, 109, 108, 107, 106,
|
---|
| 482 | 105, 104, 103, 102, 101, 100, 99, 98, 97, 96,
|
---|
| 483 | 95, 94, 93, 92, 91, 88, 87, 86, 85, 82,
|
---|
| 484 | 79, 76, 75, 70, 69, 68, 67, 66, 65, 64,
|
---|
| 485 |
|
---|
| 486 | 35, 63, 32, 62, 61, 58, 57, 56, 51, 48,
|
---|
| 487 | 47, 46, 35, 32, 203, 3, 203, 203, 203, 203,
|
---|
| 488 | 203, 203, 203, 203, 203, 203, 203, 203, 203, 203,
|
---|
| 489 | 203, 203, 203, 203, 203, 203, 203, 203, 203, 203,
|
---|
| 490 | 203, 203, 203, 203, 203, 203, 203, 203, 203, 203,
|
---|
| 491 | 203, 203, 203, 203
|
---|
| 492 | } ;
|
---|
| 493 |
|
---|
| 494 | static yyconst flex_int16_t yy_chk[255] =
|
---|
| 495 | { 0,
|
---|
| 496 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
---|
| 497 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
---|
| 498 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
---|
| 499 | 1, 1, 1, 1, 1, 1, 1, 1, 17, 18,
|
---|
| 500 | 23, 19, 29, 18, 25, 44, 206, 17, 19, 17,
|
---|
| 501 | 29, 58, 18, 25, 25, 23, 17, 45, 48, 25,
|
---|
| 502 | 44, 45, 50, 163, 52, 58, 201, 48, 197, 196,
|
---|
| 503 | 50, 52, 195, 194, 191, 190, 189, 188, 187, 163,
|
---|
| 504 | 204, 184, 204, 205, 205, 205, 182, 178, 177, 176,
|
---|
| 505 | 175, 174, 171, 169, 168, 167, 166, 165, 164, 162,
|
---|
| 506 |
|
---|
| 507 | 161, 160, 159, 158, 157, 156, 155, 154, 153, 152,
|
---|
| 508 | 149, 148, 147, 146, 145, 143, 142, 141, 140, 139,
|
---|
| 509 | 138, 137, 136, 135, 134, 133, 132, 131, 130, 129,
|
---|
| 510 | 128, 127, 126, 123, 122, 120, 118, 117, 116, 115,
|
---|
| 511 | 113, 112, 111, 110, 108, 107, 106, 104, 103, 102,
|
---|
| 512 | 101, 98, 97, 96, 95, 92, 91, 90, 89, 88,
|
---|
| 513 | 87, 86, 85, 84, 83, 82, 81, 80, 78, 77,
|
---|
| 514 | 75, 74, 73, 72, 71, 70, 69, 68, 67, 66,
|
---|
| 515 | 65, 64, 62, 60, 59, 57, 55, 54, 53, 51,
|
---|
| 516 | 49, 47, 46, 43, 42, 41, 40, 39, 38, 37,
|
---|
| 517 |
|
---|
| 518 | 34, 33, 32, 31, 30, 28, 27, 26, 24, 22,
|
---|
| 519 | 21, 20, 10, 5, 3, 203, 203, 203, 203, 203,
|
---|
| 520 | 203, 203, 203, 203, 203, 203, 203, 203, 203, 203,
|
---|
| 521 | 203, 203, 203, 203, 203, 203, 203, 203, 203, 203,
|
---|
| 522 | 203, 203, 203, 203, 203, 203, 203, 203, 203, 203,
|
---|
| 523 | 203, 203, 203, 203
|
---|
| 524 | } ;
|
---|
| 525 |
|
---|
| 526 | /* Table of booleans, true if rule could match eol. */
|
---|
| 527 | static yyconst flex_int32_t yy_rule_can_match_eol[49] =
|
---|
| 528 | { 0,
|
---|
| 529 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
---|
| 530 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
---|
| 531 | 0, 0, 0, 0, 0, 0, 1, 0, 0, };
|
---|
| 532 |
|
---|
| 533 | /* The intent behind this definition is that it'll catch
|
---|
| 534 | * any uses of REJECT which flex missed.
|
---|
| 535 | */
|
---|
| 536 | #define REJECT reject_used_but_not_detected
|
---|
| 537 | #define yymore() yymore_used_but_not_detected
|
---|
| 538 | #define YY_MORE_ADJ 0
|
---|
| 539 | #define YY_RESTORE_YY_MORE_OFFSET
|
---|
| 540 |
|
---|
| 541 | #if !defined(SUN4)
|
---|
| 542 | #include <string.h>
|
---|
| 543 | #endif
|
---|
| 544 |
|
---|
| 545 | #include <util/misc/exenv.h>
|
---|
| 546 |
|
---|
| 547 | #include "mpqcin.h"
|
---|
| 548 | #include "parse.h"
|
---|
| 549 |
|
---|
| 550 | using namespace sc;
|
---|
| 551 |
|
---|
| 552 | #define YY_NO_UNISTD_H
|
---|
| 553 | extern "C" int MPQCInwrap();
|
---|
| 554 |
|
---|
| 555 | #ifndef yywrap
|
---|
| 556 | # define yywrap MPQCInwrap
|
---|
| 557 | #endif
|
---|
| 558 |
|
---|
| 559 | static inline char *
|
---|
| 560 | cstr(char *yytext)
|
---|
| 561 | {
|
---|
| 562 | if (MPQCIn::checking()) return 0;
|
---|
| 563 | char *ret;
|
---|
| 564 | int strlenyytext = strlen(yytext);
|
---|
| 565 | ret = (char *)malloc(strlenyytext+1);
|
---|
| 566 | if (!ret) {
|
---|
| 567 | ExEnv::outn() << "MPQC: malloc failed"
|
---|
| 568 | << endl;
|
---|
| 569 | abort();
|
---|
| 570 | }
|
---|
| 571 | strcpy(ret,yytext);
|
---|
| 572 | return ret;
|
---|
| 573 | }
|
---|
| 574 |
|
---|
| 575 | #define INITIAL 0
|
---|
| 576 |
|
---|
| 577 | /* Special case for "unistd.h", since it is non-ANSI. We include it way
|
---|
| 578 | * down here because we want the user's section 1 to have been scanned first.
|
---|
| 579 | * The user has a chance to override it with an option.
|
---|
| 580 | */
|
---|
| 581 | #include <unistd.h>
|
---|
| 582 |
|
---|
| 583 | #ifndef YY_EXTRA_TYPE
|
---|
| 584 | #define YY_EXTRA_TYPE void *
|
---|
| 585 | #endif
|
---|
| 586 |
|
---|
| 587 | #ifndef yytext_ptr
|
---|
| 588 | static void yy_flex_strncpy (char *,yyconst char *,int );
|
---|
| 589 | #endif
|
---|
| 590 |
|
---|
| 591 | #ifdef YY_NEED_STRLEN
|
---|
| 592 | static int yy_flex_strlen (yyconst char * );
|
---|
| 593 | #endif
|
---|
| 594 |
|
---|
| 595 | #ifndef YY_NO_INPUT
|
---|
| 596 |
|
---|
| 597 | #endif
|
---|
| 598 |
|
---|
| 599 | /* Amount of stuff to slurp up with each read. */
|
---|
| 600 | #ifndef YY_READ_BUF_SIZE
|
---|
| 601 | #define YY_READ_BUF_SIZE 8192
|
---|
| 602 | #endif
|
---|
| 603 |
|
---|
| 604 | /* Copy whatever the last rule matched to the standard output. */
|
---|
| 605 | #ifndef ECHO
|
---|
| 606 | #define ECHO LexerOutput( yytext, yyleng )
|
---|
| 607 | #endif
|
---|
| 608 |
|
---|
| 609 | /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
|
---|
| 610 | * is returned in "result".
|
---|
| 611 | */
|
---|
| 612 | #ifndef YY_INPUT
|
---|
| 613 | #define YY_INPUT(buf,result,max_size) \
|
---|
| 614 | \
|
---|
| 615 | if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
|
---|
| 616 | YY_FATAL_ERROR( "input in flex scanner failed" );
|
---|
| 617 |
|
---|
| 618 | #endif
|
---|
| 619 |
|
---|
| 620 | /* No semi-colon after return; correct usage is to write "yyterminate();" -
|
---|
| 621 | * we don't want an extra ';' after the "return" because that will cause
|
---|
| 622 | * some compilers to complain about unreachable statements.
|
---|
| 623 | */
|
---|
| 624 | #ifndef yyterminate
|
---|
| 625 | #define yyterminate() return YY_NULL
|
---|
| 626 | #endif
|
---|
| 627 |
|
---|
| 628 | /* Number of entries by which start-condition stack grows. */
|
---|
| 629 | #ifndef YY_START_STACK_INCR
|
---|
| 630 | #define YY_START_STACK_INCR 25
|
---|
| 631 | #endif
|
---|
| 632 |
|
---|
| 633 | /* Report a fatal error. */
|
---|
| 634 | #ifndef YY_FATAL_ERROR
|
---|
| 635 | #define YY_FATAL_ERROR(msg) LexerError( msg )
|
---|
| 636 | #endif
|
---|
| 637 |
|
---|
| 638 | /* end tables serialization structures and prototypes */
|
---|
| 639 |
|
---|
| 640 | /* Default declaration of generated scanner - a define so the user can
|
---|
| 641 | * easily add parameters.
|
---|
| 642 | */
|
---|
| 643 | #ifndef YY_DECL
|
---|
| 644 | #define YY_DECL_IS_OURS 1
|
---|
| 645 | #define YY_DECL int yyFlexLexer::yylex()
|
---|
| 646 | #endif /* !YY_DECL */
|
---|
| 647 |
|
---|
| 648 | /* Code executed at the beginning of each rule, after yytext and yyleng
|
---|
| 649 | * have been set up.
|
---|
| 650 | */
|
---|
| 651 | #ifndef YY_USER_ACTION
|
---|
| 652 | #define YY_USER_ACTION
|
---|
| 653 | #endif
|
---|
| 654 |
|
---|
| 655 | /* Code executed at the end of each rule. */
|
---|
| 656 | #ifndef YY_BREAK
|
---|
| 657 | #define YY_BREAK break;
|
---|
| 658 | #endif
|
---|
| 659 |
|
---|
| 660 | #define YY_RULE_SETUP \
|
---|
| 661 | YY_USER_ACTION
|
---|
| 662 |
|
---|
| 663 | /** The main scanner function which does all the work.
|
---|
| 664 | */
|
---|
| 665 | YY_DECL
|
---|
| 666 | {
|
---|
| 667 | register yy_state_type yy_current_state;
|
---|
| 668 | register char *yy_cp, *yy_bp;
|
---|
| 669 | register int yy_act;
|
---|
| 670 |
|
---|
| 671 | if ( (yy_init) )
|
---|
| 672 | {
|
---|
| 673 | (yy_init) = 0;
|
---|
| 674 |
|
---|
| 675 | #ifdef YY_USER_INIT
|
---|
| 676 | YY_USER_INIT;
|
---|
| 677 | #endif
|
---|
| 678 |
|
---|
| 679 | if ( ! (yy_start) )
|
---|
| 680 | (yy_start) = 1; /* first start state */
|
---|
| 681 |
|
---|
| 682 | if ( ! yyin )
|
---|
| 683 | yyin = & std::cin;
|
---|
| 684 |
|
---|
| 685 | if ( ! yyout )
|
---|
| 686 | yyout = & std::cout;
|
---|
| 687 |
|
---|
| 688 | if ( ! YY_CURRENT_BUFFER ) {
|
---|
| 689 | yyensure_buffer_stack ();
|
---|
| 690 | YY_CURRENT_BUFFER_LVALUE =
|
---|
| 691 | yy_create_buffer( yyin, YY_BUF_SIZE );
|
---|
| 692 | }
|
---|
| 693 |
|
---|
| 694 | yy_load_buffer_state( );
|
---|
| 695 | }
|
---|
| 696 |
|
---|
| 697 | while ( 1 ) /* loops until end-of-file is reached */
|
---|
| 698 | {
|
---|
| 699 | yy_cp = (yy_c_buf_p);
|
---|
| 700 |
|
---|
| 701 | /* Support of yytext. */
|
---|
| 702 | *yy_cp = (yy_hold_char);
|
---|
| 703 |
|
---|
| 704 | /* yy_bp points to the position in yy_ch_buf of the start of
|
---|
| 705 | * the current run.
|
---|
| 706 | */
|
---|
| 707 | yy_bp = yy_cp;
|
---|
| 708 |
|
---|
| 709 | yy_current_state = (yy_start);
|
---|
| 710 | yy_match:
|
---|
| 711 | do
|
---|
| 712 | {
|
---|
| 713 | register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
|
---|
| 714 | if ( yy_accept[yy_current_state] )
|
---|
| 715 | {
|
---|
| 716 | (yy_last_accepting_state) = yy_current_state;
|
---|
| 717 | (yy_last_accepting_cpos) = yy_cp;
|
---|
| 718 | }
|
---|
| 719 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
|
---|
| 720 | {
|
---|
| 721 | yy_current_state = (int) yy_def[yy_current_state];
|
---|
| 722 | if ( yy_current_state >= 204 )
|
---|
| 723 | yy_c = yy_meta[(unsigned int) yy_c];
|
---|
| 724 | }
|
---|
| 725 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
|
---|
| 726 | ++yy_cp;
|
---|
| 727 | }
|
---|
| 728 | while ( yy_base[yy_current_state] != 216 );
|
---|
| 729 |
|
---|
| 730 | yy_find_action:
|
---|
| 731 | yy_act = yy_accept[yy_current_state];
|
---|
| 732 | if ( yy_act == 0 )
|
---|
| 733 | { /* have to back up */
|
---|
| 734 | yy_cp = (yy_last_accepting_cpos);
|
---|
| 735 | yy_current_state = (yy_last_accepting_state);
|
---|
| 736 | yy_act = yy_accept[yy_current_state];
|
---|
| 737 | }
|
---|
| 738 |
|
---|
| 739 | YY_DO_BEFORE_ACTION;
|
---|
| 740 |
|
---|
| 741 | if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
|
---|
| 742 | {
|
---|
| 743 | int yyl;
|
---|
| 744 | for ( yyl = 0; yyl < yyleng; ++yyl )
|
---|
| 745 | if ( yytext[yyl] == '\n' )
|
---|
| 746 |
|
---|
| 747 | yylineno++;
|
---|
| 748 | ;
|
---|
| 749 | }
|
---|
| 750 |
|
---|
| 751 | do_action: /* This label is used only to access EOF actions. */
|
---|
| 752 |
|
---|
| 753 | switch ( yy_act )
|
---|
| 754 | { /* beginning of action switch */
|
---|
| 755 | case 0: /* must back up */
|
---|
| 756 | /* undo the effects of YY_DO_BEFORE_ACTION */
|
---|
| 757 | *yy_cp = (yy_hold_char);
|
---|
| 758 | yy_cp = (yy_last_accepting_cpos);
|
---|
| 759 | yy_current_state = (yy_last_accepting_state);
|
---|
| 760 | goto yy_find_action;
|
---|
| 761 |
|
---|
| 762 | case 1:
|
---|
| 763 | YY_RULE_SETUP
|
---|
| 764 | { return T_NOT; }
|
---|
| 765 | YY_BREAK
|
---|
| 766 | case 2:
|
---|
| 767 | YY_RULE_SETUP
|
---|
| 768 | { return T_EBC; }
|
---|
| 769 | YY_BREAK
|
---|
| 770 | case 3:
|
---|
| 771 | YY_RULE_SETUP
|
---|
| 772 | { return T_GBC; }
|
---|
| 773 | YY_BREAK
|
---|
| 774 | case 4:
|
---|
| 775 | YY_RULE_SETUP
|
---|
| 776 | { return T_CABS; }
|
---|
| 777 | YY_BREAK
|
---|
| 778 | case 5:
|
---|
| 779 | YY_RULE_SETUP
|
---|
| 780 | { return T_CABSP; }
|
---|
| 781 | YY_BREAK
|
---|
| 782 | case 6:
|
---|
| 783 | YY_RULE_SETUP
|
---|
| 784 | { return T_ABS; }
|
---|
| 785 | YY_BREAK
|
---|
| 786 | case 7:
|
---|
| 787 | YY_RULE_SETUP
|
---|
| 788 | { return T_ABSP; }
|
---|
| 789 | YY_BREAK
|
---|
| 790 | case 8:
|
---|
| 791 | YY_RULE_SETUP
|
---|
| 792 | { return T_MEMORY; }
|
---|
| 793 | YY_BREAK
|
---|
| 794 | case 9:
|
---|
| 795 | YY_RULE_SETUP
|
---|
| 796 | { return T_MOLECULE; }
|
---|
| 797 | YY_BREAK
|
---|
| 798 | case 10:
|
---|
| 799 | YY_RULE_SETUP
|
---|
| 800 | { return T_MULTIPLICITY; }
|
---|
| 801 | YY_BREAK
|
---|
| 802 | case 11:
|
---|
| 803 | YY_RULE_SETUP
|
---|
| 804 | { return T_OPTIMIZE; }
|
---|
| 805 | YY_BREAK
|
---|
| 806 | case 12:
|
---|
| 807 | YY_RULE_SETUP
|
---|
| 808 | { return T_GRADIENT; }
|
---|
| 809 | YY_BREAK
|
---|
| 810 | case 13:
|
---|
| 811 | YY_RULE_SETUP
|
---|
| 812 | { return T_FREQUENCIES; }
|
---|
| 813 | YY_BREAK
|
---|
| 814 | case 14:
|
---|
| 815 | YY_RULE_SETUP
|
---|
| 816 | { MPQCInylval.i = 1; return T_BOOL; }
|
---|
| 817 | YY_BREAK
|
---|
| 818 | case 15:
|
---|
| 819 | YY_RULE_SETUP
|
---|
| 820 | { MPQCInylval.i = 0; return T_BOOL; }
|
---|
| 821 | YY_BREAK
|
---|
| 822 | case 16:
|
---|
| 823 | YY_RULE_SETUP
|
---|
| 824 | { return T_CHARGE; }
|
---|
| 825 | YY_BREAK
|
---|
| 826 | case 17:
|
---|
| 827 | YY_RULE_SETUP
|
---|
| 828 | { return T_METHOD; }
|
---|
| 829 | YY_BREAK
|
---|
| 830 | case 18:
|
---|
| 831 | YY_RULE_SETUP
|
---|
| 832 | { return T_BASIS; }
|
---|
| 833 | YY_BREAK
|
---|
| 834 | case 19:
|
---|
| 835 | YY_RULE_SETUP
|
---|
| 836 | { return T_AUXBASIS; }
|
---|
| 837 | YY_BREAK
|
---|
| 838 | case 20:
|
---|
| 839 | YY_RULE_SETUP
|
---|
| 840 | { return T_CARTESIAN; }
|
---|
| 841 | YY_BREAK
|
---|
| 842 | case 21:
|
---|
| 843 | YY_RULE_SETUP
|
---|
| 844 | { return T_INTERNAL; }
|
---|
| 845 | YY_BREAK
|
---|
| 846 | case 22:
|
---|
| 847 | YY_RULE_SETUP
|
---|
| 848 | { return T_REDUNDANT; }
|
---|
| 849 | YY_BREAK
|
---|
| 850 | case 23:
|
---|
| 851 | YY_RULE_SETUP
|
---|
| 852 | { return T_RESTART; }
|
---|
| 853 | YY_BREAK
|
---|
| 854 | case 24:
|
---|
| 855 | YY_RULE_SETUP
|
---|
| 856 | { return T_CHECKPOINT; }
|
---|
| 857 | YY_BREAK
|
---|
| 858 | case 25:
|
---|
| 859 | YY_RULE_SETUP
|
---|
| 860 | { return T_XC; }
|
---|
| 861 | YY_BREAK
|
---|
| 862 | case 26:
|
---|
| 863 | YY_RULE_SETUP
|
---|
| 864 | { return T_SYMMETRY; }
|
---|
| 865 | YY_BREAK
|
---|
| 866 | case 27:
|
---|
| 867 | YY_RULE_SETUP
|
---|
| 868 | { return T_BOHR; }
|
---|
| 869 | YY_BREAK
|
---|
| 870 | case 28:
|
---|
| 871 | YY_RULE_SETUP
|
---|
| 872 | { return T_ANGSTROM; }
|
---|
| 873 | YY_BREAK
|
---|
| 874 | case 29:
|
---|
| 875 | YY_RULE_SETUP
|
---|
| 876 | { return T_DOCC; }
|
---|
| 877 | YY_BREAK
|
---|
| 878 | case 30:
|
---|
| 879 | YY_RULE_SETUP
|
---|
| 880 | { return T_SOCC; }
|
---|
| 881 | YY_BREAK
|
---|
| 882 | case 31:
|
---|
| 883 | YY_RULE_SETUP
|
---|
| 884 | { return T_ALPHA; }
|
---|
| 885 | YY_BREAK
|
---|
| 886 | case 32:
|
---|
| 887 | YY_RULE_SETUP
|
---|
| 888 | { return T_BETA; }
|
---|
| 889 | YY_BREAK
|
---|
| 890 | case 33:
|
---|
| 891 | YY_RULE_SETUP
|
---|
| 892 | { return T_FROZEN_DOCC; }
|
---|
| 893 | YY_BREAK
|
---|
| 894 | case 34:
|
---|
| 895 | YY_RULE_SETUP
|
---|
| 896 | { return T_FROZEN_UOCC; }
|
---|
| 897 | YY_BREAK
|
---|
| 898 | case 35:
|
---|
| 899 | YY_RULE_SETUP
|
---|
| 900 | { return T_GRID; }
|
---|
| 901 | YY_BREAK
|
---|
| 902 | case 36:
|
---|
| 903 | YY_RULE_SETUP
|
---|
| 904 | { return T_EQUALS; }
|
---|
| 905 | YY_BREAK
|
---|
| 906 | case 37:
|
---|
| 907 | YY_RULE_SETUP
|
---|
| 908 | { return T_COLON; }
|
---|
| 909 | YY_BREAK
|
---|
| 910 | case 38:
|
---|
| 911 | YY_RULE_SETUP
|
---|
| 912 | { return T_BEG_OPT; }
|
---|
| 913 | YY_BREAK
|
---|
| 914 | case 39:
|
---|
| 915 | YY_RULE_SETUP
|
---|
| 916 | { return T_END_OPT; }
|
---|
| 917 | YY_BREAK
|
---|
| 918 | case 40:
|
---|
| 919 | YY_RULE_SETUP
|
---|
| 920 | { return T_OO_INPUT_KEYWORD; }
|
---|
| 921 | YY_BREAK
|
---|
| 922 | case 41:
|
---|
| 923 | YY_RULE_SETUP
|
---|
| 924 | { return T_OO_INPUT_KEYWORD; }
|
---|
| 925 | YY_BREAK
|
---|
| 926 | case 42:
|
---|
| 927 | YY_RULE_SETUP
|
---|
| 928 | { MPQCInylval.str = cstr(yytext);
|
---|
| 929 | return T_STRING;
|
---|
| 930 | }
|
---|
| 931 | YY_BREAK
|
---|
| 932 | case 43:
|
---|
| 933 | YY_RULE_SETUP
|
---|
| 934 | { if (MPQCIn::checking()) return T_STRING;
|
---|
| 935 | MPQCInylval.str = (char *)malloc(strlen(yytext));
|
---|
| 936 | if (!MPQCInylval.str) {
|
---|
| 937 | ExEnv::outn() << "MPQC: {qstring} rule: malloc failed"
|
---|
| 938 | << endl;
|
---|
| 939 | abort();
|
---|
| 940 | }
|
---|
| 941 | strcpy(MPQCInylval.str,&yytext[1]);
|
---|
| 942 | MPQCInylval.str[strlen(MPQCInylval.str)-1] = '\0';
|
---|
| 943 | return(T_STRING);
|
---|
| 944 | }
|
---|
| 945 | YY_BREAK
|
---|
| 946 | case 44:
|
---|
| 947 | YY_RULE_SETUP
|
---|
| 948 | ;
|
---|
| 949 | YY_BREAK
|
---|
| 950 | case 45:
|
---|
| 951 | *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
|
---|
| 952 | (yy_c_buf_p) = yy_cp -= 1;
|
---|
| 953 | YY_DO_BEFORE_ACTION; /* set up yytext again */
|
---|
| 954 | YY_RULE_SETUP
|
---|
| 955 | ;
|
---|
| 956 | YY_BREAK
|
---|
| 957 | case 46:
|
---|
| 958 | /* rule 46 can match eol */
|
---|
| 959 | YY_RULE_SETUP
|
---|
| 960 | ;
|
---|
| 961 | YY_BREAK
|
---|
| 962 | case 47:
|
---|
| 963 | YY_RULE_SETUP
|
---|
| 964 | { ExEnv::outn() << "MPQC: Illegal character: \""
|
---|
| 965 | << yytext[0] <<"\"" << endl; }
|
---|
| 966 | YY_BREAK
|
---|
| 967 | case 48:
|
---|
| 968 | YY_RULE_SETUP
|
---|
| 969 | ECHO;
|
---|
| 970 | YY_BREAK
|
---|
| 971 | case YY_STATE_EOF(INITIAL):
|
---|
| 972 | yyterminate();
|
---|
| 973 |
|
---|
| 974 | case YY_END_OF_BUFFER:
|
---|
| 975 | {
|
---|
| 976 | /* Amount of text matched not including the EOB char. */
|
---|
| 977 | int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
|
---|
| 978 |
|
---|
| 979 | /* Undo the effects of YY_DO_BEFORE_ACTION. */
|
---|
| 980 | *yy_cp = (yy_hold_char);
|
---|
| 981 | YY_RESTORE_YY_MORE_OFFSET
|
---|
| 982 |
|
---|
| 983 | if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
|
---|
| 984 | {
|
---|
| 985 | /* We're scanning a new file or input source. It's
|
---|
| 986 | * possible that this happened because the user
|
---|
| 987 | * just pointed yyin at a new source and called
|
---|
| 988 | * yylex(). If so, then we have to assure
|
---|
| 989 | * consistency between YY_CURRENT_BUFFER and our
|
---|
| 990 | * globals. Here is the right place to do so, because
|
---|
| 991 | * this is the first action (other than possibly a
|
---|
| 992 | * back-up) that will match for the new input source.
|
---|
| 993 | */
|
---|
| 994 | (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
|
---|
| 995 | YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
|
---|
| 996 | YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
|
---|
| 997 | }
|
---|
| 998 |
|
---|
| 999 | /* Note that here we test for yy_c_buf_p "<=" to the position
|
---|
| 1000 | * of the first EOB in the buffer, since yy_c_buf_p will
|
---|
| 1001 | * already have been incremented past the NUL character
|
---|
| 1002 | * (since all states make transitions on EOB to the
|
---|
| 1003 | * end-of-buffer state). Contrast this with the test
|
---|
| 1004 | * in input().
|
---|
| 1005 | */
|
---|
| 1006 | if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
|
---|
| 1007 | { /* This was really a NUL. */
|
---|
| 1008 | yy_state_type yy_next_state;
|
---|
| 1009 |
|
---|
| 1010 | (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
|
---|
| 1011 |
|
---|
| 1012 | yy_current_state = yy_get_previous_state( );
|
---|
| 1013 |
|
---|
| 1014 | /* Okay, we're now positioned to make the NUL
|
---|
| 1015 | * transition. We couldn't have
|
---|
| 1016 | * yy_get_previous_state() go ahead and do it
|
---|
| 1017 | * for us because it doesn't know how to deal
|
---|
| 1018 | * with the possibility of jamming (and we don't
|
---|
| 1019 | * want to build jamming into it because then it
|
---|
| 1020 | * will run more slowly).
|
---|
| 1021 | */
|
---|
| 1022 |
|
---|
| 1023 | yy_next_state = yy_try_NUL_trans( yy_current_state );
|
---|
| 1024 |
|
---|
| 1025 | yy_bp = (yytext_ptr) + YY_MORE_ADJ;
|
---|
| 1026 |
|
---|
| 1027 | if ( yy_next_state )
|
---|
| 1028 | {
|
---|
| 1029 | /* Consume the NUL. */
|
---|
| 1030 | yy_cp = ++(yy_c_buf_p);
|
---|
| 1031 | yy_current_state = yy_next_state;
|
---|
| 1032 | goto yy_match;
|
---|
| 1033 | }
|
---|
| 1034 |
|
---|
| 1035 | else
|
---|
| 1036 | {
|
---|
| 1037 | yy_cp = (yy_c_buf_p);
|
---|
| 1038 | goto yy_find_action;
|
---|
| 1039 | }
|
---|
| 1040 | }
|
---|
| 1041 |
|
---|
| 1042 | else switch ( yy_get_next_buffer( ) )
|
---|
| 1043 | {
|
---|
| 1044 | case EOB_ACT_END_OF_FILE:
|
---|
| 1045 | {
|
---|
| 1046 | (yy_did_buffer_switch_on_eof) = 0;
|
---|
| 1047 |
|
---|
| 1048 | if ( yywrap( ) )
|
---|
| 1049 | {
|
---|
| 1050 | /* Note: because we've taken care in
|
---|
| 1051 | * yy_get_next_buffer() to have set up
|
---|
| 1052 | * yytext, we can now set up
|
---|
| 1053 | * yy_c_buf_p so that if some total
|
---|
| 1054 | * hoser (like flex itself) wants to
|
---|
| 1055 | * call the scanner after we return the
|
---|
| 1056 | * YY_NULL, it'll still work - another
|
---|
| 1057 | * YY_NULL will get returned.
|
---|
| 1058 | */
|
---|
| 1059 | (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
|
---|
| 1060 |
|
---|
| 1061 | yy_act = YY_STATE_EOF(YY_START);
|
---|
| 1062 | goto do_action;
|
---|
| 1063 | }
|
---|
| 1064 |
|
---|
| 1065 | else
|
---|
| 1066 | {
|
---|
| 1067 | if ( ! (yy_did_buffer_switch_on_eof) )
|
---|
| 1068 | YY_NEW_FILE;
|
---|
| 1069 | }
|
---|
| 1070 | break;
|
---|
| 1071 | }
|
---|
| 1072 |
|
---|
| 1073 | case EOB_ACT_CONTINUE_SCAN:
|
---|
| 1074 | (yy_c_buf_p) =
|
---|
| 1075 | (yytext_ptr) + yy_amount_of_matched_text;
|
---|
| 1076 |
|
---|
| 1077 | yy_current_state = yy_get_previous_state( );
|
---|
| 1078 |
|
---|
| 1079 | yy_cp = (yy_c_buf_p);
|
---|
| 1080 | yy_bp = (yytext_ptr) + YY_MORE_ADJ;
|
---|
| 1081 | goto yy_match;
|
---|
| 1082 |
|
---|
| 1083 | case EOB_ACT_LAST_MATCH:
|
---|
| 1084 | (yy_c_buf_p) =
|
---|
| 1085 | &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
|
---|
| 1086 |
|
---|
| 1087 | yy_current_state = yy_get_previous_state( );
|
---|
| 1088 |
|
---|
| 1089 | yy_cp = (yy_c_buf_p);
|
---|
| 1090 | yy_bp = (yytext_ptr) + YY_MORE_ADJ;
|
---|
| 1091 | goto yy_find_action;
|
---|
| 1092 | }
|
---|
| 1093 | break;
|
---|
| 1094 | }
|
---|
| 1095 |
|
---|
| 1096 | default:
|
---|
| 1097 | YY_FATAL_ERROR(
|
---|
| 1098 | "fatal flex scanner internal error--no action found" );
|
---|
| 1099 | } /* end of action switch */
|
---|
| 1100 | } /* end of scanning one token */
|
---|
| 1101 | } /* end of yylex */
|
---|
| 1102 |
|
---|
| 1103 | yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout )
|
---|
| 1104 | {
|
---|
| 1105 | yyin = arg_yyin;
|
---|
| 1106 | yyout = arg_yyout;
|
---|
| 1107 | yy_c_buf_p = 0;
|
---|
| 1108 | yy_init = 1;
|
---|
| 1109 | yy_start = 0;
|
---|
| 1110 | yy_flex_debug = 0;
|
---|
| 1111 | yylineno = 1; // this will only get updated if %option yylineno
|
---|
| 1112 |
|
---|
| 1113 | yy_did_buffer_switch_on_eof = 0;
|
---|
| 1114 |
|
---|
| 1115 | yy_looking_for_trail_begin = 0;
|
---|
| 1116 | yy_more_flag = 0;
|
---|
| 1117 | yy_more_len = 0;
|
---|
| 1118 | yy_more_offset = yy_prev_more_offset = 0;
|
---|
| 1119 |
|
---|
| 1120 | yy_start_stack_ptr = yy_start_stack_depth = 0;
|
---|
| 1121 | yy_start_stack = 0;
|
---|
| 1122 |
|
---|
| 1123 | (yy_buffer_stack) = 0;
|
---|
| 1124 | (yy_buffer_stack_top) = 0;
|
---|
| 1125 | (yy_buffer_stack_max) = 0;
|
---|
| 1126 |
|
---|
| 1127 | yy_state_buf = 0;
|
---|
| 1128 |
|
---|
| 1129 | }
|
---|
| 1130 |
|
---|
| 1131 | yyFlexLexer::~yyFlexLexer()
|
---|
| 1132 | {
|
---|
| 1133 | delete [] yy_state_buf;
|
---|
| 1134 | MPQCInfree(yy_start_stack );
|
---|
| 1135 | yy_delete_buffer( YY_CURRENT_BUFFER );
|
---|
| 1136 | }
|
---|
| 1137 |
|
---|
| 1138 | void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out )
|
---|
| 1139 | {
|
---|
| 1140 | if ( new_in )
|
---|
| 1141 | {
|
---|
| 1142 | yy_delete_buffer( YY_CURRENT_BUFFER );
|
---|
| 1143 | yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) );
|
---|
| 1144 | }
|
---|
| 1145 |
|
---|
| 1146 | if ( new_out )
|
---|
| 1147 | yyout = new_out;
|
---|
| 1148 | }
|
---|
| 1149 |
|
---|
| 1150 | #ifdef YY_INTERACTIVE
|
---|
| 1151 | int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )
|
---|
| 1152 | #else
|
---|
| 1153 | int yyFlexLexer::LexerInput( char* buf, int max_size )
|
---|
| 1154 | #endif
|
---|
| 1155 | {
|
---|
| 1156 | if ( yyin->eof() || yyin->fail() )
|
---|
| 1157 | return 0;
|
---|
| 1158 |
|
---|
| 1159 | #ifdef YY_INTERACTIVE
|
---|
| 1160 | yyin->get( buf[0] );
|
---|
| 1161 |
|
---|
| 1162 | if ( yyin->eof() )
|
---|
| 1163 | return 0;
|
---|
| 1164 |
|
---|
| 1165 | if ( yyin->bad() )
|
---|
| 1166 | return -1;
|
---|
| 1167 |
|
---|
| 1168 | return 1;
|
---|
| 1169 |
|
---|
| 1170 | #else
|
---|
| 1171 | (void) yyin->read( buf, max_size );
|
---|
| 1172 |
|
---|
| 1173 | if ( yyin->bad() )
|
---|
| 1174 | return -1;
|
---|
| 1175 | else
|
---|
| 1176 | return yyin->gcount();
|
---|
| 1177 | #endif
|
---|
| 1178 | }
|
---|
| 1179 |
|
---|
| 1180 | void yyFlexLexer::LexerOutput( const char* buf, int size )
|
---|
| 1181 | {
|
---|
| 1182 | (void) yyout->write( buf, size );
|
---|
| 1183 | }
|
---|
| 1184 |
|
---|
| 1185 | /* yy_get_next_buffer - try to read in a new buffer
|
---|
| 1186 | *
|
---|
| 1187 | * Returns a code representing an action:
|
---|
| 1188 | * EOB_ACT_LAST_MATCH -
|
---|
| 1189 | * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
|
---|
| 1190 | * EOB_ACT_END_OF_FILE - end of file
|
---|
| 1191 | */
|
---|
| 1192 | int yyFlexLexer::yy_get_next_buffer()
|
---|
| 1193 | {
|
---|
| 1194 | register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
|
---|
| 1195 | register char *source = (yytext_ptr);
|
---|
| 1196 | register int number_to_move, i;
|
---|
| 1197 | int ret_val;
|
---|
| 1198 |
|
---|
| 1199 | if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
|
---|
| 1200 | YY_FATAL_ERROR(
|
---|
| 1201 | "fatal flex scanner internal error--end of buffer missed" );
|
---|
| 1202 |
|
---|
| 1203 | if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
|
---|
| 1204 | { /* Don't try to fill the buffer, so this is an EOF. */
|
---|
| 1205 | if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
|
---|
| 1206 | {
|
---|
| 1207 | /* We matched a single character, the EOB, so
|
---|
| 1208 | * treat this as a final EOF.
|
---|
| 1209 | */
|
---|
| 1210 | return EOB_ACT_END_OF_FILE;
|
---|
| 1211 | }
|
---|
| 1212 |
|
---|
| 1213 | else
|
---|
| 1214 | {
|
---|
| 1215 | /* We matched some text prior to the EOB, first
|
---|
| 1216 | * process it.
|
---|
| 1217 | */
|
---|
| 1218 | return EOB_ACT_LAST_MATCH;
|
---|
| 1219 | }
|
---|
| 1220 | }
|
---|
| 1221 |
|
---|
| 1222 | /* Try to read more data. */
|
---|
| 1223 |
|
---|
| 1224 | /* First move last chars to start of buffer. */
|
---|
| 1225 | number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
|
---|
| 1226 |
|
---|
| 1227 | for ( i = 0; i < number_to_move; ++i )
|
---|
| 1228 | *(dest++) = *(source++);
|
---|
| 1229 |
|
---|
| 1230 | if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
|
---|
| 1231 | /* don't do the read, it's not guaranteed to return an EOF,
|
---|
| 1232 | * just force an EOF
|
---|
| 1233 | */
|
---|
| 1234 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
|
---|
| 1235 |
|
---|
| 1236 | else
|
---|
| 1237 | {
|
---|
| 1238 | size_t num_to_read =
|
---|
| 1239 | YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
|
---|
| 1240 |
|
---|
| 1241 | while ( num_to_read <= 0 )
|
---|
| 1242 | { /* Not enough room in the buffer - grow it. */
|
---|
| 1243 |
|
---|
| 1244 | /* just a shorter name for the current buffer */
|
---|
| 1245 | YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
|
---|
| 1246 |
|
---|
| 1247 | int yy_c_buf_p_offset =
|
---|
| 1248 | (int) ((yy_c_buf_p) - b->yy_ch_buf);
|
---|
| 1249 |
|
---|
| 1250 | if ( b->yy_is_our_buffer )
|
---|
| 1251 | {
|
---|
| 1252 | int new_size = b->yy_buf_size * 2;
|
---|
| 1253 |
|
---|
| 1254 | if ( new_size <= 0 )
|
---|
| 1255 | b->yy_buf_size += b->yy_buf_size / 8;
|
---|
| 1256 | else
|
---|
| 1257 | b->yy_buf_size *= 2;
|
---|
| 1258 |
|
---|
| 1259 | b->yy_ch_buf = (char *)
|
---|
| 1260 | /* Include room in for 2 EOB chars. */
|
---|
| 1261 | MPQCInrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
|
---|
| 1262 | }
|
---|
| 1263 | else
|
---|
| 1264 | /* Can't grow it, we don't own it. */
|
---|
| 1265 | b->yy_ch_buf = 0;
|
---|
| 1266 |
|
---|
| 1267 | if ( ! b->yy_ch_buf )
|
---|
| 1268 | YY_FATAL_ERROR(
|
---|
| 1269 | "fatal error - scanner input buffer overflow" );
|
---|
| 1270 |
|
---|
| 1271 | (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
|
---|
| 1272 |
|
---|
| 1273 | num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
|
---|
| 1274 | number_to_move - 1;
|
---|
| 1275 |
|
---|
| 1276 | }
|
---|
| 1277 |
|
---|
| 1278 | if ( num_to_read > YY_READ_BUF_SIZE )
|
---|
| 1279 | num_to_read = YY_READ_BUF_SIZE;
|
---|
| 1280 |
|
---|
| 1281 | /* Read in more data. */
|
---|
| 1282 | YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
|
---|
| 1283 | (yy_n_chars), num_to_read );
|
---|
| 1284 |
|
---|
| 1285 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
|
---|
| 1286 | }
|
---|
| 1287 |
|
---|
| 1288 | if ( (yy_n_chars) == 0 )
|
---|
| 1289 | {
|
---|
| 1290 | if ( number_to_move == YY_MORE_ADJ )
|
---|
| 1291 | {
|
---|
| 1292 | ret_val = EOB_ACT_END_OF_FILE;
|
---|
| 1293 | yyrestart( yyin );
|
---|
| 1294 | }
|
---|
| 1295 |
|
---|
| 1296 | else
|
---|
| 1297 | {
|
---|
| 1298 | ret_val = EOB_ACT_LAST_MATCH;
|
---|
| 1299 | YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
|
---|
| 1300 | YY_BUFFER_EOF_PENDING;
|
---|
| 1301 | }
|
---|
| 1302 | }
|
---|
| 1303 |
|
---|
| 1304 | else
|
---|
| 1305 | ret_val = EOB_ACT_CONTINUE_SCAN;
|
---|
| 1306 |
|
---|
| 1307 | (yy_n_chars) += number_to_move;
|
---|
| 1308 | YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
|
---|
| 1309 | YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
|
---|
| 1310 |
|
---|
| 1311 | (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
|
---|
| 1312 |
|
---|
| 1313 | return ret_val;
|
---|
| 1314 | }
|
---|
| 1315 |
|
---|
| 1316 | /* yy_get_previous_state - get the state just before the EOB char was reached */
|
---|
| 1317 |
|
---|
| 1318 | yy_state_type yyFlexLexer::yy_get_previous_state()
|
---|
| 1319 | {
|
---|
| 1320 | register yy_state_type yy_current_state;
|
---|
| 1321 | register char *yy_cp;
|
---|
| 1322 |
|
---|
| 1323 | yy_current_state = (yy_start);
|
---|
| 1324 |
|
---|
| 1325 | for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
|
---|
| 1326 | {
|
---|
| 1327 | register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
|
---|
| 1328 | if ( yy_accept[yy_current_state] )
|
---|
| 1329 | {
|
---|
| 1330 | (yy_last_accepting_state) = yy_current_state;
|
---|
| 1331 | (yy_last_accepting_cpos) = yy_cp;
|
---|
| 1332 | }
|
---|
| 1333 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
|
---|
| 1334 | {
|
---|
| 1335 | yy_current_state = (int) yy_def[yy_current_state];
|
---|
| 1336 | if ( yy_current_state >= 204 )
|
---|
| 1337 | yy_c = yy_meta[(unsigned int) yy_c];
|
---|
| 1338 | }
|
---|
| 1339 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
|
---|
| 1340 | }
|
---|
| 1341 |
|
---|
| 1342 | return yy_current_state;
|
---|
| 1343 | }
|
---|
| 1344 |
|
---|
| 1345 | /* yy_try_NUL_trans - try to make a transition on the NUL character
|
---|
| 1346 | *
|
---|
| 1347 | * synopsis
|
---|
| 1348 | * next_state = yy_try_NUL_trans( current_state );
|
---|
| 1349 | */
|
---|
| 1350 | yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )
|
---|
| 1351 | {
|
---|
| 1352 | register int yy_is_jam;
|
---|
| 1353 | register char *yy_cp = (yy_c_buf_p);
|
---|
| 1354 |
|
---|
| 1355 | register YY_CHAR yy_c = 1;
|
---|
| 1356 | if ( yy_accept[yy_current_state] )
|
---|
| 1357 | {
|
---|
| 1358 | (yy_last_accepting_state) = yy_current_state;
|
---|
| 1359 | (yy_last_accepting_cpos) = yy_cp;
|
---|
| 1360 | }
|
---|
| 1361 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
|
---|
| 1362 | {
|
---|
| 1363 | yy_current_state = (int) yy_def[yy_current_state];
|
---|
| 1364 | if ( yy_current_state >= 204 )
|
---|
| 1365 | yy_c = yy_meta[(unsigned int) yy_c];
|
---|
| 1366 | }
|
---|
| 1367 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
|
---|
| 1368 | yy_is_jam = (yy_current_state == 203);
|
---|
| 1369 |
|
---|
| 1370 | return yy_is_jam ? 0 : yy_current_state;
|
---|
| 1371 | }
|
---|
| 1372 |
|
---|
| 1373 | void yyFlexLexer::yyunput( int c, register char* yy_bp)
|
---|
| 1374 | {
|
---|
| 1375 | register char *yy_cp;
|
---|
| 1376 |
|
---|
| 1377 | yy_cp = (yy_c_buf_p);
|
---|
| 1378 |
|
---|
| 1379 | /* undo effects of setting up yytext */
|
---|
| 1380 | *yy_cp = (yy_hold_char);
|
---|
| 1381 |
|
---|
| 1382 | if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
|
---|
| 1383 | { /* need to shift things up to make room */
|
---|
| 1384 | /* +2 for EOB chars. */
|
---|
| 1385 | register int number_to_move = (yy_n_chars) + 2;
|
---|
| 1386 | register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
|
---|
| 1387 | YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
|
---|
| 1388 | register char *source =
|
---|
| 1389 | &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
|
---|
| 1390 |
|
---|
| 1391 | while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
|
---|
| 1392 | *--dest = *--source;
|
---|
| 1393 |
|
---|
| 1394 | yy_cp += (int) (dest - source);
|
---|
| 1395 | yy_bp += (int) (dest - source);
|
---|
| 1396 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
|
---|
| 1397 | (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
|
---|
| 1398 |
|
---|
| 1399 | if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
|
---|
| 1400 | YY_FATAL_ERROR( "flex scanner push-back overflow" );
|
---|
| 1401 | }
|
---|
| 1402 |
|
---|
| 1403 | *--yy_cp = (char) c;
|
---|
| 1404 |
|
---|
| 1405 | if ( c == '\n' ){
|
---|
| 1406 | --yylineno;
|
---|
| 1407 | }
|
---|
| 1408 |
|
---|
| 1409 | (yytext_ptr) = yy_bp;
|
---|
| 1410 | (yy_hold_char) = *yy_cp;
|
---|
| 1411 | (yy_c_buf_p) = yy_cp;
|
---|
| 1412 | }
|
---|
| 1413 |
|
---|
| 1414 | int yyFlexLexer::yyinput()
|
---|
| 1415 | {
|
---|
| 1416 | int c;
|
---|
| 1417 |
|
---|
| 1418 | *(yy_c_buf_p) = (yy_hold_char);
|
---|
| 1419 |
|
---|
| 1420 | if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
|
---|
| 1421 | {
|
---|
| 1422 | /* yy_c_buf_p now points to the character we want to return.
|
---|
| 1423 | * If this occurs *before* the EOB characters, then it's a
|
---|
| 1424 | * valid NUL; if not, then we've hit the end of the buffer.
|
---|
| 1425 | */
|
---|
| 1426 | if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
|
---|
| 1427 | /* This was really a NUL. */
|
---|
| 1428 | *(yy_c_buf_p) = '\0';
|
---|
| 1429 |
|
---|
| 1430 | else
|
---|
| 1431 | { /* need more input */
|
---|
| 1432 | int offset = (yy_c_buf_p) - (yytext_ptr);
|
---|
| 1433 | ++(yy_c_buf_p);
|
---|
| 1434 |
|
---|
| 1435 | switch ( yy_get_next_buffer( ) )
|
---|
| 1436 | {
|
---|
| 1437 | case EOB_ACT_LAST_MATCH:
|
---|
| 1438 | /* This happens because yy_g_n_b()
|
---|
| 1439 | * sees that we've accumulated a
|
---|
| 1440 | * token and flags that we need to
|
---|
| 1441 | * try matching the token before
|
---|
| 1442 | * proceeding. But for input(),
|
---|
| 1443 | * there's no matching to consider.
|
---|
| 1444 | * So convert the EOB_ACT_LAST_MATCH
|
---|
| 1445 | * to EOB_ACT_END_OF_FILE.
|
---|
| 1446 | */
|
---|
| 1447 |
|
---|
| 1448 | /* Reset buffer status. */
|
---|
| 1449 | yyrestart( yyin );
|
---|
| 1450 |
|
---|
| 1451 | /*FALLTHROUGH*/
|
---|
| 1452 |
|
---|
| 1453 | case EOB_ACT_END_OF_FILE:
|
---|
| 1454 | {
|
---|
| 1455 | if ( yywrap( ) )
|
---|
| 1456 | return EOF;
|
---|
| 1457 |
|
---|
| 1458 | if ( ! (yy_did_buffer_switch_on_eof) )
|
---|
| 1459 | YY_NEW_FILE;
|
---|
| 1460 | #ifdef __cplusplus
|
---|
| 1461 | return yyinput();
|
---|
| 1462 | #else
|
---|
| 1463 | return input();
|
---|
| 1464 | #endif
|
---|
| 1465 | }
|
---|
| 1466 |
|
---|
| 1467 | case EOB_ACT_CONTINUE_SCAN:
|
---|
| 1468 | (yy_c_buf_p) = (yytext_ptr) + offset;
|
---|
| 1469 | break;
|
---|
| 1470 | }
|
---|
| 1471 | }
|
---|
| 1472 | }
|
---|
| 1473 |
|
---|
| 1474 | c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
|
---|
| 1475 | *(yy_c_buf_p) = '\0'; /* preserve yytext */
|
---|
| 1476 | (yy_hold_char) = *++(yy_c_buf_p);
|
---|
| 1477 |
|
---|
| 1478 | if ( c == '\n' )
|
---|
| 1479 |
|
---|
| 1480 | yylineno++;
|
---|
| 1481 | ;
|
---|
| 1482 |
|
---|
| 1483 | return c;
|
---|
| 1484 | }
|
---|
| 1485 |
|
---|
| 1486 | /** Immediately switch to a different input stream.
|
---|
| 1487 | * @param input_file A readable stream.
|
---|
| 1488 | *
|
---|
| 1489 | * @note This function does not reset the start condition to @c INITIAL .
|
---|
| 1490 | */
|
---|
| 1491 | void yyFlexLexer::yyrestart( std::istream* input_file )
|
---|
| 1492 | {
|
---|
| 1493 |
|
---|
| 1494 | if ( ! YY_CURRENT_BUFFER ){
|
---|
| 1495 | yyensure_buffer_stack ();
|
---|
| 1496 | YY_CURRENT_BUFFER_LVALUE =
|
---|
| 1497 | yy_create_buffer( yyin, YY_BUF_SIZE );
|
---|
| 1498 | }
|
---|
| 1499 |
|
---|
| 1500 | yy_init_buffer( YY_CURRENT_BUFFER, input_file );
|
---|
| 1501 | yy_load_buffer_state( );
|
---|
| 1502 | }
|
---|
| 1503 |
|
---|
| 1504 | /** Switch to a different input buffer.
|
---|
| 1505 | * @param new_buffer The new input buffer.
|
---|
| 1506 | *
|
---|
| 1507 | */
|
---|
| 1508 | void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
|
---|
| 1509 | {
|
---|
| 1510 |
|
---|
| 1511 | /* TODO. We should be able to replace this entire function body
|
---|
| 1512 | * with
|
---|
| 1513 | * yypop_buffer_state();
|
---|
| 1514 | * yypush_buffer_state(new_buffer);
|
---|
| 1515 | */
|
---|
| 1516 | yyensure_buffer_stack ();
|
---|
| 1517 | if ( YY_CURRENT_BUFFER == new_buffer )
|
---|
| 1518 | return;
|
---|
| 1519 |
|
---|
| 1520 | if ( YY_CURRENT_BUFFER )
|
---|
| 1521 | {
|
---|
| 1522 | /* Flush out information for old buffer. */
|
---|
| 1523 | *(yy_c_buf_p) = (yy_hold_char);
|
---|
| 1524 | YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
|
---|
| 1525 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
|
---|
| 1526 | }
|
---|
| 1527 |
|
---|
| 1528 | YY_CURRENT_BUFFER_LVALUE = new_buffer;
|
---|
| 1529 | yy_load_buffer_state( );
|
---|
| 1530 |
|
---|
| 1531 | /* We don't actually know whether we did this switch during
|
---|
| 1532 | * EOF (yywrap()) processing, but the only time this flag
|
---|
| 1533 | * is looked at is after yywrap() is called, so it's safe
|
---|
| 1534 | * to go ahead and always set it.
|
---|
| 1535 | */
|
---|
| 1536 | (yy_did_buffer_switch_on_eof) = 1;
|
---|
| 1537 | }
|
---|
| 1538 |
|
---|
| 1539 | void yyFlexLexer::yy_load_buffer_state()
|
---|
| 1540 | {
|
---|
| 1541 | (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
|
---|
| 1542 | (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
|
---|
| 1543 | yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
|
---|
| 1544 | (yy_hold_char) = *(yy_c_buf_p);
|
---|
| 1545 | }
|
---|
| 1546 |
|
---|
| 1547 | /** Allocate and initialize an input buffer state.
|
---|
| 1548 | * @param file A readable stream.
|
---|
| 1549 | * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
|
---|
| 1550 | *
|
---|
| 1551 | * @return the allocated buffer state.
|
---|
| 1552 | */
|
---|
| 1553 | YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size )
|
---|
| 1554 | {
|
---|
| 1555 | YY_BUFFER_STATE b;
|
---|
| 1556 |
|
---|
| 1557 | b = (YY_BUFFER_STATE) MPQCInalloc(sizeof( struct yy_buffer_state ) );
|
---|
| 1558 | if ( ! b )
|
---|
| 1559 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
|
---|
| 1560 |
|
---|
| 1561 | b->yy_buf_size = size;
|
---|
| 1562 |
|
---|
| 1563 | /* yy_ch_buf has to be 2 characters longer than the size given because
|
---|
| 1564 | * we need to put in 2 end-of-buffer characters.
|
---|
| 1565 | */
|
---|
| 1566 | b->yy_ch_buf = (char *) MPQCInalloc(b->yy_buf_size + 2 );
|
---|
| 1567 | if ( ! b->yy_ch_buf )
|
---|
| 1568 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
|
---|
| 1569 |
|
---|
| 1570 | b->yy_is_our_buffer = 1;
|
---|
| 1571 |
|
---|
| 1572 | yy_init_buffer( b, file );
|
---|
| 1573 |
|
---|
| 1574 | return b;
|
---|
| 1575 | }
|
---|
| 1576 |
|
---|
| 1577 | /** Destroy the buffer.
|
---|
| 1578 | * @param b a buffer created with yy_create_buffer()
|
---|
| 1579 | *
|
---|
| 1580 | */
|
---|
| 1581 | void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )
|
---|
| 1582 | {
|
---|
| 1583 |
|
---|
| 1584 | if ( ! b )
|
---|
| 1585 | return;
|
---|
| 1586 |
|
---|
| 1587 | if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
|
---|
| 1588 | YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
|
---|
| 1589 |
|
---|
| 1590 | if ( b->yy_is_our_buffer )
|
---|
| 1591 | MPQCInfree((void *) b->yy_ch_buf );
|
---|
| 1592 |
|
---|
| 1593 | MPQCInfree((void *) b );
|
---|
| 1594 | }
|
---|
| 1595 |
|
---|
| 1596 |
|
---|
| 1597 | /* Initializes or reinitializes a buffer.
|
---|
| 1598 | * This function is sometimes called more than once on the same buffer,
|
---|
| 1599 | * such as during a yyrestart() or at EOF.
|
---|
| 1600 | */
|
---|
| 1601 | void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream* file )
|
---|
| 1602 |
|
---|
| 1603 | {
|
---|
| 1604 | int oerrno = errno;
|
---|
| 1605 |
|
---|
| 1606 | yy_flush_buffer( b );
|
---|
| 1607 |
|
---|
| 1608 | b->yy_input_file = file;
|
---|
| 1609 | b->yy_fill_buffer = 1;
|
---|
| 1610 |
|
---|
| 1611 | /* If b is the current buffer, then yy_init_buffer was _probably_
|
---|
| 1612 | * called from yyrestart() or through yy_get_next_buffer.
|
---|
| 1613 | * In that case, we don't want to reset the lineno or column.
|
---|
| 1614 | */
|
---|
| 1615 | if (b != YY_CURRENT_BUFFER){
|
---|
| 1616 | b->yy_bs_lineno = 1;
|
---|
| 1617 | b->yy_bs_column = 0;
|
---|
| 1618 | }
|
---|
| 1619 |
|
---|
| 1620 | b->yy_is_interactive = 0;
|
---|
| 1621 | errno = oerrno;
|
---|
| 1622 | }
|
---|
| 1623 |
|
---|
| 1624 | /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
|
---|
| 1625 | * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
|
---|
| 1626 | *
|
---|
| 1627 | */
|
---|
| 1628 | void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b )
|
---|
| 1629 | {
|
---|
| 1630 | if ( ! b )
|
---|
| 1631 | return;
|
---|
| 1632 |
|
---|
| 1633 | b->yy_n_chars = 0;
|
---|
| 1634 |
|
---|
| 1635 | /* We always need two end-of-buffer characters. The first causes
|
---|
| 1636 | * a transition to the end-of-buffer state. The second causes
|
---|
| 1637 | * a jam in that state.
|
---|
| 1638 | */
|
---|
| 1639 | b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
|
---|
| 1640 | b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
|
---|
| 1641 |
|
---|
| 1642 | b->yy_buf_pos = &b->yy_ch_buf[0];
|
---|
| 1643 |
|
---|
| 1644 | b->yy_at_bol = 1;
|
---|
| 1645 | b->yy_buffer_status = YY_BUFFER_NEW;
|
---|
| 1646 |
|
---|
| 1647 | if ( b == YY_CURRENT_BUFFER )
|
---|
| 1648 | yy_load_buffer_state( );
|
---|
| 1649 | }
|
---|
| 1650 |
|
---|
| 1651 | /** Pushes the new state onto the stack. The new state becomes
|
---|
| 1652 | * the current state. This function will allocate the stack
|
---|
| 1653 | * if necessary.
|
---|
| 1654 | * @param new_buffer The new state.
|
---|
| 1655 | *
|
---|
| 1656 | */
|
---|
| 1657 | void yyFlexLexer::yypush_buffer_state (YY_BUFFER_STATE new_buffer)
|
---|
| 1658 | {
|
---|
| 1659 | if (new_buffer == NULL)
|
---|
| 1660 | return;
|
---|
| 1661 |
|
---|
| 1662 | yyensure_buffer_stack();
|
---|
| 1663 |
|
---|
| 1664 | /* This block is copied from yy_switch_to_buffer. */
|
---|
| 1665 | if ( YY_CURRENT_BUFFER )
|
---|
| 1666 | {
|
---|
| 1667 | /* Flush out information for old buffer. */
|
---|
| 1668 | *(yy_c_buf_p) = (yy_hold_char);
|
---|
| 1669 | YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
|
---|
| 1670 | YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
|
---|
| 1671 | }
|
---|
| 1672 |
|
---|
| 1673 | /* Only push if top exists. Otherwise, replace top. */
|
---|
| 1674 | if (YY_CURRENT_BUFFER)
|
---|
| 1675 | (yy_buffer_stack_top)++;
|
---|
| 1676 | YY_CURRENT_BUFFER_LVALUE = new_buffer;
|
---|
| 1677 |
|
---|
| 1678 | /* copied from yy_switch_to_buffer. */
|
---|
| 1679 | yy_load_buffer_state( );
|
---|
| 1680 | (yy_did_buffer_switch_on_eof) = 1;
|
---|
| 1681 | }
|
---|
| 1682 |
|
---|
| 1683 | /** Removes and deletes the top of the stack, if present.
|
---|
| 1684 | * The next element becomes the new top.
|
---|
| 1685 | *
|
---|
| 1686 | */
|
---|
| 1687 | void yyFlexLexer::yypop_buffer_state (void)
|
---|
| 1688 | {
|
---|
| 1689 | if (!YY_CURRENT_BUFFER)
|
---|
| 1690 | return;
|
---|
| 1691 |
|
---|
| 1692 | yy_delete_buffer(YY_CURRENT_BUFFER );
|
---|
| 1693 | YY_CURRENT_BUFFER_LVALUE = NULL;
|
---|
| 1694 | if ((yy_buffer_stack_top) > 0)
|
---|
| 1695 | --(yy_buffer_stack_top);
|
---|
| 1696 |
|
---|
| 1697 | if (YY_CURRENT_BUFFER) {
|
---|
| 1698 | yy_load_buffer_state( );
|
---|
| 1699 | (yy_did_buffer_switch_on_eof) = 1;
|
---|
| 1700 | }
|
---|
| 1701 | }
|
---|
| 1702 |
|
---|
| 1703 | /* Allocates the stack if it does not exist.
|
---|
| 1704 | * Guarantees space for at least one push.
|
---|
| 1705 | */
|
---|
| 1706 | void yyFlexLexer::yyensure_buffer_stack(void)
|
---|
| 1707 | {
|
---|
| 1708 | int num_to_alloc;
|
---|
| 1709 |
|
---|
| 1710 | if (!(yy_buffer_stack)) {
|
---|
| 1711 |
|
---|
| 1712 | /* First allocation is just for 2 elements, since we don't know if this
|
---|
| 1713 | * scanner will even need a stack. We use 2 instead of 1 to avoid an
|
---|
| 1714 | * immediate realloc on the next call.
|
---|
| 1715 | */
|
---|
| 1716 | num_to_alloc = 1;
|
---|
| 1717 | (yy_buffer_stack) = (struct yy_buffer_state**)MPQCInalloc
|
---|
| 1718 | (num_to_alloc * sizeof(struct yy_buffer_state*)
|
---|
| 1719 | );
|
---|
| 1720 |
|
---|
| 1721 | memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
|
---|
| 1722 |
|
---|
| 1723 | (yy_buffer_stack_max) = num_to_alloc;
|
---|
| 1724 | (yy_buffer_stack_top) = 0;
|
---|
| 1725 | return;
|
---|
| 1726 | }
|
---|
| 1727 |
|
---|
| 1728 | if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
|
---|
| 1729 |
|
---|
| 1730 | /* Increase the buffer to prepare for a possible push. */
|
---|
| 1731 | int grow_size = 8 /* arbitrary grow size */;
|
---|
| 1732 |
|
---|
| 1733 | num_to_alloc = (yy_buffer_stack_max) + grow_size;
|
---|
| 1734 | (yy_buffer_stack) = (struct yy_buffer_state**)MPQCInrealloc
|
---|
| 1735 | ((yy_buffer_stack),
|
---|
| 1736 | num_to_alloc * sizeof(struct yy_buffer_state*)
|
---|
| 1737 | );
|
---|
| 1738 |
|
---|
| 1739 | /* zero only the new slots.*/
|
---|
| 1740 | memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
|
---|
| 1741 | (yy_buffer_stack_max) = num_to_alloc;
|
---|
| 1742 | }
|
---|
| 1743 | }
|
---|
| 1744 |
|
---|
| 1745 | void yyFlexLexer::yy_push_state( int new_state )
|
---|
| 1746 | {
|
---|
| 1747 | if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
|
---|
| 1748 | {
|
---|
| 1749 | yy_size_t new_size;
|
---|
| 1750 |
|
---|
| 1751 | (yy_start_stack_depth) += YY_START_STACK_INCR;
|
---|
| 1752 | new_size = (yy_start_stack_depth) * sizeof( int );
|
---|
| 1753 |
|
---|
| 1754 | if ( ! (yy_start_stack) )
|
---|
| 1755 | (yy_start_stack) = (int *) MPQCInalloc(new_size );
|
---|
| 1756 |
|
---|
| 1757 | else
|
---|
| 1758 | (yy_start_stack) = (int *) MPQCInrealloc((void *) (yy_start_stack),new_size );
|
---|
| 1759 |
|
---|
| 1760 | if ( ! (yy_start_stack) )
|
---|
| 1761 | YY_FATAL_ERROR(
|
---|
| 1762 | "out of memory expanding start-condition stack" );
|
---|
| 1763 | }
|
---|
| 1764 |
|
---|
| 1765 | (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
|
---|
| 1766 |
|
---|
| 1767 | BEGIN(new_state);
|
---|
| 1768 | }
|
---|
| 1769 |
|
---|
| 1770 | void yyFlexLexer::yy_pop_state()
|
---|
| 1771 | {
|
---|
| 1772 | if ( --(yy_start_stack_ptr) < 0 )
|
---|
| 1773 | YY_FATAL_ERROR( "start-condition stack underflow" );
|
---|
| 1774 |
|
---|
| 1775 | BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
|
---|
| 1776 | }
|
---|
| 1777 |
|
---|
| 1778 | int yyFlexLexer::yy_top_state()
|
---|
| 1779 | {
|
---|
| 1780 | return (yy_start_stack)[(yy_start_stack_ptr) - 1];
|
---|
| 1781 | }
|
---|
| 1782 |
|
---|
| 1783 | #ifndef YY_EXIT_FAILURE
|
---|
| 1784 | #define YY_EXIT_FAILURE 2
|
---|
| 1785 | #endif
|
---|
| 1786 |
|
---|
| 1787 | void yyFlexLexer::LexerError( yyconst char msg[] )
|
---|
| 1788 | {
|
---|
| 1789 | std::cerr << msg << std::endl;
|
---|
| 1790 | exit( YY_EXIT_FAILURE );
|
---|
| 1791 | }
|
---|
| 1792 |
|
---|
| 1793 | /* Redefine yyless() so it works in section 3 code. */
|
---|
| 1794 |
|
---|
| 1795 | #undef yyless
|
---|
| 1796 | #define yyless(n) \
|
---|
| 1797 | do \
|
---|
| 1798 | { \
|
---|
| 1799 | /* Undo effects of setting up yytext. */ \
|
---|
| 1800 | int yyless_macro_arg = (n); \
|
---|
| 1801 | YY_LESS_LINENO(yyless_macro_arg);\
|
---|
| 1802 | yytext[yyleng] = (yy_hold_char); \
|
---|
| 1803 | (yy_c_buf_p) = yytext + yyless_macro_arg; \
|
---|
| 1804 | (yy_hold_char) = *(yy_c_buf_p); \
|
---|
| 1805 | *(yy_c_buf_p) = '\0'; \
|
---|
| 1806 | yyleng = yyless_macro_arg; \
|
---|
| 1807 | } \
|
---|
| 1808 | while ( 0 )
|
---|
| 1809 |
|
---|
| 1810 | /* Accessor methods (get/set functions) to struct members. */
|
---|
| 1811 |
|
---|
| 1812 | /*
|
---|
| 1813 | * Internal utility routines.
|
---|
| 1814 | */
|
---|
| 1815 |
|
---|
| 1816 | #ifndef yytext_ptr
|
---|
| 1817 | static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
|
---|
| 1818 | {
|
---|
| 1819 | register int i;
|
---|
| 1820 | for ( i = 0; i < n; ++i )
|
---|
| 1821 | s1[i] = s2[i];
|
---|
| 1822 | }
|
---|
| 1823 | #endif
|
---|
| 1824 |
|
---|
| 1825 | #ifdef YY_NEED_STRLEN
|
---|
| 1826 | static int yy_flex_strlen (yyconst char * s )
|
---|
| 1827 | {
|
---|
| 1828 | register int n;
|
---|
| 1829 | for ( n = 0; s[n]; ++n )
|
---|
| 1830 | ;
|
---|
| 1831 |
|
---|
| 1832 | return n;
|
---|
| 1833 | }
|
---|
| 1834 | #endif
|
---|
| 1835 |
|
---|
| 1836 | void *MPQCInalloc (yy_size_t size )
|
---|
| 1837 | {
|
---|
| 1838 | return (void *) malloc( size );
|
---|
| 1839 | }
|
---|
| 1840 |
|
---|
| 1841 | void *MPQCInrealloc (void * ptr, yy_size_t size )
|
---|
| 1842 | {
|
---|
| 1843 | /* The cast to (char *) in the following accommodates both
|
---|
| 1844 | * implementations that use char* generic pointers, and those
|
---|
| 1845 | * that use void* generic pointers. It works with the latter
|
---|
| 1846 | * because both ANSI C and C++ allow castless assignment from
|
---|
| 1847 | * any pointer type to void*, and deal with argument conversions
|
---|
| 1848 | * as though doing an assignment.
|
---|
| 1849 | */
|
---|
| 1850 | return (void *) realloc( (char *) ptr, size );
|
---|
| 1851 | }
|
---|
| 1852 |
|
---|
| 1853 | void MPQCInfree (void * ptr )
|
---|
| 1854 | {
|
---|
| 1855 | free( (char *) ptr ); /* see MPQCInrealloc() for (char *) cast */
|
---|
| 1856 | }
|
---|
| 1857 |
|
---|
| 1858 | #define YYTABLES_NAME "yytables"
|
---|
| 1859 |
|
---|
| 1860 | #undef YY_NEW_FILE
|
---|
| 1861 | #undef YY_FLUSH_BUFFER
|
---|
| 1862 | #undef yy_set_bol
|
---|
| 1863 | #undef yy_new_buffer
|
---|
| 1864 | #undef yy_set_interactive
|
---|
| 1865 | #undef yytext_ptr
|
---|
| 1866 | #undef YY_DO_BEFORE_ACTION
|
---|
| 1867 |
|
---|
| 1868 | #ifdef YY_DECL_IS_OURS
|
---|
| 1869 | #undef YY_DECL_IS_OURS
|
---|
| 1870 | #undef YY_DECL
|
---|
| 1871 | #endif
|
---|
| 1872 |
|
---|
| 1873 | int
|
---|
| 1874 | MPQCInwrap()
|
---|
| 1875 | {
|
---|
| 1876 | return 1;
|
---|
| 1877 | }
|
---|
| 1878 |
|
---|