OSDN Git Service

Initial Import
[nethackexpress/trunk.git] / sys / share / lev_lex.c
1 /* A lexical scanner for NetHack generated by flex */
2
3 /* Scanner skeleton version:
4  * flexhack.skl 3.3.0 (from .../flex/RCS/flex.skl,v 2.85 95/04/24 10:48:47)
5  */
6 #define FLEXHACK_SCANNER
7 #define YY_FLEX_MAJOR_VERSION 2
8 #define YY_FLEX_MINOR_VERSION 5
9
10 #include "config.h"
11 #define yyconst const   /* some code inserted by flex will refer to yyconst */
12
13 /* Returned upon end-of-file. */
14 #define YY_NULL 0
15
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
19  * double cast.
20  */
21 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
22
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.
26  */
27 #define BEGIN yy_start = 1 + 2 *
28
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
31  * compatibility.
32  */
33 #define YY_START ((yy_start - 1) / 2)
34 #define YYSTATE YY_START
35
36 /* Action number for EOF rule of a given start state. */
37 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
38
39 /* Special action meaning "start processing a new file". */
40 #define YY_NEW_FILE yyrestart( yyin )
41
42 #define YY_END_OF_BUFFER_CHAR 0
43
44 /* Size of default input buffer. */
45 #define YY_BUF_SIZE 16384
46
47 typedef struct yy_buffer_state *YY_BUFFER_STATE;
48
49 extern int yyleng;
50 extern FILE *yyin, *yyout;
51
52 #define EOB_ACT_CONTINUE_SCAN 0
53 #define EOB_ACT_END_OF_FILE 1
54 #define EOB_ACT_LAST_MATCH 2
55
56 /* Return all but the first 'n' matched characters back to the input stream. */
57 #define yyless(n) \
58         do \
59                 { \
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 */ \
64                 } \
65         while ( 0 )
66
67 #define unput(c) yyunput( c, yytext_ptr )
68
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).
72  */
73 typedef unsigned int yy_size_t;
74
75
76 struct yy_buffer_state
77         {
78         FILE *yy_input_file;
79
80         char *yy_ch_buf;                /* input buffer */
81         char *yy_buf_pos;               /* current position in input buffer */
82
83         /* Size of input buffer in bytes, not including room for EOB
84          * characters.
85          */
86         yy_size_t yy_buf_size;
87
88         /* Number of characters read into yy_ch_buf, not including EOB
89          * characters.
90          */
91         int yy_n_chars;
92
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
95          * delete it.
96          */
97         int yy_is_our_buffer;
98
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
102          * each newline.
103          */
104         int yy_is_interactive;
105
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
108          * not.
109          */
110         int yy_at_bol;
111
112         /* Whether to try to fill the input buffer when we reach the
113          * end of it.
114          */
115         int yy_fill_buffer;
116
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.
125          *
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.
129          */
130 #define YY_BUFFER_EOF_PENDING 2
131         };
132
133 static YY_BUFFER_STATE yy_current_buffer = 0;
134
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
137  * "scanner state".
138  */
139 #define YY_CURRENT_BUFFER yy_current_buffer
140
141 /* yy_hold_char holds the character lost when yytext is formed. */
142 static char yy_hold_char;
143
144 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
145
146 int yyleng;
147
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 */
152
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 ...
155  */
156 static int yy_did_buffer_switch_on_eof;
157
158 void FDECL(yyrestart, (FILE *));
159
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 )
167
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));
171
172 #define yy_new_buffer yy_create_buffer
173
174 #define yy_set_interactive(is_interactive) \
175         { \
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; \
179         }
180
181 #define yy_set_bol(at_bol) \
182         { \
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; \
186         }
187
188 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
189
190 typedef unsigned char YY_CHAR;
191 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
192 typedef int yy_state_type;
193 extern char *yytext;
194 #define yytext_ptr yytext
195
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 *));
200
201 /* Done after the current pattern has been matched and before the
202  * corresponding action - sets up yytext.
203  */
204 #define YY_DO_BEFORE_ACTION \
205         yytext_ptr = yy_bp; \
206         yyleng = (int) (yy_cp - yy_bp); \
207         yy_hold_char = *yy_cp; \
208         *yy_cp = '\0'; \
209         yy_c_buf_p = yy_cp;
210
211 #define YY_NUM_RULES 112
212 #define YY_END_OF_BUFFER 113
213 static yyconst short int yy_accept[640] =
214     {   0,
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,
225
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,
236
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,
247
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,
258
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,
269
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,
280
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
285     } ;
286
287 static yyconst int yy_ec[256] =
288     {   0,
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,
299
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,
310
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,
316         1,    1,    1,    1,    1
317     } ;
318
319 static yyconst int yy_meta[65] =
320     {   0,
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,
327         1,    1,    1,    1
328     } ;
329
330 static yyconst short int yy_base[645] =
331     {   0,
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,
342
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,
353
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,
364
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,
375
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,
386
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,
397
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,
402       374,  376,  378,  381
403     } ;
404
405 static yyconst short int yy_def[645] =
406     {   0,
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,
417
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,
428
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,
439
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,
450
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,
461
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,
472
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,
477       639,  639,  639,  639
478     } ;
479
480 static yyconst short int yy_nxt[862] =
481     {   0,
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,
492
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,
503
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,
514
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,
525
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,
536
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,
547
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,
558
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,
569
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,
576       639
577     } ;
578
579 static yyconst short int yy_chk[862] =
580     {   0,
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,
591
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,
602
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,
613
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,
624
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,
635
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,
646
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,
657
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,
668
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,
675       639
676     } ;
677
678 static yy_state_type yy_last_accepting_state;
679 static char *yy_last_accepting_cpos;
680
681 /* The intent behind this definition is that it'll catch
682  * any uses of REJECT which flex missed.
683  */
684 #define REJECT reject_used_but_not_detected
685 #define yymore() yymore_used_but_not_detected
686 #define YY_MORE_ADJ 0
687 char *yytext;
688 #define INITIAL 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. */
692
693 #define LEV_LEX_C
694
695 #include "hack.h"
696 #include "lev_comp.h"
697 #include "sp_lev.h"
698
699 /* Most of these don't exist in flex, yywrap is macro and
700  * yyunput is properly declared in flex.skel.
701  */
702 #if !defined(FLEX_SCANNER) && !defined(FLEXHACK_SCANNER)
703 int FDECL(yyback, (int *,int));
704 int NDECL(yylook);
705 int NDECL(yyinput);
706 int NDECL(yywrap);
707 int NDECL(yylex);
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.
716          *
717          * Digital UNIX is difficult and still has int in spite of all
718          * other signs.
719          */
720 # if defined(NeXT) || defined(SVR4) || defined(_AIX32)
721 #  define VOIDYYPUT
722 # endif
723 # if !defined(VOIDYYPUT) && defined(POSIX_TYPES)
724 #  if !defined(BOS) && !defined(HISX) && !defined(_M_UNIX) && !defined(VMS)
725 #   define VOIDYYPUT
726 #  endif
727 # endif
728 # if !defined(VOIDYYPUT) && defined(WEIRD_LEX)
729 #  if defined(SUNOS4) && defined(__STDC__) && (WEIRD_LEX > 1)
730 #   define VOIDYYPUT
731 #  endif
732 # endif
733 # if defined(VOIDYYPUT) && defined(__osf__)
734 #  undef VOIDYYPUT
735 # endif
736 # ifdef VOIDYYPUT
737 void FDECL(yyunput, (int));
738 void FDECL(yyoutput, (int));
739 # else
740 int FDECL(yyunput, (int));
741 int FDECL(yyoutput, (int));
742 # endif
743 #endif  /* !FLEX_SCANNER && !FLEXHACK_SCANNER */
744
745 #ifdef FLEX_SCANNER
746 #define YY_MALLOC_DECL \
747               genericptr_t FDECL(malloc, (size_t)); \
748               genericptr_t FDECL(realloc, (genericptr_t,size_t));
749 #endif
750
751 void FDECL(init_yyin, (FILE *));
752 void FDECL(init_yyout, (FILE *));
753
754 /*
755  * This doesn't always get put in lev_comp.h
756  * (esp. when using older versions of bison).
757  */
758 extern YYSTYPE yylval;
759
760 int line_number = 1, colon_line_number = 1;
761 static char map[4096];
762 static int map_cnt = 0;
763
764 #define MAPC 1
765
766
767 /* Macros after this point can all be overridden by user definitions in
768  * section 1.
769  */
770
771 #ifndef YY_SKIP_YYWRAP
772 extern int NDECL(yywrap);
773 #endif
774
775 #ifndef YY_NO_UNPUT
776 static void FDECL(yyunput, (int,char *));
777 #endif
778
779 #ifndef yytext_ptr
780 static void FDECL(yy_flex_strncpy, (char *,const char *,int));
781 #endif
782
783 #ifndef YY_NO_INPUT
784 static int NDECL(input);
785 #endif
786
787 /* Amount of stuff to slurp up with each read. */
788 #ifndef YY_READ_BUF_SIZE
789 #define YY_READ_BUF_SIZE 8192
790 #endif
791
792 /* Copy whatever the last rule matched to the standard output. */
793
794 #ifndef ECHO
795 /* This used to be an fputs(), but since the string might contain NUL's,
796  * we now use fwrite().
797  */
798 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
799 #endif
800
801 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
802  * is returned in "result".
803  */
804 #ifndef YY_INPUT
805 #define YY_INPUT(buf,result,max_size) \
806         if ( yy_current_buffer->yy_is_interactive ) \
807                 { \
808                 int c = '*', n; \
809                 for ( n = 0; n < max_size && \
810                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
811                         buf[n] = (char) c; \
812                 if ( c == '\n' ) \
813                         buf[n++] = (char) c; \
814                 if ( c == EOF && ferror( yyin ) ) \
815                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
816                 result = n; \
817                 } \
818         else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
819                   && ferror( yyin ) ) \
820                 YY_FATAL_ERROR( "input in flex scanner failed" );
821 #endif
822
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.
826  */
827 #ifndef yyterminate
828 #define yyterminate() return YY_NULL
829 #endif
830
831 /* Number of entries by which start-condition stack grows. */
832 #ifndef YY_START_STACK_INCR
833 #define YY_START_STACK_INCR 25
834 #endif
835
836 /* Report a fatal error. */
837 #ifndef YY_FATAL_ERROR
838 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
839 #endif
840
841 /* Code executed at the beginning of each rule, after yytext and yyleng
842  * have been set up.
843  */
844 #ifndef YY_USER_ACTION
845 #define YY_USER_ACTION
846 #endif
847
848 /* Code executed at the end of each rule. */
849 #ifndef YY_BREAK
850 #define YY_BREAK break;
851 #endif
852
853 #define YY_RULE_SETUP \
854         if ( yyleng > 0 ) \
855                 yy_current_buffer->yy_at_bol = \
856                                 (yytext[yyleng - 1] == '\n'); \
857         YY_USER_ACTION
858
859 int NDECL(yylex);
860 int yylex()
861         {
862         register yy_state_type yy_current_state;
863         register char *yy_cp, *yy_bp;
864         register int yy_act;
865
866
867
868         if ( yy_init )
869                 {
870                 yy_init = 0;
871
872 #ifdef YY_USER_INIT
873                 YY_USER_INIT;
874 #endif
875
876                 if ( ! yy_start )
877                         yy_start = 1;   /* first start state */
878
879                 if ( ! yyin )
880                         yyin = stdin;
881
882                 if ( ! yyout )
883                         yyout = stdout;
884
885                 if ( ! yy_current_buffer )
886                         yy_current_buffer =
887                                 yy_create_buffer( yyin, YY_BUF_SIZE );
888
889                 yy_load_buffer_state();
890                 }
891
892         while ( 1 )             /* loops until end-of-file is reached */
893                 {
894                 yy_cp = yy_c_buf_p;
895
896                 /* Support of yytext. */
897                 *yy_cp = yy_hold_char;
898
899                 /* yy_bp points to the position in yy_ch_buf of the start of
900                  * the current run.
901                  */
902                 yy_bp = yy_cp;
903
904                 yy_current_state = yy_start;
905                 yy_current_state += YY_AT_BOL();
906 yy_match:
907                 do
908                         {
909                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
910                         if ( yy_accept[yy_current_state] )
911                                 {
912                                 yy_last_accepting_state = yy_current_state;
913                                 yy_last_accepting_cpos = yy_cp;
914                                 }
915                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
916                                 {
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];
920                                 }
921                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
922                         ++yy_cp;
923                         }
924                 while ( yy_base[yy_current_state] != 797 );
925
926 yy_find_action:
927                 yy_act = yy_accept[yy_current_state];
928                 if ( yy_act == 0 )
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];
933                         }
934
935                 YY_DO_BEFORE_ACTION;
936
937
938 do_action:      /* This label is used only to access EOF actions. */
939
940
941                 switch ( yy_act )
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;
948                         goto yy_find_action;
949
950 case 1:
951 YY_RULE_SETUP
952 {
953                   BEGIN(INITIAL);
954                   yylval.map = (char *) alloc(map_cnt + 1);
955                   (void) strncpy(yylval.map, map, map_cnt);
956                   yylval.map[map_cnt] = 0;
957                   map_cnt = 0;
958                   return MAP_ID;
959                 }
960         YY_BREAK
961 case 2:
962 YY_RULE_SETUP
963 {
964                   int len = yyleng;
965                   /* convert \r\n to \n */
966                   if (len >= 2 && yytext[len - 2] == '\r') len -= 1;
967                   line_number++;
968                   (void) strncpy(map + map_cnt, yytext, len);
969                   map_cnt += len;
970                   map[map_cnt - 1] = '\n';
971                   map[map_cnt] = '\0';
972                 }
973         YY_BREAK
974 case 3:
975 YY_RULE_SETUP
976 { line_number++; }
977         YY_BREAK
978 case 4:
979 YY_RULE_SETUP
980 { colon_line_number = line_number; return ':'; }
981         YY_BREAK
982 case 5:
983 YY_RULE_SETUP
984 return MESSAGE_ID;
985         YY_BREAK
986 case 6:
987 YY_RULE_SETUP
988 return MAZE_ID;
989         YY_BREAK
990 case 7:
991 YY_RULE_SETUP
992 return NOMAP_ID;
993         YY_BREAK
994 case 8:
995 YY_RULE_SETUP
996 return LEVEL_ID;
997         YY_BREAK
998 case 9:
999 YY_RULE_SETUP
1000 return LEV_INIT_ID;
1001         YY_BREAK
1002 case 10:
1003 YY_RULE_SETUP
1004 return FLAGS_ID;
1005         YY_BREAK
1006 case 11:
1007 YY_RULE_SETUP
1008 return GEOMETRY_ID;
1009         YY_BREAK
1010 case 12:
1011 YY_RULE_SETUP
1012 { BEGIN(MAPC); line_number++; }
1013         YY_BREAK
1014 case 13:
1015 YY_RULE_SETUP
1016 return OBJECT_ID;
1017         YY_BREAK
1018 case 14:
1019 YY_RULE_SETUP
1020 return COBJECT_ID;
1021         YY_BREAK
1022 case 15:
1023 YY_RULE_SETUP
1024 return MONSTER_ID;
1025         YY_BREAK
1026 case 16:
1027 YY_RULE_SETUP
1028 return TRAP_ID;
1029         YY_BREAK
1030 case 17:
1031 YY_RULE_SETUP
1032 return DOOR_ID;
1033         YY_BREAK
1034 case 18:
1035 YY_RULE_SETUP
1036 return DRAWBRIDGE_ID;
1037         YY_BREAK
1038 case 19:
1039 YY_RULE_SETUP
1040 return MAZEWALK_ID;
1041         YY_BREAK
1042 case 20:
1043 YY_RULE_SETUP
1044 return WALLIFY_ID;
1045         YY_BREAK
1046 case 21:
1047 YY_RULE_SETUP
1048 return REGION_ID;
1049         YY_BREAK
1050 case 22:
1051 YY_RULE_SETUP
1052 return RANDOM_OBJECTS_ID;
1053         YY_BREAK
1054 case 23:
1055 YY_RULE_SETUP
1056 return RANDOM_MONSTERS_ID;
1057         YY_BREAK
1058 case 24:
1059 YY_RULE_SETUP
1060 return RANDOM_PLACES_ID;
1061         YY_BREAK
1062 case 25:
1063 YY_RULE_SETUP
1064 return ALTAR_ID;
1065         YY_BREAK
1066 case 26:
1067 YY_RULE_SETUP
1068 return LADDER_ID;
1069         YY_BREAK
1070 case 27:
1071 YY_RULE_SETUP
1072 return STAIR_ID;
1073         YY_BREAK
1074 case 28:
1075 YY_RULE_SETUP
1076 return PORTAL_ID;
1077         YY_BREAK
1078 case 29:
1079 YY_RULE_SETUP
1080 return TELEPRT_ID;
1081         YY_BREAK
1082 case 30:
1083 YY_RULE_SETUP
1084 return BRANCH_ID;
1085         YY_BREAK
1086 case 31:
1087 YY_RULE_SETUP
1088 return FOUNTAIN_ID;
1089         YY_BREAK
1090 case 32:
1091 YY_RULE_SETUP
1092 return SINK_ID;
1093         YY_BREAK
1094 case 33:
1095 YY_RULE_SETUP
1096 return POOL_ID;
1097         YY_BREAK
1098 case 34:
1099 YY_RULE_SETUP
1100 return NON_DIGGABLE_ID;
1101         YY_BREAK
1102 case 35:
1103 YY_RULE_SETUP
1104 return NON_PASSWALL_ID;
1105         YY_BREAK
1106 case 36:
1107 YY_RULE_SETUP
1108 return ROOM_ID;
1109         YY_BREAK
1110 case 37:
1111 YY_RULE_SETUP
1112 return SUBROOM_ID;
1113         YY_BREAK
1114 case 38:
1115 YY_RULE_SETUP
1116 return RAND_CORRIDOR_ID;
1117         YY_BREAK
1118 case 39:
1119 YY_RULE_SETUP
1120 return CORRIDOR_ID;
1121         YY_BREAK
1122 case 40:
1123 YY_RULE_SETUP
1124 return GOLD_ID;
1125         YY_BREAK
1126 case 41:
1127 YY_RULE_SETUP
1128 return ENGRAVING_ID;
1129         YY_BREAK
1130 case 42:
1131 YY_RULE_SETUP
1132 return NAME_ID;
1133         YY_BREAK
1134 case 43:
1135 YY_RULE_SETUP
1136 return CHANCE_ID;
1137         YY_BREAK
1138 case 44:
1139 YY_RULE_SETUP
1140 return LEV;
1141         YY_BREAK
1142 case 45:
1143 YY_RULE_SETUP
1144 { yylval.i=D_ISOPEN; return DOOR_STATE; }
1145         YY_BREAK
1146 case 46:
1147 YY_RULE_SETUP
1148 { yylval.i=D_CLOSED; return DOOR_STATE; }
1149         YY_BREAK
1150 case 47:
1151 YY_RULE_SETUP
1152 { yylval.i=D_LOCKED; return DOOR_STATE; }
1153         YY_BREAK
1154 case 48:
1155 YY_RULE_SETUP
1156 { yylval.i=D_NODOOR; return DOOR_STATE; }
1157         YY_BREAK
1158 case 49:
1159 YY_RULE_SETUP
1160 { yylval.i=D_BROKEN; return DOOR_STATE; }
1161         YY_BREAK
1162 case 50:
1163 YY_RULE_SETUP
1164 { yylval.i=W_NORTH; return DIRECTION; }
1165         YY_BREAK
1166 case 51:
1167 YY_RULE_SETUP
1168 { yylval.i=W_EAST; return DIRECTION; }
1169         YY_BREAK
1170 case 52:
1171 YY_RULE_SETUP
1172 { yylval.i=W_SOUTH; return DIRECTION; }
1173         YY_BREAK
1174 case 53:
1175 YY_RULE_SETUP
1176 { yylval.i=W_WEST; return DIRECTION; }
1177         YY_BREAK
1178 case 54:
1179 YY_RULE_SETUP
1180 { yylval.i = -1; return RANDOM_TYPE; }
1181         YY_BREAK
1182 case 55:
1183 YY_RULE_SETUP
1184 { yylval.i = -2; return NONE; }
1185         YY_BREAK
1186 case 56:
1187 YY_RULE_SETUP
1188 return O_REGISTER;
1189         YY_BREAK
1190 case 57:
1191 YY_RULE_SETUP
1192 return M_REGISTER;
1193         YY_BREAK
1194 case 58:
1195 YY_RULE_SETUP
1196 return P_REGISTER;
1197         YY_BREAK
1198 case 59:
1199 YY_RULE_SETUP
1200 return A_REGISTER;
1201         YY_BREAK
1202 case 60:
1203 YY_RULE_SETUP
1204 { yylval.i=1; return LEFT_OR_RIGHT; }
1205         YY_BREAK
1206 case 61:
1207 YY_RULE_SETUP
1208 { yylval.i=2; return LEFT_OR_RIGHT; }
1209         YY_BREAK
1210 case 62:
1211 YY_RULE_SETUP
1212 { yylval.i=3; return CENTER; }
1213         YY_BREAK
1214 case 63:
1215 YY_RULE_SETUP
1216 { yylval.i=4; return LEFT_OR_RIGHT; }
1217         YY_BREAK
1218 case 64:
1219 YY_RULE_SETUP
1220 { yylval.i=5; return LEFT_OR_RIGHT; }
1221         YY_BREAK
1222 case 65:
1223 YY_RULE_SETUP
1224 { yylval.i=1; return TOP_OR_BOT; }
1225         YY_BREAK
1226 case 66:
1227 YY_RULE_SETUP
1228 { yylval.i=5; return TOP_OR_BOT; }
1229         YY_BREAK
1230 case 67:
1231 YY_RULE_SETUP
1232 { yylval.i=1; return LIGHT_STATE; }
1233         YY_BREAK
1234 case 68:
1235 YY_RULE_SETUP
1236 { yylval.i=0; return LIGHT_STATE; }
1237         YY_BREAK
1238 case 69:
1239 YY_RULE_SETUP
1240 { yylval.i=0; return FILLING; }
1241         YY_BREAK
1242 case 70:
1243 YY_RULE_SETUP
1244 { yylval.i=1; return FILLING; }
1245         YY_BREAK
1246 case 71:
1247 YY_RULE_SETUP
1248 { yylval.i= AM_NONE; return ALIGNMENT; }
1249         YY_BREAK
1250 case 72:
1251 YY_RULE_SETUP
1252 { yylval.i= AM_LAWFUL; return ALIGNMENT; }
1253         YY_BREAK
1254 case 73:
1255 YY_RULE_SETUP
1256 { yylval.i= AM_NEUTRAL; return ALIGNMENT; }
1257         YY_BREAK
1258 case 74:
1259 YY_RULE_SETUP
1260 { yylval.i= AM_CHAOTIC; return ALIGNMENT; }
1261         YY_BREAK
1262 case 75:
1263 YY_RULE_SETUP
1264 { yylval.i= AM_SPLEV_CO; return ALIGNMENT; }
1265         YY_BREAK
1266 case 76:
1267 YY_RULE_SETUP
1268 { yylval.i= AM_SPLEV_NONCO; return ALIGNMENT; }
1269         YY_BREAK
1270 case 77:
1271 YY_RULE_SETUP
1272 { yylval.i=1; return MON_ATTITUDE; }
1273         YY_BREAK
1274 case 78:
1275 YY_RULE_SETUP
1276 { yylval.i=0; return MON_ATTITUDE; }
1277         YY_BREAK
1278 case 79:
1279 YY_RULE_SETUP
1280 { yylval.i=1; return MON_ALERTNESS; }
1281         YY_BREAK
1282 case 80:
1283 YY_RULE_SETUP
1284 { yylval.i=0; return MON_ALERTNESS; }
1285         YY_BREAK
1286 case 81:
1287 YY_RULE_SETUP
1288 { yylval.i= M_AP_FURNITURE; return MON_APPEARANCE; }
1289         YY_BREAK
1290 case 82:
1291 YY_RULE_SETUP
1292 { yylval.i= M_AP_MONSTER;   return MON_APPEARANCE; }
1293         YY_BREAK
1294 case 83:
1295 YY_RULE_SETUP
1296 { yylval.i= M_AP_OBJECT;    return MON_APPEARANCE; }
1297         YY_BREAK
1298 case 84:
1299 YY_RULE_SETUP
1300 { yylval.i=2; return ALTAR_TYPE; }
1301         YY_BREAK
1302 case 85:
1303 YY_RULE_SETUP
1304 { yylval.i=1; return ALTAR_TYPE; }
1305         YY_BREAK
1306 case 86:
1307 YY_RULE_SETUP
1308 { yylval.i=0; return ALTAR_TYPE; }
1309         YY_BREAK
1310 case 87:
1311 YY_RULE_SETUP
1312 { yylval.i=1; return UP_OR_DOWN; }
1313         YY_BREAK
1314 case 88:
1315 YY_RULE_SETUP
1316 { yylval.i=0; return UP_OR_DOWN; }
1317         YY_BREAK
1318 case 89:
1319 YY_RULE_SETUP
1320 { yylval.i=0; return BOOLEAN; }
1321         YY_BREAK
1322 case 90:
1323 YY_RULE_SETUP
1324 { yylval.i=1; return BOOLEAN; }
1325         YY_BREAK
1326 case 91:
1327 YY_RULE_SETUP
1328 { yylval.i=DUST; return ENGRAVING_TYPE; }
1329         YY_BREAK
1330 case 92:
1331 YY_RULE_SETUP
1332 { yylval.i=ENGRAVE; return ENGRAVING_TYPE; }
1333         YY_BREAK
1334 case 93:
1335 YY_RULE_SETUP
1336 { yylval.i=BURN; return ENGRAVING_TYPE; }
1337         YY_BREAK
1338 case 94:
1339 YY_RULE_SETUP
1340 { yylval.i=MARK; return ENGRAVING_TYPE; }
1341         YY_BREAK
1342 case 95:
1343 YY_RULE_SETUP
1344 { yylval.i=1; return CURSE_TYPE; }
1345         YY_BREAK
1346 case 96:
1347 YY_RULE_SETUP
1348 { yylval.i=2; return CURSE_TYPE; }
1349         YY_BREAK
1350 case 97:
1351 YY_RULE_SETUP
1352 { yylval.i=3; return CURSE_TYPE; }
1353         YY_BREAK
1354 case 98:
1355 YY_RULE_SETUP
1356 { return CONTAINED; }
1357         YY_BREAK
1358 case 99:
1359 YY_RULE_SETUP
1360 { yylval.i=NOTELEPORT; return FLAG_TYPE; }
1361         YY_BREAK
1362 case 100:
1363 YY_RULE_SETUP
1364 { yylval.i=HARDFLOOR; return FLAG_TYPE; }
1365         YY_BREAK
1366 case 101:
1367 YY_RULE_SETUP
1368 { yylval.i=NOMMAP; return FLAG_TYPE; }
1369         YY_BREAK
1370 case 102:
1371 YY_RULE_SETUP
1372 { yylval.i=ARBOREAL; return FLAG_TYPE; }        /* KMH */
1373         YY_BREAK
1374 case 103:
1375 YY_RULE_SETUP
1376 { yylval.i=SHORTSIGHTED; return FLAG_TYPE; }
1377         YY_BREAK
1378 case 104:
1379 YY_RULE_SETUP
1380 { yylval.i = atoi(yytext + 1); return PERCENT; }
1381         YY_BREAK
1382 case 105:
1383 YY_RULE_SETUP
1384 { yylval.i=atoi(yytext); return INTEGER; }
1385         YY_BREAK
1386 case 106:
1387 YY_RULE_SETUP
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 \" */
1391                   return STRING; }
1392         YY_BREAK
1393 case 107:
1394 YY_RULE_SETUP
1395 { line_number++; }
1396         YY_BREAK
1397 case 108:
1398 YY_RULE_SETUP
1399 ;
1400         YY_BREAK
1401 case 109:
1402 YY_RULE_SETUP
1403 { yylval.i = yytext[2]; return CHAR; }
1404         YY_BREAK
1405 case 110:
1406 YY_RULE_SETUP
1407 { yylval.i = yytext[1]; return CHAR; }
1408         YY_BREAK
1409 case 111:
1410 YY_RULE_SETUP
1411 { return yytext[0]; }
1412         YY_BREAK
1413 case 112:
1414 YY_RULE_SETUP
1415 ECHO;
1416         YY_BREAK
1417 case YY_STATE_EOF(INITIAL):
1418 case YY_STATE_EOF(MAPC):
1419         yyterminate();
1420
1421         case YY_END_OF_BUFFER:
1422                 {
1423                 /* Amount of text matched not including the EOB char. */
1424                 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1425
1426                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1427                 *yy_cp = yy_hold_char;
1428
1429                 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1430                         {
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.
1439                          */
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;
1443                         }
1444
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
1450                  * in input().
1451                  */
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;
1455
1456                         yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1457
1458                         yy_current_state = yy_get_previous_state();
1459
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).
1467                          */
1468
1469                         yy_next_state = yy_try_NUL_trans( yy_current_state );
1470
1471                         yy_bp = yytext_ptr + YY_MORE_ADJ;
1472
1473                         if ( yy_next_state )
1474                                 {
1475                                 /* Consume the NUL. */
1476                                 yy_cp = ++yy_c_buf_p;
1477                                 yy_current_state = yy_next_state;
1478                                 goto yy_match;
1479                                 }
1480
1481                         else
1482                                 {
1483                                 yy_cp = yy_c_buf_p;
1484                                 goto yy_find_action;
1485                                 }
1486                         }
1487
1488                 else switch ( yy_get_next_buffer() )
1489                         {
1490                         case EOB_ACT_END_OF_FILE:
1491                                 {
1492                                 yy_did_buffer_switch_on_eof = 0;
1493
1494                                 if ( yywrap() )
1495                                         {
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.
1504                                          */
1505                                         yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1506
1507                                         yy_act = YY_STATE_EOF(YY_START);
1508                                         goto do_action;
1509                                         }
1510
1511                                 else
1512                                         {
1513                                         if ( ! yy_did_buffer_switch_on_eof )
1514                                                 YY_NEW_FILE;
1515                                         }
1516                                 break;
1517                                 }
1518
1519                         case EOB_ACT_CONTINUE_SCAN:
1520                                 yy_c_buf_p =
1521                                         yytext_ptr + yy_amount_of_matched_text;
1522
1523                                 yy_current_state = yy_get_previous_state();
1524
1525                                 yy_cp = yy_c_buf_p;
1526                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
1527                                 goto yy_match;
1528
1529                         case EOB_ACT_LAST_MATCH:
1530                                 yy_c_buf_p =
1531                                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1532
1533                                 yy_current_state = yy_get_previous_state();
1534
1535                                 yy_cp = yy_c_buf_p;
1536                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
1537                                 goto yy_find_action;
1538                         }
1539                 break;
1540                 }
1541
1542         default:
1543                 YY_FATAL_ERROR(
1544                         "fatal flex scanner internal error--no action found" );
1545         } /* end of action switch */
1546                 } /* end of scanning one token */
1547         } /* end of yylex */
1548
1549
1550 /* yy_get_next_buffer - try to read in a new buffer
1551  *
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
1556  */
1557
1558 static int yy_get_next_buffer()
1559         {
1560         register char *dest = yy_current_buffer->yy_ch_buf;
1561         register char *source = yytext_ptr;
1562         register int number_to_move, i;
1563         int ret_val;
1564
1565         if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1566                 YY_FATAL_ERROR(
1567                 "fatal flex scanner internal error--end of buffer missed" );
1568
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 )
1572                         {
1573                         /* We matched a singled characater, the EOB, so
1574                          * treat this as a final EOF.
1575                          */
1576                         return EOB_ACT_END_OF_FILE;
1577                         }
1578
1579                 else
1580                         {
1581                         /* We matched some text prior to the EOB, first
1582                          * process it.
1583                          */
1584                         return EOB_ACT_LAST_MATCH;
1585                         }
1586                 }
1587
1588         /* Try to read more data. */
1589
1590         /* First move last chars to start of buffer. */
1591         number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1592
1593         for ( i = 0; i < number_to_move; ++i )
1594                 *(dest++) = *(source++);
1595
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,
1598                  * just force an EOF
1599                  */
1600                 yy_n_chars = 0;
1601
1602         else
1603                 {
1604                 int num_to_read =
1605                         yy_current_buffer->yy_buf_size - number_to_move - 1;
1606
1607                 while ( num_to_read <= 0 )
1608                         { /* Not enough room in the buffer - grow it. */
1609 #ifdef YY_USES_REJECT
1610                         YY_FATAL_ERROR(
1611 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1612 #else
1613
1614                         /* just a shorter name for the current buffer */
1615                         YY_BUFFER_STATE b = yy_current_buffer;
1616
1617                         int yy_c_buf_p_offset =
1618                                 (int) (yy_c_buf_p - b->yy_ch_buf);
1619
1620                         if ( b->yy_is_our_buffer )
1621                                 {
1622                                 int old_size = b->yy_buf_size + 2;
1623                                 int new_size = b->yy_buf_size * 2;
1624
1625                                 if ( new_size <= 0 )
1626                                         b->yy_buf_size += b->yy_buf_size / 8;
1627                                 else
1628                                         b->yy_buf_size *= 2;
1629
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 );
1634                                 }
1635                         else
1636                                 /* Can't grow it, we don't own it. */
1637                                 b->yy_ch_buf = 0;
1638
1639                         if ( ! b->yy_ch_buf )
1640                                 YY_FATAL_ERROR(
1641                                 "fatal error - scanner input buffer overflow" );
1642
1643                         yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1644
1645                         num_to_read = yy_current_buffer->yy_buf_size -
1646                                                 number_to_move - 1;
1647 #endif
1648                         }
1649
1650                 if ( num_to_read > YY_READ_BUF_SIZE )
1651                         num_to_read = YY_READ_BUF_SIZE;
1652
1653                 /* Read in more data. */
1654                 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1655                         yy_n_chars, num_to_read );
1656                 }
1657
1658         if ( yy_n_chars == 0 )
1659                 {
1660                 if ( number_to_move == YY_MORE_ADJ )
1661                         {
1662                         ret_val = EOB_ACT_END_OF_FILE;
1663                         yyrestart( yyin );
1664                         }
1665
1666                 else
1667                         {
1668                         ret_val = EOB_ACT_LAST_MATCH;
1669                         yy_current_buffer->yy_buffer_status =
1670                                 YY_BUFFER_EOF_PENDING;
1671                         }
1672                 }
1673
1674         else
1675                 ret_val = EOB_ACT_CONTINUE_SCAN;
1676
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;
1680
1681         yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1682
1683         return ret_val;
1684         }
1685
1686
1687 /* yy_get_previous_state - get the state just before the EOB char was reached */
1688
1689 static yy_state_type yy_get_previous_state()
1690         {
1691         register yy_state_type yy_current_state;
1692         register char *yy_cp;
1693
1694         yy_current_state = yy_start;
1695         yy_current_state += YY_AT_BOL();
1696
1697         for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1698                 {
1699                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1700                 if ( yy_accept[yy_current_state] )
1701                         {
1702                         yy_last_accepting_state = yy_current_state;
1703                         yy_last_accepting_cpos = yy_cp;
1704                         }
1705                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1706                         {
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];
1710                         }
1711                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1712                 }
1713
1714         return yy_current_state;
1715         }
1716
1717
1718 /* yy_try_NUL_trans - try to make a transition on the NUL character
1719  *
1720  * synopsis
1721  *      next_state = yy_try_NUL_trans( current_state );
1722  */
1723
1724 static yy_state_type yy_try_NUL_trans( yy_current_state )
1725 yy_state_type yy_current_state;
1726         {
1727         register int yy_is_jam;
1728         register char *yy_cp = yy_c_buf_p;
1729
1730         register YY_CHAR yy_c = 1;
1731         if ( yy_accept[yy_current_state] )
1732                 {
1733                 yy_last_accepting_state = yy_current_state;
1734                 yy_last_accepting_cpos = yy_cp;
1735                 }
1736         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1737                 {
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];
1741                 }
1742         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1743         yy_is_jam = (yy_current_state == 639);
1744
1745         return yy_is_jam ? 0 : yy_current_state;
1746         }
1747
1748
1749 #ifndef YY_NO_UNPUT
1750 static void yyunput( c, yy_bp )
1751 int c;
1752 register char *yy_bp;
1753         {
1754         register char *yy_cp = yy_c_buf_p;
1755
1756         /* undo effects of setting up yytext */
1757         *yy_cp = yy_hold_char;
1758
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];
1767
1768                 while ( source > yy_current_buffer->yy_ch_buf )
1769                         *--dest = *--source;
1770
1771                 yy_cp += (int) (dest - source);
1772                 yy_bp += (int) (dest - source);
1773                 yy_n_chars = yy_current_buffer->yy_buf_size;
1774
1775                 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1776                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
1777                 }
1778
1779         *--yy_cp = (char) c;
1780
1781
1782         yytext_ptr = yy_bp;
1783         yy_hold_char = *yy_cp;
1784         yy_c_buf_p = yy_cp;
1785         }
1786 #endif  /* ifndef YY_NO_UNPUT */
1787
1788
1789 static int input()
1790         {
1791         int c;
1792
1793         *yy_c_buf_p = yy_hold_char;
1794
1795         if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1796                 {
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.
1800                  */
1801                 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1802                         /* This was really a NUL. */
1803                         *yy_c_buf_p = '\0';
1804
1805                 else
1806                         { /* need more input */
1807                         yytext_ptr = yy_c_buf_p;
1808                         ++yy_c_buf_p;
1809
1810                         switch ( yy_get_next_buffer() )
1811                                 {
1812                                 case EOB_ACT_END_OF_FILE:
1813                                         {
1814                                         if ( yywrap() )
1815                                                 {
1816                                                 yy_c_buf_p =
1817                                                 yytext_ptr + YY_MORE_ADJ;
1818                                                 return EOF;
1819                                                 }
1820
1821                                         if ( ! yy_did_buffer_switch_on_eof )
1822                                                 YY_NEW_FILE;
1823                                         return input();
1824                                         }
1825
1826                                 case EOB_ACT_CONTINUE_SCAN:
1827                                         yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1828                                         break;
1829
1830                                 case EOB_ACT_LAST_MATCH:
1831                                         YY_FATAL_ERROR(
1832                                         "unexpected last match in input()" );
1833                                 }
1834                         }
1835                 }
1836
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;
1840
1841         yy_current_buffer->yy_at_bol = (c == '\n');
1842
1843         return c;
1844         }
1845
1846
1847 void yyrestart( input_file )
1848 FILE *input_file;
1849         {
1850         if ( ! yy_current_buffer )
1851                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1852
1853         yy_init_buffer( yy_current_buffer, input_file );
1854         yy_load_buffer_state();
1855         }
1856
1857
1858 void yy_switch_to_buffer( new_buffer )
1859 YY_BUFFER_STATE new_buffer;
1860         {
1861         if ( yy_current_buffer == new_buffer )
1862                 return;
1863
1864         if ( yy_current_buffer )
1865                 {
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;
1870                 }
1871
1872         yy_current_buffer = new_buffer;
1873         yy_load_buffer_state();
1874
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.
1879          */
1880         yy_did_buffer_switch_on_eof = 1;
1881         }
1882
1883
1884 void yy_load_buffer_state()
1885         {
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;
1890         }
1891
1892
1893 YY_BUFFER_STATE yy_create_buffer( file, size )
1894 FILE *file;
1895 int size;
1896         {
1897         YY_BUFFER_STATE b;
1898
1899         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1900         if ( ! b )
1901                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1902
1903         b->yy_buf_size = size;
1904
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.
1907          */
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()" );
1911
1912         b->yy_is_our_buffer = 1;
1913
1914         yy_init_buffer( b, file );
1915
1916         return b;
1917         }
1918
1919
1920 void yy_delete_buffer( b )
1921 YY_BUFFER_STATE b;
1922         {
1923         if ( ! b )
1924                 return;
1925
1926         if ( b == yy_current_buffer )
1927                 yy_current_buffer = (YY_BUFFER_STATE) 0;
1928
1929         if ( b->yy_is_our_buffer )
1930                 yy_flex_free( (genericptr_t) b->yy_ch_buf );
1931
1932         yy_flex_free( (genericptr_t) b );
1933         }
1934
1935
1936 #ifndef YY_ALWAYS_INTERACTIVE
1937 #ifndef YY_NEVER_INTERACTIVE
1938 extern int FDECL(isatty, (int));
1939 #endif
1940 #endif
1941
1942 void yy_init_buffer( b, file )
1943 YY_BUFFER_STATE b;
1944 FILE *file;
1945         {
1946         yy_flush_buffer( b );
1947
1948         b->yy_input_file = file;
1949         b->yy_fill_buffer = 1;
1950
1951 #ifdef YY_ALWAYS_INTERACTIVE
1952         b->yy_is_interactive = 1;
1953 #else
1954 #ifdef YY_NEVER_INTERACTIVE
1955         b->yy_is_interactive = 0;
1956 #else
1957         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1958 #endif
1959 #endif
1960         }
1961
1962
1963 void yy_flush_buffer( b )
1964 YY_BUFFER_STATE b;
1965         {
1966         b->yy_n_chars = 0;
1967
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.
1971          */
1972         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1973         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1974
1975         b->yy_buf_pos = &b->yy_ch_buf[0];
1976
1977         b->yy_at_bol = 1;
1978         b->yy_buffer_status = YY_BUFFER_NEW;
1979
1980         if ( b == yy_current_buffer )
1981                 yy_load_buffer_state();
1982         }
1983
1984
1985
1986 #ifndef YY_EXIT_FAILURE
1987 #define YY_EXIT_FAILURE 2
1988 #endif
1989
1990 static void yy_fatal_error( msg )
1991 const char msg[];
1992         {
1993         (void) fprintf( stderr, "%s\n", msg );
1994         exit( YY_EXIT_FAILURE );
1995         }
1996
1997
1998
1999 /* Redefine yyless() so it works in section 3 code. */
2000
2001 #undef yyless
2002 #define yyless(n) \
2003         do \
2004                 { \
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'; \
2010                 yyleng = n; \
2011                 } \
2012         while ( 0 )
2013
2014
2015 /* Internal utility routines. */
2016
2017 #ifndef yytext_ptr
2018 static void yy_flex_strncpy( s1, s2, n )
2019 char *s1;
2020 const char *s2;
2021 int n;
2022         {
2023         register int i;
2024         for ( i = 0; i < n; ++i )
2025                 s1[i] = s2[i];
2026         }
2027 #endif
2028
2029
2030 static genericptr_t yy_flex_alloc( size )
2031 yy_size_t size;
2032         {
2033         return (genericptr_t) alloc((unsigned)size);
2034         }
2035
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 )
2039 genericptr_t ptr;
2040 yy_size_t size;
2041 int old_size;
2042         {
2043         genericptr_t outptr = yy_flex_alloc(size);
2044
2045         if (ptr) {
2046             char *p = (char *) outptr, *q = (char *) ptr;
2047
2048             while (--old_size >= 0) *p++ = *q++;
2049             yy_flex_free(ptr);
2050         }
2051         return outptr;
2052         }
2053
2054 static void yy_flex_free( ptr )
2055 genericptr_t ptr;
2056         {
2057         free( ptr );
2058         }
2059
2060 /*flexhack.skl*/
2061
2062 #ifdef  AMIGA
2063 long *alloc(n)
2064         unsigned n;
2065 {
2066         return ((long *)malloc (n));
2067 }
2068 #endif
2069
2070 /* routine to switch to another input file; needed for flex */
2071 void init_yyin( input_f )
2072 FILE *input_f;
2073 {
2074 #if defined(FLEX_SCANNER) || defined(FLEXHACK_SCANNER)
2075         if (yyin)
2076             yyrestart(input_f);
2077         else
2078 #endif
2079             yyin = input_f;
2080 }
2081 /* analogous routine (for completeness) */
2082 void init_yyout( output_f )
2083 FILE *output_f;
2084 {
2085         yyout = output_f;
2086 }
2087
2088 /*lev_comp.l*/