|
0 |
/* A lexical scanner generated by flex */
|
|
1 |
|
|
2 |
/* Scanner skeleton version:
|
|
3 |
* $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
|
|
4 |
*/
|
|
5 |
|
|
6 |
#define FLEX_SCANNER
|
|
7 |
#define YY_FLEX_MAJOR_VERSION 2
|
|
8 |
#define YY_FLEX_MINOR_VERSION 5
|
|
9 |
|
|
10 |
#include <stdio.h>
|
|
11 |
|
|
12 |
|
|
13 |
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
|
|
14 |
#ifdef c_plusplus
|
|
15 |
#ifndef __cplusplus
|
|
16 |
#define __cplusplus
|
|
17 |
#endif
|
|
18 |
#endif
|
|
19 |
|
|
20 |
|
|
21 |
#ifdef __cplusplus
|
|
22 |
|
|
23 |
#include <stdlib.h>
|
|
24 |
#include <unistd.h>
|
|
25 |
|
|
26 |
/* Use prototypes in function declarations. */
|
|
27 |
#define YY_USE_PROTOS
|
|
28 |
|
|
29 |
/* The "const" storage-class-modifier is valid. */
|
|
30 |
#define YY_USE_CONST
|
|
31 |
|
|
32 |
#else /* ! __cplusplus */
|
|
33 |
|
|
34 |
#if __STDC__
|
|
35 |
|
|
36 |
#define YY_USE_PROTOS
|
|
37 |
#define YY_USE_CONST
|
|
38 |
|
|
39 |
#endif /* __STDC__ */
|
|
40 |
#endif /* ! __cplusplus */
|
|
41 |
|
|
42 |
#ifdef __TURBOC__
|
|
43 |
#pragma warn -rch
|
|
44 |
#pragma warn -use
|
|
45 |
#include <io.h>
|
|
46 |
#include <stdlib.h>
|
|
47 |
#define YY_USE_CONST
|
|
48 |
#define YY_USE_PROTOS
|
|
49 |
#endif
|
|
50 |
|
|
51 |
#ifdef YY_USE_CONST
|
|
52 |
#define yyconst const
|
|
53 |
#else
|
|
54 |
#define yyconst
|
|
55 |
#endif
|
|
56 |
|
|
57 |
|
|
58 |
#ifdef YY_USE_PROTOS
|
|
59 |
#define YY_PROTO(proto) proto
|
|
60 |
#else
|
|
61 |
#define YY_PROTO(proto) ()
|
|
62 |
#endif
|
|
63 |
|
|
64 |
/* Returned upon end-of-file. */
|
|
65 |
#define YY_NULL 0
|
|
66 |
|
|
67 |
/* Promotes a possibly negative, possibly signed char to an unsigned
|
|
68 |
* integer for use as an array index. If the signed char is negative,
|
|
69 |
* we want to instead treat it as an 8-bit unsigned char, hence the
|
|
70 |
* double cast.
|
|
71 |
*/
|
|
72 |
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
|
|
73 |
|
|
74 |
/* Enter a start condition. This macro really ought to take a parameter,
|
|
75 |
* but we do it the disgusting crufty way forced on us by the ()-less
|
|
76 |
* definition of BEGIN.
|
|
77 |
*/
|
|
78 |
#define BEGIN yy_start = 1 + 2 *
|
|
79 |
|
|
80 |
/* Translate the current start state into a value that can be later handed
|
|
81 |
* to BEGIN to return to the state. The YYSTATE alias is for lex
|
|
82 |
* compatibility.
|
|
83 |
*/
|
|
84 |
#define YY_START ((yy_start - 1) / 2)
|
|
85 |
#define YYSTATE YY_START
|
|
86 |
|
|
87 |
/* Action number for EOF rule of a given start state. */
|
|
88 |
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
|
|
89 |
|
|
90 |
/* Special action meaning "start processing a new file". */
|
|
91 |
#define YY_NEW_FILE yyrestart( yyin )
|
|
92 |
|
|
93 |
#define YY_END_OF_BUFFER_CHAR 0
|
|
94 |
|
|
95 |
/* Size of default input buffer. */
|
|
96 |
#define YY_BUF_SIZE 16384
|
|
97 |
|
|
98 |
typedef struct yy_buffer_state *YY_BUFFER_STATE;
|
|
99 |
|
|
100 |
extern int yyleng;
|
|
101 |
extern FILE *yyin, *yyout;
|
|
102 |
|
|
103 |
#define EOB_ACT_CONTINUE_SCAN 0
|
|
104 |
#define EOB_ACT_END_OF_FILE 1
|
|
105 |
#define EOB_ACT_LAST_MATCH 2
|
|
106 |
|
|
107 |
/* The funky do-while in the following #define is used to turn the definition
|
|
108 |
* int a single C statement (which needs a semi-colon terminator). This
|
|
109 |
* avoids problems with code like:
|
|
110 |
*
|
|
111 |
* if ( condition_holds )
|
|
112 |
* yyless( 5 );
|
|
113 |
* else
|
|
114 |
* do_something_else();
|
|
115 |
*
|
|
116 |
* Prior to using the do-while the compiler would get upset at the
|
|
117 |
* "else" because it interpreted the "if" statement as being all
|
|
118 |
* done when it reached the ';' after the yyless() call.
|
|
119 |
*/
|
|
120 |
|
|
121 |
/* Return all but the first 'n' matched characters back to the input stream. */
|
|
122 |
|
|
123 |
#define yyless(n) \
|
|
124 |
do \
|
|
125 |
{ \
|
|
126 |
/* Undo effects of setting up yytext. */ \
|
|
127 |
*yy_cp = yy_hold_char; \
|
|
128 |
YY_RESTORE_YY_MORE_OFFSET \
|
|
129 |
yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
|
|
130 |
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
|
|
131 |
} \
|
|
132 |
while ( 0 )
|
|
133 |
|
|
134 |
#define unput(c) yyunput( c, yytext_ptr )
|
|
135 |
|
|
136 |
/* The following is because we cannot portably get our hands on size_t
|
|
137 |
* (without autoconf's help, which isn't available because we want
|
|
138 |
* flex-generated scanners to compile on their own).
|
|
139 |
*/
|
|
140 |
typedef unsigned int yy_size_t;
|
|
141 |
|
|
142 |
|
|
143 |
struct yy_buffer_state
|
|
144 |
{
|
|
145 |
FILE *yy_input_file;
|
|
146 |
|
|
147 |
char *yy_ch_buf; /* input buffer */
|
|
148 |
char *yy_buf_pos; /* current position in input buffer */
|
|
149 |
|
|
150 |
/* Size of input buffer in bytes, not including room for EOB
|
|
151 |
* characters.
|
|
152 |
*/
|
|
153 |
yy_size_t yy_buf_size;
|
|
154 |
|
|
155 |
/* Number of characters read into yy_ch_buf, not including EOB
|
|
156 |
* characters.
|
|
157 |
*/
|
|
158 |
int yy_n_chars;
|
|
159 |
|
|
160 |
/* Whether we "own" the buffer - i.e., we know we created it,
|
|
161 |
* and can realloc() it to grow it, and should free() it to
|
|
162 |
* delete it.
|
|
163 |
*/
|
|
164 |
int yy_is_our_buffer;
|
|
165 |
|
|
166 |
/* Whether this is an "interactive" input source; if so, and
|
|
167 |
* if we're using stdio for input, then we want to use getc()
|
|
168 |
* instead of fread(), to make sure we stop fetching input after
|
|
169 |
* each newline.
|
|
170 |
*/
|
|
171 |
int yy_is_interactive;
|
|
172 |
|
|
173 |
/* Whether we're considered to be at the beginning of a line.
|
|
174 |
* If so, '^' rules will be active on the next match, otherwise
|
|
175 |
* not.
|
|
176 |
*/
|
|
177 |
int yy_at_bol;
|
|
178 |
|
|
179 |
/* Whether to try to fill the input buffer when we reach the
|
|
180 |
* end of it.
|
|
181 |
*/
|
|
182 |
int yy_fill_buffer;
|
|
183 |
|
|
184 |
int yy_buffer_status;
|
|
185 |
#define YY_BUFFER_NEW 0
|
|
186 |
#define YY_BUFFER_NORMAL 1
|
|
187 |
/* When an EOF's been seen but there's still some text to process
|
|
188 |
* then we mark the buffer as YY_EOF_PENDING, to indicate that we
|
|
189 |
* shouldn't try reading from the input source any more. We might
|
|
190 |
* still have a bunch of tokens to match, though, because of
|
|
191 |
* possible backing-up.
|
|
192 |
*
|
|
193 |
* When we actually see the EOF, we change the status to "new"
|
|
194 |
* (via yyrestart()), so that the user can continue scanning by
|
|
195 |
* just pointing yyin at a new input file.
|
|
196 |
*/
|
|
197 |
#define YY_BUFFER_EOF_PENDING 2
|
|
198 |
};
|
|
199 |
|
|
200 |
static YY_BUFFER_STATE yy_current_buffer = 0;
|
|
201 |
|
|
202 |
/* We provide macros for accessing buffer states in case in the
|
|
203 |
* future we want to put the buffer states in a more general
|
|
204 |
* "scanner state".
|
|
205 |
*/
|
|
206 |
#define YY_CURRENT_BUFFER yy_current_buffer
|
|
207 |
|
|
208 |
|
|
209 |
/* yy_hold_char holds the character lost when yytext is formed. */
|
|
210 |
static char yy_hold_char;
|
|
211 |
|
|
212 |
static int yy_n_chars; /* number of characters read into yy_ch_buf */
|
|
213 |
|
|
214 |
|
|
215 |
int yyleng;
|
|
216 |
|
|
217 |
/* Points to current character in buffer. */
|
|
218 |
static char *yy_c_buf_p = (char *) 0;
|
|
219 |
static int yy_init = 1; /* whether we need to initialize */
|
|
220 |
static int yy_start = 0; /* start state number */
|
|
221 |
|
|
222 |
/* Flag which is used to allow yywrap()'s to do buffer switches
|
|
223 |
* instead of setting up a fresh yyin. A bit of a hack ...
|
|
224 |
*/
|
|
225 |
static int yy_did_buffer_switch_on_eof;
|
|
226 |
|
|
227 |
void yyrestart YY_PROTO(( FILE *input_file ));
|
|
228 |
|
|
229 |
void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
|
|
230 |
void yy_load_buffer_state YY_PROTO(( void ));
|
|
231 |
YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
|
|
232 |
void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
|
|
233 |
void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
|
|
234 |
void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
|
|
235 |
#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
|
|
236 |
|
|
237 |
YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
|
|
238 |
YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
|
|
239 |
YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
|
|
240 |
|
|
241 |
static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
|
|
242 |
static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
|
|
243 |
static void yy_flex_free YY_PROTO(( void * ));
|
|
244 |
|
|
245 |
#define yy_new_buffer yy_create_buffer
|
|
246 |
|
|
247 |
#define yy_set_interactive(is_interactive) \
|
|
248 |
{ \
|
|
249 |
if ( ! yy_current_buffer ) \
|
|
250 |
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
|
|
251 |
yy_current_buffer->yy_is_interactive = is_interactive; \
|
|
252 |
}
|
|
253 |
|
|
254 |
#define yy_set_bol(at_bol) \
|
|
255 |
{ \
|
|
256 |
if ( ! yy_current_buffer ) \
|
|
257 |
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
|
|
258 |
yy_current_buffer->yy_at_bol = at_bol; \
|
|
259 |
}
|
|
260 |
|
|
261 |
#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
|
|
262 |
|
|
263 |
|
|
264 |
#define yywrap() 1
|
|
265 |
#define YY_SKIP_YYWRAP
|
|
266 |
typedef unsigned char YY_CHAR;
|
|
267 |
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
|
|
268 |
typedef int yy_state_type;
|
|
269 |
extern char *yytext;
|
|
270 |
#define yytext_ptr yytext
|
|
271 |
|
|
272 |
static yy_state_type yy_get_previous_state YY_PROTO(( void ));
|
|
273 |
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
|
|
274 |
static int yy_get_next_buffer YY_PROTO(( void ));
|
|
275 |
static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
|
|
276 |
|
|
277 |
/* Done after the current pattern has been matched and before the
|
|
278 |
* corresponding action - sets up yytext.
|
|
279 |
*/
|
|
280 |
#define YY_DO_BEFORE_ACTION \
|
|
281 |
yytext_ptr = yy_bp; \
|
|
282 |
yyleng = (int) (yy_cp - yy_bp); \
|
|
283 |
yy_hold_char = *yy_cp; \
|
|
284 |
*yy_cp = '\0'; \
|
|
285 |
yy_c_buf_p = yy_cp;
|
|
286 |
|
|
287 |
#define YY_NUM_RULES 56
|
|
288 |
#define YY_END_OF_BUFFER 57
|
|
289 |
static yyconst short int yy_accept[240] =
|
|
290 |
{ 0,
|
|
291 |
0, 0, 57, 55, 54, 2, 19, 55, 3, 20,
|
|
292 |
16, 55, 55, 55, 55, 55, 55, 55, 55, 55,
|
|
293 |
55, 55, 55, 55, 55, 55, 55, 55, 17, 18,
|
|
294 |
54, 0, 0, 3, 0, 0, 0, 0, 0, 0,
|
|
295 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
296 |
51, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
297 |
0, 0, 0, 0, 0, 0, 0, 53, 1, 0,
|
|
298 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
299 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
300 |
8, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
301 |
|
|
302 |
0, 0, 0, 49, 0, 0, 0, 0, 0, 24,
|
|
303 |
0, 0, 7, 0, 0, 0, 0, 0, 0, 42,
|
|
304 |
0, 0, 0, 25, 0, 0, 10, 0, 0, 0,
|
|
305 |
0, 43, 50, 26, 0, 0, 0, 23, 0, 37,
|
|
306 |
0, 0, 35, 0, 6, 52, 44, 0, 0, 41,
|
|
307 |
4, 0, 0, 21, 0, 0, 0, 22, 5, 0,
|
|
308 |
39, 40, 0, 0, 0, 31, 32, 9, 0, 0,
|
|
309 |
0, 0, 47, 38, 0, 0, 0, 0, 0, 0,
|
|
310 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
311 |
0, 0, 0, 28, 27, 30, 29, 0, 0, 0,
|
|
312 |
|
|
313 |
0, 48, 0, 0, 34, 0, 0, 0, 11, 0,
|
|
314 |
0, 0, 0, 0, 46, 45, 15, 33, 0, 0,
|
|
315 |
0, 0, 0, 0, 0, 13, 0, 0, 0, 0,
|
|
316 |
14, 0, 0, 0, 12, 0, 0, 36, 0
|
|
317 |
} ;
|
|
318 |
|
|
319 |
static yyconst int yy_ec[256] =
|
|
320 |
{ 0,
|
|
321 |
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
|
|
322 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
323 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
324 |
1, 2, 1, 4, 5, 1, 1, 1, 1, 1,
|
|
325 |
1, 1, 1, 1, 1, 1, 1, 6, 6, 6,
|
|
326 |
6, 6, 6, 6, 6, 6, 6, 1, 7, 1,
|
|
327 |
8, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
328 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
329 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
330 |
1, 1, 1, 1, 9, 1, 10, 11, 12, 13,
|
|
331 |
|
|
332 |
14, 15, 16, 17, 18, 1, 19, 20, 21, 22,
|
|
333 |
23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
|
|
334 |
33, 34, 35, 1, 36, 1, 1, 1, 1, 1,
|
|
335 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
336 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
337 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
338 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
339 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
340 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
341 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
342 |
|
|
343 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
344 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
345 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
346 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
347 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
348 |
1, 1, 1, 1, 1
|
|
349 |
} ;
|
|
350 |
|
|
351 |
static yyconst int yy_meta[37] =
|
|
352 |
{ 0,
|
|
353 |
1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
|
|
354 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
355 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
356 |
1, 1, 1, 1, 1, 1
|
|
357 |
} ;
|
|
358 |
|
|
359 |
static yyconst short int yy_base[242] =
|
|
360 |
{ 0,
|
|
361 |
0, 0, 248, 249, 245, 249, 0, 0, 240, 249,
|
|
362 |
249, 27, 15, 29, 30, 219, 19, 29, 221, 220,
|
|
363 |
224, 30, 36, 37, 221, 226, 48, 225, 249, 249,
|
|
364 |
236, 233, 233, 229, 222, 35, 213, 209, 204, 219,
|
|
365 |
201, 210, 207, 194, 215, 198, 199, 192, 206, 193,
|
|
366 |
193, 194, 42, 186, 203, 186, 200, 203, 188, 190,
|
|
367 |
181, 185, 180, 181, 186, 178, 177, 199, 249, 183,
|
|
368 |
172, 180, 170, 171, 169, 173, 169, 166, 166, 178,
|
|
369 |
167, 172, 175, 174, 173, 176, 47, 171, 155, 155,
|
|
370 |
249, 168, 153, 166, 153, 164, 163, 162, 161, 148,
|
|
371 |
|
|
372 |
145, 152, 143, 249, 154, 142, 159, 146, 139, 249,
|
|
373 |
134, 131, 249, 149, 149, 144, 126, 133, 138, 249,
|
|
374 |
139, 146, 138, 132, 135, 126, 249, 134, 137, 121,
|
|
375 |
122, 249, 249, 249, 137, 128, 121, 249, 118, 249,
|
|
376 |
54, 121, 249, 133, 249, 249, 132, 131, 116, 249,
|
|
377 |
249, 126, 117, 249, 118, 109, 116, 249, 249, 124,
|
|
378 |
249, 249, 120, 121, 107, 249, 249, 249, 50, 117,
|
|
379 |
115, 105, 249, 249, 110, 111, 112, 110, 112, 97,
|
|
380 |
91, 42, 60, 96, 100, 89, 99, 102, 86, 99,
|
|
381 |
92, 97, 88, 249, 249, 249, 249, 95, 82, 97,
|
|
382 |
|
|
383 |
78, 249, 67, 85, 249, 78, 90, 87, 249, 81,
|
|
384 |
87, 87, 85, 87, 249, 249, 249, 249, 70, 72,
|
|
385 |
85, 60, 78, 76, 66, 249, 78, 72, 57, 64,
|
|
386 |
249, 55, 55, 56, 249, 50, 50, 249, 249, 45,
|
|
387 |
44
|
|
388 |
} ;
|
|
389 |
|
|
390 |
static yyconst short int yy_def[242] =
|
|
391 |
{ 0,
|
|
392 |
239, 1, 239, 239, 239, 239, 240, 241, 239, 239,
|
|
393 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
394 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
395 |
239, 240, 241, 239, 239, 239, 239, 239, 239, 239,
|
|
396 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
397 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
398 |
239, 239, 239, 239, 239, 239, 239, 240, 239, 239,
|
|
399 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
400 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
401 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
402 |
|
|
403 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
404 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
405 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
406 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
407 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
408 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
409 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
410 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
411 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
412 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
413 |
|
|
414 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
415 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
416 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
417 |
239, 239, 239, 239, 239, 239, 239, 239, 0, 239,
|
|
418 |
239
|
|
419 |
} ;
|
|
420 |
|
|
421 |
static yyconst short int yy_nxt[286] =
|
|
422 |
{ 0,
|
|
423 |
4, 5, 6, 7, 8, 9, 10, 11, 4, 4,
|
|
424 |
12, 13, 4, 14, 15, 16, 17, 4, 4, 18,
|
|
425 |
19, 20, 4, 21, 4, 22, 23, 24, 25, 26,
|
|
426 |
27, 4, 28, 4, 29, 30, 35, 37, 39, 43,
|
|
427 |
38, 46, 48, 53, 33, 32, 49, 44, 40, 36,
|
|
428 |
41, 47, 54, 55, 60, 194, 71, 65, 56, 57,
|
|
429 |
42, 66, 61, 58, 59, 72, 89, 122, 90, 62,
|
|
430 |
166, 182, 195, 196, 123, 212, 183, 238, 237, 236,
|
|
431 |
213, 235, 234, 167, 233, 232, 231, 230, 229, 228,
|
|
432 |
197, 227, 226, 225, 224, 223, 222, 221, 220, 219,
|
|
433 |
|
|
434 |
218, 217, 216, 215, 214, 211, 210, 209, 208, 207,
|
|
435 |
206, 205, 204, 203, 202, 201, 200, 199, 198, 193,
|
|
436 |
192, 191, 190, 189, 188, 187, 186, 185, 184, 181,
|
|
437 |
180, 179, 178, 177, 176, 175, 174, 173, 172, 171,
|
|
438 |
170, 169, 168, 165, 164, 163, 162, 161, 160, 159,
|
|
439 |
158, 157, 156, 155, 154, 153, 152, 151, 150, 149,
|
|
440 |
148, 147, 146, 145, 144, 143, 142, 141, 140, 139,
|
|
441 |
138, 137, 136, 135, 134, 133, 132, 131, 130, 129,
|
|
442 |
128, 127, 126, 125, 124, 121, 120, 119, 118, 117,
|
|
443 |
116, 115, 114, 113, 112, 111, 110, 109, 108, 107,
|
|
444 |
|
|
445 |
106, 105, 68, 104, 103, 102, 101, 100, 99, 98,
|
|
446 |
97, 96, 95, 94, 93, 92, 91, 88, 87, 86,
|
|
447 |
85, 84, 83, 82, 81, 80, 79, 78, 77, 76,
|
|
448 |
75, 74, 73, 70, 34, 69, 68, 31, 67, 64,
|
|
449 |
63, 52, 51, 50, 45, 34, 31, 239, 3, 239,
|
|
450 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
451 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
452 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
453 |
239, 239, 239, 239, 239
|
|
454 |
} ;
|
|
455 |
|
|
456 |
static yyconst short int yy_chk[286] =
|
|
457 |
{ 0,
|
|
458 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
459 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
460 |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
461 |
1, 1, 1, 1, 1, 1, 12, 13, 14, 15,
|
|
462 |
13, 17, 18, 22, 241, 240, 18, 15, 14, 12,
|
|
463 |
14, 17, 22, 23, 24, 182, 36, 27, 23, 23,
|
|
464 |
14, 27, 24, 23, 23, 36, 53, 87, 53, 24,
|
|
465 |
141, 169, 182, 183, 87, 203, 169, 237, 236, 234,
|
|
466 |
203, 233, 232, 141, 230, 229, 228, 227, 225, 224,
|
|
467 |
183, 223, 222, 221, 220, 219, 214, 213, 212, 211,
|
|
468 |
|
|
469 |
210, 208, 207, 206, 204, 201, 200, 199, 198, 193,
|
|
470 |
192, 191, 190, 189, 188, 187, 186, 185, 184, 181,
|
|
471 |
180, 179, 178, 177, 176, 175, 172, 171, 170, 165,
|
|
472 |
164, 163, 160, 157, 156, 155, 153, 152, 149, 148,
|
|
473 |
147, 144, 142, 139, 137, 136, 135, 131, 130, 129,
|
|
474 |
128, 126, 125, 124, 123, 122, 121, 119, 118, 117,
|
|
475 |
116, 115, 114, 112, 111, 109, 108, 107, 106, 105,
|
|
476 |
103, 102, 101, 100, 99, 98, 97, 96, 95, 94,
|
|
477 |
93, 92, 90, 89, 88, 86, 85, 84, 83, 82,
|
|
478 |
81, 80, 79, 78, 77, 76, 75, 74, 73, 72,
|
|
479 |
|
|
480 |
71, 70, 68, 67, 66, 65, 64, 63, 62, 61,
|
|
481 |
60, 59, 58, 57, 56, 55, 54, 52, 51, 50,
|
|
482 |
49, 48, 47, 46, 45, 44, 43, 42, 41, 40,
|
|
483 |
39, 38, 37, 35, 34, 33, 32, 31, 28, 26,
|
|
484 |
25, 21, 20, 19, 16, 9, 5, 3, 239, 239,
|
|
485 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
486 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
487 |
239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
|
|
488 |
239, 239, 239, 239, 239
|
|
489 |
} ;
|
|
490 |
|
|
491 |
static yy_state_type yy_last_accepting_state;
|
|
492 |
static char *yy_last_accepting_cpos;
|
|
493 |
|
|
494 |
/* The intent behind this definition is that it'll catch
|
|
495 |
* any uses of REJECT which flex missed.
|
|
496 |
*/
|
|
497 |
#define REJECT reject_used_but_not_detected
|
|
498 |
#define yymore() yymore_used_but_not_detected
|
|
499 |
#define YY_MORE_ADJ 0
|
|
500 |
#define YY_RESTORE_YY_MORE_OFFSET
|
|
501 |
char *yytext;
|
|
502 |
#line 1 "level.ll"
|
|
503 |
#define INITIAL 0
|
|
504 |
/************************************************************************
|
|
505 |
-------------------
|
|
506 |
begin : Fri Dec 8 2000
|
|
507 |
copyright : (C) 2000 by Waldemar Baraldi
|
|
508 |
email : baraldi@lacasilla.com.ar
|
|
509 |
***************************************************************************/
|
|
510 |
/***************************************************************************
|
|
511 |
* *
|
|
512 |
* This program is free software; you can redistribute it and/or modify *
|
|
513 |
* it under the terms of the GNU General Public License as published by *
|
|
514 |
* the Free Software Foundation; either version 2 of the License, or *
|
|
515 |
* (at your option) any later version. *
|
|
516 |
* *
|
|
517 |
***************************************************************************/
|
|
518 |
#line 18 "level.ll"
|
|
519 |
#include "level.h"
|
|
520 |
#include "pipe.h"
|
|
521 |
#include "elbowupleft.h"
|
|
522 |
#include "elbowupright.h"
|
|
523 |
#include "elbowdownleft.h"
|
|
524 |
#include "elbowdownright.h"
|
|
525 |
#include "vertical.h"
|
|
526 |
#include "horizontal.h"
|
|
527 |
#include "verticalbowl.h"
|
|
528 |
#include "horizontalbowl.h"
|
|
529 |
#include "cross.h"
|
|
530 |
#include "entry.h"
|
|
531 |
#include "exit.h"
|
|
532 |
|
|
533 |
#define NUMBER 1
|
|
534 |
#define LEVEL 2
|
|
535 |
#define SPEED 3
|
|
536 |
#define GRAPH_DIR 4
|
|
537 |
#define PIPENIGHTDREAMS 5
|
|
538 |
#define ENTRY 6
|
|
539 |
#define EXIT 7
|
|
540 |
#define ROW 8
|
|
541 |
#define COLUMN 9
|
|
542 |
#define SIDE 10
|
|
543 |
#define O_BLOCK 11
|
|
544 |
#define C_BLOCK 12
|
|
545 |
#define DOUBLE_COUTE 13
|
|
546 |
#define EQUAL 15
|
|
547 |
#define SEMICOLON 16
|
|
548 |
#define EOFILE 17
|
|
549 |
#define NORTH 18
|
|
550 |
#define SOUTH 19
|
|
551 |
#define WEST 20
|
|
552 |
#define EAST 21
|
|
553 |
#define STRING 22
|
|
554 |
#define START_DELAY 23
|
|
555 |
#define RESTRICT_COEF 24
|
|
556 |
#define FIXED_COEF 25
|
|
557 |
#define PIPE 26
|
|
558 |
#define REQUIRED 150
|
|
559 |
|
|
560 |
#define TYPE 27
|
|
561 |
// Possible values for TYPE
|
|
562 |
#define ELBOW_NW 28
|
|
563 |
#define ELBOW_NE 29
|
|
564 |
#define ELBOW_SW 30
|
|
565 |
#define ELBOW_SE 31
|
|
566 |
#define BOWL_H 32
|
|
567 |
#define BOWL_V 33
|
|
568 |
#define HORIZONTAL 34
|
|
569 |
#define VERTICAL 35
|
|
570 |
#define CROSS 36
|
|
571 |
|
|
572 |
#define RESTRICTED_OUTPUT 37
|
|
573 |
|
|
574 |
#define BONUS 38
|
|
575 |
// Possible values for BONUS
|
|
576 |
#define NORMAL 40
|
|
577 |
#define SUPER 41
|
|
578 |
#define ULTRA 42
|
|
579 |
#define HYPER 43
|
|
580 |
#define EXTRA_LIFE 44
|
|
581 |
#define EXTRA_TIME 45
|
|
582 |
|
|
583 |
#define FIXED 46
|
|
584 |
|
|
585 |
#define TRUE 47
|
|
586 |
#define FALSE 48
|
|
587 |
|
|
588 |
#define BACKGROUND 49
|
|
589 |
//Posibles valores para background
|
|
590 |
#define WALLPAPER 50
|
|
591 |
#define MOSAIC 51
|
|
592 |
|
|
593 |
|
|
594 |
#define INVALID 100
|
|
595 |
|
|
596 |
int nline;
|
|
597 |
#define YY_NO_UNPUT 1
|
|
598 |
#line 600 "lex.yy.c"
|
|
599 |
|
|
600 |
/* Macros after this point can all be overridden by user definitions in
|
|
601 |
* section 1.
|
|
602 |
*/
|
|
603 |
|
|
604 |
#ifndef YY_SKIP_YYWRAP
|
|
605 |
#ifdef __cplusplus
|
|
606 |
extern "C" int yywrap YY_PROTO(( void ));
|
|
607 |
#else
|
|
608 |
extern int yywrap YY_PROTO(( void ));
|
|
609 |
#endif
|
|
610 |
#endif
|
|
611 |
|
|
612 |
#ifndef YY_NO_UNPUT
|
|
613 |
static void yyunput YY_PROTO(( int c, char *buf_ptr ));
|
|
614 |
#endif
|
|
615 |
|
|
616 |
#ifndef yytext_ptr
|
|
617 |
static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
|
|
618 |
#endif
|
|
619 |
|
|
620 |
#ifdef YY_NEED_STRLEN
|
|
621 |
static int yy_flex_strlen YY_PROTO(( yyconst char * ));
|
|
622 |
#endif
|
|
623 |
|
|
624 |
#ifndef YY_NO_INPUT
|
|
625 |
#ifdef __cplusplus
|
|
626 |
static int yyinput YY_PROTO(( void ));
|
|
627 |
#else
|
|
628 |
static int input YY_PROTO(( void ));
|
|
629 |
#endif
|
|
630 |
#endif
|
|
631 |
|
|
632 |
#if YY_STACK_USED
|
|
633 |
static int yy_start_stack_ptr = 0;
|
|
634 |
static int yy_start_stack_depth = 0;
|
|
635 |
static int *yy_start_stack = 0;
|
|
636 |
#ifndef YY_NO_PUSH_STATE
|
|
637 |
static void yy_push_state YY_PROTO(( int new_state ));
|
|
638 |
#endif
|
|
639 |
#ifndef YY_NO_POP_STATE
|
|
640 |
static void yy_pop_state YY_PROTO(( void ));
|
|
641 |
#endif
|
|
642 |
#ifndef YY_NO_TOP_STATE
|
|
643 |
static int yy_top_state YY_PROTO(( void ));
|
|
644 |
#endif
|
|
645 |
|
|
646 |
#else
|
|
647 |
#define YY_NO_PUSH_STATE 1
|
|
648 |
#define YY_NO_POP_STATE 1
|
|
649 |
#define YY_NO_TOP_STATE 1
|
|
650 |
#endif
|
|
651 |
|
|
652 |
#ifdef YY_MALLOC_DECL
|
|
653 |
YY_MALLOC_DECL
|
|
654 |
#else
|
|
655 |
#if __STDC__
|
|
656 |
#ifndef __cplusplus
|
|
657 |
#include <stdlib.h>
|
|
658 |
#endif
|
|
659 |
#else
|
|
660 |
/* Just try to get by without declaring the routines. This will fail
|
|
661 |
* miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
|
|
662 |
* or sizeof(void*) != sizeof(int).
|
|
663 |
*/
|
|
664 |
#endif
|
|
665 |
#endif
|
|
666 |
|
|
667 |
/* Amount of stuff to slurp up with each read. */
|
|
668 |
#ifndef YY_READ_BUF_SIZE
|
|
669 |
#define YY_READ_BUF_SIZE 8192
|
|
670 |
#endif
|
|
671 |
|
|
672 |
/* Copy whatever the last rule matched to the standard output. */
|
|
673 |
|
|
674 |
#ifndef ECHO
|
|
675 |
/* This used to be an fputs(), but since the string might contain NUL's,
|
|
676 |
* we now use fwrite().
|
|
677 |
*/
|
|
678 |
#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
|
|
679 |
#endif
|
|
680 |
|
|
681 |
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
|
|
682 |
* is returned in "result".
|
|
683 |
*/
|
|
684 |
#ifndef YY_INPUT
|
|
685 |
#define YY_INPUT(buf,result,max_size) \
|
|
686 |
if ( yy_current_buffer->yy_is_interactive ) \
|
|
687 |
{ \
|
|
688 |
int c = '*', n; \
|
|
689 |
for ( n = 0; n < max_size && \
|
|
690 |
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
|
|
691 |
buf[n] = (char) c; \
|
|
692 |
if ( c == '\n' ) \
|
|
693 |
buf[n++] = (char) c; \
|
|
694 |
if ( c == EOF && ferror( yyin ) ) \
|
|
695 |
YY_FATAL_ERROR( "input in flex scanner failed" ); \
|
|
696 |
result = n; \
|
|
697 |
} \
|
|
698 |
else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
|
|
699 |
&& ferror( yyin ) ) \
|
|
700 |
YY_FATAL_ERROR( "input in flex scanner failed" );
|
|
701 |
#endif
|
|
702 |
|
|
703 |
/* No semi-colon after return; correct usage is to write "yyterminate();" -
|
|
704 |
* we don't want an extra ';' after the "return" because that will cause
|
|
705 |
* some compilers to complain about unreachable statements.
|
|
706 |
*/
|
|
707 |
#ifndef yyterminate
|
|
708 |
#define yyterminate() return YY_NULL
|
|
709 |
#endif
|
|
710 |
|
|
711 |
/* Number of entries by which start-condition stack grows. */
|
|
712 |
#ifndef YY_START_STACK_INCR
|
|
713 |
#define YY_START_STACK_INCR 25
|
|
714 |
#endif
|
|
715 |
|
|
716 |
/* Report a fatal error. */
|
|
717 |
#ifndef YY_FATAL_ERROR
|
|
718 |
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
|
|
719 |
#endif
|
|
720 |
|
|
721 |
/* Default declaration of generated scanner - a define so the user can
|
|
722 |
* easily add parameters.
|
|
723 |
*/
|
|
724 |
#ifndef YY_DECL
|
|
725 |
#define YY_DECL int yylex YY_PROTO(( void ))
|
|
726 |
#endif
|
|
727 |
|
|
728 |
/* Code executed at the beginning of each rule, after yytext and yyleng
|
|
729 |
* have been set up.
|
|
730 |
*/
|
|
731 |
#ifndef YY_USER_ACTION
|
|
732 |
#define YY_USER_ACTION
|
|
733 |
#endif
|
|
734 |
|
|
735 |
/* Code executed at the end of each rule. */
|
|
736 |
#ifndef YY_BREAK
|
|
737 |
#define YY_BREAK break;
|
|
738 |
#endif
|
|
739 |
|
|
740 |
#define YY_RULE_SETUP \
|
|
741 |
YY_USER_ACTION
|
|
742 |
|
|
743 |
YY_DECL
|
|
744 |
{
|
|
745 |
register yy_state_type yy_current_state;
|
|
746 |
register char *yy_cp, *yy_bp;
|
|
747 |
register int yy_act;
|
|
748 |
|
|
749 |
#line 104 "level.ll"
|
|
750 |
|
|
751 |
|
|
752 |
#line 754 "lex.yy.c"
|
|
753 |
|
|
754 |
if ( yy_init )
|
|
755 |
{
|
|
756 |
yy_init = 0;
|
|
757 |
|
|
758 |
#ifdef YY_USER_INIT
|
|
759 |
YY_USER_INIT;
|
|
760 |
#endif
|
|
761 |
|
|
762 |
if ( ! yy_start )
|
|
763 |
yy_start = 1; /* first start state */
|
|
764 |
|
|
765 |
if ( ! yyin )
|
|
766 |
yyin = stdin;
|
|
767 |
|
|
768 |
if ( ! yyout )
|
|
769 |
yyout = stdout;
|
|
770 |
|
|
771 |
if ( ! yy_current_buffer )
|
|
772 |
yy_current_buffer =
|
|
773 |
yy_create_buffer( yyin, YY_BUF_SIZE );
|
|
774 |
|
|
775 |
yy_load_buffer_state();
|
|
776 |
}
|
|
777 |
|
|
778 |
while ( 1 ) /* loops until end-of-file is reached */
|
|
779 |
{
|
|
780 |
yy_cp = yy_c_buf_p;
|
|
781 |
|
|
782 |
/* Support of yytext. */
|
|
783 |
*yy_cp = yy_hold_char;
|
|
784 |
|
|
785 |
/* yy_bp points to the position in yy_ch_buf of the start of
|
|
786 |
* the current run.
|
|
787 |
*/
|
|
788 |
yy_bp = yy_cp;
|
|
789 |
|
|
790 |
yy_current_state = yy_start;
|
|
791 |
yy_match:
|
|
792 |
do
|
|
793 |
{
|
|
794 |
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
|
|
795 |
if ( yy_accept[yy_current_state] )
|
|
796 |
{
|
|
797 |
yy_last_accepting_state = yy_current_state;
|
|
798 |
yy_last_accepting_cpos = yy_cp;
|
|
799 |
}
|
|
800 |
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
|
|
801 |
{
|
|
802 |
yy_current_state = (int) yy_def[yy_current_state];
|
|
803 |
if ( yy_current_state >= 240 )
|
|
804 |
yy_c = yy_meta[(unsigned int) yy_c];
|
|
805 |
}
|
|
806 |
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
|
|
807 |
++yy_cp;
|
|
808 |
}
|
|
809 |
while ( yy_base[yy_current_state] != 249 );
|
|
810 |
|
|
811 |
yy_find_action:
|
|
812 |
yy_act = yy_accept[yy_current_state];
|
|
813 |
if ( yy_act == 0 )
|
|
814 |
{ /* have to back up */
|
|
815 |
yy_cp = yy_last_accepting_cpos;
|
|
816 |
yy_current_state = yy_last_accepting_state;
|
|
817 |
yy_act = yy_accept[yy_current_state];
|
|
818 |
}
|
|
819 |
|
|
820 |
YY_DO_BEFORE_ACTION;
|
|
821 |
|
|
822 |
|
|
823 |
do_action: /* This label is used only to access EOF actions. */
|
|
824 |
|
|
825 |
|
|
826 |
switch ( yy_act )
|
|
827 |
{ /* beginning of action switch */
|
|
828 |
case 0: /* must back up */
|
|
829 |
/* undo the effects of YY_DO_BEFORE_ACTION */
|
|
830 |
*yy_cp = yy_hold_char;
|
|
831 |
yy_cp = yy_last_accepting_cpos;
|
|
832 |
yy_current_state = yy_last_accepting_state;
|
|
833 |
goto yy_find_action;
|
|
834 |
|
|
835 |
case 1:
|
|
836 |
YY_RULE_SETUP
|
|
837 |
#line 106 "level.ll"
|
|
838 |
nline++;
|
|
839 |
YY_BREAK
|
|
840 |
case 2:
|
|
841 |
YY_RULE_SETUP
|
|
842 |
#line 107 "level.ll"
|
|
843 |
nline++;
|
|
844 |
YY_BREAK
|
|
845 |
case 3:
|
|
846 |
YY_RULE_SETUP
|
|
847 |
#line 108 "level.ll"
|
|
848 |
return NUMBER;
|
|
849 |
YY_BREAK
|
|
850 |
case 4:
|
|
851 |
YY_RULE_SETUP
|
|
852 |
#line 109 "level.ll"
|
|
853 |
return LEVEL;
|
|
854 |
YY_BREAK
|
|
855 |
case 5:
|
|
856 |
YY_RULE_SETUP
|
|
857 |
#line 110 "level.ll"
|
|
858 |
return SPEED;
|
|
859 |
YY_BREAK
|
|
860 |
case 6:
|
|
861 |
YY_RULE_SETUP
|
|
862 |
#line 111 "level.ll"
|
|
863 |
return ENTRY;
|
|
864 |
YY_BREAK
|
|
865 |
case 7:
|
|
866 |
YY_RULE_SETUP
|
|
867 |
#line 112 "level.ll"
|
|
868 |
return EXIT;
|
|
869 |
YY_BREAK
|
|
870 |
case 8:
|
|
871 |
YY_RULE_SETUP
|
|
872 |
#line 113 "level.ll"
|
|
873 |
return ROW;
|
|
874 |
YY_BREAK
|
|
875 |
case 9:
|
|
876 |
YY_RULE_SETUP
|
|
877 |
#line 114 "level.ll"
|
|
878 |
return COLUMN;
|
|
879 |
YY_BREAK
|
|
880 |
case 10:
|
|
881 |
YY_RULE_SETUP
|
|
882 |
#line 115 "level.ll"
|
|
883 |
return SIDE;
|
|
884 |
YY_BREAK
|
|
885 |
case 11:
|
|
886 |
YY_RULE_SETUP
|
|
887 |
#line 116 "level.ll"
|
|
888 |
return GRAPH_DIR;
|
|
889 |
YY_BREAK
|
|
890 |
case 12:
|
|
891 |
YY_RULE_SETUP
|
|
892 |
#line 117 "level.ll"
|
|
893 |
return PIPENIGHTDREAMS;
|
|
894 |
YY_BREAK
|
|
895 |
case 13:
|
|
896 |
YY_RULE_SETUP
|
|
897 |
#line 118 "level.ll"
|
|
898 |
return START_DELAY;
|
|
899 |
YY_BREAK
|
|
900 |
case 14:
|
|
901 |
YY_RULE_SETUP
|
|
902 |
#line 119 "level.ll"
|
|
903 |
return RESTRICT_COEF;
|
|
904 |
YY_BREAK
|
|
905 |
case 15:
|
|
906 |
YY_RULE_SETUP
|
|
907 |
#line 120 "level.ll"
|
|
908 |
return FIXED_COEF;
|
|
909 |
YY_BREAK
|
|
910 |
case 16:
|
|
911 |
YY_RULE_SETUP
|
|
912 |
#line 121 "level.ll"
|
|
913 |
return EQUAL;
|
|
914 |
YY_BREAK
|
|
915 |
case 17:
|
|
916 |
YY_RULE_SETUP
|
|
917 |
#line 122 "level.ll"
|
|
918 |
return O_BLOCK;
|
|
919 |
YY_BREAK
|
|
920 |
case 18:
|
|
921 |
YY_RULE_SETUP
|
|
922 |
#line 123 "level.ll"
|
|
923 |
return C_BLOCK;
|
|
924 |
YY_BREAK
|
|
925 |
case 19:
|
|
926 |
YY_RULE_SETUP
|
|
927 |
#line 124 "level.ll"
|
|
928 |
return DOUBLE_COUTE;
|
|
929 |
YY_BREAK
|
|
930 |
case 20:
|
|
931 |
YY_RULE_SETUP
|
|
932 |
#line 125 "level.ll"
|
|
933 |
return SEMICOLON;
|
|
934 |
YY_BREAK
|
|
935 |
case YY_STATE_EOF(INITIAL):
|
|
936 |
#line 126 "level.ll"
|
|
937 |
return EOF;
|
|
938 |
YY_BREAK
|
|
939 |
case 21:
|
|
940 |
YY_RULE_SETUP
|
|
941 |
#line 127 "level.ll"
|
|
942 |
return NORTH;
|
|
943 |
YY_BREAK
|
|
944 |
case 22:
|
|
945 |
YY_RULE_SETUP
|
|
946 |
#line 128 "level.ll"
|
|
947 |
return SOUTH;
|
|
948 |
YY_BREAK
|
|
949 |
case 23:
|
|
950 |
YY_RULE_SETUP
|
|
951 |
#line 129 "level.ll"
|
|
952 |
return WEST;
|
|
953 |
YY_BREAK
|
|
954 |
case 24:
|
|
955 |
YY_RULE_SETUP
|
|
956 |
#line 130 "level.ll"
|
|
957 |
return EAST;
|
|
958 |
YY_BREAK
|
|
959 |
case 25:
|
|
960 |
YY_RULE_SETUP
|
|
961 |
#line 131 "level.ll"
|
|
962 |
return PIPE;
|
|
963 |
YY_BREAK
|
|
964 |
case 26:
|
|
965 |
YY_RULE_SETUP
|
|
966 |
#line 132 "level.ll"
|
|
967 |
return TYPE;
|
|
968 |
YY_BREAK
|
|
969 |
case 27:
|
|
970 |
YY_RULE_SETUP
|
|
971 |
#line 133 "level.ll"
|
|
972 |
return ELBOW_NW;
|
|
973 |
YY_BREAK
|
|
974 |
case 28:
|
|
975 |
YY_RULE_SETUP
|
|
976 |
#line 134 "level.ll"
|
|
977 |
return ELBOW_NE;
|
|
978 |
YY_BREAK
|
|
979 |
case 29:
|
|
980 |
YY_RULE_SETUP
|
|
981 |
#line 135 "level.ll"
|
|
982 |
return ELBOW_SW;
|
|
983 |
YY_BREAK
|
|
984 |
case 30:
|
|
985 |
YY_RULE_SETUP
|
|
986 |
#line 136 "level.ll"
|
|
987 |
return ELBOW_SE;
|
|
988 |
YY_BREAK
|
|
989 |
case 31:
|
|
990 |
YY_RULE_SETUP
|
|
991 |
#line 137 "level.ll"
|
|
992 |
return BOWL_H;
|
|
993 |
YY_BREAK
|
|
994 |
case 32:
|
|
995 |
YY_RULE_SETUP
|
|
996 |
#line 138 "level.ll"
|
|
997 |
return BOWL_V;
|
|
998 |
YY_BREAK
|
|
999 |
case 33:
|
|
1000 |
YY_RULE_SETUP
|
|
1001 |
#line 139 "level.ll"
|
|
1002 |
return HORIZONTAL;
|
|
1003 |
YY_BREAK
|
|
1004 |
case 34:
|
|
1005 |
YY_RULE_SETUP
|
|
1006 |
#line 140 "level.ll"
|
|
1007 |
return VERTICAL;
|
|
1008 |
YY_BREAK
|
|
1009 |
case 35:
|
|
1010 |
YY_RULE_SETUP
|
|
1011 |
#line 141 "level.ll"
|
|
1012 |
return CROSS;
|
|
1013 |
YY_BREAK
|
|
1014 |
case 36:
|
|
1015 |
YY_RULE_SETUP
|
|
1016 |
#line 142 "level.ll"
|
|
1017 |
return RESTRICTED_OUTPUT;
|
|
1018 |
YY_BREAK
|
|
1019 |
case 37:
|
|
1020 |
YY_RULE_SETUP
|
|
1021 |
#line 143 "level.ll"
|
|
1022 |
return BONUS;
|
|
1023 |
YY_BREAK
|
|
1024 |
case 38:
|
|
1025 |
YY_RULE_SETUP
|
|
1026 |
#line 144 "level.ll"
|
|
1027 |
return NORMAL;
|
|
1028 |
YY_BREAK
|
|
1029 |
case 39:
|
|
1030 |
YY_RULE_SETUP
|
|
1031 |
#line 145 "level.ll"
|
|
1032 |
return SUPER;
|
|
1033 |
YY_BREAK
|
|
1034 |
case 40:
|
|
1035 |
YY_RULE_SETUP
|
|
1036 |
#line 146 "level.ll"
|
|
1037 |
return ULTRA;
|
|
1038 |
YY_BREAK
|
|
1039 |
case 41:
|
|
1040 |
YY_RULE_SETUP
|
|
1041 |
#line 147 "level.ll"
|
|
1042 |
return HYPER;
|
|
1043 |
YY_BREAK
|
|
1044 |
case 42:
|
|
1045 |
YY_RULE_SETUP
|
|
1046 |
#line 148 "level.ll"
|
|
1047 |
return EXTRA_LIFE;
|
|
1048 |
YY_BREAK
|
|
1049 |
case 43:
|
|
1050 |
YY_RULE_SETUP
|
|
1051 |
#line 149 "level.ll"
|
|
1052 |
return EXTRA_TIME;
|
|
1053 |
YY_BREAK
|
|
1054 |
case 44:
|
|
1055 |
YY_RULE_SETUP
|
|
1056 |
#line 150 "level.ll"
|
|
1057 |
return FIXED;
|
|
1058 |
YY_BREAK
|
|
1059 |
case 45:
|
|
1060 |
YY_RULE_SETUP
|
|
1061 |
#line 151 "level.ll"
|
|
1062 |
return BACKGROUND;
|
|
1063 |
YY_BREAK
|
|
1064 |
case 46:
|
|
1065 |
YY_RULE_SETUP
|
|
1066 |
#line 152 "level.ll"
|
|
1067 |
return WALLPAPER;
|
|
1068 |
YY_BREAK
|
|
1069 |
case 47:
|
|
1070 |
YY_RULE_SETUP
|
|
1071 |
#line 153 "level.ll"
|
|
1072 |
return MOSAIC;
|
|
1073 |
YY_BREAK
|
|
1074 |
case 48:
|
|
1075 |
YY_RULE_SETUP
|
|
1076 |
#line 154 "level.ll"
|
|
1077 |
return REQUIRED;
|
|
1078 |
YY_BREAK
|
|
1079 |
case 49:
|
|
1080 |
YY_RULE_SETUP
|
|
1081 |
#line 155 "level.ll"
|
|
1082 |
return TRUE;
|
|
1083 |
YY_BREAK
|
|
1084 |
case 50:
|
|
1085 |
YY_RULE_SETUP
|
|
1086 |
#line 156 "level.ll"
|
|
1087 |
return TRUE;
|
|
1088 |
YY_BREAK
|
|
1089 |
case 51:
|
|
1090 |
YY_RULE_SETUP
|
|
1091 |
#line 157 "level.ll"
|
|
1092 |
return FALSE;
|
|
1093 |
YY_BREAK
|
|
1094 |
case 52:
|
|
1095 |
YY_RULE_SETUP
|
|
1096 |
#line 158 "level.ll"
|
|
1097 |
return FALSE;
|
|
1098 |
YY_BREAK
|
|
1099 |
case 53:
|
|
1100 |
YY_RULE_SETUP
|
|
1101 |
#line 159 "level.ll"
|
|
1102 |
return STRING;
|
|
1103 |
YY_BREAK
|
|
1104 |
case 54:
|
|
1105 |
YY_RULE_SETUP
|
|
1106 |
#line 160 "level.ll"
|
|
1107 |
|
|
1108 |
YY_BREAK
|
|
1109 |
case 55:
|
|
1110 |
YY_RULE_SETUP
|
|
1111 |
#line 161 "level.ll"
|
|
1112 |
return INVALID;
|
|
1113 |
YY_BREAK
|
|
1114 |
case 56:
|
|
1115 |
YY_RULE_SETUP
|
|
1116 |
#line 162 "level.ll"
|
|
1117 |
ECHO;
|
|
1118 |
YY_BREAK
|
|
1119 |
#line 1121 "lex.yy.c"
|
|
1120 |
|
|
1121 |
case YY_END_OF_BUFFER:
|
|
1122 |
{
|
|
1123 |
/* Amount of text matched not including the EOB char. */
|
|
1124 |
int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
|
|
1125 |
|
|
1126 |
/* Undo the effects of YY_DO_BEFORE_ACTION. */
|
|
1127 |
*yy_cp = yy_hold_char;
|
|
1128 |
YY_RESTORE_YY_MORE_OFFSET
|
|
1129 |
|
|
1130 |
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
|
|
1131 |
{
|
|
1132 |
/* We're scanning a new file or input source. It's
|
|
1133 |
* possible that this happened because the user
|
|
1134 |
* just pointed yyin at a new source and called
|
|
1135 |
* yylex(). If so, then we have to assure
|
|
1136 |
* consistency between yy_current_buffer and our
|
|
1137 |
* globals. Here is the right place to do so, because
|
|
1138 |
* this is the first action (other than possibly a
|
|
1139 |
* back-up) that will match for the new input source.
|
|
1140 |
*/
|
|
1141 |
yy_n_chars = yy_current_buffer->yy_n_chars;
|
|
1142 |
yy_current_buffer->yy_input_file = yyin;
|
|
1143 |
yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
|
|
1144 |
}
|
|
1145 |
|
|
1146 |
/* Note that here we test for yy_c_buf_p "<=" to the position
|
|
1147 |
* of the first EOB in the buffer, since yy_c_buf_p will
|
|
1148 |
* already have been incremented past the NUL character
|
|
1149 |
* (since all states make transitions on EOB to the
|
|
1150 |
* end-of-buffer state). Contrast this with the test
|
|
1151 |
* in input().
|
|
1152 |
*/
|
|
1153 |
if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
|
|
1154 |
{ /* This was really a NUL. */
|
|
1155 |
yy_state_type yy_next_state;
|
|
1156 |
|
|
1157 |
yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
|
|
1158 |
|
|
1159 |
yy_current_state = yy_get_previous_state();
|
|
1160 |
|
|
1161 |
/* Okay, we're now positioned to make the NUL
|
|
1162 |
* transition. We couldn't have
|
|
1163 |
* yy_get_previous_state() go ahead and do it
|
|
1164 |
* for us because it doesn't know how to deal
|
|
1165 |
* with the possibility of jamming (and we don't
|
|
1166 |
* want to build jamming into it because then it
|
|
1167 |
* will run more slowly).
|
|
1168 |
*/
|
|
1169 |
|
|
1170 |
yy_next_state = yy_try_NUL_trans( yy_current_state );
|
|
1171 |
|
|
1172 |
yy_bp = yytext_ptr + YY_MORE_ADJ;
|
|
1173 |
|
|
1174 |
if ( yy_next_state )
|
|
1175 |
{
|
|
1176 |
/* Consume the NUL. */
|
|
1177 |
yy_cp = ++yy_c_buf_p;
|
|
1178 |
yy_current_state = yy_next_state;
|
|
1179 |
goto yy_match;
|
|
1180 |
}
|
|
1181 |
|
|
1182 |
else
|
|
1183 |
{
|
|
1184 |
yy_cp = yy_c_buf_p;
|
|
1185 |
goto yy_find_action;
|
|
1186 |
}
|
|
1187 |
}
|
|
1188 |
|
|
1189 |
else switch ( yy_get_next_buffer() )
|
|
1190 |
{
|
|
1191 |
case EOB_ACT_END_OF_FILE:
|
|
1192 |
{
|
|
1193 |
yy_did_buffer_switch_on_eof = 0;
|
|
1194 |
|
|
1195 |
if ( yywrap() )
|
|
1196 |
{
|
|
1197 |
/* Note: because we've taken care in
|
|
1198 |
* yy_get_next_buffer() to have set up
|
|
1199 |
* yytext, we can now set up
|
|
1200 |
* yy_c_buf_p so that if some total
|
|
1201 |
* hoser (like flex itself) wants to
|
|
1202 |
* call the scanner after we return the
|
|
1203 |
* YY_NULL, it'll still work - another
|
|
1204 |
* YY_NULL will get returned.
|
|
1205 |
*/
|
|
1206 |
yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
|
|
1207 |
|
|
1208 |
yy_act = YY_STATE_EOF(YY_START);
|
|
1209 |
goto do_action;
|
|
1210 |
}
|
|
1211 |
|
|
1212 |
else
|
|
1213 |
{
|
|
1214 |
if ( ! yy_did_buffer_switch_on_eof )
|
|
1215 |
YY_NEW_FILE;
|
|
1216 |
}
|
|
1217 |
break;
|
|
1218 |
}
|
|
1219 |
|
|
1220 |
case EOB_ACT_CONTINUE_SCAN:
|
|
1221 |
yy_c_buf_p =
|
|
1222 |
yytext_ptr + yy_amount_of_matched_text;
|
|
1223 |
|
|
1224 |
yy_current_state = yy_get_previous_state();
|
|
1225 |
|
|
1226 |
yy_cp = yy_c_buf_p;
|
|
1227 |
yy_bp = yytext_ptr + YY_MORE_ADJ;
|
|
1228 |
goto yy_match;
|
|
1229 |
|
|
1230 |
case EOB_ACT_LAST_MATCH:
|
|
1231 |
yy_c_buf_p =
|
|
1232 |
&yy_current_buffer->yy_ch_buf[yy_n_chars];
|
|
1233 |
|
|
1234 |
yy_current_state = yy_get_previous_state();
|
|
1235 |
|
|
1236 |
yy_cp = yy_c_buf_p;
|
|
1237 |
yy_bp = yytext_ptr + YY_MORE_ADJ;
|
|
1238 |
goto yy_find_action;
|
|
1239 |
}
|
|
1240 |
break;
|
|
1241 |
}
|
|
1242 |
|
|
1243 |
default:
|
|
1244 |
YY_FATAL_ERROR(
|
|
1245 |
"fatal flex scanner internal error--no action found" );
|
|
1246 |
} /* end of action switch */
|
|
1247 |
} /* end of scanning one token */
|
|
1248 |
} /* end of yylex */
|
|
1249 |
|
|
1250 |
|
|
1251 |
/* yy_get_next_buffer - try to read in a new buffer
|
|
1252 |
*
|
|
1253 |
* Returns a code representing an action:
|
|
1254 |
* EOB_ACT_LAST_MATCH -
|
|
1255 |
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
|
|
1256 |
* EOB_ACT_END_OF_FILE - end of file
|
|
1257 |
*/
|
|
1258 |
|
|
1259 |
static int yy_get_next_buffer()
|
|
1260 |
{
|
|
1261 |
register char *dest = yy_current_buffer->yy_ch_buf;
|
|
1262 |
register char *source = yytext_ptr;
|
|
1263 |
register int number_to_move, i;
|
|
1264 |
int ret_val;
|
|
1265 |
|
|
1266 |
if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
|
|
1267 |
YY_FATAL_ERROR(
|
|
1268 |
"fatal flex scanner internal error--end of buffer missed" );
|
|
1269 |
|
|
1270 |
if ( yy_current_buffer->yy_fill_buffer == 0 )
|
|
1271 |
{ /* Don't try to fill the buffer, so this is an EOF. */
|
|
1272 |
if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
|
|
1273 |
{
|
|
1274 |
/* We matched a single character, the EOB, so
|
|
1275 |
* treat this as a final EOF.
|
|
1276 |
*/
|
|
1277 |
return EOB_ACT_END_OF_FILE;
|
|
1278 |
}
|
|
1279 |
|
|
1280 |
else
|
|
1281 |
{
|
|
1282 |
/* We matched some text prior to the EOB, first
|
|
1283 |
* process it.
|
|
1284 |
*/
|
|
1285 |
return EOB_ACT_LAST_MATCH;
|
|
1286 |
}
|
|
1287 |
}
|
|
1288 |
|
|
1289 |
/* Try to read more data. */
|
|
1290 |
|
|
1291 |
/* First move last chars to start of buffer. */
|
|
1292 |
number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
|
|
1293 |
|
|
1294 |
for ( i = 0; i < number_to_move; ++i )
|
|
1295 |
*(dest++) = *(source++);
|
|
1296 |
|
|
1297 |
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
|
|
1298 |
/* don't do the read, it's not guaranteed to return an EOF,
|
|
1299 |
* just force an EOF
|
|
1300 |
*/
|
|
1301 |
yy_current_buffer->yy_n_chars = yy_n_chars = 0;
|
|
1302 |
|
|
1303 |
else
|
|
1304 |
{
|
|
1305 |
int num_to_read =
|
|
1306 |
yy_current_buffer->yy_buf_size - number_to_move - 1;
|
|
1307 |
|
|
1308 |
while ( num_to_read <= 0 )
|
|
1309 |
{ /* Not enough room in the buffer - grow it. */
|
|
1310 |
#ifdef YY_USES_REJECT
|
|
1311 |
YY_FATAL_ERROR(
|
|
1312 |
"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
|
|
1313 |
#else
|
|
1314 |
|
|
1315 |
/* just a shorter name for the current buffer */
|
|
1316 |
YY_BUFFER_STATE b = yy_current_buffer;
|
|
1317 |
|
|
1318 |
int yy_c_buf_p_offset =
|
|
1319 |
(int) (yy_c_buf_p - b->yy_ch_buf);
|
|
1320 |
|
|
1321 |
if ( b->yy_is_our_buffer )
|
|
1322 |
{
|
|
1323 |
int new_size = b->yy_buf_size * 2;
|
|
1324 |
|
|
1325 |
if ( new_size <= 0 )
|
|
1326 |
b->yy_buf_size += b->yy_buf_size / 8;
|
|
1327 |
else
|
|
1328 |
b->yy_buf_size *= 2;
|
|
1329 |
|
|
1330 |
b->yy_ch_buf = (char *)
|
|
1331 |
/* Include room in for 2 EOB chars. */
|
|
1332 |
yy_flex_realloc( (void *) b->yy_ch_buf,
|
|
1333 |
b->yy_buf_size + 2 );
|
|
1334 |
}
|
|
1335 |
else
|
|
1336 |
/* Can't grow it, we don't own it. */
|
|
1337 |
b->yy_ch_buf = 0;
|
|
1338 |
|
|
1339 |
if ( ! b->yy_ch_buf )
|
|
1340 |
YY_FATAL_ERROR(
|
|
1341 |
"fatal error - scanner input buffer overflow" );
|
|
1342 |
|
|
1343 |
yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
|
|
1344 |
|
|
1345 |
num_to_read = yy_current_buffer->yy_buf_size -
|
|
1346 |
number_to_move - 1;
|
|
1347 |
#endif
|
|
1348 |
}
|
|
1349 |
|
|
1350 |
if ( num_to_read > YY_READ_BUF_SIZE )
|
|
1351 |
num_to_read = YY_READ_BUF_SIZE;
|
|
1352 |
|
|
1353 |
/* Read in more data. */
|
|
1354 |
YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
|
|
1355 |
yy_n_chars, num_to_read );
|
|
1356 |
|
|
1357 |
yy_current_buffer->yy_n_chars = yy_n_chars;
|
|
1358 |
}
|
|
1359 |
|
|
1360 |
if ( yy_n_chars == 0 )
|
|
1361 |
{
|
|
1362 |
if ( number_to_move == YY_MORE_ADJ )
|
|
1363 |
{
|
|
1364 |
ret_val = EOB_ACT_END_OF_FILE;
|
|
1365 |
yyrestart( yyin );
|
|
1366 |
}
|
|
1367 |
|
|
1368 |
else
|
|
1369 |
{
|
|
1370 |
ret_val = EOB_ACT_LAST_MATCH;
|
|
1371 |
yy_current_buffer->yy_buffer_status =
|
|
1372 |
YY_BUFFER_EOF_PENDING;
|
|
1373 |
}
|
|
1374 |
}
|
|
1375 |
|
|
1376 |
else
|
|
1377 |
ret_val = EOB_ACT_CONTINUE_SCAN;
|
|
1378 |
|
|
1379 |
yy_n_chars += number_to_move;
|
|
1380 |
yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
|
|
1381 |
yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
|
|
1382 |
|
|
1383 |
yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
|
|
1384 |
|
|
1385 |
return ret_val;
|
|
1386 |
}
|
|
1387 |
|
|
1388 |
|
|
1389 |
/* yy_get_previous_state - get the state just before the EOB char was reached */
|
|
1390 |
|
|
1391 |
static yy_state_type yy_get_previous_state()
|
|
1392 |
{
|
|
1393 |
register yy_state_type yy_current_state;
|
|
1394 |
register char *yy_cp;
|
|
1395 |
|
|
1396 |
yy_current_state = yy_start;
|
|
1397 |
|
|
1398 |
for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
|
|
1399 |
{
|
|
1400 |
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
|
|
1401 |
if ( yy_accept[yy_current_state] )
|
|
1402 |
{
|
|
1403 |
yy_last_accepting_state = yy_current_state;
|
|
1404 |
yy_last_accepting_cpos = yy_cp;
|
|
1405 |
}
|
|
1406 |
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
|
|
1407 |
{
|
|
1408 |
yy_current_state = (int) yy_def[yy_current_state];
|
|
1409 |
if ( yy_current_state >= 240 )
|
|
1410 |
yy_c = yy_meta[(unsigned int) yy_c];
|
|
1411 |
}
|
|
1412 |
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
|
|
1413 |
}
|
|
1414 |
|
|
1415 |
return yy_current_state;
|
|
1416 |
}
|
|
1417 |
|
|
1418 |
|
|
1419 |
/* yy_try_NUL_trans - try to make a transition on the NUL character
|
|
1420 |
*
|
|
1421 |
* synopsis
|
|
1422 |
* next_state = yy_try_NUL_trans( current_state );
|
|
1423 |
*/
|
|
1424 |
|
|
1425 |
#ifdef YY_USE_PROTOS
|
|
1426 |
static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
|
|
1427 |
#else
|
|
1428 |
static yy_state_type yy_try_NUL_trans( yy_current_state )
|
|
1429 |
yy_state_type yy_current_state;
|
|
1430 |
#endif
|
|
1431 |
{
|
|
1432 |
register int yy_is_jam;
|
|
1433 |
register char *yy_cp = yy_c_buf_p;
|
|
1434 |
|
|
1435 |
register YY_CHAR yy_c = 1;
|
|
1436 |
if ( yy_accept[yy_current_state] )
|
|
1437 |
{
|
|
1438 |
yy_last_accepting_state = yy_current_state;
|
|
1439 |
yy_last_accepting_cpos = yy_cp;
|
|
1440 |
}
|
|
1441 |
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
|
|
1442 |
{
|
|
1443 |
yy_current_state = (int) yy_def[yy_current_state];
|
|
1444 |
if ( yy_current_state >= 240 )
|
|
1445 |
yy_c = yy_meta[(unsigned int) yy_c];
|
|
1446 |
}
|
|
1447 |
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
|
|
1448 |
yy_is_jam = (yy_current_state == 239);
|
|
1449 |
|
|
1450 |
return yy_is_jam ? 0 : yy_current_state;
|
|
1451 |
}
|
|
1452 |
|
|
1453 |
|
|
1454 |
#ifndef YY_NO_UNPUT
|
|
1455 |
#ifdef YY_USE_PROTOS
|
|
1456 |
static void yyunput( int c, register char *yy_bp )
|
|
1457 |
#else
|
|
1458 |
static void yyunput( c, yy_bp )
|
|
1459 |
int c;
|
|
1460 |
register char *yy_bp;
|
|
1461 |
#endif
|
|
1462 |
{
|
|
1463 |
register char *yy_cp = yy_c_buf_p;
|
|
1464 |
|
|
1465 |
/* undo effects of setting up yytext */
|
|
1466 |
*yy_cp = yy_hold_char;
|
|
1467 |
|
|
1468 |
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
|
|
1469 |
{ /* need to shift things up to make room */
|
|
1470 |
/* +2 for EOB chars. */
|
|
1471 |
register int number_to_move = yy_n_chars + 2;
|
|
1472 |
register char *dest = &yy_current_buffer->yy_ch_buf[
|
|
1473 |
yy_current_buffer->yy_buf_size + 2];
|
|
1474 |
register char *source =
|
|
1475 |
&yy_current_buffer->yy_ch_buf[number_to_move];
|
|
1476 |
|
|
1477 |
while ( source > yy_current_buffer->yy_ch_buf )
|
|
1478 |
*--dest = *--source;
|
|
1479 |
|
|
1480 |
yy_cp += (int) (dest - source);
|
|
1481 |
yy_bp += (int) (dest - source);
|
|
1482 |
yy_current_buffer->yy_n_chars =
|
|
1483 |
yy_n_chars = yy_current_buffer->yy_buf_size;
|
|
1484 |
|
|
1485 |
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
|
|
1486 |
YY_FATAL_ERROR( "flex scanner push-back overflow" );
|
|
1487 |
}
|
|
1488 |
|
|
1489 |
*--yy_cp = (char) c;
|
|
1490 |
|
|
1491 |
|
|
1492 |
yytext_ptr = yy_bp;
|
|
1493 |
yy_hold_char = *yy_cp;
|
|
1494 |
yy_c_buf_p = yy_cp;
|
|
1495 |
}
|
|
1496 |
#endif /* ifndef YY_NO_UNPUT */
|
|
1497 |
|
|
1498 |
|
|
1499 |
#ifdef __cplusplus
|
|
1500 |
static int yyinput()
|
|
1501 |
#else
|
|
1502 |
static int input()
|
|
1503 |
#endif
|
|
1504 |
{
|
|
1505 |
int c;
|
|
1506 |
|
|
1507 |
*yy_c_buf_p = yy_hold_char;
|
|
1508 |
|
|
1509 |
if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
|
|
1510 |
{
|
|
1511 |
/* yy_c_buf_p now points to the character we want to return.
|
|
1512 |
* If this occurs *before* the EOB characters, then it's a
|
|
1513 |
* valid NUL; if not, then we've hit the end of the buffer.
|
|
1514 |
*/
|
|
1515 |
if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
|
|
1516 |
/* This was really a NUL. */
|
|
1517 |
*yy_c_buf_p = '\0';
|
|
1518 |
|
|
1519 |
else
|
|
1520 |
{ /* need more input */
|
|
1521 |
int offset = yy_c_buf_p - yytext_ptr;
|
|
1522 |
++yy_c_buf_p;
|
|
1523 |
|
|
1524 |
switch ( yy_get_next_buffer() )
|
|
1525 |
{
|
|
1526 |
case EOB_ACT_LAST_MATCH:
|
|
1527 |
/* This happens because yy_g_n_b()
|
|
1528 |
* sees that we've accumulated a
|
|
1529 |
* token and flags that we need to
|
|
1530 |
* try matching the token before
|
|
1531 |
* proceeding. But for input(),
|
|
1532 |
* there's no matching to consider.
|
|
1533 |
* So convert the EOB_ACT_LAST_MATCH
|
|
1534 |
* to EOB_ACT_END_OF_FILE.
|
|
1535 |
*/
|
|
1536 |
|
|
1537 |
/* Reset buffer status. */
|
|
1538 |
yyrestart( yyin );
|
|
1539 |
|
|
1540 |
/* fall through */
|
|
1541 |
|
|
1542 |
case EOB_ACT_END_OF_FILE:
|
|
1543 |
{
|
|
1544 |
if ( yywrap() )
|
|
1545 |
return EOF;
|
|
1546 |
|
|
1547 |
if ( ! yy_did_buffer_switch_on_eof )
|
|
1548 |
YY_NEW_FILE;
|
|
1549 |
#ifdef __cplusplus
|
|
1550 |
return yyinput();
|
|
1551 |
#else
|
|
1552 |
return input();
|
|
1553 |
#endif
|
|
1554 |
}
|
|
1555 |
|
|
1556 |
case EOB_ACT_CONTINUE_SCAN:
|
|
1557 |
yy_c_buf_p = yytext_ptr + offset;
|
|
1558 |
break;
|
|
1559 |
}
|
|
1560 |
}
|
|
1561 |
}
|
|
1562 |
|
|
1563 |
c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
|
|
1564 |
*yy_c_buf_p = '\0'; /* preserve yytext */
|
|
1565 |
yy_hold_char = *++yy_c_buf_p;
|
|
1566 |
|
|
1567 |
|
|
1568 |
return c;
|
|
1569 |
}
|
|
1570 |
|
|
1571 |
|
|
1572 |
#ifdef YY_USE_PROTOS
|
|
1573 |
void yyrestart( FILE *input_file )
|
|
1574 |
#else
|
|
1575 |
void yyrestart( input_file )
|
|
1576 |
FILE *input_file;
|
|
1577 |
#endif
|
|
1578 |
{
|
|
1579 |
if ( ! yy_current_buffer )
|
|
1580 |
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
|
|
1581 |
|
|
1582 |
yy_init_buffer( yy_current_buffer, input_file );
|
|
1583 |
yy_load_buffer_state();
|
|
1584 |
}
|
|
1585 |
|
|
1586 |
|
|
1587 |
#ifdef YY_USE_PROTOS
|
|
1588 |
void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
|
|
1589 |
#else
|
|
1590 |
void yy_switch_to_buffer( new_buffer )
|
|
1591 |
YY_BUFFER_STATE new_buffer;
|
|
1592 |
#endif
|
|
1593 |
{
|
|
1594 |
if ( yy_current_buffer == new_buffer )
|
|
1595 |
return;
|
|
1596 |
|
|
1597 |
if ( yy_current_buffer )
|
|
1598 |
{
|
|
1599 |
/* Flush out information for old buffer. */
|
|
1600 |
*yy_c_buf_p = yy_hold_char;
|
|
1601 |
yy_current_buffer->yy_buf_pos = yy_c_buf_p;
|
|
1602 |
yy_current_buffer->yy_n_chars = yy_n_chars;
|
|
1603 |
}
|
|
1604 |
|
|
1605 |
yy_current_buffer = new_buffer;
|
|
1606 |
yy_load_buffer_state();
|
|
1607 |
|
|
1608 |
/* We don't actually know whether we did this switch during
|
|
1609 |
* EOF (yywrap()) processing, but the only time this flag
|
|
1610 |
* is looked at is after yywrap() is called, so it's safe
|
|
1611 |
* to go ahead and always set it.
|
|
1612 |
*/
|
|
1613 |
yy_did_buffer_switch_on_eof = 1;
|
|
1614 |
}
|
|
1615 |
|
|
1616 |
|
|
1617 |
#ifdef YY_USE_PROTOS
|
|
1618 |
void yy_load_buffer_state( void )
|
|
1619 |
#else
|
|
1620 |
void yy_load_buffer_state()
|
|
1621 |
#endif
|
|
1622 |
{
|
|
1623 |
yy_n_chars = yy_current_buffer->yy_n_chars;
|
|
1624 |
yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
|
|
1625 |
yyin = yy_current_buffer->yy_input_file;
|
|
1626 |
yy_hold_char = *yy_c_buf_p;
|
|
1627 |
}
|
|
1628 |
|
|
1629 |
|
|
1630 |
#ifdef YY_USE_PROTOS
|
|
1631 |
YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
|
|
1632 |
#else
|
|
1633 |
YY_BUFFER_STATE yy_create_buffer( file, size )
|
|
1634 |
FILE *file;
|
|
1635 |
int size;
|
|
1636 |
#endif
|
|
1637 |
{
|
|
1638 |
YY_BUFFER_STATE b;
|
|
1639 |
|
|
1640 |
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
|
|
1641 |
if ( ! b )
|
|
1642 |
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
|
|
1643 |
|
|
1644 |
b->yy_buf_size = size;
|
|
1645 |
|
|
1646 |
/* yy_ch_buf has to be 2 characters longer than the size given because
|
|
1647 |
* we need to put in 2 end-of-buffer characters.
|
|
1648 |
*/
|
|
1649 |
b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
|
|
1650 |
if ( ! b->yy_ch_buf )
|
|
1651 |
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
|
|
1652 |
|
|
1653 |
b->yy_is_our_buffer = 1;
|
|
1654 |
|
|
1655 |
yy_init_buffer( b, file );
|
|
1656 |
|
|
1657 |
return b;
|
|
1658 |
}
|
|
1659 |
|
|
1660 |
|
|
1661 |
#ifdef YY_USE_PROTOS
|
|
1662 |
void yy_delete_buffer( YY_BUFFER_STATE b )
|
|
1663 |
#else
|
|
1664 |
void yy_delete_buffer( b )
|
|
1665 |
YY_BUFFER_STATE b;
|
|
1666 |
#endif
|
|
1667 |
{
|
|
1668 |
if ( ! b )
|
|
1669 |
return;
|
|
1670 |
|
|
1671 |
if ( b == yy_current_buffer )
|
|
1672 |
yy_current_buffer = (YY_BUFFER_STATE) 0;
|
|
1673 |
|
|
1674 |
if ( b->yy_is_our_buffer )
|
|
1675 |
yy_flex_free( (void *) b->yy_ch_buf );
|
|
1676 |
|
|
1677 |
yy_flex_free( (void *) b );
|
|
1678 |
}
|
|
1679 |
|
|
1680 |
|
|
1681 |
#ifndef YY_ALWAYS_INTERACTIVE
|
|
1682 |
#ifndef YY_NEVER_INTERACTIVE
|
|
1683 |
extern int isatty YY_PROTO(( int ));
|
|
1684 |
#endif
|
|
1685 |
#endif
|
|
1686 |
|
|
1687 |
#ifdef YY_USE_PROTOS
|
|
1688 |
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
|
|
1689 |
#else
|
|
1690 |
void yy_init_buffer( b, file )
|
|
1691 |
YY_BUFFER_STATE b;
|
|
1692 |
FILE *file;
|
|
1693 |
#endif
|
|
1694 |
|
|
1695 |
|
|
1696 |
{
|
|
1697 |
yy_flush_buffer( b );
|
|
1698 |
|
|
1699 |
b->yy_input_file = file;
|
|
1700 |
b->yy_fill_buffer = 1;
|
|
1701 |
|
|
1702 |
#if YY_ALWAYS_INTERACTIVE
|
|
1703 |
b->yy_is_interactive = 1;
|
|
1704 |
#else
|
|
1705 |
#if YY_NEVER_INTERACTIVE
|
|
1706 |
b->yy_is_interactive = 0;
|
|
1707 |
#else
|
|
1708 |
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
|
|
1709 |
#endif
|
|
1710 |
#endif
|
|
1711 |
}
|
|
1712 |
|
|
1713 |
|
|
1714 |
#ifdef YY_USE_PROTOS
|
|
1715 |
void yy_flush_buffer( YY_BUFFER_STATE b )
|
|
1716 |
#else
|
|
1717 |
void yy_flush_buffer( b )
|
|
1718 |
YY_BUFFER_STATE b;
|
|
1719 |
#endif
|
|
1720 |
|
|
1721 |
{
|
|
1722 |
if ( ! b )
|
|
1723 |
return;
|
|
1724 |
|
|
1725 |
b->yy_n_chars = 0;
|
|
1726 |
|
|
1727 |
/* We always need two end-of-buffer characters. The first causes
|
|
1728 |
* a transition to the end-of-buffer state. The second causes
|
|
1729 |
* a jam in that state.
|
|
1730 |
*/
|
|
1731 |
b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
|
|
1732 |
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
|
|
1733 |
|
|
1734 |
b->yy_buf_pos = &b->yy_ch_buf[0];
|
|
1735 |
|
|
1736 |
b->yy_at_bol = 1;
|
|
1737 |
b->yy_buffer_status = YY_BUFFER_NEW;
|
|
1738 |
|
|
1739 |
if ( b == yy_current_buffer )
|
|
1740 |
yy_load_buffer_state();
|
|
1741 |
}
|
|
1742 |
|
|
1743 |
|
|
1744 |
#ifndef YY_NO_SCAN_BUFFER
|
|
1745 |
#ifdef YY_USE_PROTOS
|
|
1746 |
YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
|
|
1747 |
#else
|
|
1748 |
YY_BUFFER_STATE yy_scan_buffer( base, size )
|
|
1749 |
char *base;
|
|
1750 |
yy_size_t size;
|
|
1751 |
#endif
|
|
1752 |
{
|
|
1753 |
YY_BUFFER_STATE b;
|
|
1754 |
|
|
1755 |
if ( size < 2 ||
|
|
1756 |
base[size-2] != YY_END_OF_BUFFER_CHAR ||
|
|
1757 |
base[size-1] != YY_END_OF_BUFFER_CHAR )
|
|
1758 |
/* They forgot to leave room for the EOB's. */
|
|
1759 |
return 0;
|
|
1760 |
|
|
1761 |
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
|
|
1762 |
if ( ! b )
|
|
1763 |
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
|
|
1764 |
|
|
1765 |
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
|
|
1766 |
b->yy_buf_pos = b->yy_ch_buf = base;
|
|
1767 |
b->yy_is_our_buffer = 0;
|
|
1768 |
b->yy_input_file = 0;
|
|
1769 |
b->yy_n_chars = b->yy_buf_size;
|
|
1770 |
b->yy_is_interactive = 0;
|
|
1771 |
b->yy_at_bol = 1;
|
|
1772 |
b->yy_fill_buffer = 0;
|
|
1773 |
b->yy_buffer_status = YY_BUFFER_NEW;
|
|
1774 |
|
|
1775 |
yy_switch_to_buffer( b );
|
|
1776 |
|
|
1777 |
return b;
|
|
1778 |
}
|
|
1779 |
#endif
|
|
1780 |
|
|
1781 |
|
|
1782 |
#ifndef YY_NO_SCAN_STRING
|
|
1783 |
#ifdef YY_USE_PROTOS
|
|
1784 |
YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
|
|
1785 |
#else
|
|
1786 |
YY_BUFFER_STATE yy_scan_string( yy_str )
|
|
1787 |
yyconst char *yy_str;
|
|
1788 |
#endif
|
|
1789 |
{
|
|
1790 |
int len;
|
|
1791 |
for ( len = 0; yy_str[len]; ++len )
|
|
1792 |
;
|
|
1793 |
|
|
1794 |
return yy_scan_bytes( yy_str, len );
|
|
1795 |
}
|
|
1796 |
#endif
|
|
1797 |
|
|
1798 |
|
|
1799 |
#ifndef YY_NO_SCAN_BYTES
|
|
1800 |
#ifdef YY_USE_PROTOS
|
|
1801 |
YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
|
|
1802 |
#else
|
|
1803 |
YY_BUFFER_STATE yy_scan_bytes( bytes, len )
|
|
1804 |
yyconst char *bytes;
|
|
1805 |
int len;
|
|
1806 |
#endif
|
|
1807 |
{
|
|
1808 |
YY_BUFFER_STATE b;
|
|
1809 |
char *buf;
|
|
1810 |
yy_size_t n;
|
|
1811 |
int i;
|
|
1812 |
|
|
1813 |
/* Get memory for full buffer, including space for trailing EOB's. */
|
|
1814 |
n = len + 2;
|
|
1815 |
buf = (char *) yy_flex_alloc( n );
|
|
1816 |
if ( ! buf )
|
|
1817 |
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
|
|
1818 |
|
|
1819 |
for ( i = 0; i < len; ++i )
|
|
1820 |
buf[i] = bytes[i];
|
|
1821 |
|
|
1822 |
buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
|
|
1823 |
|
|
1824 |
b = yy_scan_buffer( buf, n );
|
|
1825 |
if ( ! b )
|
|
1826 |
YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
|
|
1827 |
|
|
1828 |
/* It's okay to grow etc. this buffer, and we should throw it
|
|
1829 |
* away when we're done.
|
|
1830 |
*/
|
|
1831 |
b->yy_is_our_buffer = 1;
|
|
1832 |
|
|
1833 |
return b;
|
|
1834 |
}
|
|
1835 |
#endif
|
|
1836 |
|
|
1837 |
|
|
1838 |
#ifndef YY_NO_PUSH_STATE
|
|
1839 |
#ifdef YY_USE_PROTOS
|
|
1840 |
static void yy_push_state( int new_state )
|
|
1841 |
#else
|
|
1842 |
static void yy_push_state( new_state )
|
|
1843 |
int new_state;
|
|
1844 |
#endif
|
|
1845 |
{
|
|
1846 |
if ( yy_start_stack_ptr >= yy_start_stack_depth )
|
|
1847 |
{
|
|
1848 |
yy_size_t new_size;
|
|
1849 |
|
|
1850 |
yy_start_stack_depth += YY_START_STACK_INCR;
|
|
1851 |
new_size = yy_start_stack_depth * sizeof( int );
|
|
1852 |
|
|
1853 |
if ( ! yy_start_stack )
|
|
1854 |
yy_start_stack = (int *) yy_flex_alloc( new_size );
|
|
1855 |
|
|
1856 |
else
|
|
1857 |
yy_start_stack = (int *) yy_flex_realloc(
|
|
1858 |
(void *) yy_start_stack, new_size );
|
|
1859 |
|
|
1860 |
if ( ! yy_start_stack )
|
|
1861 |
YY_FATAL_ERROR(
|
|
1862 |
"out of memory expanding start-condition stack" );
|
|
1863 |
}
|
|
1864 |
|
|
1865 |
yy_start_stack[yy_start_stack_ptr++] = YY_START;
|
|
1866 |
|
|
1867 |
BEGIN(new_state);
|
|
1868 |
}
|
|
1869 |
#endif
|
|
1870 |
|
|
1871 |
|
|
1872 |
#ifndef YY_NO_POP_STATE
|
|
1873 |
static void yy_pop_state()
|
|
1874 |
{
|
|
1875 |
if ( --yy_start_stack_ptr < 0 )
|
|
1876 |
YY_FATAL_ERROR( "start-condition stack underflow" );
|
|
1877 |
|
|
1878 |
BEGIN(yy_start_stack[yy_start_stack_ptr]);
|
|
1879 |
}
|
|
1880 |
#endif
|
|
1881 |
|
|
1882 |
|
|
1883 |
#ifndef YY_NO_TOP_STATE
|
|
1884 |
static int yy_top_state()
|
|
1885 |
{
|
|
1886 |
return yy_start_stack[yy_start_stack_ptr - 1];
|
|
1887 |
}
|
|
1888 |
#endif
|
|
1889 |
|
|
1890 |
#ifndef YY_EXIT_FAILURE
|
|
1891 |
#define YY_EXIT_FAILURE 2
|
|
1892 |
#endif
|
|
1893 |
|
|
1894 |
#ifdef YY_USE_PROTOS
|
|
1895 |
static void yy_fatal_error( yyconst char msg[] )
|
|
1896 |
#else
|
|
1897 |
static void yy_fatal_error( msg )
|
|
1898 |
char msg[];
|
|
1899 |
#endif
|
|
1900 |
{
|
|
1901 |
(void) fprintf( stderr, "%s\n", msg );
|
|
1902 |
exit( YY_EXIT_FAILURE );
|
|
1903 |
}
|
|
1904 |
|
|
1905 |
|
|
1906 |
|
|
1907 |
/* Redefine yyless() so it works in section 3 code. */
|
|
1908 |
|
|
1909 |
#undef yyless
|
|
1910 |
#define yyless(n) \
|
|
1911 |
do \
|
|
1912 |
{ \
|
|
1913 |
/* Undo effects of setting up yytext. */ \
|
|
1914 |
yytext[yyleng] = yy_hold_char; \
|
|
1915 |
yy_c_buf_p = yytext + n; \
|
|
1916 |
yy_hold_char = *yy_c_buf_p; \
|
|
1917 |
*yy_c_buf_p = '\0'; \
|
|
1918 |
yyleng = n; \
|
|
1919 |
} \
|
|
1920 |
while ( 0 )
|
|
1921 |
|
|
1922 |
|
|
1923 |
/* Internal utility routines. */
|
|
1924 |
|
|
1925 |
#ifndef yytext_ptr
|
|
1926 |
#ifdef YY_USE_PROTOS
|
|
1927 |
static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
|
|
1928 |
#else
|
|
1929 |
static void yy_flex_strncpy( s1, s2, n )
|
|
1930 |
char *s1;
|
|
1931 |
yyconst char *s2;
|
|
1932 |
int n;
|
|
1933 |
#endif
|
|
1934 |
{
|
|
1935 |
register int i;
|
|
1936 |
for ( i = 0; i < n; ++i )
|
|
1937 |
s1[i] = s2[i];
|
|
1938 |
}
|
|
1939 |
#endif
|
|
1940 |
|
|
1941 |
#ifdef YY_NEED_STRLEN
|
|
1942 |
#ifdef YY_USE_PROTOS
|
|
1943 |
static int yy_flex_strlen( yyconst char *s )
|
|
1944 |
#else
|
|
1945 |
static int yy_flex_strlen( s )
|
|
1946 |
yyconst char *s;
|
|
1947 |
#endif
|
|
1948 |
{
|
|
1949 |
register int n;
|
|
1950 |
for ( n = 0; s[n]; ++n )
|
|
1951 |
;
|
|
1952 |
|
|
1953 |
return n;
|
|
1954 |
}
|
|
1955 |
#endif
|
|
1956 |
|
|
1957 |
|
|
1958 |
#ifdef YY_USE_PROTOS
|
|
1959 |
static void *yy_flex_alloc( yy_size_t size )
|
|
1960 |
#else
|
|
1961 |
static void *yy_flex_alloc( size )
|
|
1962 |
yy_size_t size;
|
|
1963 |
#endif
|
|
1964 |
{
|
|
1965 |
return (void *) malloc( size );
|
|
1966 |
}
|
|
1967 |
|
|
1968 |
#ifdef YY_USE_PROTOS
|
|
1969 |
static void *yy_flex_realloc( void *ptr, yy_size_t size )
|
|
1970 |
#else
|
|
1971 |
static void *yy_flex_realloc( ptr, size )
|
|
1972 |
void *ptr;
|
|
1973 |
yy_size_t size;
|
|
1974 |
#endif
|
|
1975 |
{
|
|
1976 |
/* The cast to (char *) in the following accommodates both
|
|
1977 |
* implementations that use char* generic pointers, and those
|
|
1978 |
* that use void* generic pointers. It works with the latter
|
|
1979 |
* because both ANSI C and C++ allow castless assignment from
|
|
1980 |
* any pointer type to void*, and deal with argument conversions
|
|
1981 |
* as though doing an assignment.
|
|
1982 |
*/
|
|
1983 |
return (void *) realloc( (char *) ptr, size );
|
|
1984 |
}
|
|
1985 |
|
|
1986 |
#ifdef YY_USE_PROTOS
|
|
1987 |
static void yy_flex_free( void *ptr )
|
|
1988 |
#else
|
|
1989 |
static void yy_flex_free( ptr )
|
|
1990 |
void *ptr;
|
|
1991 |
#endif
|
|
1992 |
{
|
|
1993 |
free( ptr );
|
|
1994 |
}
|
|
1995 |
|
|
1996 |
#if YY_MAIN
|
|
1997 |
int main()
|
|
1998 |
{
|
|
1999 |
yylex();
|
|
2000 |
return 0;
|
|
2001 |
}
|
|
2002 |
#endif
|
|
2003 |
#line 162 "level.ll"
|
|
2004 |
|
|
2005 |
|
|
2006 |
Level::Level(){
|
|
2007 |
level_number=0;
|
|
2008 |
error=false;
|
|
2009 |
entry_ready=false;
|
|
2010 |
npipes=0;
|
|
2011 |
start_delay=-1;
|
|
2012 |
restrict_coef=-1;
|
|
2013 |
fixed_coef=-1;
|
|
2014 |
speed=1;
|
|
2015 |
required=0;
|
|
2016 |
graph_dirs=NULL;
|
|
2017 |
background=MosaicBackground;
|
|
2018 |
}
|
|
2019 |
|
|
2020 |
Level::~Level(){
|
|
2021 |
if (graph_dirs){
|
|
2022 |
graph_dirs->empty(true);
|
|
2023 |
delete graph_dirs;
|
|
2024 |
}
|
|
2025 |
}
|
|
2026 |
|
|
2027 |
void Level::printError(Str * s){
|
|
2028 |
error=true;
|
|
2029 |
printf("Level error:%i:%s\n", nline, s->get());
|
|
2030 |
delete s;
|
|
2031 |
}
|
|
2032 |
|
|
2033 |
CardinalPoint Level::sideAssignment(){
|
|
2034 |
int aux_token;
|
|
2035 |
|
|
2036 |
if (yylex()==EQUAL){
|
|
2037 |
aux_token=yylex();
|
|
2038 |
token=yylex();
|
|
2039 |
switch (aux_token){
|
|
2040 |
case NORTH: return North;
|
|
2041 |
case SOUTH: return South;
|
|
2042 |
case WEST: return West;
|
|
2043 |
case EAST: return East;
|
|
2044 |
default: printError(new Str("Invalid side"));
|
|
2045 |
}
|
|
2046 |
}else
|
|
2047 |
printError(new Str("'=' expected"));
|
|
2048 |
return Void;
|
|
2049 |
}
|
|
2050 |
|
|
2051 |
int Level::numberAssignment(){
|
|
2052 |
int aux;
|
|
2053 |
|
|
2054 |
if (yylex()==EQUAL)
|
|
2055 |
if (yylex()==NUMBER){
|
|
2056 |
aux=atoi(yytext);
|
|
2057 |
token=yylex();
|
|
2058 |
return aux;
|
|
2059 |
}else printError(new Str("number expected"));
|
|
2060 |
else printError(new Str("'=' expected"));
|
|
2061 |
return 0;
|
|
2062 |
}
|
|
2063 |
|
|
2064 |
Str * Level::stringAssignment(){
|
|
2065 |
Str * s;
|
|
2066 |
|
|
2067 |
if (yylex()==EQUAL)
|
|
2068 |
if (yylex()==STRING){
|
|
2069 |
s=new Str(yytext);
|
|
2070 |
token=yylex();
|
|
2071 |
return s;
|
|
2072 |
}else printError(new Str("string expected"));
|
|
2073 |
else printError(new Str("'=' expected"));
|
|
2074 |
return NULL;
|
|
2075 |
}
|
|
2076 |
|
|
2077 |
Level::PipeType Level::pipeTypeAssignment(){
|
|
2078 |
int aux_token;
|
|
2079 |
if (yylex()==EQUAL){
|
|
2080 |
aux_token=yylex();
|
|
2081 |
token=yylex();
|
|
2082 |
switch (aux_token){
|
|
2083 |
case ELBOW_NW : return ElbowNW;
|
|
2084 |
case ELBOW_NE : return ElbowNE;
|
|
2085 |
case ELBOW_SW : return ElbowSW;
|
|
2086 |
case ELBOW_SE : return ElbowSE;
|
|
2087 |
case BOWL_H : return BowlH;
|
|
2088 |
case BOWL_V : return BowlV;
|
|
2089 |
case VERTICAL : return Vert;
|
|
2090 |
case HORIZONTAL: return Horiz;
|
|
2091 |
case CROSS : return CrossPipe;
|
|
2092 |
default:{
|
|
2093 |
printError(new Str("pipe type not valid"));
|
|
2094 |
}
|
|
2095 |
}
|
|
2096 |
}else printError(new Str("'=' expected"));
|
|
2097 |
return ElbowNW;
|
|
2098 |
}
|
|
2099 |
|
|
2100 |
Bonus Level::bonusAssignment(){
|
|
2101 |
int aux_token;
|
|
2102 |
if (yylex()==EQUAL){
|
|
2103 |
aux_token=yylex();
|
|
2104 |
token=yylex();
|
|
2105 |
switch (aux_token){
|
|
2106 |
case NORMAL : return NormalBonus;
|
|
2107 |
case SUPER : return SuperBonus;
|
|
2108 |
case ULTRA : return UltraBonus;
|
|
2109 |
case HYPER : return HyperBonus;
|
|
2110 |
case EXTRA_LIFE: return LifeBonus;
|
|
2111 |
case EXTRA_TIME: return TimeBonus;
|
|
2112 |
default:{
|
|
2113 |
printError(new Str("bonus type not valid"));
|
|
2114 |
break;
|
|
2115 |
}
|
|
2116 |
}
|
|
2117 |
}else printError(new Str("'=' expected"));
|
|
2118 |
return NormalBonus;
|
|
2119 |
}
|
|
2120 |
|
|
2121 |
bool Level::boolAssignment(){
|
|
2122 |
bool aux;
|
|
2123 |
if (yylex()==EQUAL){
|
|
2124 |
switch (yylex()){
|
|
2125 |
case TRUE : {aux=true;break;}
|
|
2126 |
case FALSE : {aux=false;break;}
|
|
2127 |
default:{
|
|
2128 |
printError(new Str("not boolean type"));
|
|
2129 |
break;
|
|
2130 |
}
|
|
2131 |
}
|
|
2132 |
token=yylex();
|
|
2133 |
return aux;
|
|
2134 |
}else printError(new Str("'=' expected"));
|
|
2135 |
return false;
|
|
2136 |
}
|
|
2137 |
|
|
2138 |
BackgroundType Level::backgroundAssignment(){
|
|
2139 |
int aux_token;
|
|
2140 |
if (yylex()==EQUAL){
|
|
2141 |
aux_token=yylex();
|
|
2142 |
token=yylex();
|
|
2143 |
switch (aux_token){
|
|
2144 |
case WALLPAPER : return WallpaperBackground;
|
|
2145 |
case MOSAIC : return MosaicBackground;
|
|
2146 |
default:break;
|
|
2147 |
}
|
|
2148 |
}else printError(new Str("'=' expected"));
|
|
2149 |
return MosaicBackground;
|
|
2150 |
}
|
|
2151 |
|
|
2152 |
|
|
2153 |
Entry * Level::getEntry(int& row, int& column){
|
|
2154 |
Entry * entry= new Entry(pipetable[0].restricted_output1);
|
|
2155 |
row=pipetable[0].row;
|
|
2156 |
column=pipetable[0].column;
|
|
2157 |
return entry;
|
|
2158 |
}
|
|
2159 |
|
|
2160 |
Exit * Level::getExit(int& row, int& column){
|
|
2161 |
Exit * exit= new Exit(pipetable[1].restricted_output1);
|
|
2162 |
row=pipetable[1].row;
|
|
2163 |
column=pipetable[1].column;
|
|
2164 |
return exit;
|
|
2165 |
}
|
|
2166 |
|
|
2167 |
int Level::getFixedCoef(){
|
|
2168 |
return fixed_coef;
|
|
2169 |
}
|
|
2170 |
|
|
2171 |
int Level::getRestrictionCoef(){
|
|
2172 |
return restrict_coef;
|
|
2173 |
}
|
|
2174 |
|
|
2175 |
int Level::getStartDelay(){
|
|
2176 |
return start_delay;
|
|
2177 |
}
|
|
2178 |
|
|
2179 |
int Level::getSpeed(){
|
|
2180 |
return speed;
|
|
2181 |
}
|
|
2182 |
|
|
2183 |
int Level::getRequired(){
|
|
2184 |
return required;
|
|
2185 |
}
|
|
2186 |
|
|
2187 |
BackgroundType Level::getBackgroundType(){
|
|
2188 |
return background;
|
|
2189 |
}
|
|
2190 |
|
|
2191 |
List * Level::getGraphDirs(){
|
|
2192 |
List * list=new List();
|
|
2193 |
Index * ind=graph_dirs->getFirst();
|
|
2194 |
while (!graph_dirs->isEnd(ind)){
|
|
2195 |
list->insert(list->getEnd(), new Str((Str*)(graph_dirs->getObject(ind))));
|
|
2196 |
ind=graph_dirs->getNext(ind);
|
|
2197 |
}
|
|
2198 |
return list;
|
|
2199 |
}
|
|
2200 |
|
|
2201 |
int Level::getPipeIndex(){
|
|
2202 |
return 2;
|
|
2203 |
}
|
|
2204 |
|
|
2205 |
Pipe * Level::getPipe(int& i, int& row, int& column){
|
|
2206 |
Pipe * pipe;
|
|
2207 |
|
|
2208 |
if (i < npipes && i > 1){
|
|
2209 |
switch (pipetable[i].type){
|
|
2210 |
case ElbowNW:{
|
|
2211 |
pipe=new ElbowUpLeft();
|
|
2212 |
break;
|
|
2213 |
}
|
|
2214 |
case ElbowNE:{
|
|
2215 |
pipe=new ElbowUpRight();
|
|
2216 |
break;
|
|
2217 |
}
|
|
2218 |
case ElbowSW:{
|
|
2219 |
pipe=new ElbowDownLeft();
|
|
2220 |
break;
|
|
2221 |
}
|
|
2222 |
case ElbowSE:{
|
|
2223 |
pipe=new ElbowDownRight();
|
|
2224 |
break;
|
|
2225 |
}
|
|
2226 |
case Vert:{
|
|
2227 |
pipe=new Vertical();
|
|
2228 |
break;
|
|
2229 |
}
|
|
2230 |
case Horiz:{
|
|
2231 |
pipe=new Horizontal();
|
|
2232 |
break;
|
|
2233 |
}
|
|
2234 |
case BowlH:{
|
|
2235 |
pipe=new HorizontalBowl();
|
|
2236 |
break;
|
|
2237 |
}
|
|
2238 |
case BowlV:{
|
|
2239 |
pipe=new VerticalBowl();
|
|
2240 |
break;
|
|
2241 |
}
|
|
2242 |
case CrossPipe:{
|
|
2243 |
pipe=new Cross();
|
|
2244 |
break;
|
|
2245 |
}
|
|
2246 |
}
|
|
2247 |
pipe->setBonus(pipetable[i].bonus);
|
|
2248 |
if (pipetable[i].restricted_output1 != Void)
|
|
2249 |
pipe->restrictAsOutput(pipetable[i].restricted_output1);
|
|
2250 |
if (pipetable[i].restricted_output2 != Void)
|
|
2251 |
pipe->restrictAsOutput(pipetable[i].restricted_output2);
|
|
2252 |
pipe->setFixed(pipetable[i].fixed);
|
|
2253 |
row=pipetable[i].row;
|
|
2254 |
column=pipetable[i].column;
|
|
2255 |
i++;
|
|
2256 |
return pipe;
|
|
2257 |
}
|
|
2258 |
return NULL;
|
|
2259 |
}
|
|
2260 |
|
|
2261 |
void Level::ee(){
|
|
2262 |
int row=0, column=0;
|
|
2263 |
CardinalPoint con=North;
|
|
2264 |
int aux_token=token;
|
|
2265 |
|
|
2266 |
if (token==ENTRY || token==EXIT){
|
|
2267 |
if (yylex()==O_BLOCK){
|
|
2268 |
token=yylex();
|
|
2269 |
while (token!=C_BLOCK && !error){
|
|
2270 |
switch (token){
|
|
2271 |
case ROW:{
|
|
2272 |
row=numberAssignment();
|
|
2273 |
break;
|
|
2274 |
}
|
|
2275 |
case COLUMN:{
|
|
2276 |
column=numberAssignment();
|
|
2277 |
break;
|
|
2278 |
}
|
|
2279 |
case SIDE:{
|
|
2280 |
con=sideAssignment();
|
|
2281 |
break;
|
|
2282 |
}
|
|
2283 |
default:{
|
|
2284 |
if (aux_token==ENTRY)
|
|
2285 |
printError(new Str("invalid word in entry structure"));
|
|
2286 |
else
|
|
2287 |
printError(new Str("invalid word in exit structure"));
|
|
2288 |
}
|
|
2289 |
}
|
|
2290 |
}
|
|
2291 |
if (!error) {
|
|
2292 |
token=yylex();
|
|
2293 |
if (aux_token==ENTRY){
|
|
2294 |
pipetable[0].row=row;
|
|
2295 |
pipetable[0].column=column;
|
|
2296 |
pipetable[0].restricted_output1=con;
|
|
2297 |
entry_ready=true;
|
|
2298 |
}else{
|
|
2299 |
pipetable[1].row=row;
|
|
2300 |
pipetable[1].column=column;
|
|
2301 |
pipetable[1].restricted_output1=con;
|
|
2302 |
exit_ready=true;
|
|
2303 |
}
|
|
2304 |
}
|
|
2305 |
}else printError(new Str("'{' expected"));
|
|
2306 |
}else printError(new Str("'entry' or 'exit' expected"));
|
|
2307 |
}
|
|
2308 |
|
|
2309 |
void Level::pipe(){
|
|
2310 |
|
|
2311 |
pipetable[npipes].row=0;
|
|
2312 |
pipetable[npipes].column=0;
|
|
2313 |
pipetable[npipes].type=ElbowNW;
|
|
2314 |
pipetable[npipes].restricted_output1=Void;
|
|
2315 |
pipetable[npipes].restricted_output2=Void;
|
|
2316 |
pipetable[npipes].bonus=NormalBonus;
|
|
2317 |
pipetable[npipes].fixed=false;
|
|
2318 |
|
|
2319 |
if (token==PIPE){
|
|
2320 |
if (yylex()==O_BLOCK){
|
|
2321 |
token=yylex();
|
|
2322 |
while (token!=C_BLOCK && !error){
|
|
2323 |
switch (token){
|
|
2324 |
case ROW:{
|
|
2325 |
pipetable[npipes].row=numberAssignment();
|
|
2326 |
break;
|
|
2327 |
}
|
|
2328 |
case COLUMN:{
|
|
2329 |
pipetable[npipes].column=numberAssignment();
|
|
2330 |
break;
|
|
2331 |
}
|
|
2332 |
case TYPE:{
|
|
2333 |
pipetable[npipes].type=pipeTypeAssignment();
|
|
2334 |
break;
|
|
2335 |
}
|
|
2336 |
case RESTRICTED_OUTPUT:{
|
|
2337 |
if (pipetable[npipes].restricted_output1!=Void){
|
|
2338 |
if (pipetable[npipes].restricted_output2!=Void)
|
|
2339 |
pipetable[npipes].restricted_output1=pipetable[npipes].restricted_output2;
|
|
2340 |
pipetable[npipes].restricted_output2=sideAssignment();
|
|
2341 |
}else pipetable[npipes].restricted_output1=sideAssignment();
|
|
2342 |
break;
|
|
2343 |
}
|
|
2344 |
case BONUS:{
|
|
2345 |
pipetable[npipes].bonus=bonusAssignment();
|
|
2346 |
break;
|
|
2347 |
}
|
|
2348 |
case FIXED:{
|
|
2349 |
pipetable[npipes].fixed=boolAssignment();
|
|
2350 |
break;
|
|
2351 |
}
|
|
2352 |
default:printError(new Str("invalid word in pipe structure"));
|
|
2353 |
}
|
|
2354 |
}
|
|
2355 |
npipes++;
|
|
2356 |
token=yylex();
|
|
2357 |
}else printError(new Str("'{' expected"));
|
|
2358 |
}else printError(new Str("'pipe' expected"));
|
|
2359 |
}
|
|
2360 |
|
|
2361 |
|
|
2362 |
void Level::level(){
|
|
2363 |
Str * s;
|
|
2364 |
|
|
2365 |
/** Default values for a level*/
|
|
2366 |
entry_ready=false;
|
|
2367 |
exit_ready=false;
|
|
2368 |
level_number=0;
|
|
2369 |
error=false;
|
|
2370 |
npipes=2;
|
|
2371 |
start_delay=0;
|
|
2372 |
restrict_coef=0;
|
|
2373 |
fixed_coef=0;
|
|
2374 |
speed=1;
|
|
2375 |
if (graph_dirs) graph_dirs->empty(true);
|
|
2376 |
else graph_dirs=new List();
|
|
2377 |
|
|
2378 |
pipetable[0].row=0;
|
|
2379 |
pipetable[0].column=0;
|
|
2380 |
pipetable[0].restricted_output1=East;
|
|
2381 |
|
|
2382 |
pipetable[1].row=0;
|
|
2383 |
pipetable[1].column=1;
|
|
2384 |
pipetable[1].restricted_output1=West;
|
|
2385 |
|
|
2386 |
if ((token=yylex())==PIPENIGHTDREAMS){
|
|
2387 |
if (yylex()==O_BLOCK){
|
|
2388 |
token=yylex();
|
|
2389 |
while (token!=C_BLOCK && !error){
|
|
2390 |
switch (token){
|
|
2391 |
case LEVEL:{
|
|
2392 |
level_number=numberAssignment();
|
|
2393 |
break;
|
|
2394 |
}
|
|
2395 |
case SPEED:{
|
|
2396 |
speed=numberAssignment();
|
|
2397 |
break;
|
|
2398 |
}
|
|
2399 |
case GRAPH_DIR:{
|
|
2400 |
s=stringAssignment();
|
|
2401 |
if (!error){
|
|
2402 |
s->crop(1, s->lenght()-1);
|
|
2403 |
graph_dirs->insert(graph_dirs->getEnd(), s);
|
|
2404 |
}
|
|
2405 |
break;
|
|
2406 |
}
|
|
2407 |
case START_DELAY:{
|
|
2408 |
start_delay=numberAssignment();
|
|
2409 |
break;
|
|
2410 |
}
|
|
2411 |
case RESTRICT_COEF:{
|
|
2412 |
restrict_coef=numberAssignment();
|
|
2413 |
break;
|
|
2414 |
}
|
|
2415 |
case FIXED_COEF:{
|
|
2416 |
fixed_coef=numberAssignment();
|
|
2417 |
break;
|
|
2418 |
}
|
|
2419 |
case BACKGROUND:{
|
|
2420 |
background=backgroundAssignment();
|
|
2421 |
break;
|
|
2422 |
}
|
|
2423 |
case REQUIRED:{
|
|
2424 |
required=numberAssignment();
|
|
2425 |
break;
|
|
2426 |
}
|
|
2427 |
case ENTRY:case EXIT:{
|
|
2428 |
ee();
|
|
2429 |
break;
|
|
2430 |
}
|
|
2431 |
case PIPE:{
|
|
2432 |
pipe();
|
|
2433 |
break;
|
|
2434 |
}
|
|
2435 |
default:printError(new Str("invalid word in level structure"));
|
|
2436 |
}
|
|
2437 |
}
|
|
2438 |
if (!entry_ready && !error) printError(new Str("no entry available"));
|
|
2439 |
if (!exit_ready && !error) printError(new Str("no exit available"));
|
|
2440 |
}else printError(new Str("'{' expected"));
|
|
2441 |
}else printError(new Str("'pipenightdreams' not found"));
|
|
2442 |
}
|
|
2443 |
|
|
2444 |
int Level::load(Str * filename){
|
|
2445 |
YY_FLUSH_BUFFER;
|
|
2446 |
nline=1;
|
|
2447 |
if (!(yyin=fopen(filename->get(), "r"))){
|
|
2448 |
delete filename;
|
|
2449 |
return 1;
|
|
2450 |
}
|
|
2451 |
delete filename;
|
|
2452 |
level();
|
|
2453 |
fclose(yyin);
|
|
2454 |
if (error) return -1;
|
|
2455 |
return 0;
|
|
2456 |
}
|
|
2457 |
|