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