source: liacs/coco/assignment2/gen/lex.yy.c@ 377

Last change on this file since 377 was 2, checked in by Rick van der Zwet, 15 years ago

Initial import of data of old repository ('data') worth keeping (e.g. tracking
means of URL access statistics)

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