Debian Codegraph @

texk/web2c/otps/otp-lexer.c

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