1 #line 2 "engines/director/lingo/lingo-lex.cpp"
2
3 #line 4 "engines/director/lingo/lingo-lex.cpp"
4
5 #define YY_INT_ALIGNED short int
6
7 /* A lexical scanner generated by flex */
8
9 #define FLEX_SCANNER
10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 5
12 #define YY_FLEX_SUBMINOR_VERSION 35
13 #if YY_FLEX_SUBMINOR_VERSION > 0
14 #define FLEX_BETA
15 #endif
16
17 /* First, we deal with platform-specific or compiler-specific issues. */
18
19 /* begin standard C headers. */
20 #include <stdio.h>
21 #include <string.h>
22 #include <errno.h>
23 #include <stdlib.h>
24
25 /* end standard C headers. */
26
27 /* flex integer type definitions */
28
29 #ifndef FLEXINT_H
30 #define FLEXINT_H
31
32 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33
34 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35
36 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37 * if you want the limit (max/min) macros for int types.
38 */
39 #ifndef __STDC_LIMIT_MACROS
40 #define __STDC_LIMIT_MACROS 1
41 #endif
42
43 #include <inttypes.h>
44 typedef int8_t flex_int8_t;
45 typedef uint8_t flex_uint8_t;
46 typedef int16_t flex_int16_t;
47 typedef uint16_t flex_uint16_t;
48 typedef int32_t flex_int32_t;
49 typedef uint32_t flex_uint32_t;
50 typedef uint64_t flex_uint64_t;
51 #else
52 typedef signed char flex_int8_t;
53 typedef short int flex_int16_t;
54 typedef int flex_int32_t;
55 typedef unsigned char flex_uint8_t;
56 typedef unsigned short int flex_uint16_t;
57 typedef unsigned int flex_uint32_t;
58 #endif /* ! C99 */
59
60 /* Limits of integral types. */
61 #ifndef INT8_MIN
62 #define INT8_MIN (-128)
63 #endif
64 #ifndef INT16_MIN
65 #define INT16_MIN (-32767-1)
66 #endif
67 #ifndef INT32_MIN
68 #define INT32_MIN (-2147483647-1)
69 #endif
70 #ifndef INT8_MAX
71 #define INT8_MAX (127)
72 #endif
73 #ifndef INT16_MAX
74 #define INT16_MAX (32767)
75 #endif
76 #ifndef INT32_MAX
77 #define INT32_MAX (2147483647)
78 #endif
79 #ifndef UINT8_MAX
80 #define UINT8_MAX (255U)
81 #endif
82 #ifndef UINT16_MAX
83 #define UINT16_MAX (65535U)
84 #endif
85 #ifndef UINT32_MAX
86 #define UINT32_MAX (4294967295U)
87 #endif
88
89 #endif /* ! FLEXINT_H */
90
91 #ifdef __cplusplus
92
93 /* The "const" storage-class-modifier is valid. */
94 #define YY_USE_CONST
95
96 #else /* ! __cplusplus */
97
98 /* C99 requires __STDC__ to be defined as 1. */
99 #if defined (__STDC__)
100
101 #define YY_USE_CONST
102
103 #endif /* defined (__STDC__) */
104 #endif /* ! __cplusplus */
105
106 #ifdef YY_USE_CONST
107 #define yyconst const
108 #else
109 #define yyconst
110 #endif
111
112 /* Returned upon end-of-file. */
113 #define YY_NULL 0
114
115 /* Promotes a possibly negative, possibly signed char to an unsigned
116 * integer for use as an array index. If the signed char is negative,
117 * we want to instead treat it as an 8-bit unsigned char, hence the
118 * double cast.
119 */
120 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
121
122 /* Enter a start condition. This macro really ought to take a parameter,
123 * but we do it the disgusting crufty way forced on us by the ()-less
124 * definition of BEGIN.
125 */
126 #define BEGIN (yy_start) = 1 + 2 *
127
128 /* Translate the current start state into a value that can be later handed
129 * to BEGIN to return to the state. The YYSTATE alias is for lex
130 * compatibility.
131 */
132 #define YY_START (((yy_start) - 1) / 2)
133 #define YYSTATE YY_START
134
135 /* Action number for EOF rule of a given start state. */
136 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
137
138 /* Special action meaning "start processing a new file". */
139 #define YY_NEW_FILE yyrestart(yyin )
140
141 #define YY_END_OF_BUFFER_CHAR 0
142
143 /* Size of default input buffer. */
144 #ifndef YY_BUF_SIZE
145 #define YY_BUF_SIZE 16384
146 #endif
147
148 /* The state buf must be large enough to hold one state per character in the main buffer.
149 */
150 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
151
152 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
153 #define YY_TYPEDEF_YY_BUFFER_STATE
154 typedef struct yy_buffer_state *YY_BUFFER_STATE;
155 #endif
156
157 #ifndef YY_TYPEDEF_YY_SIZE_T
158 #define YY_TYPEDEF_YY_SIZE_T
159 typedef size_t yy_size_t;
160 #endif
161
162 extern yy_size_t yyleng;
163
164 extern FILE *yyin, *yyout;
165
166 #define EOB_ACT_CONTINUE_SCAN 0
167 #define EOB_ACT_END_OF_FILE 1
168 #define EOB_ACT_LAST_MATCH 2
169
170 #define YY_LESS_LINENO(n)
171
172 /* Return all but the first "n" matched characters back to the input stream. */
173 #define yyless(n) \
174 do \
175 { \
176 /* Undo effects of setting up yytext. */ \
177 int yyless_macro_arg = (n); \
178 YY_LESS_LINENO(yyless_macro_arg);\
179 *yy_cp = (yy_hold_char); \
180 YY_RESTORE_YY_MORE_OFFSET \
181 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
182 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
183 } \
184 while ( 0 )
185
186 #define unput(c) yyunput( c, (yytext_ptr) )
187
188 #ifndef YY_STRUCT_YY_BUFFER_STATE
189 #define YY_STRUCT_YY_BUFFER_STATE
190 struct yy_buffer_state
191 {
192 FILE *yy_input_file;
193
194 char *yy_ch_buf; /* input buffer */
195 char *yy_buf_pos; /* current position in input buffer */
196
197 /* Size of input buffer in bytes, not including room for EOB
198 * characters.
199 */
200 yy_size_t yy_buf_size;
201
202 /* Number of characters read into yy_ch_buf, not including EOB
203 * characters.
204 */
205 yy_size_t yy_n_chars;
206
207 /* Whether we "own" the buffer - i.e., we know we created it,
208 * and can realloc() it to grow it, and should free() it to
209 * delete it.
210 */
211 int yy_is_our_buffer;
212
213 /* Whether this is an "interactive" input source; if so, and
214 * if we're using stdio for input, then we want to use getc()
215 * instead of fread(), to make sure we stop fetching input after
216 * each newline.
217 */
218 int yy_is_interactive;
219
220 /* Whether we're considered to be at the beginning of a line.
221 * If so, '^' rules will be active on the next match, otherwise
222 * not.
223 */
224 int yy_at_bol;
225
226 int yy_bs_lineno; /**< The line count. */
227 int yy_bs_column; /**< The column count. */
228
229 /* Whether to try to fill the input buffer when we reach the
230 * end of it.
231 */
232 int yy_fill_buffer;
233
234 int yy_buffer_status;
235
236 #define YY_BUFFER_NEW 0
237 #define YY_BUFFER_NORMAL 1
238 /* When an EOF's been seen but there's still some text to process
239 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
240 * shouldn't try reading from the input source any more. We might
241 * still have a bunch of tokens to match, though, because of
242 * possible backing-up.
243 *
244 * When we actually see the EOF, we change the status to "new"
245 * (via yyrestart()), so that the user can continue scanning by
246 * just pointing yyin at a new input file.
247 */
248 #define YY_BUFFER_EOF_PENDING 2
249
250 };
251 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
252
253 /* Stack of input buffers. */
254 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
255 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
256 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
257
258 /* We provide macros for accessing buffer states in case in the
259 * future we want to put the buffer states in a more general
260 * "scanner state".
261 *
262 * Returns the top of the stack, or NULL.
263 */
264 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
265 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
266 : NULL)
267
268 /* Same as previous macro, but useful when we know that the buffer stack is not
269 * NULL or when we need an lvalue. For internal use only.
270 */
271 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
272
273 /* yy_hold_char holds the character lost when yytext is formed. */
274 static char yy_hold_char;
275 static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
276 yy_size_t yyleng;
277
278 /* Points to current character in buffer. */
279 static char *yy_c_buf_p = (char *) 0;
280 static int yy_init = 0; /* whether we need to initialize */
281 static int yy_start = 0; /* start state number */
282
283 /* Flag which is used to allow yywrap()'s to do buffer switches
284 * instead of setting up a fresh yyin. A bit of a hack ...
285 */
286 static int yy_did_buffer_switch_on_eof;
287
288 void yyrestart (FILE *input_file );
289 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
290 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
291 void yy_delete_buffer (YY_BUFFER_STATE b );
292 void yy_flush_buffer (YY_BUFFER_STATE b );
293 void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
294 void yypop_buffer_state (void );
295
296 static void yyensure_buffer_stack (void );
297 static void yy_load_buffer_state (void );
298 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
299
300 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
301
302 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
303 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
304 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len );
305
306 void *yyalloc (yy_size_t );
307 void *yyrealloc (void *,yy_size_t );
308 void yyfree (void * );
309
310 #define yy_new_buffer yy_create_buffer
311
312 #define yy_set_interactive(is_interactive) \
313 { \
314 if ( ! YY_CURRENT_BUFFER ){ \
315 yyensure_buffer_stack (); \
316 YY_CURRENT_BUFFER_LVALUE = \
317 yy_create_buffer(yyin,YY_BUF_SIZE ); \
318 } \
319 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
320 }
321
322 #define yy_set_bol(at_bol) \
323 { \
324 if ( ! YY_CURRENT_BUFFER ){\
325 yyensure_buffer_stack (); \
326 YY_CURRENT_BUFFER_LVALUE = \
327 yy_create_buffer(yyin,YY_BUF_SIZE ); \
328 } \
329 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
330 }
331
332 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
333
334 /* Begin user sect3 */
335
336 #define yywrap(n) 1
337 #define YY_SKIP_YYWRAP
338
339 typedef unsigned char YY_CHAR;
340
341 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
342
343 typedef int yy_state_type;
344
345 extern int yylineno;
346
347 int yylineno = 1;
348
349 extern char *yytext;
350 #define yytext_ptr yytext
351
352 static yy_state_type yy_get_previous_state (void );
353 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
354 static int yy_get_next_buffer (void );
355 static void yy_fatal_error (yyconst char msg[] );
356
357 /* Done after the current pattern has been matched and before the
358 * corresponding action - sets up yytext.
359 */
360 #define YY_DO_BEFORE_ACTION \
361 (yytext_ptr) = yy_bp; \
362 yyleng = (yy_size_t) (yy_cp - yy_bp); \
363 (yy_hold_char) = *yy_cp; \
364 *yy_cp = '\0'; \
365 (yy_c_buf_p) = yy_cp;
366
367 #define YY_NUM_RULES 74
368 #define YY_END_OF_BUFFER 75
369 /* This struct is not used in this scanner,
370 but its presence is necessary. */
371 struct yy_trans_info
372 {
373 flex_int32_t yy_verify;
374 flex_int32_t yy_nxt;
375 };
376 static yyconst flex_int16_t yy_accept[274] =
377 { 0,
378 0, 0, 75, 73, 4, 71, 71, 73, 73, 73,
379 70, 70, 70, 69, 70, 70, 67, 67, 67, 67,
380 67, 67, 67, 67, 67, 67, 67, 67, 67, 67,
381 67, 67, 67, 67, 73, 3, 3, 4, 71, 0,
382 0, 0, 0, 0, 72, 5, 66, 2, 68, 69,
383 65, 63, 64, 67, 67, 67, 67, 67, 67, 67,
384 67, 67, 67, 67, 67, 67, 23, 13, 67, 67,
385 67, 67, 67, 67, 67, 67, 67, 36, 37, 67,
386 39, 67, 67, 67, 67, 67, 67, 67, 67, 67,
387 56, 67, 67, 67, 1, 3, 3, 0, 5, 2,
388
389 68, 67, 7, 67, 67, 67, 67, 67, 67, 17,
390 67, 67, 67, 67, 0, 67, 67, 67, 67, 67,
391 67, 67, 32, 67, 67, 35, 67, 67, 67, 67,
392 44, 67, 46, 67, 67, 67, 67, 67, 67, 67,
393 67, 0, 67, 67, 9, 67, 11, 12, 16, 0,
394 17, 19, 67, 67, 67, 0, 67, 67, 26, 27,
395 28, 29, 67, 67, 67, 34, 38, 40, 67, 67,
396 67, 67, 67, 48, 0, 54, 60, 67, 58, 62,
397 15, 6, 67, 67, 17, 17, 67, 20, 67, 22,
398 67, 67, 30, 67, 33, 67, 67, 67, 67, 67,
399
400 67, 53, 53, 53, 55, 61, 67, 0, 8, 67,
401 17, 67, 21, 67, 67, 31, 67, 67, 67, 45,
402 57, 47, 0, 0, 53, 53, 59, 0, 67, 18,
403 67, 67, 67, 67, 67, 0, 0, 0, 0, 53,
404 53, 14, 10, 24, 67, 67, 42, 43, 0, 0,
405 0, 53, 53, 67, 41, 0, 0, 0, 0, 0,
406 25, 52, 51, 52, 0, 0, 0, 0, 0, 0,
407 49, 50, 0
408 } ;
409
410 static yyconst flex_int32_t yy_ec[256] =
411 { 0,
412 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
413 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
414 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
415 1, 5, 1, 6, 7, 1, 8, 9, 1, 8,
416 8, 8, 10, 8, 11, 12, 8, 13, 13, 13,
417 13, 13, 13, 13, 13, 13, 13, 8, 1, 14,
418 15, 16, 1, 1, 17, 18, 19, 20, 21, 22,
419 23, 24, 25, 26, 26, 27, 28, 29, 30, 31,
420 32, 33, 34, 35, 36, 37, 38, 39, 40, 26,
421 8, 1, 8, 8, 41, 1, 42, 43, 44, 45,
422
423 46, 47, 48, 49, 50, 26, 26, 51, 52, 53,
424 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
425 64, 26, 1, 1, 1, 1, 1, 1, 1, 1,
426 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
427 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
428 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
429 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
430 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
431 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
432 1, 1, 1, 65, 1, 1, 1, 1, 1, 1,
433
434 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
435 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
436 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
437 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
438 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
439 1, 1, 1, 1, 1
440 } ;
441
442 static yyconst flex_int32_t yy_meta[66] =
443 { 0,
444 1, 2, 3, 3, 2, 1, 1, 1, 1, 1,
445 1, 1, 4, 1, 1, 1, 5, 5, 5, 5,
446 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
447 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
448 6, 5, 5, 5, 5, 5, 5, 5, 5, 5,
449 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
450 5, 5, 5, 5, 1
451 } ;
452
453 static yyconst flex_int16_t yy_base[285] =
454 { 0,
455 0, 64, 188, 702, 68, 72, 76, 80, 148, 0,
456 702, 129, 106, 55, 71, 95, 66, 68, 66, 62,
457 72, 88, 73, 0, 104, 82, 120, 110, 136, 119,
458 83, 113, 154, 156, 105, 192, 209, 213, 702, 217,
459 180, 225, 120, 100, 702, 0, 702, 0, 89, 130,
460 702, 702, 702, 0, 114, 108, 155, 181, 178, 195,
461 191, 189, 210, 217, 220, 202, 89, 0, 205, 220,
462 214, 214, 226, 215, 232, 212, 219, 0, 0, 226,
463 0, 238, 252, 224, 234, 241, 246, 267, 254, 264,
464 0, 265, 253, 259, 702, 292, 315, 265, 0, 0,
465
466 85, 280, 0, 274, 274, 273, 281, 284, 293, 320,
467 286, 289, 301, 312, 333, 299, 319, 308, 320, 312,
468 313, 320, 0, 322, 315, 0, 322, 312, 317, 325,
469 0, 336, 0, 334, 328, 335, 385, 335, 344, 353,
470 359, 360, 350, 356, 0, 374, 0, 0, 0, 185,
471 0, 0, 363, 373, 379, 368, 382, 368, 0, 0,
472 0, 0, 373, 375, 387, 0, 0, 392, 385, 390,
473 395, 380, 383, 0, 418, 157, 0, 405, 403, 0,
474 395, 0, 409, 406, 0, 0, 407, 0, 414, 702,
475 414, 410, 0, 412, 0, 427, 418, 416, 415, 433,
476
477 424, 473, 475, 479, 456, 0, 433, 488, 0, 434,
478 0, 430, 0, 447, 474, 0, 477, 452, 463, 0,
479 0, 0, 495, 483, 497, 499, 0, 486, 471, 0,
480 493, 497, 498, 476, 483, 522, 509, 514, 512, 543,
481 555, 702, 0, 0, 508, 519, 0, 0, 515, 561,
482 530, 567, 578, 534, 0, 538, 584, 550, 589, 593,
483 0, 702, 595, 702, 599, 559, 603, 563, 610, 615,
484 616, 620, 702, 657, 659, 662, 665, 671, 676, 681,
485 684, 689, 691, 696
486 } ;
487
488 static yyconst flex_int16_t yy_def[285] =
489 { 0,
490 273, 1, 273, 273, 273, 273, 273, 273, 274, 275,
491 273, 273, 273, 273, 273, 273, 276, 276, 276, 276,
492 276, 276, 276, 276, 276, 276, 276, 276, 276, 276,
493 276, 276, 276, 276, 273, 273, 273, 273, 273, 273,
494 273, 273, 273, 274, 273, 277, 273, 278, 273, 273,
495 273, 273, 273, 276, 276, 276, 276, 276, 276, 276,
496 276, 276, 276, 276, 276, 276, 276, 276, 276, 276,
497 276, 276, 276, 276, 276, 276, 276, 276, 276, 276,
498 276, 276, 276, 276, 276, 276, 276, 276, 276, 276,
499 276, 276, 276, 276, 273, 273, 273, 273, 277, 278,
500
501 273, 276, 276, 276, 276, 276, 276, 276, 276, 279,
502 276, 276, 276, 276, 273, 276, 276, 276, 276, 276,
503 276, 276, 276, 276, 276, 276, 276, 276, 276, 276,
504 276, 276, 276, 276, 276, 276, 276, 276, 276, 276,
505 276, 273, 276, 276, 276, 276, 276, 276, 276, 280,
506 281, 276, 276, 276, 276, 273, 276, 276, 276, 276,
507 276, 276, 276, 276, 276, 276, 276, 276, 276, 276,
508 276, 276, 276, 276, 282, 276, 276, 276, 276, 276,
509 273, 276, 276, 276, 283, 281, 276, 276, 276, 273,
510 276, 276, 276, 276, 276, 276, 276, 276, 276, 276,
511
512 276, 282, 282, 282, 273, 276, 276, 273, 276, 276,
513 283, 276, 276, 276, 276, 276, 276, 276, 276, 276,
514 276, 276, 273, 273, 282, 282, 276, 273, 276, 276,
515 276, 276, 276, 276, 276, 273, 273, 273, 273, 282,
516 282, 273, 276, 276, 276, 276, 276, 276, 273, 273,
517 273, 282, 282, 276, 276, 273, 284, 273, 273, 273,
518 276, 273, 284, 273, 273, 273, 273, 273, 273, 273,
519 284, 284, 0, 273, 273, 273, 273, 273, 273, 273,
520 273, 273, 273, 273
521 } ;
522
523 static yyconst flex_int16_t yy_nxt[768] =
524 { 0,
525 4, 5, 6, 7, 8, 9, 10, 11, 12, 11,
526 13, 4, 14, 15, 11, 16, 17, 18, 19, 20,
527 21, 22, 23, 24, 25, 24, 26, 27, 28, 29,
528 30, 24, 31, 32, 33, 24, 24, 34, 24, 24,
529 24, 17, 18, 19, 20, 21, 22, 23, 24, 25,
530 26, 27, 28, 29, 30, 24, 31, 32, 33, 24,
531 24, 34, 24, 24, 35, 36, 49, 50, 37, 38,
532 39, 39, 40, 41, 42, 42, 41, 41, 42, 42,
533 41, 40, 39, 39, 40, 51, 52, 55, 57, 58,
534 115, 60, 43, 115, 56, 59, 43, 101, 61, 66,
535
536 62, 101, 67, 85, 64, 45, 71, 95, 95, 53,
537 63, 72, 55, 57, 58, 60, 48, 43, 56, 59,
538 65, 43, 61, 66, 62, 68, 67, 103, 85, 64,
539 76, 71, 69, 86, 63, 72, 73, 47, 70, 77,
540 74, 49, 50, 87, 65, 82, 98, 88, 102, 75,
541 68, 83, 103, 45, 84, 76, 69, 78, 86, 205,
542 205, 73, 70, 77, 79, 74, 80, 87, 81, 82,
543 98, 88, 102, 75, 89, 83, 104, 90, 84, 92,
544 93, 41, 78, 91, 41, 94, 150, 273, 79, 150,
545 80, 273, 81, 96, 39, 39, 97, 105, 273, 89,
546
547 43, 104, 90, 273, 92, 93, 106, 91, 110, 94,
548 97, 39, 39, 97, 38, 39, 39, 40, 40, 39,
549 39, 40, 105, 107, 109, 43, 41, 42, 42, 41,
550 106, 114, 108, 110, 111, 112, 113, 273, 116, 117,
551 118, 273, 119, 120, 121, 43, 127, 107, 109, 122,
552 125, 123, 273, 126, 128, 114, 108, 273, 131, 111,
553 112, 113, 116, 117, 132, 118, 119, 120, 124, 121,
554 43, 127, 129, 122, 125, 133, 123, 126, 134, 128,
555 136, 130, 131, 135, 137, 138, 273, 140, 132, 139,
556 273, 141, 124, 96, 39, 39, 97, 129, 142, 133,
557
558 143, 147, 134, 144, 136, 130, 145, 146, 135, 137,
559 138, 140, 148, 149, 139, 141, 97, 39, 39, 97,
560 152, 150, 142, 153, 150, 143, 147, 144, 154, 155,
561 145, 146, 54, 157, 115, 160, 148, 115, 149, 158,
562 161, 273, 162, 164, 152, 163, 165, 153, 159, 166,
563 167, 168, 154, 169, 155, 170, 171, 157, 172, 160,
564 173, 174, 273, 177, 158, 161, 162, 156, 164, 163,
565 178, 165, 159, 166, 167, 168, 179, 169, 180, 170,
566 181, 171, 182, 172, 173, 174, 175, 177, 183, 175,
567 184, 156, 187, 188, 178, 189, 208, 190, 191, 208,
568
569 192, 179, 193, 180, 194, 181, 182, 195, 196, 197,
570 198, 199, 183, 176, 200, 184, 187, 201, 188, 175,
571 189, 190, 175, 191, 192, 206, 193, 207, 194, 209,
572 210, 216, 195, 196, 197, 198, 199, 176, 200, 212,
573 213, 201, 214, 215, 203, 217, 273, 218, 219, 220,
574 206, 204, 207, 221, 209, 210, 216, 222, 205, 205,
575 273, 227, 229, 212, 213, 231, 214, 215, 203, 230,
576 217, 218, 219, 220, 223, 204, 223, 223, 221, 223,
577 223, 222, 224, 223, 224, 227, 229, 234, 224, 208,
578 231, 225, 208, 230, 232, 233, 236, 235, 223, 236,
579
580 223, 223, 237, 223, 243, 273, 224, 242, 224, 247,
581 226, 234, 228, 244, 237, 245, 225, 239, 246, 232,
582 233, 235, 248, 236, 238, 249, 236, 237, 243, 239,
583 240, 241, 242, 247, 226, 250, 251, 228, 244, 237,
584 245, 239, 254, 246, 223, 255, 248, 223, 238, 256,
585 249, 238, 224, 239, 240, 241, 223, 258, 262, 223,
586 250, 251, 257, 273, 224, 257, 254, 261, 259, 255,
587 264, 259, 273, 256, 273, 238, 224, 252, 273, 260,
588 269, 258, 260, 262, 270, 257, 273, 224, 257, 253,
589 265, 261, 273, 265, 267, 264, 273, 267, 273, 273,
590
591 265, 252, 273, 265, 267, 269, 273, 267, 237, 270,
592 273, 271, 237, 253, 271, 273, 272, 271, 266, 272,
593 271, 272, 268, 239, 272, 273, 273, 239, 266, 273,
594 273, 273, 268, 237, 273, 273, 273, 237, 273, 273,
595 273, 273, 266, 273, 273, 273, 268, 239, 273, 273,
596 273, 239, 266, 273, 273, 273, 268, 44, 44, 273,
597 44, 44, 44, 46, 46, 54, 54, 54, 99, 99,
598 99, 100, 100, 273, 100, 100, 100, 151, 273, 151,
599 151, 151, 185, 273, 273, 185, 185, 186, 186, 186,
600 202, 273, 273, 202, 211, 211, 211, 263, 273, 273,
601
602 263, 3, 273, 273, 273, 273, 273, 273, 273, 273,
603 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
604 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
605 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
606 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
607 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
608 273, 273, 273, 273, 273, 273, 273
609 } ;
610
611 static yyconst flex_int16_t yy_chk[768] =
612 { 0,
613 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
614 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
615 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
616 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
617 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
618 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
619 1, 1, 1, 1, 1, 2, 14, 14, 2, 5,
620 5, 5, 5, 6, 6, 6, 6, 7, 7, 7,
621 7, 8, 8, 8, 8, 15, 15, 17, 18, 19,
622 67, 20, 6, 67, 17, 19, 7, 101, 21, 23,
623
624 21, 49, 23, 31, 22, 44, 26, 35, 35, 16,
625 21, 26, 17, 18, 19, 20, 13, 6, 17, 19,
626 22, 7, 21, 23, 21, 25, 23, 56, 31, 22,
627 28, 26, 25, 32, 21, 26, 27, 12, 25, 28,
628 27, 50, 50, 32, 22, 30, 43, 32, 55, 27,
629 25, 30, 56, 9, 30, 28, 25, 29, 32, 176,
630 176, 27, 25, 28, 29, 27, 29, 32, 29, 30,
631 43, 32, 55, 27, 33, 30, 57, 33, 30, 34,
632 34, 41, 29, 33, 41, 34, 150, 3, 29, 150,
633 29, 0, 29, 36, 36, 36, 36, 58, 0, 33,
634
635 41, 57, 33, 0, 34, 34, 59, 33, 62, 34,
636 37, 37, 37, 37, 38, 38, 38, 38, 40, 40,
637 40, 40, 58, 60, 61, 41, 42, 42, 42, 42,
638 59, 66, 60, 62, 63, 64, 65, 0, 69, 69,
639 70, 0, 71, 72, 73, 42, 80, 60, 61, 74,
640 76, 75, 0, 77, 82, 66, 60, 0, 84, 63,
641 64, 65, 69, 69, 85, 70, 71, 72, 75, 73,
642 42, 80, 83, 74, 76, 86, 75, 77, 87, 82,
643 89, 83, 84, 88, 90, 92, 0, 93, 85, 92,
644 0, 94, 75, 96, 96, 96, 96, 83, 98, 86,
645
646 102, 107, 87, 104, 89, 83, 105, 106, 88, 90,
647 92, 93, 108, 109, 92, 94, 97, 97, 97, 97,
648 111, 110, 98, 112, 110, 102, 107, 104, 113, 114,
649 105, 106, 110, 116, 115, 118, 108, 115, 109, 117,
650 119, 0, 120, 122, 111, 121, 124, 112, 117, 125,
651 127, 128, 113, 129, 114, 130, 132, 116, 134, 118,
652 135, 136, 0, 138, 117, 119, 120, 115, 122, 121,
653 139, 124, 117, 125, 127, 128, 140, 129, 141, 130,
654 142, 132, 143, 134, 135, 136, 137, 138, 144, 137,
655 146, 115, 153, 154, 139, 155, 181, 156, 157, 181,
656
657 158, 140, 163, 141, 164, 142, 143, 165, 168, 169,
658 170, 171, 144, 137, 172, 146, 153, 173, 154, 175,
659 155, 156, 175, 157, 158, 178, 163, 179, 164, 183,
660 184, 194, 165, 168, 169, 170, 171, 137, 172, 187,
661 189, 173, 191, 192, 175, 196, 0, 197, 198, 199,
662 178, 175, 179, 200, 183, 184, 194, 201, 205, 205,
663 0, 207, 210, 187, 189, 214, 191, 192, 175, 212,
664 196, 197, 198, 199, 202, 175, 203, 202, 200, 203,
665 204, 201, 202, 204, 203, 207, 210, 218, 204, 208,
666 214, 203, 208, 212, 215, 217, 223, 219, 225, 223,
667
668 226, 225, 224, 226, 229, 0, 225, 228, 226, 234,
669 204, 218, 208, 231, 223, 232, 203, 224, 233, 215,
670 217, 219, 235, 236, 223, 237, 236, 224, 229, 223,
671 225, 226, 228, 234, 204, 238, 239, 208, 231, 223,
672 232, 224, 245, 233, 240, 246, 235, 240, 223, 249,
673 237, 236, 240, 223, 225, 226, 241, 251, 256, 241,
674 238, 239, 250, 0, 241, 250, 245, 254, 252, 246,
675 258, 252, 0, 249, 0, 236, 252, 240, 0, 253,
676 266, 251, 253, 256, 268, 257, 0, 253, 257, 241,
677 259, 254, 0, 259, 260, 258, 263, 260, 0, 263,
678
679 265, 240, 0, 265, 267, 266, 0, 267, 259, 268,
680 0, 269, 260, 241, 269, 0, 270, 271, 259, 270,
681 271, 272, 260, 259, 272, 0, 0, 260, 265, 0,
682 0, 0, 267, 259, 0, 0, 0, 260, 0, 0,
683 0, 0, 259, 0, 0, 0, 260, 259, 0, 0,
684 0, 260, 265, 0, 0, 0, 267, 274, 274, 0,
685 274, 274, 274, 275, 275, 276, 276, 276, 277, 277,
686 277, 278, 278, 0, 278, 278, 278, 279, 0, 279,
687 279, 279, 280, 0, 0, 280, 280, 281, 281, 281,
688 282, 0, 0, 282, 283, 283, 283, 284, 0, 0,
689
690 284, 273, 273, 273, 273, 273, 273, 273, 273, 273,
691 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
692 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
693 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
694 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
695 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
696 273, 273, 273, 273, 273, 273, 273
697 } ;
698
699 static yy_state_type yy_last_accepting_state;
700 static char *yy_last_accepting_cpos;
701
702 extern int yy_flex_debug;
703 int yy_flex_debug = 0;
704
705 /* The intent behind this definition is that it'll catch
706 * any uses of REJECT which flex missed.
707 */
708 #define REJECT reject_used_but_not_detected
709 #define yymore() yymore_used_but_not_detected
710 #define YY_MORE_ADJ 0
711 #define YY_RESTORE_YY_MORE_OFFSET
712 char *yytext;
713 #line 1 "engines/director/lingo/lingo-lex.l"
714 /* ScummVM - Graphic Adventure Engine
715 *
716 * ScummVM is the legal property of its developers, whose names
717 * are too numerous to list here. Please refer to the COPYRIGHT
718 * file distributed with this source distribution.
719 *
720 * This program is free software; you can redistribute it and/or
721 * modify it under the terms of the GNU General Public License
722 * as published by the Free Software Foundation; either version 2
723 * of the License, or (at your option) any later version.
724 *
725 * This program is distributed in the hope that it will be useful,
726 * but WITHOUT ANY WARRANTY; without even the implied warranty of
727 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
728 * GNU General Public License for more details.
729 *
730 * You should have received a copy of the GNU General Public License
731 * along with this program; if not, write to the Free Software
732 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
733 *
734 */
735 #define YY_NO_INPUT 1
736 #line 29 "engines/director/lingo/lingo-lex.l"
737
738 #define YY_NO_UNISTD_H
739 #define FORBIDDEN_SYMBOL_ALLOW_ALL
740
741 #include "common/str.h"
742
743 #include "director/lingo/lingo.h"
744 #include "director/lingo/lingo-gr.h"
745
746 using namespace Director;
747
748 int yyparse();
count()749 static void count() {
750 if (debugChannelSet(-1, kDebugLingoParse))
751 debug("LEXER: Read '%s' at %d:%d", yytext, g_lingo->_linenumber, g_lingo->_colnumber);
752
753 g_lingo->_colnumber += strlen(yytext);
754 }
755
countnl()756 static void countnl() {
757 char *p = yytext;
758
759 while(*p == '\n' || *p == '\r')
760 p++;
761
762 g_lingo->_linenumber++;
763 g_lingo->_colnumber = strlen(p);
764 }
765
checkImmediate(int token)766 static int checkImmediate(int token) {
767 if (g_lingo->_immediateMode) {
768 yylval.s = new Common::String(yytext);
769
770 return ID;
771 }
772
773 return token;
774 }
775
776 #line 777 "engines/director/lingo/lingo-lex.cpp"
777
778 #define INITIAL 0
779
780 #ifndef YY_NO_UNISTD_H
781 /* Special case for "unistd.h", since it is non-ANSI. We include it way
782 * down here because we want the user's section 1 to have been scanned first.
783 * The user has a chance to override it with an option.
784 */
785 #include <unistd.h>
786 #endif
787
788 #ifndef YY_EXTRA_TYPE
789 #define YY_EXTRA_TYPE void *
790 #endif
791
792 static int yy_init_globals (void );
793
794 /* Accessor methods to globals.
795 These are made visible to non-reentrant scanners for convenience. */
796
797 int yylex_destroy (void );
798
799 int yyget_debug (void );
800
801 void yyset_debug (int debug_flag );
802
803 YY_EXTRA_TYPE yyget_extra (void );
804
805 void yyset_extra (YY_EXTRA_TYPE user_defined );
806
807 FILE *yyget_in (void );
808
809 void yyset_in (FILE * in_str );
810
811 FILE *yyget_out (void );
812
813 void yyset_out (FILE * out_str );
814
815 yy_size_t yyget_leng (void );
816
817 char *yyget_text (void );
818
819 int yyget_lineno (void );
820
821 void yyset_lineno (int line_number );
822
823 /* Macros after this point can all be overridden by user definitions in
824 * section 1.
825 */
826
827 #ifndef YY_SKIP_YYWRAP
828 #ifdef __cplusplus
829 extern "C" int yywrap (void );
830 #else
831 extern int yywrap (void );
832 #endif
833 #endif
834
835 #ifndef yytext_ptr
836 static void yy_flex_strncpy (char *,yyconst char *,int );
837 #endif
838
839 #ifdef YY_NEED_STRLEN
840 static int yy_flex_strlen (yyconst char * );
841 #endif
842
843 #ifndef YY_NO_INPUT
844
845 #ifdef __cplusplus
846 static int yyinput (void );
847 #else
848 static int input (void );
849 #endif
850
851 #endif
852
853 /* Amount of stuff to slurp up with each read. */
854 #ifndef YY_READ_BUF_SIZE
855 #define YY_READ_BUF_SIZE 8192
856 #endif
857
858 /* Copy whatever the last rule matched to the standard output. */
859 #ifndef ECHO
860 /* This used to be an fputs(), but since the string might contain NUL's,
861 * we now use fwrite().
862 */
863 #define ECHO fwrite( yytext, yyleng, 1, yyout )
864 #endif
865
866 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
867 * is returned in "result".
868 */
869 #ifndef YY_INPUT
870 #define YY_INPUT(buf,result,max_size) \
871 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
872 { \
873 int c = '*'; \
874 yy_size_t n; \
875 for ( n = 0; n < max_size && \
876 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
877 buf[n] = (char) c; \
878 if ( c == '\n' ) \
879 buf[n++] = (char) c; \
880 if ( c == EOF && ferror( yyin ) ) \
881 YY_FATAL_ERROR( "input in flex scanner failed" ); \
882 result = n; \
883 } \
884 else \
885 { \
886 errno=0; \
887 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
888 { \
889 if( errno != EINTR) \
890 { \
891 YY_FATAL_ERROR( "input in flex scanner failed" ); \
892 break; \
893 } \
894 errno=0; \
895 clearerr(yyin); \
896 } \
897 }\
898 \
899
900 #endif
901
902 /* No semi-colon after return; correct usage is to write "yyterminate();" -
903 * we don't want an extra ';' after the "return" because that will cause
904 * some compilers to complain about unreachable statements.
905 */
906 #ifndef yyterminate
907 #define yyterminate() return YY_NULL
908 #endif
909
910 /* Number of entries by which start-condition stack grows. */
911 #ifndef YY_START_STACK_INCR
912 #define YY_START_STACK_INCR 25
913 #endif
914
915 /* Report a fatal error. */
916 #ifndef YY_FATAL_ERROR
917 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
918 #endif
919
920 /* end tables serialization structures and prototypes */
921
922 /* Default declaration of generated scanner - a define so the user can
923 * easily add parameters.
924 */
925 #ifndef YY_DECL
926 #define YY_DECL_IS_OURS 1
927
928 extern int yylex (void);
929
930 #define YY_DECL int yylex (void)
931 #endif /* !YY_DECL */
932
933 /* Code executed at the beginning of each rule, after yytext and yyleng
934 * have been set up.
935 */
936 #ifndef YY_USER_ACTION
937 #define YY_USER_ACTION
938 #endif
939
940 /* Code executed at the end of each rule. */
941 #ifndef YY_BREAK
942 #define YY_BREAK break;
943 #endif
944
945 #define YY_RULE_SETUP \
946 if ( yyleng > 0 ) \
947 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
948 (yytext[yyleng - 1] == '\n'); \
949 YY_USER_ACTION
950
951 /** The main scanner function which does all the work.
952 */
953 YY_DECL
954 {
955 register yy_state_type yy_current_state;
956 register char *yy_cp, *yy_bp;
957 register int yy_act;
958
959 #line 78 "engines/director/lingo/lingo-lex.l"
960
961
962 #line 963 "engines/director/lingo/lingo-lex.cpp"
963
964 if ( !(yy_init) )
965 {
966 (yy_init) = 1;
967
968 #ifdef YY_USER_INIT
969 YY_USER_INIT;
970 #endif
971
972 if ( ! (yy_start) )
973 (yy_start) = 1; /* first start state */
974
975 if ( ! yyin )
976 yyin = stdin;
977
978 if ( ! yyout )
979 yyout = stdout;
980
981 if ( ! YY_CURRENT_BUFFER ) {
982 yyensure_buffer_stack ();
983 YY_CURRENT_BUFFER_LVALUE =
984 yy_create_buffer(yyin,YY_BUF_SIZE );
985 }
986
987 yy_load_buffer_state( );
988 }
989
990 while ( 1 ) /* loops until end-of-file is reached */
991 {
992 yy_cp = (yy_c_buf_p);
993
994 /* Support of yytext. */
995 *yy_cp = (yy_hold_char);
996
997 /* yy_bp points to the position in yy_ch_buf of the start of
998 * the current run.
999 */
1000 yy_bp = yy_cp;
1001
1002 yy_current_state = (yy_start);
1003 yy_current_state += YY_AT_BOL();
1004 yy_match:
1005 do
1006 {
1007 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1008 if ( yy_accept[yy_current_state] )
1009 {
1010 (yy_last_accepting_state) = yy_current_state;
1011 (yy_last_accepting_cpos) = yy_cp;
1012 }
1013 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1014 {
1015 yy_current_state = (int) yy_def[yy_current_state];
1016 if ( yy_current_state >= 274 )
1017 yy_c = yy_meta[(unsigned int) yy_c];
1018 }
1019 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1020 ++yy_cp;
1021 }
1022 while ( yy_current_state != 273 );
1023 yy_cp = (yy_last_accepting_cpos);
1024 yy_current_state = (yy_last_accepting_state);
1025
1026 yy_find_action:
1027 yy_act = yy_accept[yy_current_state];
1028
1029 YY_DO_BEFORE_ACTION;
1030
1031 do_action: /* This label is used only to access EOF actions. */
1032
1033 switch ( yy_act )
1034 { /* beginning of action switch */
1035 case 0: /* must back up */
1036 /* undo the effects of YY_DO_BEFORE_ACTION */
1037 *yy_cp = (yy_hold_char);
1038 yy_cp = (yy_last_accepting_cpos);
1039 yy_current_state = (yy_last_accepting_state);
1040 goto yy_find_action;
1041
1042 case 1:
1043 /* rule 1 can match eol */
1044 YY_RULE_SETUP
1045 #line 80 "engines/director/lingo/lingo-lex.l"
1046 { g_lingo->_linenumber++; g_lingo->_colnumber = 0; }
1047 YY_BREAK
1048 case 2:
1049 YY_RULE_SETUP
1050 #line 81 "engines/director/lingo/lingo-lex.l"
1051
1052 YY_BREAK
1053 case 3:
1054 YY_RULE_SETUP
1055 #line 82 "engines/director/lingo/lingo-lex.l"
1056 { count(); }
1057 YY_BREAK
1058 case 4:
1059 YY_RULE_SETUP
1060 #line 83 "engines/director/lingo/lingo-lex.l"
1061 { count(); return ' '; }
1062 YY_BREAK
1063 case 5:
1064 YY_RULE_SETUP
1065 #line 85 "engines/director/lingo/lingo-lex.l"
1066 { count(); yylval.s = new Common::String(yytext); return SYMBOL; } // D3
1067 YY_BREAK
1068 case 6:
1069 YY_RULE_SETUP
1070 #line 87 "engines/director/lingo/lingo-lex.l"
1071 { count(); return tAFTER; } // D3
1072 YY_BREAK
1073 case 7:
1074 YY_RULE_SETUP
1075 #line 88 "engines/director/lingo/lingo-lex.l"
1076 { count(); return tAND; }
1077 YY_BREAK
1078 case 8:
1079 YY_RULE_SETUP
1080 #line 89 "engines/director/lingo/lingo-lex.l"
1081 { count(); return tBEFORE; } // D3
1082 YY_BREAK
1083 case 9:
1084 YY_RULE_SETUP
1085 #line 90 "engines/director/lingo/lingo-lex.l"
1086 { count(); return tCHAR; } // D3
1087 YY_BREAK
1088 case 10:
1089 YY_RULE_SETUP
1090 #line 91 "engines/director/lingo/lingo-lex.l"
1091 { count(); return tCONTAINS; }
1092 YY_BREAK
1093 case 11:
1094 YY_RULE_SETUP
1095 #line 92 "engines/director/lingo/lingo-lex.l"
1096 { count(); return tDONE; }
1097 YY_BREAK
1098 case 12:
1099 YY_RULE_SETUP
1100 #line 93 "engines/director/lingo/lingo-lex.l"
1101 { count(); return tDOWN; }
1102 YY_BREAK
1103 case 13:
1104 YY_RULE_SETUP
1105 #line 94 "engines/director/lingo/lingo-lex.l"
1106 { count(); return tIF; }
1107 YY_BREAK
1108 case 14:
1109 /* rule 14 can match eol */
1110 YY_RULE_SETUP
1111 #line 95 "engines/director/lingo/lingo-lex.l"
1112 { countnl(); return tNLELSIF; }
1113 YY_BREAK
1114 case 15:
1115 /* rule 15 can match eol */
1116 YY_RULE_SETUP
1117 #line 96 "engines/director/lingo/lingo-lex.l"
1118 { countnl(); return tNLELSE; }
1119 YY_BREAK
1120 case 16:
1121 YY_RULE_SETUP
1122 #line 97 "engines/director/lingo/lingo-lex.l"
1123 { count(); return tELSE; }
1124 YY_BREAK
1125 case 17:
1126 YY_RULE_SETUP
1127 #line 98 "engines/director/lingo/lingo-lex.l"
1128 {
1129 count();
1130
1131 const char *ptr = &yytext[4]; // Skip 'end '
1132 while (*ptr == ' ' || *ptr == '\t')
1133 ptr++;
1134
1135 yylval.s = new Common::String(ptr);
1136
1137 return ENDCLAUSE;
1138 }
1139 YY_BREAK
1140 case 18:
1141 YY_RULE_SETUP
1142 #line 109 "engines/director/lingo/lingo-lex.l"
1143 { count(); return tFACTORY; }
1144 YY_BREAK
1145 case 19:
1146 YY_RULE_SETUP
1147 #line 110 "engines/director/lingo/lingo-lex.l"
1148 { count(); return tEXIT; }
1149 YY_BREAK
1150 case 20:
1151 YY_RULE_SETUP
1152 #line 111 "engines/director/lingo/lingo-lex.l"
1153 { count(); return tFRAME; }
1154 YY_BREAK
1155 case 21:
1156 YY_RULE_SETUP
1157 #line 112 "engines/director/lingo/lingo-lex.l"
1158 { count(); return tGLOBAL; }
1159 YY_BREAK
1160 case 22:
1161 YY_RULE_SETUP
1162 #line 113 "engines/director/lingo/lingo-lex.l"
1163 { count(); return tGO; }
1164 YY_BREAK
1165 case 23:
1166 YY_RULE_SETUP
1167 #line 114 "engines/director/lingo/lingo-lex.l"
1168 { count(); return tGO; }
1169 YY_BREAK
1170 case 24:
1171 YY_RULE_SETUP
1172 #line 115 "engines/director/lingo/lingo-lex.l"
1173 { count(); return tINSTANCE; }
1174 YY_BREAK
1175 case 25:
1176 YY_RULE_SETUP
1177 #line 116 "engines/director/lingo/lingo-lex.l"
1178 { count(); return tINTERSECTS; }
1179 YY_BREAK
1180 case 26:
1181 YY_RULE_SETUP
1182 #line 117 "engines/director/lingo/lingo-lex.l"
1183 { count(); return tINTO; }
1184 YY_BREAK
1185 case 27:
1186 YY_RULE_SETUP
1187 #line 118 "engines/director/lingo/lingo-lex.l"
1188 { count(); return tITEM; }
1189 YY_BREAK
1190 case 28:
1191 YY_RULE_SETUP
1192 #line 119 "engines/director/lingo/lingo-lex.l"
1193 { count(); return tLINE; }
1194 YY_BREAK
1195 case 29:
1196 YY_RULE_SETUP
1197 #line 120 "engines/director/lingo/lingo-lex.l"
1198 { count(); return checkImmediate(tLOOP); }
1199 YY_BREAK
1200 case 30:
1201 YY_RULE_SETUP
1202 #line 121 "engines/director/lingo/lingo-lex.l"
1203 { count(); return tMACRO; }
1204 YY_BREAK
1205 case 31:
1206 YY_RULE_SETUP
1207 #line 122 "engines/director/lingo/lingo-lex.l"
1208 { count(); return tMETHOD; }
1209 YY_BREAK
1210 case 32:
1211 YY_RULE_SETUP
1212 #line 123 "engines/director/lingo/lingo-lex.l"
1213 { count(); return tMOD; }
1214 YY_BREAK
1215 case 33:
1216 YY_RULE_SETUP
1217 #line 124 "engines/director/lingo/lingo-lex.l"
1218 { count(); return tMOVIE; }
1219 YY_BREAK
1220 case 34:
1221 YY_RULE_SETUP
1222 #line 125 "engines/director/lingo/lingo-lex.l"
1223 { count(); return tNEXT; }
1224 YY_BREAK
1225 case 35:
1226 YY_RULE_SETUP
1227 #line 126 "engines/director/lingo/lingo-lex.l"
1228 { count(); return tNOT; }
1229 YY_BREAK
1230 case 36:
1231 YY_RULE_SETUP
1232 #line 127 "engines/director/lingo/lingo-lex.l"
1233 { count(); return tOF; }
1234 YY_BREAK
1235 case 37:
1236 YY_RULE_SETUP
1237 #line 128 "engines/director/lingo/lingo-lex.l"
1238 { count(); return tON; } // D3
1239 YY_BREAK
1240 case 38:
1241 YY_RULE_SETUP
1242 #line 129 "engines/director/lingo/lingo-lex.l"
1243 { count(); return tOPEN; }
1244 YY_BREAK
1245 case 39:
1246 YY_RULE_SETUP
1247 #line 130 "engines/director/lingo/lingo-lex.l"
1248 { count(); return tOR; }
1249 YY_BREAK
1250 case 40:
1251 YY_RULE_SETUP
1252 #line 131 "engines/director/lingo/lingo-lex.l"
1253 { count(); return tPLAY; }
1254 YY_BREAK
1255 case 41:
1256 YY_RULE_SETUP
1257 #line 132 "engines/director/lingo/lingo-lex.l"
1258 { count(); yylval.s = new Common::String(yytext); return tPLAYACCEL; }
1259 YY_BREAK
1260 case 42:
1261 YY_RULE_SETUP
1262 #line 133 "engines/director/lingo/lingo-lex.l"
1263 { count(); return tPREVIOUS; }
1264 YY_BREAK
1265 case 43:
1266 YY_RULE_SETUP
1267 #line 134 "engines/director/lingo/lingo-lex.l"
1268 { count(); return tPROPERTY; } // D4
1269 YY_BREAK
1270 case 44:
1271 YY_RULE_SETUP
1272 #line 135 "engines/director/lingo/lingo-lex.l"
1273 { count(); return tPUT; }
1274 YY_BREAK
1275 case 45:
1276 YY_RULE_SETUP
1277 #line 136 "engines/director/lingo/lingo-lex.l"
1278 { count(); return checkImmediate(tREPEAT); }
1279 YY_BREAK
1280 case 46:
1281 YY_RULE_SETUP
1282 #line 137 "engines/director/lingo/lingo-lex.l"
1283 { count(); return tSET; }
1284 YY_BREAK
1285 case 47:
1286 YY_RULE_SETUP
1287 #line 138 "engines/director/lingo/lingo-lex.l"
1288 { count(); return tSTARTS; }
1289 YY_BREAK
1290 case 48:
1291 YY_RULE_SETUP
1292 #line 139 "engines/director/lingo/lingo-lex.l"
1293 { count(); return tTELL; }
1294 YY_BREAK
1295 case 49:
1296 YY_RULE_SETUP
1297 #line 140 "engines/director/lingo/lingo-lex.l"
1298 {
1299 count();
1300
1301 yylval.e[0] = g_lingo->_theEntities["last"]->entity;
1302 yylval.e[1] = 0; // No field
1303
1304 return THEENTITYWITHID;
1305 }
1306 YY_BREAK
1307 case 50:
1308 YY_RULE_SETUP
1309 #line 148 "engines/director/lingo/lingo-lex.l"
1310 {
1311 count();
1312
1313 yylval.e[0] = g_lingo->_theEntities["sqrt"]->entity;
1314 yylval.e[1] = 0; // No field
1315
1316 return THEENTITYWITHID;
1317 }
1318 YY_BREAK
1319 case 51:
1320 YY_RULE_SETUP
1321 #line 156 "engines/director/lingo/lingo-lex.l"
1322 {
1323 count();
1324
1325 const char *ptr = &yytext[4]; // Skip 'the '
1326 while (*ptr == ' ' || *ptr == '\t')
1327 ptr++;
1328
1329 Common::String field;
1330 while (*ptr != ' ' && *ptr != '\t')
1331 field += *ptr++;
1332
1333 while (*ptr == ' ' || *ptr == '\t')
1334 ptr++;
1335
1336 ptr += 3; // Skip 'of '
1337
1338 while (*ptr == ' ' || *ptr == '\t')
1339 ptr++;
1340
1341 if (g_lingo->_theEntities.contains(ptr)) {
1342 field = Common::String::format("%d%s", g_lingo->_theEntities[ptr]->entity, field.c_str());
1343
1344 if (!g_lingo->_theEntityFields.contains(field)) {
1345 error("Unhandled the field %s", ptr);
1346 }
1347
1348 if (g_lingo->_theEntityFields[field]->entity != g_lingo->_theEntities[ptr]->entity)
1349 error("Unsupported field '%s' for entity '%s'", field.c_str(), ptr);
1350
1351 yylval.e[0] = g_lingo->_theEntities[ptr]->entity;
1352 yylval.e[1] = g_lingo->_theEntityFields[field]->field;
1353
1354 if (g_lingo->_theEntities[ptr]->hasId)
1355 return THEENTITYWITHID;
1356 else
1357 return THEENTITY;
1358 }
1359
1360 warning("Unhandled the entity %s", ptr);
1361 }
1362 YY_BREAK
1363 case 52:
1364 YY_RULE_SETUP
1365 #line 196 "engines/director/lingo/lingo-lex.l"
1366 {
1367 count();
1368
1369 const char *ptr = &yytext[4]; // Skip 'the '
1370 while (*ptr == ' ' || *ptr == '\t')
1371 ptr++;
1372
1373 Common::String field;
1374 while (*ptr != ' ' && *ptr != '\t')
1375 field += *ptr++;
1376
1377 while (*ptr == ' ' || *ptr == '\t')
1378 ptr++;
1379
1380 field = Common::String::format("%d%s", g_lingo->_theEntities[ptr]->entity, field.c_str());
1381
1382 if (!g_lingo->_theEntityFields.contains(field)) {
1383 error("Unhandled the field %s", ptr);
1384 }
1385
1386 if (g_lingo->_theEntityFields[field]->entity != g_lingo->_theEntities[ptr]->entity)
1387 error("Unsupported field '%s' for entity '%s'", field.c_str(), ptr);
1388
1389 yylval.e[0] = g_lingo->_theEntities[ptr]->entity;
1390 yylval.e[1] = g_lingo->_theEntityFields[field]->field;
1391
1392 if (g_lingo->_theEntities[ptr]->hasId)
1393 return THEENTITYWITHID;
1394 else
1395 return THEENTITY;
1396 }
1397 YY_BREAK
1398 case 53:
1399 YY_RULE_SETUP
1400 #line 227 "engines/director/lingo/lingo-lex.l"
1401 {
1402 count();
1403
1404 const char *ptr = &yytext[4]; // Skip 'the '
1405 while (*ptr == ' ' || *ptr == '\t')
1406 ptr++;
1407
1408 if (g_lingo->_theEntities.contains(ptr)) {
1409 yylval.e[0] = g_lingo->_theEntities[ptr]->entity;
1410 yylval.e[1] = 0; // No field
1411
1412 if (g_lingo->_theEntities[ptr]->hasId)
1413 return THEENTITYWITHID;
1414 else
1415 return THEENTITY;
1416 }
1417
1418 warning("Unhandled the entity %s", ptr);
1419 }
1420 YY_BREAK
1421 case 54:
1422 YY_RULE_SETUP
1423 #line 246 "engines/director/lingo/lingo-lex.l"
1424 { count(); return tTHEN; }
1425 YY_BREAK
1426 case 55:
1427 /* rule 55 can match eol */
1428 YY_RULE_SETUP
1429 #line 247 "engines/director/lingo/lingo-lex.l"
1430 { count(); return tTHENNL; }
1431 YY_BREAK
1432 case 56:
1433 YY_RULE_SETUP
1434 #line 248 "engines/director/lingo/lingo-lex.l"
1435 { count(); return tTO; }
1436 YY_BREAK
1437 case 57:
1438 YY_RULE_SETUP
1439 #line 249 "engines/director/lingo/lingo-lex.l"
1440 { count(); return tSPRITE; }
1441 YY_BREAK
1442 case 58:
1443 YY_RULE_SETUP
1444 #line 250 "engines/director/lingo/lingo-lex.l"
1445 { count(); return tWITH; }
1446 YY_BREAK
1447 case 59:
1448 YY_RULE_SETUP
1449 #line 251 "engines/director/lingo/lingo-lex.l"
1450 { count(); return tWITHIN; }
1451 YY_BREAK
1452 case 60:
1453 YY_RULE_SETUP
1454 #line 252 "engines/director/lingo/lingo-lex.l"
1455 { count(); return tWHEN; }
1456 YY_BREAK
1457 case 61:
1458 YY_RULE_SETUP
1459 #line 253 "engines/director/lingo/lingo-lex.l"
1460 { count(); return tWHILE; }
1461 YY_BREAK
1462 case 62:
1463 YY_RULE_SETUP
1464 #line 254 "engines/director/lingo/lingo-lex.l"
1465 { count(); return tWORD; }
1466 YY_BREAK
1467 case 63:
1468 YY_RULE_SETUP
1469 #line 256 "engines/director/lingo/lingo-lex.l"
1470 { count(); return tNEQ; }
1471 YY_BREAK
1472 case 64:
1473 YY_RULE_SETUP
1474 #line 257 "engines/director/lingo/lingo-lex.l"
1475 { count(); return tGE; }
1476 YY_BREAK
1477 case 65:
1478 YY_RULE_SETUP
1479 #line 258 "engines/director/lingo/lingo-lex.l"
1480 { count(); return tLE; }
1481 YY_BREAK
1482 case 66:
1483 YY_RULE_SETUP
1484 #line 259 "engines/director/lingo/lingo-lex.l"
1485 { count(); return tCONCAT; }
1486 YY_BREAK
1487 case 67:
1488 YY_RULE_SETUP
1489 #line 261 "engines/director/lingo/lingo-lex.l"
1490 {
1491 count();
1492 yylval.s = new Common::String(yytext);
1493
1494 if (g_lingo->_ignoreMe && yylval.s->equalsIgnoreCase("me"))
1495 return ID;
1496
1497 if (g_lingo->_twoWordBuiltins.contains(yytext))
1498 return TWOWORDBUILTIN;
1499
1500 // Special treatment of 'me'. First parameter is method name
1501 if (!g_lingo->_currentFactory.empty()) {
1502 if (yylval.s->equalsIgnoreCase("me"))
1503 return tME;
1504 }
1505
1506 if (g_lingo->_builtins.contains(yytext)) {
1507 int type = g_lingo->_builtins[yytext]->type;
1508 if ((type == BLTIN || type == FBLTIN || type == RBLTIN) && g_lingo->_builtins[yytext]->parens == false) {
1509 if (type == RBLTIN) {
1510 if (g_lingo->_builtins[yytext]->nargs != 1 || g_lingo->_builtins[yytext]->maxArgs != 1)
1511 error("Incorrectly set RBLTIN %s", yytext);
1512
1513 return RBLTINONEARG;
1514 }
1515 if (g_lingo->_builtins[yytext]->nargs == 0) {
1516 if (g_lingo->_builtins[yytext]->maxArgs == 0)
1517 return type == BLTIN ? BLTINNOARGS : FBLTINNOARGS;
1518 else if (g_lingo->_builtins[yytext]->maxArgs == 1)
1519 return BLTINNOARGSORONE;
1520 else
1521 return type == BLTIN ? BLTINARGLIST : FBLTINARGLIST;
1522 } else if (g_lingo->_builtins[yytext]->nargs == 1 &&
1523 g_lingo->_builtins[yytext]->maxArgs == 1) {
1524 return type == BLTIN ? BLTINONEARG : FBLTINONEARG;
1525 } else if (g_lingo->_builtins[yytext]->nargs == -1) {
1526 return type == BLTIN ? BLTINARGLIST : FBLTINARGLIST;
1527 } else {
1528 return type == BLTIN ? BLTINARGLIST : FBLTINARGLIST;
1529 }
1530 }
1531 }
1532
1533 return ID;
1534 }
1535 YY_BREAK
1536 case 68:
1537 YY_RULE_SETUP
1538 #line 306 "engines/director/lingo/lingo-lex.l"
1539 { count(); yylval.f = atof(yytext); return FLOAT; }
1540 YY_BREAK
1541 case 69:
1542 YY_RULE_SETUP
1543 #line 307 "engines/director/lingo/lingo-lex.l"
1544 { count(); yylval.i = strtol(yytext, NULL, 10); return INT; }
1545 YY_BREAK
1546 case 70:
1547 YY_RULE_SETUP
1548 #line 308 "engines/director/lingo/lingo-lex.l"
1549 { count(); return *yytext; }
1550 YY_BREAK
1551 case 71:
1552 /* rule 71 can match eol */
1553 YY_RULE_SETUP
1554 #line 309 "engines/director/lingo/lingo-lex.l"
1555 { return '\n'; }
1556 YY_BREAK
1557 case 72:
1558 YY_RULE_SETUP
1559 #line 310 "engines/director/lingo/lingo-lex.l"
1560 { count(); yylval.s = new Common::String(&yytext[1]); yylval.s->deleteLastChar(); return STRING; }
1561 YY_BREAK
1562 case 73:
1563 YY_RULE_SETUP
1564 #line 311 "engines/director/lingo/lingo-lex.l"
1565 { count(); }
1566 YY_BREAK
1567 case 74:
1568 YY_RULE_SETUP
1569 #line 313 "engines/director/lingo/lingo-lex.l"
1570 ECHO;
1571 YY_BREAK
1572 #line 1573 "engines/director/lingo/lingo-lex.cpp"
1573 case YY_STATE_EOF(INITIAL):
1574 yyterminate();
1575
1576 case YY_END_OF_BUFFER:
1577 {
1578 /* Amount of text matched not including the EOB char. */
1579 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1580
1581 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1582 *yy_cp = (yy_hold_char);
1583 YY_RESTORE_YY_MORE_OFFSET
1584
1585 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1586 {
1587 /* We're scanning a new file or input source. It's
1588 * possible that this happened because the user
1589 * just pointed yyin at a new source and called
1590 * yylex(). If so, then we have to assure
1591 * consistency between YY_CURRENT_BUFFER and our
1592 * globals. Here is the right place to do so, because
1593 * this is the first action (other than possibly a
1594 * back-up) that will match for the new input source.
1595 */
1596 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1597 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1598 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1599 }
1600
1601 /* Note that here we test for yy_c_buf_p "<=" to the position
1602 * of the first EOB in the buffer, since yy_c_buf_p will
1603 * already have been incremented past the NUL character
1604 * (since all states make transitions on EOB to the
1605 * end-of-buffer state). Contrast this with the test
1606 * in input().
1607 */
1608 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1609 { /* This was really a NUL. */
1610 yy_state_type yy_next_state;
1611
1612 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1613
1614 yy_current_state = yy_get_previous_state( );
1615
1616 /* Okay, we're now positioned to make the NUL
1617 * transition. We couldn't have
1618 * yy_get_previous_state() go ahead and do it
1619 * for us because it doesn't know how to deal
1620 * with the possibility of jamming (and we don't
1621 * want to build jamming into it because then it
1622 * will run more slowly).
1623 */
1624
1625 yy_next_state = yy_try_NUL_trans( yy_current_state );
1626
1627 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1628
1629 if ( yy_next_state )
1630 {
1631 /* Consume the NUL. */
1632 yy_cp = ++(yy_c_buf_p);
1633 yy_current_state = yy_next_state;
1634 goto yy_match;
1635 }
1636
1637 else
1638 {
1639 yy_cp = (yy_last_accepting_cpos);
1640 yy_current_state = (yy_last_accepting_state);
1641 goto yy_find_action;
1642 }
1643 }
1644
1645 else switch ( yy_get_next_buffer( ) )
1646 {
1647 case EOB_ACT_END_OF_FILE:
1648 {
1649 (yy_did_buffer_switch_on_eof) = 0;
1650
1651 if ( yywrap( ) )
1652 {
1653 /* Note: because we've taken care in
1654 * yy_get_next_buffer() to have set up
1655 * yytext, we can now set up
1656 * yy_c_buf_p so that if some total
1657 * hoser (like flex itself) wants to
1658 * call the scanner after we return the
1659 * YY_NULL, it'll still work - another
1660 * YY_NULL will get returned.
1661 */
1662 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1663
1664 yy_act = YY_STATE_EOF(YY_START);
1665 goto do_action;
1666 }
1667
1668 else
1669 {
1670 if ( ! (yy_did_buffer_switch_on_eof) )
1671 YY_NEW_FILE;
1672 }
1673 break;
1674 }
1675
1676 case EOB_ACT_CONTINUE_SCAN:
1677 (yy_c_buf_p) =
1678 (yytext_ptr) + yy_amount_of_matched_text;
1679
1680 yy_current_state = yy_get_previous_state( );
1681
1682 yy_cp = (yy_c_buf_p);
1683 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1684 goto yy_match;
1685
1686 case EOB_ACT_LAST_MATCH:
1687 (yy_c_buf_p) =
1688 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1689
1690 yy_current_state = yy_get_previous_state( );
1691
1692 yy_cp = (yy_c_buf_p);
1693 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1694 goto yy_find_action;
1695 }
1696 break;
1697 }
1698
1699 default:
1700 YY_FATAL_ERROR(
1701 "fatal flex scanner internal error--no action found" );
1702 } /* end of action switch */
1703 } /* end of scanning one token */
1704 } /* end of yylex */
1705
1706 /* yy_get_next_buffer - try to read in a new buffer
1707 *
1708 * Returns a code representing an action:
1709 * EOB_ACT_LAST_MATCH -
1710 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1711 * EOB_ACT_END_OF_FILE - end of file
1712 */
1713 static int yy_get_next_buffer (void)
1714 {
1715 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1716 register char *source = (yytext_ptr);
1717 register int number_to_move, i;
1718 int ret_val;
1719
1720 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1721 YY_FATAL_ERROR(
1722 "fatal flex scanner internal error--end of buffer missed" );
1723
1724 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1725 { /* Don't try to fill the buffer, so this is an EOF. */
1726 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1727 {
1728 /* We matched a single character, the EOB, so
1729 * treat this as a final EOF.
1730 */
1731 return EOB_ACT_END_OF_FILE;
1732 }
1733
1734 else
1735 {
1736 /* We matched some text prior to the EOB, first
1737 * process it.
1738 */
1739 return EOB_ACT_LAST_MATCH;
1740 }
1741 }
1742
1743 /* Try to read more data. */
1744
1745 /* First move last chars to start of buffer. */
1746 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1747
1748 for ( i = 0; i < number_to_move; ++i )
1749 *(dest++) = *(source++);
1750
1751 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1752 /* don't do the read, it's not guaranteed to return an EOF,
1753 * just force an EOF
1754 */
1755 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1756
1757 else
1758 {
1759 yy_size_t num_to_read =
1760 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1761
1762 while ( num_to_read <= 0 )
1763 { /* Not enough room in the buffer - grow it. */
1764
1765 /* just a shorter name for the current buffer */
1766 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1767
1768 int yy_c_buf_p_offset =
1769 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1770
1771 if ( b->yy_is_our_buffer )
1772 {
1773 yy_size_t new_size = b->yy_buf_size * 2;
1774
1775 if ( new_size <= 0 )
1776 b->yy_buf_size += b->yy_buf_size / 8;
1777 else
1778 b->yy_buf_size *= 2;
1779
1780 b->yy_ch_buf = (char *)
1781 /* Include room in for 2 EOB chars. */
1782 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1783 }
1784 else
1785 /* Can't grow it, we don't own it. */
1786 b->yy_ch_buf = 0;
1787
1788 if ( ! b->yy_ch_buf )
1789 YY_FATAL_ERROR(
1790 "fatal error - scanner input buffer overflow" );
1791
1792 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1793
1794 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1795 number_to_move - 1;
1796
1797 }
1798
1799 if ( num_to_read > YY_READ_BUF_SIZE )
1800 num_to_read = YY_READ_BUF_SIZE;
1801
1802 /* Read in more data. */
1803 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1804 (yy_n_chars), num_to_read );
1805
1806 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1807 }
1808
1809 if ( (yy_n_chars) == 0 )
1810 {
1811 if ( number_to_move == YY_MORE_ADJ )
1812 {
1813 ret_val = EOB_ACT_END_OF_FILE;
1814 yyrestart(yyin );
1815 }
1816
1817 else
1818 {
1819 ret_val = EOB_ACT_LAST_MATCH;
1820 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1821 YY_BUFFER_EOF_PENDING;
1822 }
1823 }
1824
1825 else
1826 ret_val = EOB_ACT_CONTINUE_SCAN;
1827
1828 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1829 /* Extend the array by 50%, plus the number we really need. */
1830 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1831 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1832 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1833 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1834 }
1835
1836 (yy_n_chars) += number_to_move;
1837 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1838 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1839
1840 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1841
1842 return ret_val;
1843 }
1844
1845 /* yy_get_previous_state - get the state just before the EOB char was reached */
1846
yy_get_previous_state(void)1847 static yy_state_type yy_get_previous_state (void)
1848 {
1849 register yy_state_type yy_current_state;
1850 register char *yy_cp;
1851
1852 yy_current_state = (yy_start);
1853 yy_current_state += YY_AT_BOL();
1854
1855 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1856 {
1857 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1858 if ( yy_accept[yy_current_state] )
1859 {
1860 (yy_last_accepting_state) = yy_current_state;
1861 (yy_last_accepting_cpos) = yy_cp;
1862 }
1863 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1864 {
1865 yy_current_state = (int) yy_def[yy_current_state];
1866 if ( yy_current_state >= 274 )
1867 yy_c = yy_meta[(unsigned int) yy_c];
1868 }
1869 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1870 }
1871
1872 return yy_current_state;
1873 }
1874
1875 /* yy_try_NUL_trans - try to make a transition on the NUL character
1876 *
1877 * synopsis
1878 * next_state = yy_try_NUL_trans( current_state );
1879 */
yy_try_NUL_trans(yy_state_type yy_current_state)1880 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1881 {
1882 register int yy_is_jam;
1883 register char *yy_cp = (yy_c_buf_p);
1884
1885 register YY_CHAR yy_c = 1;
1886 if ( yy_accept[yy_current_state] )
1887 {
1888 (yy_last_accepting_state) = yy_current_state;
1889 (yy_last_accepting_cpos) = yy_cp;
1890 }
1891 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1892 {
1893 yy_current_state = (int) yy_def[yy_current_state];
1894 if ( yy_current_state >= 274 )
1895 yy_c = yy_meta[(unsigned int) yy_c];
1896 }
1897 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1898 yy_is_jam = (yy_current_state == 273);
1899
1900 return yy_is_jam ? 0 : yy_current_state;
1901 }
1902
1903 #ifndef YY_NO_INPUT
1904 #ifdef __cplusplus
yyinput(void)1905 static int yyinput (void)
1906 #else
1907 static int input (void)
1908 #endif
1909
1910 {
1911 int c;
1912
1913 *(yy_c_buf_p) = (yy_hold_char);
1914
1915 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1916 {
1917 /* yy_c_buf_p now points to the character we want to return.
1918 * If this occurs *before* the EOB characters, then it's a
1919 * valid NUL; if not, then we've hit the end of the buffer.
1920 */
1921 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1922 /* This was really a NUL. */
1923 *(yy_c_buf_p) = '\0';
1924
1925 else
1926 { /* need more input */
1927 yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1928 ++(yy_c_buf_p);
1929
1930 switch ( yy_get_next_buffer( ) )
1931 {
1932 case EOB_ACT_LAST_MATCH:
1933 /* This happens because yy_g_n_b()
1934 * sees that we've accumulated a
1935 * token and flags that we need to
1936 * try matching the token before
1937 * proceeding. But for input(),
1938 * there's no matching to consider.
1939 * So convert the EOB_ACT_LAST_MATCH
1940 * to EOB_ACT_END_OF_FILE.
1941 */
1942
1943 /* Reset buffer status. */
1944 yyrestart(yyin );
1945
1946 /*FALLTHROUGH*/
1947
1948 case EOB_ACT_END_OF_FILE:
1949 {
1950 if ( yywrap( ) )
1951 return 0;
1952
1953 if ( ! (yy_did_buffer_switch_on_eof) )
1954 YY_NEW_FILE;
1955 #ifdef __cplusplus
1956 return yyinput();
1957 #else
1958 return input();
1959 #endif
1960 }
1961
1962 case EOB_ACT_CONTINUE_SCAN:
1963 (yy_c_buf_p) = (yytext_ptr) + offset;
1964 break;
1965 }
1966 }
1967 }
1968
1969 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1970 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1971 (yy_hold_char) = *++(yy_c_buf_p);
1972
1973 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
1974
1975 return c;
1976 }
1977 #endif /* ifndef YY_NO_INPUT */
1978
1979 /** Immediately switch to a different input stream.
1980 * @param input_file A readable stream.
1981 *
1982 * @note This function does not reset the start condition to @c INITIAL .
1983 */
yyrestart(FILE * input_file)1984 void yyrestart (FILE * input_file )
1985 {
1986
1987 if ( ! YY_CURRENT_BUFFER ){
1988 yyensure_buffer_stack ();
1989 YY_CURRENT_BUFFER_LVALUE =
1990 yy_create_buffer(yyin,YY_BUF_SIZE );
1991 }
1992
1993 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1994 yy_load_buffer_state( );
1995 }
1996
1997 /** Switch to a different input buffer.
1998 * @param new_buffer The new input buffer.
1999 *
2000 */
yy_switch_to_buffer(YY_BUFFER_STATE new_buffer)2001 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
2002 {
2003
2004 /* TODO. We should be able to replace this entire function body
2005 * with
2006 * yypop_buffer_state();
2007 * yypush_buffer_state(new_buffer);
2008 */
2009 yyensure_buffer_stack ();
2010 if ( YY_CURRENT_BUFFER == new_buffer )
2011 return;
2012
2013 if ( YY_CURRENT_BUFFER )
2014 {
2015 /* Flush out information for old buffer. */
2016 *(yy_c_buf_p) = (yy_hold_char);
2017 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2018 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2019 }
2020
2021 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2022 yy_load_buffer_state( );
2023
2024 /* We don't actually know whether we did this switch during
2025 * EOF (yywrap()) processing, but the only time this flag
2026 * is looked at is after yywrap() is called, so it's safe
2027 * to go ahead and always set it.
2028 */
2029 (yy_did_buffer_switch_on_eof) = 1;
2030 }
2031
yy_load_buffer_state(void)2032 static void yy_load_buffer_state (void)
2033 {
2034 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2035 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2036 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2037 (yy_hold_char) = *(yy_c_buf_p);
2038 }
2039
2040 /** Allocate and initialize an input buffer state.
2041 * @param file A readable stream.
2042 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2043 *
2044 * @return the allocated buffer state.
2045 */
yy_create_buffer(FILE * file,int size)2046 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
2047 {
2048 YY_BUFFER_STATE b;
2049
2050 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
2051 if ( ! b )
2052 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2053
2054 b->yy_buf_size = size;
2055
2056 /* yy_ch_buf has to be 2 characters longer than the size given because
2057 * we need to put in 2 end-of-buffer characters.
2058 */
2059 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
2060 if ( ! b->yy_ch_buf )
2061 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2062
2063 b->yy_is_our_buffer = 1;
2064
2065 yy_init_buffer(b,file );
2066
2067 return b;
2068 }
2069
2070 /** Destroy the buffer.
2071 * @param b a buffer created with yy_create_buffer()
2072 *
2073 */
yy_delete_buffer(YY_BUFFER_STATE b)2074 void yy_delete_buffer (YY_BUFFER_STATE b )
2075 {
2076
2077 if ( ! b )
2078 return;
2079
2080 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2081 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2082
2083 if ( b->yy_is_our_buffer )
2084 yyfree((void *) b->yy_ch_buf );
2085
2086 yyfree((void *) b );
2087 }
2088
2089 /* Initializes or reinitializes a buffer.
2090 * This function is sometimes called more than once on the same buffer,
2091 * such as during a yyrestart() or at EOF.
2092 */
yy_init_buffer(YY_BUFFER_STATE b,FILE * file)2093 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
2094
2095 {
2096 int oerrno = errno;
2097
2098 yy_flush_buffer(b );
2099
2100 b->yy_input_file = file;
2101 b->yy_fill_buffer = 1;
2102
2103 /* If b is the current buffer, then yy_init_buffer was _probably_
2104 * called from yyrestart() or through yy_get_next_buffer.
2105 * In that case, we don't want to reset the lineno or column.
2106 */
2107 if (b != YY_CURRENT_BUFFER){
2108 b->yy_bs_lineno = 1;
2109 b->yy_bs_column = 0;
2110 }
2111
2112 b->yy_is_interactive = 0;
2113
2114 errno = oerrno;
2115 }
2116
2117 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2118 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2119 *
2120 */
yy_flush_buffer(YY_BUFFER_STATE b)2121 void yy_flush_buffer (YY_BUFFER_STATE b )
2122 {
2123 if ( ! b )
2124 return;
2125
2126 b->yy_n_chars = 0;
2127
2128 /* We always need two end-of-buffer characters. The first causes
2129 * a transition to the end-of-buffer state. The second causes
2130 * a jam in that state.
2131 */
2132 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2133 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2134
2135 b->yy_buf_pos = &b->yy_ch_buf[0];
2136
2137 b->yy_at_bol = 1;
2138 b->yy_buffer_status = YY_BUFFER_NEW;
2139
2140 if ( b == YY_CURRENT_BUFFER )
2141 yy_load_buffer_state( );
2142 }
2143
2144 /** Pushes the new state onto the stack. The new state becomes
2145 * the current state. This function will allocate the stack
2146 * if necessary.
2147 * @param new_buffer The new state.
2148 *
2149 */
yypush_buffer_state(YY_BUFFER_STATE new_buffer)2150 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
2151 {
2152 if (new_buffer == NULL)
2153 return;
2154
2155 yyensure_buffer_stack();
2156
2157 /* This block is copied from yy_switch_to_buffer. */
2158 if ( YY_CURRENT_BUFFER )
2159 {
2160 /* Flush out information for old buffer. */
2161 *(yy_c_buf_p) = (yy_hold_char);
2162 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2163 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2164 }
2165
2166 /* Only push if top exists. Otherwise, replace top. */
2167 if (YY_CURRENT_BUFFER)
2168 (yy_buffer_stack_top)++;
2169 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2170
2171 /* copied from yy_switch_to_buffer. */
2172 yy_load_buffer_state( );
2173 (yy_did_buffer_switch_on_eof) = 1;
2174 }
2175
2176 /** Removes and deletes the top of the stack, if present.
2177 * The next element becomes the new top.
2178 *
2179 */
yypop_buffer_state(void)2180 void yypop_buffer_state (void)
2181 {
2182 if (!YY_CURRENT_BUFFER)
2183 return;
2184
2185 yy_delete_buffer(YY_CURRENT_BUFFER );
2186 YY_CURRENT_BUFFER_LVALUE = NULL;
2187 if ((yy_buffer_stack_top) > 0)
2188 --(yy_buffer_stack_top);
2189
2190 if (YY_CURRENT_BUFFER) {
2191 yy_load_buffer_state( );
2192 (yy_did_buffer_switch_on_eof) = 1;
2193 }
2194 }
2195
2196 /* Allocates the stack if it does not exist.
2197 * Guarantees space for at least one push.
2198 */
yyensure_buffer_stack(void)2199 static void yyensure_buffer_stack (void)
2200 {
2201 yy_size_t num_to_alloc;
2202
2203 if (!(yy_buffer_stack)) {
2204
2205 /* First allocation is just for 2 elements, since we don't know if this
2206 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2207 * immediate realloc on the next call.
2208 */
2209 num_to_alloc = 1;
2210 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
2211 (num_to_alloc * sizeof(struct yy_buffer_state*)
2212 );
2213 if ( ! (yy_buffer_stack) )
2214 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2215
2216 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2217
2218 (yy_buffer_stack_max) = num_to_alloc;
2219 (yy_buffer_stack_top) = 0;
2220 return;
2221 }
2222
2223 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2224
2225 /* Increase the buffer to prepare for a possible push. */
2226 int grow_size = 8 /* arbitrary grow size */;
2227
2228 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2229 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
2230 ((yy_buffer_stack),
2231 num_to_alloc * sizeof(struct yy_buffer_state*)
2232 );
2233 if ( ! (yy_buffer_stack) )
2234 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2235
2236 /* zero only the new slots.*/
2237 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2238 (yy_buffer_stack_max) = num_to_alloc;
2239 }
2240 }
2241
2242 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2243 * @param base the character buffer
2244 * @param size the size in bytes of the character buffer
2245 *
2246 * @return the newly allocated buffer state object.
2247 */
yy_scan_buffer(char * base,yy_size_t size)2248 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
2249 {
2250 YY_BUFFER_STATE b;
2251
2252 if ( size < 2 ||
2253 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2254 base[size-1] != YY_END_OF_BUFFER_CHAR )
2255 /* They forgot to leave room for the EOB's. */
2256 return 0;
2257
2258 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
2259 if ( ! b )
2260 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2261
2262 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2263 b->yy_buf_pos = b->yy_ch_buf = base;
2264 b->yy_is_our_buffer = 0;
2265 b->yy_input_file = 0;
2266 b->yy_n_chars = b->yy_buf_size;
2267 b->yy_is_interactive = 0;
2268 b->yy_at_bol = 1;
2269 b->yy_fill_buffer = 0;
2270 b->yy_buffer_status = YY_BUFFER_NEW;
2271
2272 yy_switch_to_buffer(b );
2273
2274 return b;
2275 }
2276
2277 /** Setup the input buffer state to scan a string. The next call to yylex() will
2278 * scan from a @e copy of @a str.
2279 * @param yystr a NUL-terminated string to scan
2280 *
2281 * @return the newly allocated buffer state object.
2282 * @note If you want to scan bytes that may contain NUL values, then use
2283 * yy_scan_bytes() instead.
2284 */
yy_scan_string(yyconst char * yystr)2285 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
2286 {
2287
2288 return yy_scan_bytes(yystr,strlen(yystr) );
2289 }
2290
2291 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2292 * scan from a @e copy of @a bytes.
2293 * @param bytes the byte buffer to scan
2294 * @param len the number of bytes in the buffer pointed to by @a bytes.
2295 *
2296 * @return the newly allocated buffer state object.
2297 */
yy_scan_bytes(yyconst char * yybytes,yy_size_t _yybytes_len)2298 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
2299 {
2300 YY_BUFFER_STATE b;
2301 char *buf;
2302 yy_size_t n, i;
2303
2304 /* Get memory for full buffer, including space for trailing EOB's. */
2305 n = _yybytes_len + 2;
2306 buf = (char *) yyalloc(n );
2307 if ( ! buf )
2308 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2309
2310 for ( i = 0; i < _yybytes_len; ++i )
2311 buf[i] = yybytes[i];
2312
2313 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2314
2315 b = yy_scan_buffer(buf,n );
2316 if ( ! b )
2317 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2318
2319 /* It's okay to grow etc. this buffer, and we should throw it
2320 * away when we're done.
2321 */
2322 b->yy_is_our_buffer = 1;
2323
2324 return b;
2325 }
2326
2327 #ifndef YY_EXIT_FAILURE
2328 #define YY_EXIT_FAILURE 2
2329 #endif
2330
yy_fatal_error(yyconst char * msg)2331 static void yy_fatal_error (yyconst char* msg )
2332 {
2333 (void) fprintf( stderr, "%s\n", msg );
2334 exit( YY_EXIT_FAILURE );
2335 }
2336
2337 /* Redefine yyless() so it works in section 3 code. */
2338
2339 #undef yyless
2340 #define yyless(n) \
2341 do \
2342 { \
2343 /* Undo effects of setting up yytext. */ \
2344 int yyless_macro_arg = (n); \
2345 YY_LESS_LINENO(yyless_macro_arg);\
2346 yytext[yyleng] = (yy_hold_char); \
2347 (yy_c_buf_p) = yytext + yyless_macro_arg; \
2348 (yy_hold_char) = *(yy_c_buf_p); \
2349 *(yy_c_buf_p) = '\0'; \
2350 yyleng = yyless_macro_arg; \
2351 } \
2352 while ( 0 )
2353
2354 /* Accessor methods (get/set functions) to struct members. */
2355
2356 /** Get the current line number.
2357 *
2358 */
yyget_lineno(void)2359 int yyget_lineno (void)
2360 {
2361
2362 return yylineno;
2363 }
2364
2365 /** Get the input stream.
2366 *
2367 */
yyget_in(void)2368 FILE *yyget_in (void)
2369 {
2370 return yyin;
2371 }
2372
2373 /** Get the output stream.
2374 *
2375 */
yyget_out(void)2376 FILE *yyget_out (void)
2377 {
2378 return yyout;
2379 }
2380
2381 /** Get the length of the current token.
2382 *
2383 */
yyget_leng(void)2384 yy_size_t yyget_leng (void)
2385 {
2386 return yyleng;
2387 }
2388
2389 /** Get the current token.
2390 *
2391 */
2392
yyget_text(void)2393 char *yyget_text (void)
2394 {
2395 return yytext;
2396 }
2397
2398 /** Set the current line number.
2399 * @param line_number
2400 *
2401 */
yyset_lineno(int line_number)2402 void yyset_lineno (int line_number )
2403 {
2404
2405 yylineno = line_number;
2406 }
2407
2408 /** Set the input stream. This does not discard the current
2409 * input buffer.
2410 * @param in_str A readable stream.
2411 *
2412 * @see yy_switch_to_buffer
2413 */
yyset_in(FILE * in_str)2414 void yyset_in (FILE * in_str )
2415 {
2416 yyin = in_str ;
2417 }
2418
yyset_out(FILE * out_str)2419 void yyset_out (FILE * out_str )
2420 {
2421 yyout = out_str ;
2422 }
2423
yyget_debug(void)2424 int yyget_debug (void)
2425 {
2426 return yy_flex_debug;
2427 }
2428
yyset_debug(int bdebug)2429 void yyset_debug (int bdebug )
2430 {
2431 yy_flex_debug = bdebug ;
2432 }
2433
yy_init_globals(void)2434 static int yy_init_globals (void)
2435 {
2436 /* Initialization is the same as for the non-reentrant scanner.
2437 * This function is called from yylex_destroy(), so don't allocate here.
2438 */
2439
2440 (yy_buffer_stack) = 0;
2441 (yy_buffer_stack_top) = 0;
2442 (yy_buffer_stack_max) = 0;
2443 (yy_c_buf_p) = (char *) 0;
2444 (yy_init) = 0;
2445 (yy_start) = 0;
2446
2447 /* Defined in main.c */
2448 #ifdef YY_STDINIT
2449 yyin = stdin;
2450 yyout = stdout;
2451 #else
2452 yyin = (FILE *) 0;
2453 yyout = (FILE *) 0;
2454 #endif
2455
2456 /* For future reference: Set errno on error, since we are called by
2457 * yylex_init()
2458 */
2459 return 0;
2460 }
2461
2462 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
yylex_destroy(void)2463 int yylex_destroy (void)
2464 {
2465
2466 /* Pop the buffer stack, destroying each element. */
2467 while(YY_CURRENT_BUFFER){
2468 yy_delete_buffer(YY_CURRENT_BUFFER );
2469 YY_CURRENT_BUFFER_LVALUE = NULL;
2470 yypop_buffer_state();
2471 }
2472
2473 /* Destroy the stack itself. */
2474 yyfree((yy_buffer_stack) );
2475 (yy_buffer_stack) = NULL;
2476
2477 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2478 * yylex() is called, initialization will occur. */
2479 yy_init_globals( );
2480
2481 return 0;
2482 }
2483
2484 /*
2485 * Internal utility routines.
2486 */
2487
2488 #ifndef yytext_ptr
yy_flex_strncpy(char * s1,yyconst char * s2,int n)2489 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2490 {
2491 register int i;
2492 for ( i = 0; i < n; ++i )
2493 s1[i] = s2[i];
2494 }
2495 #endif
2496
2497 #ifdef YY_NEED_STRLEN
yy_flex_strlen(yyconst char * s)2498 static int yy_flex_strlen (yyconst char * s )
2499 {
2500 register int n;
2501 for ( n = 0; s[n]; ++n )
2502 ;
2503
2504 return n;
2505 }
2506 #endif
2507
yyalloc(yy_size_t size)2508 void *yyalloc (yy_size_t size )
2509 {
2510 return (void *) malloc( size );
2511 }
2512
yyrealloc(void * ptr,yy_size_t size)2513 void *yyrealloc (void * ptr, yy_size_t size )
2514 {
2515 /* The cast to (char *) in the following accommodates both
2516 * implementations that use char* generic pointers, and those
2517 * that use void* generic pointers. It works with the latter
2518 * because both ANSI C and C++ allow castless assignment from
2519 * any pointer type to void*, and deal with argument conversions
2520 * as though doing an assignment.
2521 */
2522 return (void *) realloc( (char *) ptr, size );
2523 }
2524
yyfree(void * ptr)2525 void yyfree (void * ptr )
2526 {
2527 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2528 }
2529
2530 #define YYTABLES_NAME "yytables"
2531
2532 #line 313 "engines/director/lingo/lingo-lex.l"
2533
2534
2535
2536 extern int yydebug;
2537
2538 namespace Director {
2539
parse(const char * code)2540 int Lingo::parse(const char *code) {
2541 YY_BUFFER_STATE bp;
2542
2543 if (debugChannelSet(-1, kDebugLingoParse))
2544 yydebug = 1;
2545 else
2546 yydebug = 0;
2547
2548 yy_delete_buffer(YY_CURRENT_BUFFER);
2549
2550 bp = yy_scan_string(code);
2551 yy_switch_to_buffer(bp);
2552 yyparse();
2553 yy_delete_buffer(bp);
2554
2555 return 0;
2556 }
2557
2558 }
2559
2560