1 /* A lexical scanner for NetHack generated by flex */
3 /* Scanner skeleton version:
4 * flexhack.skl 3.3.0 (from .../flex/RCS/flex.skl,v 2.85 95/04/24 10:48:47)
6 #define FLEXHACK_SCANNER
7 #define YY_FLEX_MAJOR_VERSION 2
8 #define YY_FLEX_MINOR_VERSION 5
11 #define yyconst const /* some code inserted by flex will refer to yyconst */
13 /* Returned upon end-of-file. */
16 /* Promotes a possibly negative, possibly signed char to an unsigned
17 * integer for use as an array index. If the signed char is negative,
18 * we want to instead treat it as an 8-bit unsigned char, hence the
21 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
23 /* Enter a start condition. This macro really ought to take a parameter,
24 * but we do it the disgusting crufty way forced on us by the ()-less
25 * definition of BEGIN.
27 #define BEGIN yy_start = 1 + 2 *
29 /* Translate the current start state into a value that can be later handed
30 * to BEGIN to return to the state. The YYSTATE alias is for lex
33 #define YY_START ((yy_start - 1) / 2)
34 #define YYSTATE YY_START
36 /* Action number for EOF rule of a given start state. */
37 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
39 /* Special action meaning "start processing a new file". */
40 #define YY_NEW_FILE yyrestart( yyin )
42 #define YY_END_OF_BUFFER_CHAR 0
44 /* Size of default input buffer. */
45 #define YY_BUF_SIZE 16384
47 typedef struct yy_buffer_state *YY_BUFFER_STATE;
50 extern FILE *yyin, *yyout;
52 #define EOB_ACT_CONTINUE_SCAN 0
53 #define EOB_ACT_END_OF_FILE 1
54 #define EOB_ACT_LAST_MATCH 2
56 /* Return all but the first 'n' matched characters back to the input stream. */
60 /* Undo effects of setting up yytext. */ \
61 *yy_cp = yy_hold_char; \
62 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
63 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
67 #define unput(c) yyunput( c, yytext_ptr )
69 /* The following is because we cannot portably get our hands on size_t
70 * (without autoconf's help, which isn't available because we want
71 * flex-generated scanners to compile on their own).
73 typedef unsigned int yy_size_t;
76 struct yy_buffer_state
80 char *yy_ch_buf; /* input buffer */
81 char *yy_buf_pos; /* current position in input buffer */
83 /* Size of input buffer in bytes, not including room for EOB
86 yy_size_t yy_buf_size;
88 /* Number of characters read into yy_ch_buf, not including EOB
93 /* Whether we "own" the buffer - i.e., we know we created it,
94 * and can realloc() it to grow it, and should free() it to
99 /* Whether this is an "interactive" input source; if so, and
100 * if we're using stdio for input, then we want to use getc()
101 * instead of fread(), to make sure we stop fetching input after
104 int yy_is_interactive;
106 /* Whether we're considered to be at the beginning of a line.
107 * If so, '^' rules will be active on the next match, otherwise
112 /* Whether to try to fill the input buffer when we reach the
117 int yy_buffer_status;
118 #define YY_BUFFER_NEW 0
119 #define YY_BUFFER_NORMAL 1
120 /* When an EOF's been seen but there's still some text to process
121 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
122 * shouldn't try reading from the input source any more. We might
123 * still have a bunch of tokens to match, though, because of
124 * possible backing-up.
126 * When we actually see the EOF, we change the status to "new"
127 * (via yyrestart()), so that the user can continue scanning by
128 * just pointing yyin at a new input file.
130 #define YY_BUFFER_EOF_PENDING 2
133 static YY_BUFFER_STATE yy_current_buffer = 0;
135 /* We provide macros for accessing buffer states in case in the
136 * future we want to put the buffer states in a more general
139 #define YY_CURRENT_BUFFER yy_current_buffer
141 /* yy_hold_char holds the character lost when yytext is formed. */
142 static char yy_hold_char;
144 static int yy_n_chars; /* number of characters read into yy_ch_buf */
148 /* Points to current character in buffer. */
149 static char *yy_c_buf_p = (char *) 0;
150 static int yy_init = 1; /* whether we need to initialize */
151 static int yy_start = 0; /* start state number */
153 /* Flag which is used to allow yywrap()'s to do buffer switches
154 * instead of setting up a fresh yyin. A bit of a hack ...
156 static int yy_did_buffer_switch_on_eof;
158 void FDECL(yyrestart, (FILE *));
160 void FDECL(yy_switch_to_buffer, (YY_BUFFER_STATE));
161 void NDECL(yy_load_buffer_state);
162 YY_BUFFER_STATE FDECL(yy_create_buffer, (FILE *,int));
163 void FDECL(yy_delete_buffer, (YY_BUFFER_STATE));
164 void FDECL(yy_init_buffer, (YY_BUFFER_STATE,FILE *));
165 void FDECL(yy_flush_buffer, (YY_BUFFER_STATE));
166 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
168 static genericptr_t FDECL(yy_flex_alloc, (yy_size_t));
169 static genericptr_t FDECL(yy_flex_realloc2, (genericptr_t,yy_size_t,int));
170 static void FDECL(yy_flex_free, (genericptr_t));
172 #define yy_new_buffer yy_create_buffer
174 #define yy_set_interactive(is_interactive) \
176 if ( ! yy_current_buffer ) \
177 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
178 yy_current_buffer->yy_is_interactive = is_interactive; \
181 #define yy_set_bol(at_bol) \
183 if ( ! yy_current_buffer ) \
184 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
185 yy_current_buffer->yy_at_bol = at_bol; \
188 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
190 typedef unsigned char YY_CHAR;
191 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
192 typedef int yy_state_type;
194 #define yytext_ptr yytext
196 static yy_state_type NDECL(yy_get_previous_state);
197 static yy_state_type FDECL(yy_try_NUL_trans, (yy_state_type));
198 static int NDECL(yy_get_next_buffer);
199 static void FDECL(yy_fatal_error, (const char *));
201 /* Done after the current pattern has been matched and before the
202 * corresponding action - sets up yytext.
204 #define YY_DO_BEFORE_ACTION \
205 yytext_ptr = yy_bp; \
206 yyleng = (int) (yy_cp - yy_bp); \
207 yy_hold_char = *yy_cp; \
211 #define YY_NUM_RULES 112
212 #define YY_END_OF_BUFFER 113
213 static yyconst short int yy_accept[640] =
215 0, 0, 0, 0, 113, 111, 108, 107, 111, 111,
216 111, 111, 105, 4, 111, 111, 111, 111, 111, 111,
217 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
218 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
219 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
220 111, 2, 111, 108, 111, 111, 105, 111, 111, 111,
221 111, 111, 111, 111, 111, 111, 111, 111, 111, 108,
222 107, 0, 106, 0, 0, 105, 0, 0, 0, 0,
223 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
224 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
226 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
227 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
228 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
229 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
230 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
231 87, 0, 0, 3, 0, 2, 2, 0, 108, 0,
232 105, 0, 0, 0, 0, 0, 0, 0, 0, 2,
233 0, 0, 110, 0, 110, 0, 0, 0, 0, 0,
234 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
235 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
237 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
238 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
239 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
240 0, 0, 0, 72, 0, 0, 67, 0, 0, 0,
241 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
242 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
243 65, 0, 0, 0, 0, 0, 0, 0, 0, 0,
244 0, 0, 0, 109, 0, 0, 0, 0, 0, 17,
245 0, 0, 0, 0, 0, 40, 0, 0, 0, 6,
246 0, 0, 42, 0, 0, 0, 33, 0, 0, 0,
248 36, 32, 0, 0, 0, 16, 0, 0, 104, 0,
249 0, 0, 0, 0, 0, 0, 0, 93, 0, 0,
250 0, 0, 0, 0, 88, 91, 51, 0, 0, 0,
251 0, 0, 0, 60, 0, 0, 0, 0, 0, 94,
252 0, 0, 0, 0, 0, 0, 55, 0, 0, 0,
253 45, 0, 0, 0, 0, 0, 0, 0, 0, 90,
254 0, 0, 0, 53, 12, 0, 0, 0, 0, 0,
255 25, 0, 0, 0, 0, 0, 0, 10, 0, 0,
256 0, 0, 8, 0, 0, 0, 7, 0, 0, 0,
257 0, 0, 0, 27, 0, 0, 0, 59, 86, 0,
259 0, 80, 0, 0, 0, 0, 74, 0, 0, 0,
260 0, 0, 89, 0, 0, 0, 0, 0, 0, 0,
261 0, 0, 0, 0, 0, 0, 0, 0, 50, 0,
262 0, 0, 58, 0, 64, 0, 0, 0, 52, 0,
263 0, 68, 0, 0, 30, 43, 0, 0, 0, 0,
264 0, 0, 0, 26, 0, 0, 0, 0, 0, 13,
265 28, 0, 21, 0, 0, 0, 0, 79, 0, 66,
266 49, 62, 46, 0, 0, 97, 0, 69, 0, 0,
267 0, 0, 0, 47, 0, 0, 0, 0, 0, 0,
268 48, 101, 0, 0, 56, 0, 54, 0, 0, 85,
270 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
271 0, 0, 5, 15, 0, 0, 0, 37, 0, 20,
272 0, 95, 0, 0, 92, 0, 0, 0, 78, 0,
273 0, 0, 0, 57, 73, 71, 0, 0, 0, 84,
274 0, 0, 0, 0, 39, 0, 0, 31, 11, 9,
275 19, 0, 0, 0, 0, 0, 0, 0, 102, 0,
276 0, 0, 0, 0, 0, 0, 0, 83, 0, 0,
277 77, 0, 96, 70, 14, 0, 41, 0, 0, 0,
278 0, 0, 0, 0, 75, 98, 61, 0, 100, 44,
279 81, 82, 0, 0, 0, 18, 0, 0, 0, 0,
281 0, 0, 0, 63, 0, 99, 0, 0, 0, 0,
282 0, 0, 0, 0, 0, 0, 34, 35, 0, 0,
283 0, 0, 0, 76, 103, 0, 0, 0, 24, 0,
284 0, 0, 22, 0, 0, 23, 29, 38, 0
287 static yyconst int yy_ec[256] =
289 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
290 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
291 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
292 1, 5, 1, 6, 7, 1, 8, 1, 9, 1,
293 1, 1, 10, 1, 11, 12, 1, 13, 13, 13,
294 13, 13, 13, 13, 13, 13, 13, 14, 1, 1,
295 1, 1, 1, 1, 15, 16, 17, 18, 19, 20,
296 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
297 1, 31, 32, 33, 34, 35, 36, 1, 37, 38,
298 39, 40, 41, 1, 42, 1, 43, 44, 45, 46,
300 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
301 57, 58, 1, 59, 60, 61, 62, 63, 64, 1,
302 1, 1, 12, 12, 12, 1, 1, 1, 1, 1,
303 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
304 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
305 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
306 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
307 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
308 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
309 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
311 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
312 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
313 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
314 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
315 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
319 static yyconst int yy_meta[65] =
321 1, 2, 3, 2, 2, 1, 2, 1, 1, 2,
322 2, 2, 2, 1, 2, 2, 2, 1, 1, 2,
323 1, 2, 2, 1, 2, 2, 1, 1, 1, 2,
324 1, 2, 2, 1, 1, 2, 1, 1, 1, 2,
325 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
326 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
330 static yyconst short int yy_base[645] =
332 0, 58, 83, 62, 796, 797, 65, 797, 792, 788,
333 753, 779, 778, 797, 764, 758, 44, 43, 760, 42,
334 62, 759, 60, 63, 68, 770, 756, 92, 91, 91,
335 769, 71, 72, 76, 87, 55, 84, 77, 61, 96,
336 103, 95, 104, 103, 108, 111, 99, 107, 736, 779,
337 151, 797, 778, 169, 173, 179, 182, 185, 194, 197,
338 752, 180, 185, 193, 181, 194, 202, 214, 241, 75,
339 797, 773, 797, 769, 768, 763, 742, 759, 758, 136,
340 743, 756, 749, 754, 734, 738, 740, 742, 746, 728,
341 724, 729, 732, 732, 151, 734, 162, 729, 735, 726,
343 726, 738, 736, 725, 735, 723, 225, 224, 143, 704,
344 693, 703, 698, 683, 686, 683, 685, 697, 682, 162,
345 679, 673, 676, 675, 685, 679, 678, 180, 671, 666,
346 172, 668, 683, 192, 668, 670, 663, 229, 672, 676,
347 679, 678, 664, 670, 662, 203, 655, 658, 653, 235,
348 797, 654, 710, 797, 212, 797, 797, 709, 274, 264,
349 265, 269, 277, 247, 282, 283, 285, 293, 294, 797,
350 708, 0, 797, 701, 700, 693, 679, 678, 672, 673,
351 672, 666, 670, 679, 671, 671, 679, 663, 677, 675,
352 674, 660, 659, 671, 674, 646, 668, 660, 652, 666,
354 660, 655, 656, 657, 648, 659, 647, 650, 254, 626,
355 631, 616, 625, 618, 610, 608, 615, 611, 605, 608,
356 604, 609, 601, 601, 604, 598, 597, 598, 596, 601,
357 606, 607, 591, 797, 590, 591, 797, 596, 601, 590,
358 602, 592, 584, 582, 588, 584, 585, 272, 578, 591,
359 590, 580, 590, 589, 587, 582, 586, 571, 578, 567,
360 797, 580, 564, 574, 573, 562, 266, 303, 299, 595,
361 308, 311, 309, 797, 590, 603, 602, 603, 594, 797,
362 600, 600, 582, 580, 593, 797, 569, 591, 583, 572,
363 592, 573, 797, 575, 306, 587, 797, 588, 573, 572,
365 797, 797, 569, 570, 568, 797, 574, 304, 797, 540,
366 536, 535, 546, 545, 531, 533, 542, 797, 541, 527,
367 539, 534, 541, 536, 797, 797, 797, 539, 534, 533,
368 568, 530, 526, 797, 529, 528, 531, 517, 520, 797,
369 510, 511, 518, 511, 524, 509, 797, 515, 510, 518,
370 797, 515, 514, 503, 498, 497, 496, 500, 505, 797,
371 495, 499, 491, 797, 797, 548, 317, 535, 320, 321,
372 797, 527, 529, 524, 528, 514, 509, 797, 528, 509,
373 514, 509, 797, 524, 517, 518, 797, 513, 520, 501,
374 507, 505, 503, 797, 501, 500, 508, 797, 797, 480,
376 468, 797, 478, 469, 467, 463, 797, 475, 471, 468,
377 472, 454, 797, 470, 293, 461, 460, 464, 466, 450,
378 450, 462, 461, 464, 457, 446, 446, 460, 797, 455,
379 440, 452, 797, 444, 797, 436, 437, 449, 797, 435,
380 440, 797, 463, 333, 797, 797, 464, 462, 467, 466,
381 465, 456, 471, 797, 459, 465, 452, 461, 449, 797,
382 797, 438, 797, 452, 447, 440, 433, 797, 429, 797,
383 797, 797, 797, 418, 417, 797, 425, 797, 424, 419,
384 412, 421, 416, 797, 404, 404, 419, 404, 408, 405,
385 797, 797, 406, 401, 797, 396, 797, 402, 405, 797,
387 408, 407, 797, 332, 434, 421, 433, 422, 421, 411,
388 417, 421, 797, 797, 424, 412, 341, 797, 410, 797,
389 388, 797, 394, 393, 797, 391, 389, 380, 797, 379,
390 376, 387, 372, 797, 797, 797, 381, 374, 376, 797,
391 380, 382, 381, 395, 797, 404, 403, 797, 797, 797,
392 797, 408, 386, 392, 391, 403, 392, 375, 797, 370,
393 369, 353, 363, 353, 355, 363, 350, 797, 359, 348,
394 797, 356, 797, 797, 797, 386, 797, 388, 388, 371,
395 373, 376, 384, 367, 797, 797, 797, 336, 797, 797,
396 797, 797, 340, 334, 333, 797, 367, 366, 360, 358,
398 370, 371, 368, 797, 339, 797, 338, 365, 341, 343,
399 332, 347, 344, 339, 313, 311, 797, 797, 338, 322,
400 293, 278, 277, 797, 797, 253, 224, 209, 797, 161,
401 138, 123, 797, 101, 69, 797, 797, 797, 797, 371,
405 static yyconst short int yy_def[645] =
407 639, 1, 1, 3, 639, 639, 639, 639, 639, 640,
408 641, 639, 639, 639, 639, 639, 639, 639, 639, 639,
409 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
410 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
411 639, 639, 639, 639, 639, 639, 639, 639, 639, 642,
412 639, 639, 639, 643, 643, 643, 643, 643, 643, 643,
413 639, 60, 60, 60, 60, 60, 60, 60, 642, 639,
414 639, 640, 639, 639, 644, 639, 639, 639, 639, 639,
415 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
416 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
418 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
419 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
420 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
421 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
422 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
423 639, 639, 642, 639, 639, 639, 639, 639, 60, 60,
424 60, 60, 60, 639, 60, 60, 60, 60, 60, 639,
425 642, 69, 639, 639, 639, 639, 639, 639, 639, 639,
426 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
427 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
429 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
430 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
431 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
432 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
433 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
434 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
435 639, 639, 639, 639, 639, 639, 639, 60, 60, 639,
436 60, 60, 60, 639, 639, 639, 639, 639, 639, 639,
437 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
438 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
440 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
441 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
442 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
443 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
444 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
445 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
446 639, 639, 639, 639, 639, 639, 60, 639, 60, 60,
447 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
448 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
449 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
451 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
452 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
453 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
454 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
455 639, 639, 639, 60, 639, 639, 639, 639, 639, 639,
456 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
457 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
458 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
459 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
460 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
462 639, 639, 639, 60, 639, 639, 639, 639, 639, 639,
463 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
464 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
465 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
466 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
467 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
468 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
469 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
470 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
471 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
473 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
474 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
475 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
476 639, 639, 639, 639, 639, 639, 639, 639, 0, 639,
480 static yyconst short int yy_nxt[862] =
482 6, 7, 8, 9, 7, 10, 6, 6, 11, 12,
483 12, 6, 13, 14, 15, 16, 17, 18, 19, 20,
484 21, 6, 22, 6, 6, 23, 24, 25, 26, 27,
485 28, 29, 30, 6, 6, 31, 6, 6, 32, 6,
486 6, 6, 33, 34, 35, 36, 37, 38, 6, 39,
487 6, 6, 6, 40, 41, 42, 43, 44, 45, 46,
488 47, 48, 6, 49, 50, 79, 70, 84, 69, 70,
489 85, 81, 80, 82, 89, 107, 70, 91, 90, 70,
490 86, 92, 94, 108, 51, 52, 53, 54, 51, 55,
491 87, 93, 56, 56, 55, 57, 95, 58, 59, 60,
493 638, 61, 62, 128, 55, 63, 98, 55, 64, 104,
494 99, 122, 65, 101, 66, 67, 123, 129, 68, 126,
495 100, 105, 55, 102, 103, 109, 124, 127, 637, 113,
496 110, 111, 114, 117, 115, 112, 118, 116, 130, 125,
497 119, 137, 131, 120, 134, 135, 132, 139, 121, 141,
498 143, 138, 133, 145, 636, 148, 142, 149, 144, 136,
499 146, 140, 150, 179, 151, 155, 180, 147, 635, 92,
500 70, 157, 158, 159, 639, 157, 158, 195, 196, 93,
501 639, 157, 158, 639, 157, 158, 639, 157, 158, 634,
502 198, 161, 199, 210, 161, 639, 157, 158, 639, 157,
504 158, 160, 160, 211, 222, 165, 160, 166, 85, 97,
505 162, 90, 88, 639, 160, 160, 167, 223, 163, 235,
506 104, 639, 639, 160, 78, 80, 168, 103, 169, 107,
507 639, 209, 105, 231, 236, 160, 108, 108, 232, 239,
508 633, 267, 639, 170, 171, 172, 240, 172, 241, 191,
509 172, 172, 172, 172, 632, 172, 172, 172, 308, 258,
510 172, 259, 172, 172, 270, 172, 172, 183, 365, 366,
511 172, 245, 172, 172, 246, 70, 172, 161, 159, 263,
512 172, 631, 264, 247, 248, 160, 160, 249, 265, 250,
513 160, 269, 639, 639, 309, 160, 271, 639, 160, 630,
515 189, 268, 639, 160, 160, 639, 160, 272, 308, 629,
516 639, 639, 203, 639, 160, 160, 346, 367, 347, 273,
517 160, 639, 639, 388, 160, 628, 277, 639, 283, 160,
518 160, 639, 160, 369, 370, 389, 639, 639, 160, 639,
519 627, 160, 160, 444, 309, 639, 479, 371, 639, 639,
520 394, 480, 504, 160, 160, 626, 625, 554, 624, 623,
521 639, 639, 622, 621, 620, 619, 618, 555, 520, 556,
522 557, 72, 72, 72, 74, 74, 153, 153, 153, 160,
523 160, 174, 174, 617, 616, 615, 614, 613, 612, 611,
524 610, 609, 608, 607, 606, 605, 604, 603, 602, 601,
526 600, 599, 598, 597, 596, 595, 594, 593, 592, 591,
527 590, 589, 588, 587, 586, 585, 584, 583, 582, 581,
528 580, 579, 578, 577, 576, 575, 574, 573, 572, 571,
529 570, 569, 568, 567, 566, 565, 564, 563, 562, 561,
530 560, 559, 558, 553, 552, 551, 550, 549, 548, 547,
531 546, 545, 544, 543, 542, 541, 540, 539, 538, 537,
532 536, 535, 534, 533, 532, 531, 530, 529, 528, 527,
533 526, 525, 524, 523, 522, 521, 520, 519, 518, 517,
534 516, 515, 514, 513, 512, 511, 510, 509, 508, 507,
535 506, 505, 503, 502, 501, 500, 499, 498, 497, 496,
537 495, 494, 493, 492, 491, 490, 489, 488, 487, 486,
538 485, 484, 483, 482, 481, 478, 477, 476, 475, 474,
539 473, 472, 471, 470, 469, 468, 467, 466, 465, 464,
540 463, 462, 461, 460, 459, 458, 457, 456, 455, 454,
541 453, 452, 451, 450, 449, 448, 447, 446, 445, 443,
542 365, 442, 441, 440, 439, 438, 437, 436, 435, 434,
543 433, 432, 431, 430, 429, 428, 427, 426, 425, 424,
544 423, 422, 421, 420, 419, 418, 417, 416, 415, 414,
545 413, 412, 411, 410, 409, 408, 407, 406, 405, 404,
546 403, 402, 401, 400, 399, 398, 397, 396, 395, 394,
548 393, 392, 391, 390, 387, 386, 385, 384, 383, 382,
549 381, 380, 379, 378, 377, 376, 375, 374, 373, 372,
550 371, 368, 364, 363, 362, 361, 360, 359, 358, 357,
551 356, 355, 354, 353, 352, 351, 350, 349, 348, 345,
552 344, 343, 342, 341, 340, 339, 338, 337, 336, 335,
553 334, 333, 332, 331, 330, 329, 328, 327, 326, 325,
554 324, 323, 322, 321, 320, 319, 318, 317, 316, 315,
555 314, 313, 312, 311, 310, 307, 306, 305, 304, 303,
556 302, 301, 300, 299, 298, 297, 296, 295, 294, 293,
557 292, 291, 290, 289, 288, 287, 286, 285, 284, 283,
559 282, 281, 280, 279, 278, 277, 276, 275, 274, 274,
560 170, 157, 154, 266, 262, 261, 260, 257, 256, 255,
561 254, 253, 252, 251, 244, 243, 242, 238, 237, 234,
562 233, 230, 229, 228, 227, 226, 225, 224, 221, 220,
563 219, 218, 217, 216, 215, 214, 213, 212, 208, 207,
564 206, 205, 204, 203, 202, 201, 200, 197, 194, 193,
565 192, 191, 190, 189, 188, 187, 186, 185, 184, 183,
566 182, 181, 178, 177, 176, 76, 175, 173, 73, 164,
567 156, 154, 152, 106, 97, 96, 88, 83, 78, 77,
568 76, 76, 75, 73, 71, 639, 5, 639, 639, 639,
570 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
571 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
572 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
573 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
574 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
575 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
579 static yyconst short int yy_chk[862] =
581 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
582 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
583 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
584 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
585 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
586 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
587 1, 1, 1, 1, 2, 17, 7, 20, 4, 7,
588 20, 18, 17, 18, 23, 32, 70, 24, 23, 70,
589 21, 24, 25, 32, 2, 3, 3, 3, 4, 3,
590 21, 24, 3, 3, 3, 3, 25, 3, 3, 3,
592 635, 3, 3, 39, 3, 3, 28, 3, 3, 30,
593 28, 36, 3, 29, 3, 3, 36, 39, 3, 38,
594 28, 30, 3, 29, 29, 33, 37, 38, 634, 34,
595 33, 33, 34, 35, 34, 33, 35, 34, 40, 37,
596 35, 42, 40, 35, 41, 41, 40, 43, 35, 44,
597 45, 42, 40, 46, 632, 47, 44, 47, 45, 41,
598 46, 43, 48, 80, 48, 51, 80, 46, 631, 51,
599 54, 54, 54, 54, 55, 55, 55, 95, 95, 51,
600 56, 56, 56, 57, 57, 57, 58, 58, 58, 630,
601 97, 56, 97, 109, 57, 59, 59, 59, 60, 60,
603 60, 62, 65, 109, 120, 62, 63, 64, 62, 65,
604 58, 64, 63, 63, 64, 66, 66, 120, 60, 131,
605 67, 64, 66, 67, 59, 60, 66, 66, 68, 107,
606 67, 108, 67, 128, 131, 68, 108, 107, 128, 134,
607 628, 155, 68, 69, 69, 69, 134, 69, 134, 155,
608 69, 69, 69, 69, 627, 69, 69, 69, 209, 146,
609 69, 146, 69, 69, 164, 69, 69, 164, 267, 267,
610 69, 138, 69, 69, 138, 159, 69, 161, 159, 150,
611 69, 626, 150, 138, 138, 160, 161, 138, 150, 138,
612 162, 163, 160, 161, 209, 159, 165, 162, 163, 623,
614 166, 162, 159, 165, 166, 163, 167, 168, 308, 622,
615 165, 166, 167, 167, 168, 169, 248, 268, 248, 169,
616 269, 168, 169, 295, 268, 621, 269, 269, 271, 271,
617 273, 268, 272, 272, 273, 295, 271, 273, 367, 272,
618 620, 369, 370, 370, 308, 367, 415, 367, 369, 370,
619 369, 415, 444, 504, 444, 619, 616, 517, 615, 614,
620 504, 444, 613, 612, 611, 610, 609, 517, 504, 517,
621 517, 640, 640, 640, 641, 641, 642, 642, 642, 643,
622 643, 644, 644, 608, 607, 605, 603, 602, 601, 600,
623 599, 598, 597, 595, 594, 593, 588, 584, 583, 582,
625 581, 580, 579, 578, 576, 572, 570, 569, 567, 566,
626 565, 564, 563, 562, 561, 560, 558, 557, 556, 555,
627 554, 553, 552, 547, 546, 544, 543, 542, 541, 539,
628 538, 537, 533, 532, 531, 530, 528, 527, 526, 524,
629 523, 521, 519, 516, 515, 512, 511, 510, 509, 508,
630 507, 506, 505, 502, 501, 499, 498, 496, 494, 493,
631 490, 489, 488, 487, 486, 485, 483, 482, 481, 480,
632 479, 477, 475, 474, 469, 467, 466, 465, 464, 462,
633 459, 458, 457, 456, 455, 453, 452, 451, 450, 449,
634 448, 447, 443, 441, 440, 438, 437, 436, 434, 432,
636 431, 430, 428, 427, 426, 425, 424, 423, 422, 421,
637 420, 419, 418, 417, 416, 414, 412, 411, 410, 409,
638 408, 406, 405, 404, 403, 401, 400, 397, 396, 395,
639 393, 392, 391, 390, 389, 388, 386, 385, 384, 382,
640 381, 380, 379, 377, 376, 375, 374, 373, 372, 368,
641 366, 363, 362, 361, 359, 358, 357, 356, 355, 354,
642 353, 352, 350, 349, 348, 346, 345, 344, 343, 342,
643 341, 339, 338, 337, 336, 335, 333, 332, 331, 330,
644 329, 328, 324, 323, 322, 321, 320, 319, 317, 316,
645 315, 314, 313, 312, 311, 310, 307, 305, 304, 303,
647 300, 299, 298, 296, 294, 292, 291, 290, 289, 288,
648 287, 285, 284, 283, 282, 281, 279, 278, 277, 276,
649 275, 270, 266, 265, 264, 263, 262, 260, 259, 258,
650 257, 256, 255, 254, 253, 252, 251, 250, 249, 247,
651 246, 245, 244, 243, 242, 241, 240, 239, 238, 236,
652 235, 233, 232, 231, 230, 229, 228, 227, 226, 225,
653 224, 223, 222, 221, 220, 219, 218, 217, 216, 215,
654 214, 213, 212, 211, 210, 208, 207, 206, 205, 204,
655 203, 202, 201, 200, 199, 198, 197, 196, 195, 194,
656 193, 192, 191, 190, 189, 188, 187, 186, 185, 184,
658 183, 182, 181, 180, 179, 178, 177, 176, 175, 174,
659 171, 158, 153, 152, 149, 148, 147, 145, 144, 143,
660 142, 141, 140, 139, 137, 136, 135, 133, 132, 130,
661 129, 127, 126, 125, 124, 123, 122, 121, 119, 118,
662 117, 116, 115, 114, 113, 112, 111, 110, 106, 105,
663 104, 103, 102, 101, 100, 99, 98, 96, 94, 93,
664 92, 91, 90, 89, 88, 87, 86, 85, 84, 83,
665 82, 81, 79, 78, 77, 76, 75, 74, 72, 61,
666 53, 50, 49, 31, 27, 26, 22, 19, 16, 15,
667 13, 12, 11, 10, 9, 5, 639, 639, 639, 639,
669 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
670 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
671 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
672 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
673 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
674 639, 639, 639, 639, 639, 639, 639, 639, 639, 639,
678 static yy_state_type yy_last_accepting_state;
679 static char *yy_last_accepting_cpos;
681 /* The intent behind this definition is that it'll catch
682 * any uses of REJECT which flex missed.
684 #define REJECT reject_used_but_not_detected
685 #define yymore() yymore_used_but_not_detected
686 #define YY_MORE_ADJ 0
689 /* SCCS Id: @(#)lev_lex.c 3.4 2002/03/27 */
690 /* Copyright (c) 1989 by Jean-Christophe Collet */
691 /* NetHack may be freely redistributed. See license for details. */
696 #include "lev_comp.h"
699 /* Most of these don't exist in flex, yywrap is macro and
700 * yyunput is properly declared in flex.skel.
702 #if !defined(FLEX_SCANNER) && !defined(FLEXHACK_SCANNER)
703 int FDECL(yyback, (int *,int));
708 /* Traditional lexes let yyunput() and yyoutput() default to int;
709 * newer ones may declare them as void since they don't return
710 * values. For even more fun, the lex supplied as part of the
711 * newer unbundled compiler for SunOS 4.x adds the void declarations
712 * (under __STDC__ or _cplusplus ifdefs -- otherwise they remain
713 * int) while the bundled lex and the one with the older unbundled
714 * compiler do not. To detect this, we need help from outside --
715 * sys/unix/Makefile.utl.
717 * Digital UNIX is difficult and still has int in spite of all
720 # if defined(NeXT) || defined(SVR4) || defined(_AIX32)
723 # if !defined(VOIDYYPUT) && defined(POSIX_TYPES)
724 # if !defined(BOS) && !defined(HISX) && !defined(_M_UNIX) && !defined(VMS)
728 # if !defined(VOIDYYPUT) && defined(WEIRD_LEX)
729 # if defined(SUNOS4) && defined(__STDC__) && (WEIRD_LEX > 1)
733 # if defined(VOIDYYPUT) && defined(__osf__)
737 void FDECL(yyunput, (int));
738 void FDECL(yyoutput, (int));
740 int FDECL(yyunput, (int));
741 int FDECL(yyoutput, (int));
743 #endif /* !FLEX_SCANNER && !FLEXHACK_SCANNER */
746 #define YY_MALLOC_DECL \
747 genericptr_t FDECL(malloc, (size_t)); \
748 genericptr_t FDECL(realloc, (genericptr_t,size_t));
751 void FDECL(init_yyin, (FILE *));
752 void FDECL(init_yyout, (FILE *));
755 * This doesn't always get put in lev_comp.h
756 * (esp. when using older versions of bison).
758 extern YYSTYPE yylval;
760 int line_number = 1, colon_line_number = 1;
761 static char map[4096];
762 static int map_cnt = 0;
767 /* Macros after this point can all be overridden by user definitions in
771 #ifndef YY_SKIP_YYWRAP
772 extern int NDECL(yywrap);
776 static void FDECL(yyunput, (int,char *));
780 static void FDECL(yy_flex_strncpy, (char *,const char *,int));
784 static int NDECL(input);
787 /* Amount of stuff to slurp up with each read. */
788 #ifndef YY_READ_BUF_SIZE
789 #define YY_READ_BUF_SIZE 8192
792 /* Copy whatever the last rule matched to the standard output. */
795 /* This used to be an fputs(), but since the string might contain NUL's,
796 * we now use fwrite().
798 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
801 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
802 * is returned in "result".
805 #define YY_INPUT(buf,result,max_size) \
806 if ( yy_current_buffer->yy_is_interactive ) \
809 for ( n = 0; n < max_size && \
810 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
813 buf[n++] = (char) c; \
814 if ( c == EOF && ferror( yyin ) ) \
815 YY_FATAL_ERROR( "input in flex scanner failed" ); \
818 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
819 && ferror( yyin ) ) \
820 YY_FATAL_ERROR( "input in flex scanner failed" );
823 /* No semi-colon after return; correct usage is to write "yyterminate();" -
824 * we don't want an extra ';' after the "return" because that will cause
825 * some compilers to complain about unreachable statements.
828 #define yyterminate() return YY_NULL
831 /* Number of entries by which start-condition stack grows. */
832 #ifndef YY_START_STACK_INCR
833 #define YY_START_STACK_INCR 25
836 /* Report a fatal error. */
837 #ifndef YY_FATAL_ERROR
838 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
841 /* Code executed at the beginning of each rule, after yytext and yyleng
844 #ifndef YY_USER_ACTION
845 #define YY_USER_ACTION
848 /* Code executed at the end of each rule. */
850 #define YY_BREAK break;
853 #define YY_RULE_SETUP \
855 yy_current_buffer->yy_at_bol = \
856 (yytext[yyleng - 1] == '\n'); \
862 register yy_state_type yy_current_state;
863 register char *yy_cp, *yy_bp;
877 yy_start = 1; /* first start state */
885 if ( ! yy_current_buffer )
887 yy_create_buffer( yyin, YY_BUF_SIZE );
889 yy_load_buffer_state();
892 while ( 1 ) /* loops until end-of-file is reached */
896 /* Support of yytext. */
897 *yy_cp = yy_hold_char;
899 /* yy_bp points to the position in yy_ch_buf of the start of
904 yy_current_state = yy_start;
905 yy_current_state += YY_AT_BOL();
909 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
910 if ( yy_accept[yy_current_state] )
912 yy_last_accepting_state = yy_current_state;
913 yy_last_accepting_cpos = yy_cp;
915 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
917 yy_current_state = (int) yy_def[yy_current_state];
918 if ( yy_current_state >= 640 )
919 yy_c = yy_meta[(unsigned int) yy_c];
921 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
924 while ( yy_base[yy_current_state] != 797 );
927 yy_act = yy_accept[yy_current_state];
929 { /* have to back up */
930 yy_cp = yy_last_accepting_cpos;
931 yy_current_state = yy_last_accepting_state;
932 yy_act = yy_accept[yy_current_state];
938 do_action: /* This label is used only to access EOF actions. */
942 { /* beginning of action switch */
943 case 0: /* must back up */
944 /* undo the effects of YY_DO_BEFORE_ACTION */
945 *yy_cp = yy_hold_char;
946 yy_cp = yy_last_accepting_cpos;
947 yy_current_state = yy_last_accepting_state;
954 yylval.map = (char *) alloc(map_cnt + 1);
955 (void) strncpy(yylval.map, map, map_cnt);
956 yylval.map[map_cnt] = 0;
965 /* convert \r\n to \n */
966 if (len >= 2 && yytext[len - 2] == '\r') len -= 1;
968 (void) strncpy(map + map_cnt, yytext, len);
970 map[map_cnt - 1] = '\n';
980 { colon_line_number = line_number; return ':'; }
1012 { BEGIN(MAPC); line_number++; }
1036 return DRAWBRIDGE_ID;
1052 return RANDOM_OBJECTS_ID;
1056 return RANDOM_MONSTERS_ID;
1060 return RANDOM_PLACES_ID;
1100 return NON_DIGGABLE_ID;
1104 return NON_PASSWALL_ID;
1116 return RAND_CORRIDOR_ID;
1128 return ENGRAVING_ID;
1144 { yylval.i=D_ISOPEN; return DOOR_STATE; }
1148 { yylval.i=D_CLOSED; return DOOR_STATE; }
1152 { yylval.i=D_LOCKED; return DOOR_STATE; }
1156 { yylval.i=D_NODOOR; return DOOR_STATE; }
1160 { yylval.i=D_BROKEN; return DOOR_STATE; }
1164 { yylval.i=W_NORTH; return DIRECTION; }
1168 { yylval.i=W_EAST; return DIRECTION; }
1172 { yylval.i=W_SOUTH; return DIRECTION; }
1176 { yylval.i=W_WEST; return DIRECTION; }
1180 { yylval.i = -1; return RANDOM_TYPE; }
1184 { yylval.i = -2; return NONE; }
1204 { yylval.i=1; return LEFT_OR_RIGHT; }
1208 { yylval.i=2; return LEFT_OR_RIGHT; }
1212 { yylval.i=3; return CENTER; }
1216 { yylval.i=4; return LEFT_OR_RIGHT; }
1220 { yylval.i=5; return LEFT_OR_RIGHT; }
1224 { yylval.i=1; return TOP_OR_BOT; }
1228 { yylval.i=5; return TOP_OR_BOT; }
1232 { yylval.i=1; return LIGHT_STATE; }
1236 { yylval.i=0; return LIGHT_STATE; }
1240 { yylval.i=0; return FILLING; }
1244 { yylval.i=1; return FILLING; }
1248 { yylval.i= AM_NONE; return ALIGNMENT; }
1252 { yylval.i= AM_LAWFUL; return ALIGNMENT; }
1256 { yylval.i= AM_NEUTRAL; return ALIGNMENT; }
1260 { yylval.i= AM_CHAOTIC; return ALIGNMENT; }
1264 { yylval.i= AM_SPLEV_CO; return ALIGNMENT; }
1268 { yylval.i= AM_SPLEV_NONCO; return ALIGNMENT; }
1272 { yylval.i=1; return MON_ATTITUDE; }
1276 { yylval.i=0; return MON_ATTITUDE; }
1280 { yylval.i=1; return MON_ALERTNESS; }
1284 { yylval.i=0; return MON_ALERTNESS; }
1288 { yylval.i= M_AP_FURNITURE; return MON_APPEARANCE; }
1292 { yylval.i= M_AP_MONSTER; return MON_APPEARANCE; }
1296 { yylval.i= M_AP_OBJECT; return MON_APPEARANCE; }
1300 { yylval.i=2; return ALTAR_TYPE; }
1304 { yylval.i=1; return ALTAR_TYPE; }
1308 { yylval.i=0; return ALTAR_TYPE; }
1312 { yylval.i=1; return UP_OR_DOWN; }
1316 { yylval.i=0; return UP_OR_DOWN; }
1320 { yylval.i=0; return BOOLEAN; }
1324 { yylval.i=1; return BOOLEAN; }
1328 { yylval.i=DUST; return ENGRAVING_TYPE; }
1332 { yylval.i=ENGRAVE; return ENGRAVING_TYPE; }
1336 { yylval.i=BURN; return ENGRAVING_TYPE; }
1340 { yylval.i=MARK; return ENGRAVING_TYPE; }
1344 { yylval.i=1; return CURSE_TYPE; }
1348 { yylval.i=2; return CURSE_TYPE; }
1352 { yylval.i=3; return CURSE_TYPE; }
1356 { return CONTAINED; }
1360 { yylval.i=NOTELEPORT; return FLAG_TYPE; }
1364 { yylval.i=HARDFLOOR; return FLAG_TYPE; }
1368 { yylval.i=NOMMAP; return FLAG_TYPE; }
1372 { yylval.i=ARBOREAL; return FLAG_TYPE; } /* KMH */
1376 { yylval.i=SHORTSIGHTED; return FLAG_TYPE; }
1380 { yylval.i = atoi(yytext + 1); return PERCENT; }
1384 { yylval.i=atoi(yytext); return INTEGER; }
1388 { yytext[yyleng-1] = 0; /* Discard the trailing \" */
1389 yylval.map = (char *) alloc(strlen(yytext+1)+1);
1390 Strcpy(yylval.map, yytext+1); /* Discard the first \" */
1403 { yylval.i = yytext[2]; return CHAR; }
1407 { yylval.i = yytext[1]; return CHAR; }
1411 { return yytext[0]; }
1417 case YY_STATE_EOF(INITIAL):
1418 case YY_STATE_EOF(MAPC):
1421 case YY_END_OF_BUFFER:
1423 /* Amount of text matched not including the EOB char. */
1424 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1426 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1427 *yy_cp = yy_hold_char;
1429 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1431 /* We're scanning a new file or input source. It's
1432 * possible that this happened because the user
1433 * just pointed yyin at a new source and called
1434 * yylex(). If so, then we have to assure
1435 * consistency between yy_current_buffer and our
1436 * globals. Here is the right place to do so, because
1437 * this is the first action (other than possibly a
1438 * back-up) that will match for the new input source.
1440 yy_n_chars = yy_current_buffer->yy_n_chars;
1441 yy_current_buffer->yy_input_file = yyin;
1442 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1445 /* Note that here we test for yy_c_buf_p "<=" to the position
1446 * of the first EOB in the buffer, since yy_c_buf_p will
1447 * already have been incremented past the NUL character
1448 * (since all states make transitions on EOB to the
1449 * end-of-buffer state). Contrast this with the test
1452 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1453 { /* This was really a NUL. */
1454 yy_state_type yy_next_state;
1456 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1458 yy_current_state = yy_get_previous_state();
1460 /* Okay, we're now positioned to make the NUL
1461 * transition. We couldn't have
1462 * yy_get_previous_state() go ahead and do it
1463 * for us because it doesn't know how to deal
1464 * with the possibility of jamming (and we don't
1465 * want to build jamming into it because then it
1466 * will run more slowly).
1469 yy_next_state = yy_try_NUL_trans( yy_current_state );
1471 yy_bp = yytext_ptr + YY_MORE_ADJ;
1473 if ( yy_next_state )
1475 /* Consume the NUL. */
1476 yy_cp = ++yy_c_buf_p;
1477 yy_current_state = yy_next_state;
1484 goto yy_find_action;
1488 else switch ( yy_get_next_buffer() )
1490 case EOB_ACT_END_OF_FILE:
1492 yy_did_buffer_switch_on_eof = 0;
1496 /* Note: because we've taken care in
1497 * yy_get_next_buffer() to have set up
1498 * yytext, we can now set up
1499 * yy_c_buf_p so that if some total
1500 * hoser (like flex itself) wants to
1501 * call the scanner after we return the
1502 * YY_NULL, it'll still work - another
1503 * YY_NULL will get returned.
1505 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1507 yy_act = YY_STATE_EOF(YY_START);
1513 if ( ! yy_did_buffer_switch_on_eof )
1519 case EOB_ACT_CONTINUE_SCAN:
1521 yytext_ptr + yy_amount_of_matched_text;
1523 yy_current_state = yy_get_previous_state();
1526 yy_bp = yytext_ptr + YY_MORE_ADJ;
1529 case EOB_ACT_LAST_MATCH:
1531 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1533 yy_current_state = yy_get_previous_state();
1536 yy_bp = yytext_ptr + YY_MORE_ADJ;
1537 goto yy_find_action;
1544 "fatal flex scanner internal error--no action found" );
1545 } /* end of action switch */
1546 } /* end of scanning one token */
1547 } /* end of yylex */
1550 /* yy_get_next_buffer - try to read in a new buffer
1552 * Returns a code representing an action:
1553 * EOB_ACT_LAST_MATCH -
1554 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1555 * EOB_ACT_END_OF_FILE - end of file
1558 static int yy_get_next_buffer()
1560 register char *dest = yy_current_buffer->yy_ch_buf;
1561 register char *source = yytext_ptr;
1562 register int number_to_move, i;
1565 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1567 "fatal flex scanner internal error--end of buffer missed" );
1569 if ( yy_current_buffer->yy_fill_buffer == 0 )
1570 { /* Don't try to fill the buffer, so this is an EOF. */
1571 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1573 /* We matched a singled characater, the EOB, so
1574 * treat this as a final EOF.
1576 return EOB_ACT_END_OF_FILE;
1581 /* We matched some text prior to the EOB, first
1584 return EOB_ACT_LAST_MATCH;
1588 /* Try to read more data. */
1590 /* First move last chars to start of buffer. */
1591 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1593 for ( i = 0; i < number_to_move; ++i )
1594 *(dest++) = *(source++);
1596 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1597 /* don't do the read, it's not guaranteed to return an EOF,
1605 yy_current_buffer->yy_buf_size - number_to_move - 1;
1607 while ( num_to_read <= 0 )
1608 { /* Not enough room in the buffer - grow it. */
1609 #ifdef YY_USES_REJECT
1611 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1614 /* just a shorter name for the current buffer */
1615 YY_BUFFER_STATE b = yy_current_buffer;
1617 int yy_c_buf_p_offset =
1618 (int) (yy_c_buf_p - b->yy_ch_buf);
1620 if ( b->yy_is_our_buffer )
1622 int old_size = b->yy_buf_size + 2;
1623 int new_size = b->yy_buf_size * 2;
1625 if ( new_size <= 0 )
1626 b->yy_buf_size += b->yy_buf_size / 8;
1628 b->yy_buf_size *= 2;
1630 b->yy_ch_buf = (char *)
1631 /* Include room in for 2 EOB chars. */
1632 yy_flex_realloc2( (genericptr_t) b->yy_ch_buf,
1633 b->yy_buf_size + 2, old_size );
1636 /* Can't grow it, we don't own it. */
1639 if ( ! b->yy_ch_buf )
1641 "fatal error - scanner input buffer overflow" );
1643 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1645 num_to_read = yy_current_buffer->yy_buf_size -
1650 if ( num_to_read > YY_READ_BUF_SIZE )
1651 num_to_read = YY_READ_BUF_SIZE;
1653 /* Read in more data. */
1654 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1655 yy_n_chars, num_to_read );
1658 if ( yy_n_chars == 0 )
1660 if ( number_to_move == YY_MORE_ADJ )
1662 ret_val = EOB_ACT_END_OF_FILE;
1668 ret_val = EOB_ACT_LAST_MATCH;
1669 yy_current_buffer->yy_buffer_status =
1670 YY_BUFFER_EOF_PENDING;
1675 ret_val = EOB_ACT_CONTINUE_SCAN;
1677 yy_n_chars += number_to_move;
1678 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1679 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1681 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1687 /* yy_get_previous_state - get the state just before the EOB char was reached */
1689 static yy_state_type yy_get_previous_state()
1691 register yy_state_type yy_current_state;
1692 register char *yy_cp;
1694 yy_current_state = yy_start;
1695 yy_current_state += YY_AT_BOL();
1697 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1699 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1700 if ( yy_accept[yy_current_state] )
1702 yy_last_accepting_state = yy_current_state;
1703 yy_last_accepting_cpos = yy_cp;
1705 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1707 yy_current_state = (int) yy_def[yy_current_state];
1708 if ( yy_current_state >= 640 )
1709 yy_c = yy_meta[(unsigned int) yy_c];
1711 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1714 return yy_current_state;
1718 /* yy_try_NUL_trans - try to make a transition on the NUL character
1721 * next_state = yy_try_NUL_trans( current_state );
1724 static yy_state_type yy_try_NUL_trans( yy_current_state )
1725 yy_state_type yy_current_state;
1727 register int yy_is_jam;
1728 register char *yy_cp = yy_c_buf_p;
1730 register YY_CHAR yy_c = 1;
1731 if ( yy_accept[yy_current_state] )
1733 yy_last_accepting_state = yy_current_state;
1734 yy_last_accepting_cpos = yy_cp;
1736 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1738 yy_current_state = (int) yy_def[yy_current_state];
1739 if ( yy_current_state >= 640 )
1740 yy_c = yy_meta[(unsigned int) yy_c];
1742 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1743 yy_is_jam = (yy_current_state == 639);
1745 return yy_is_jam ? 0 : yy_current_state;
1750 static void yyunput( c, yy_bp )
1752 register char *yy_bp;
1754 register char *yy_cp = yy_c_buf_p;
1756 /* undo effects of setting up yytext */
1757 *yy_cp = yy_hold_char;
1759 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1760 { /* need to shift things up to make room */
1761 /* +2 for EOB chars. */
1762 register int number_to_move = yy_n_chars + 2;
1763 register char *dest = &yy_current_buffer->yy_ch_buf[
1764 yy_current_buffer->yy_buf_size + 2];
1765 register char *source =
1766 &yy_current_buffer->yy_ch_buf[number_to_move];
1768 while ( source > yy_current_buffer->yy_ch_buf )
1769 *--dest = *--source;
1771 yy_cp += (int) (dest - source);
1772 yy_bp += (int) (dest - source);
1773 yy_n_chars = yy_current_buffer->yy_buf_size;
1775 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1776 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1779 *--yy_cp = (char) c;
1783 yy_hold_char = *yy_cp;
1786 #endif /* ifndef YY_NO_UNPUT */
1793 *yy_c_buf_p = yy_hold_char;
1795 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1797 /* yy_c_buf_p now points to the character we want to return.
1798 * If this occurs *before* the EOB characters, then it's a
1799 * valid NUL; if not, then we've hit the end of the buffer.
1801 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1802 /* This was really a NUL. */
1806 { /* need more input */
1807 yytext_ptr = yy_c_buf_p;
1810 switch ( yy_get_next_buffer() )
1812 case EOB_ACT_END_OF_FILE:
1817 yytext_ptr + YY_MORE_ADJ;
1821 if ( ! yy_did_buffer_switch_on_eof )
1826 case EOB_ACT_CONTINUE_SCAN:
1827 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1830 case EOB_ACT_LAST_MATCH:
1832 "unexpected last match in input()" );
1837 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1838 *yy_c_buf_p = '\0'; /* preserve yytext */
1839 yy_hold_char = *++yy_c_buf_p;
1841 yy_current_buffer->yy_at_bol = (c == '\n');
1847 void yyrestart( input_file )
1850 if ( ! yy_current_buffer )
1851 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1853 yy_init_buffer( yy_current_buffer, input_file );
1854 yy_load_buffer_state();
1858 void yy_switch_to_buffer( new_buffer )
1859 YY_BUFFER_STATE new_buffer;
1861 if ( yy_current_buffer == new_buffer )
1864 if ( yy_current_buffer )
1866 /* Flush out information for old buffer. */
1867 *yy_c_buf_p = yy_hold_char;
1868 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1869 yy_current_buffer->yy_n_chars = yy_n_chars;
1872 yy_current_buffer = new_buffer;
1873 yy_load_buffer_state();
1875 /* We don't actually know whether we did this switch during
1876 * EOF (yywrap()) processing, but the only time this flag
1877 * is looked at is after yywrap() is called, so it's safe
1878 * to go ahead and always set it.
1880 yy_did_buffer_switch_on_eof = 1;
1884 void yy_load_buffer_state()
1886 yy_n_chars = yy_current_buffer->yy_n_chars;
1887 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1888 yyin = yy_current_buffer->yy_input_file;
1889 yy_hold_char = *yy_c_buf_p;
1893 YY_BUFFER_STATE yy_create_buffer( file, size )
1899 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1901 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1903 b->yy_buf_size = size;
1905 /* yy_ch_buf has to be 2 characters longer than the size given because
1906 * we need to put in 2 end-of-buffer characters.
1908 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1909 if ( ! b->yy_ch_buf )
1910 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1912 b->yy_is_our_buffer = 1;
1914 yy_init_buffer( b, file );
1920 void yy_delete_buffer( b )
1926 if ( b == yy_current_buffer )
1927 yy_current_buffer = (YY_BUFFER_STATE) 0;
1929 if ( b->yy_is_our_buffer )
1930 yy_flex_free( (genericptr_t) b->yy_ch_buf );
1932 yy_flex_free( (genericptr_t) b );
1936 #ifndef YY_ALWAYS_INTERACTIVE
1937 #ifndef YY_NEVER_INTERACTIVE
1938 extern int FDECL(isatty, (int));
1942 void yy_init_buffer( b, file )
1946 yy_flush_buffer( b );
1948 b->yy_input_file = file;
1949 b->yy_fill_buffer = 1;
1951 #ifdef YY_ALWAYS_INTERACTIVE
1952 b->yy_is_interactive = 1;
1954 #ifdef YY_NEVER_INTERACTIVE
1955 b->yy_is_interactive = 0;
1957 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1963 void yy_flush_buffer( b )
1968 /* We always need two end-of-buffer characters. The first causes
1969 * a transition to the end-of-buffer state. The second causes
1970 * a jam in that state.
1972 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1973 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1975 b->yy_buf_pos = &b->yy_ch_buf[0];
1978 b->yy_buffer_status = YY_BUFFER_NEW;
1980 if ( b == yy_current_buffer )
1981 yy_load_buffer_state();
1986 #ifndef YY_EXIT_FAILURE
1987 #define YY_EXIT_FAILURE 2
1990 static void yy_fatal_error( msg )
1993 (void) fprintf( stderr, "%s\n", msg );
1994 exit( YY_EXIT_FAILURE );
1999 /* Redefine yyless() so it works in section 3 code. */
2005 /* Undo effects of setting up yytext. */ \
2006 yytext[yyleng] = yy_hold_char; \
2007 yy_c_buf_p = yytext + n - YY_MORE_ADJ; \
2008 yy_hold_char = *yy_c_buf_p; \
2009 *yy_c_buf_p = '\0'; \
2015 /* Internal utility routines. */
2018 static void yy_flex_strncpy( s1, s2, n )
2024 for ( i = 0; i < n; ++i )
2030 static genericptr_t yy_flex_alloc( size )
2033 return (genericptr_t) alloc((unsigned)size);
2036 /* we want to avoid use of realloc(), so we require that caller supply the
2037 size of the old block of memory */
2038 static genericptr_t yy_flex_realloc2( ptr, size, old_size )
2043 genericptr_t outptr = yy_flex_alloc(size);
2046 char *p = (char *) outptr, *q = (char *) ptr;
2048 while (--old_size >= 0) *p++ = *q++;
2054 static void yy_flex_free( ptr )
2066 return ((long *)malloc (n));
2070 /* routine to switch to another input file; needed for flex */
2071 void init_yyin( input_f )
2074 #if defined(FLEX_SCANNER) || defined(FLEXHACK_SCANNER)
2081 /* analogous routine (for completeness) */
2082 void init_yyout( output_f )