view src/sdl/expr-lex.cpp @ 34:6bde5b67a2b8

saving progress
author Robert McIntyre <rlm@mit.edu>
date Mon, 05 Mar 2012 01:58:52 -0600
parents f9f4f1b99eed
children
line wrap: on
line source
1 #line 2 "expr-lex.cpp"
2 /* A lexical scanner generated by flex */
4 /* Scanner skeleton version:
5 * $Header: /cvsroot/vba/VisualBoyAdvance/src/expr-lex.cpp,v 1.2 2003/06/06 14:17:21 forgotten Exp $
6 */
8 #define FLEX_SCANNER
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 5
12 #include <stdio.h>
13 #ifdef __GNUC__
14 #include <unistd.h>
15 #endif
18 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
19 #ifdef c_plusplus
20 #ifndef __cplusplus
21 #define __cplusplus
22 #endif
23 #endif
26 #ifdef __cplusplus
28 #include <stdlib.h>
30 /* Use prototypes in function declarations. */
31 #define YY_USE_PROTOS
33 /* The "const" storage-class-modifier is valid. */
34 #define YY_USE_CONST
36 #else /* ! __cplusplus */
38 #if __STDC__
40 #define YY_USE_PROTOS
41 #define YY_USE_CONST
43 #endif /* __STDC__ */
44 #endif /* ! __cplusplus */
46 #ifdef __TURBOC__
47 #pragma warn -rch
48 #pragma warn -use
49 #include <io.h>
50 #include <stdlib.h>
51 #define YY_USE_CONST
52 #define YY_USE_PROTOS
53 #endif
55 #ifdef YY_USE_CONST
56 #define yyconst const
57 #else
58 #define yyconst
59 #endif
62 #ifdef YY_USE_PROTOS
63 #define YY_PROTO(proto) proto
64 #else
65 #define YY_PROTO(proto) ()
66 #endif
68 /* Returned upon end-of-file. */
69 #define YY_NULL 0
71 /* Promotes a possibly negative, possibly signed char to an unsigned
72 * integer for use as an array index. If the signed char is negative,
73 * we want to instead treat it as an 8-bit unsigned char, hence the
74 * double cast.
75 */
76 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
78 /* Enter a start condition. This macro really ought to take a parameter,
79 * but we do it the disgusting crufty way forced on us by the ()-less
80 * definition of BEGIN.
81 */
82 #define BEGIN yy_start = 1 + 2 *
84 /* Translate the current start state into a value that can be later handed
85 * to BEGIN to return to the state. The YYSTATE alias is for lex
86 * compatibility.
87 */
88 #define YY_START ((yy_start - 1) / 2)
89 #define YYSTATE YY_START
91 /* Action number for EOF rule of a given start state. */
92 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
94 /* Special action meaning "start processing a new file". */
95 #define YY_NEW_FILE yyrestart( yyin )
97 #define YY_END_OF_BUFFER_CHAR 0
99 /* Size of default input buffer. */
100 #define YY_BUF_SIZE 16384
102 typedef struct yy_buffer_state *YY_BUFFER_STATE;
104 extern int yyleng;
105 extern FILE *yyin, *yyout;
107 #define EOB_ACT_CONTINUE_SCAN 0
108 #define EOB_ACT_END_OF_FILE 1
109 #define EOB_ACT_LAST_MATCH 2
111 /* The funky do-while in the following #define is used to turn the definition
112 * int a single C statement (which needs a semi-colon terminator). This
113 * avoids problems with code like:
114 *
115 * if ( condition_holds )
116 * yyless( 5 );
117 * else
118 * do_something_else();
119 *
120 * Prior to using the do-while the compiler would get upset at the
121 * "else" because it interpreted the "if" statement as being all
122 * done when it reached the ';' after the yyless() call.
123 */
125 /* Return all but the first 'n' matched characters back to the input stream. */
127 #define yyless(n) \
128 do \
129 { \
130 /* Undo effects of setting up yytext. */ \
131 *yy_cp = yy_hold_char; \
132 YY_RESTORE_YY_MORE_OFFSET \
133 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
134 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
135 } \
136 while ( 0 )
138 #define unput(c) yyunput( c, yytext_ptr )
140 /* The following is because we cannot portably get our hands on size_t
141 * (without autoconf's help, which isn't available because we want
142 * flex-generated scanners to compile on their own).
143 */
144 typedef unsigned int yy_size_t;
147 struct yy_buffer_state
148 {
149 FILE *yy_input_file;
151 char *yy_ch_buf; /* input buffer */
152 char *yy_buf_pos; /* current position in input buffer */
154 /* Size of input buffer in bytes, not including room for EOB
155 * characters.
156 */
157 yy_size_t yy_buf_size;
159 /* Number of characters read into yy_ch_buf, not including EOB
160 * characters.
161 */
162 int yy_n_chars;
164 /* Whether we "own" the buffer - i.e., we know we created it,
165 * and can realloc() it to grow it, and should free() it to
166 * delete it.
167 */
168 int yy_is_our_buffer;
170 /* Whether this is an "interactive" input source; if so, and
171 * if we're using stdio for input, then we want to use getc()
172 * instead of fread(), to make sure we stop fetching input after
173 * each newline.
174 */
175 int yy_is_interactive;
177 /* Whether we're considered to be at the beginning of a line.
178 * If so, '^' rules will be active on the next match, otherwise
179 * not.
180 */
181 int yy_at_bol;
183 /* Whether to try to fill the input buffer when we reach the
184 * end of it.
185 */
186 int yy_fill_buffer;
188 int yy_buffer_status;
189 #define YY_BUFFER_NEW 0
190 #define YY_BUFFER_NORMAL 1
191 /* When an EOF's been seen but there's still some text to process
192 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
193 * shouldn't try reading from the input source any more. We might
194 * still have a bunch of tokens to match, though, because of
195 * possible backing-up.
196 *
197 * When we actually see the EOF, we change the status to "new"
198 * (via yyrestart()), so that the user can continue scanning by
199 * just pointing yyin at a new input file.
200 */
201 #define YY_BUFFER_EOF_PENDING 2
202 };
204 static YY_BUFFER_STATE yy_current_buffer = 0;
206 /* We provide macros for accessing buffer states in case in the
207 * future we want to put the buffer states in a more general
208 * "scanner state".
209 */
210 #define YY_CURRENT_BUFFER yy_current_buffer
213 /* yy_hold_char holds the character lost when yytext is formed. */
214 static char yy_hold_char;
216 static int yy_n_chars; /* number of characters read into yy_ch_buf */
219 int yyleng;
221 /* Points to current character in buffer. */
222 static char *yy_c_buf_p = (char *) 0;
223 static int yy_init = 1; /* whether we need to initialize */
224 static int yy_start = 0; /* start state number */
226 /* Flag which is used to allow yywrap()'s to do buffer switches
227 * instead of setting up a fresh yyin. A bit of a hack ...
228 */
229 static int yy_did_buffer_switch_on_eof;
231 void yyrestart YY_PROTO(( FILE *input_file ));
233 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
234 void yy_load_buffer_state YY_PROTO(( void ));
235 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
236 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
237 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
238 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
239 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
241 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
242 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
243 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
245 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
246 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
247 static void yy_flex_free YY_PROTO(( void * ));
249 #define yy_new_buffer yy_create_buffer
251 #define yy_set_interactive(is_interactive) \
252 { \
253 if ( ! yy_current_buffer ) \
254 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
255 yy_current_buffer->yy_is_interactive = is_interactive; \
256 }
258 #define yy_set_bol(at_bol) \
259 { \
260 if ( ! yy_current_buffer ) \
261 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
262 yy_current_buffer->yy_at_bol = at_bol; \
263 }
265 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
268 #define yywrap() 1
269 #define YY_SKIP_YYWRAP
270 typedef unsigned char YY_CHAR;
271 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
272 typedef int yy_state_type;
273 extern char *yytext;
274 #define yytext_ptr yytext
276 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
277 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
278 static int yy_get_next_buffer YY_PROTO(( void ));
279 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
281 /* Done after the current pattern has been matched and before the
282 * corresponding action - sets up yytext.
283 */
284 #define YY_DO_BEFORE_ACTION \
285 yytext_ptr = yy_bp; \
286 yyleng = (int) (yy_cp - yy_bp); \
287 yy_hold_char = *yy_cp; \
288 *yy_cp = '\0'; \
289 yy_c_buf_p = yy_cp;
291 #define YY_NUM_RULES 10
292 #define YY_END_OF_BUFFER 11
293 static yyconst short int yy_accept[24] =
294 { 0,
295 0, 0, 11, 9, 8, 8, 6, 7, 9, 4,
296 3, 2, 2, 8, 5, 3, 2, 2, 2, 2,
297 2, 1, 0
298 } ;
300 static yyconst int yy_ec[256] =
301 { 0,
302 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
303 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
304 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
305 1, 2, 1, 1, 1, 1, 1, 4, 1, 1,
306 1, 5, 1, 1, 6, 7, 1, 8, 8, 8,
307 8, 8, 8, 8, 8, 8, 8, 1, 1, 1,
308 1, 9, 1, 1, 10, 10, 10, 10, 10, 10,
309 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
310 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
311 1, 1, 1, 1, 10, 1, 10, 10, 10, 10,
313 11, 12, 10, 10, 13, 10, 10, 10, 10, 10,
314 14, 10, 10, 10, 15, 10, 10, 10, 10, 10,
315 10, 16, 1, 1, 1, 1, 1, 1, 1, 1,
316 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
317 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
318 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
319 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
320 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
321 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
322 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
324 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
325 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
326 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
327 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
328 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
329 1, 1, 1, 1, 1
330 } ;
332 static yyconst int yy_meta[17] =
333 { 0,
334 1, 1, 1, 1, 1, 1, 1, 2, 1, 2,
335 2, 2, 2, 2, 2, 2
336 } ;
338 static yyconst short int yy_base[25] =
339 { 0,
340 0, 0, 32, 33, 15, 17, 33, 33, 22, 33,
341 22, 0, 16, 19, 33, 20, 0, 11, 15, 11,
342 12, 0, 33, 21
343 } ;
345 static yyconst short int yy_def[25] =
346 { 0,
347 23, 1, 23, 23, 23, 23, 23, 23, 23, 23,
348 23, 24, 24, 23, 23, 23, 24, 24, 24, 24,
349 24, 24, 0, 23
350 } ;
352 static yyconst short int yy_nxt[50] =
353 { 0,
354 4, 5, 6, 7, 8, 9, 10, 11, 4, 12,
355 12, 12, 12, 12, 13, 12, 14, 14, 14, 14,
356 14, 14, 17, 22, 21, 20, 19, 16, 18, 16,
357 15, 23, 3, 23, 23, 23, 23, 23, 23, 23,
358 23, 23, 23, 23, 23, 23, 23, 23, 23
359 } ;
361 static yyconst short int yy_chk[50] =
362 { 0,
363 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
364 1, 1, 1, 1, 1, 1, 5, 5, 6, 6,
365 14, 14, 24, 21, 20, 19, 18, 16, 13, 11,
366 9, 3, 23, 23, 23, 23, 23, 23, 23, 23,
367 23, 23, 23, 23, 23, 23, 23, 23, 23
368 } ;
370 static yy_state_type yy_last_accepting_state;
371 static char *yy_last_accepting_cpos;
373 /* The intent behind this definition is that it'll catch
374 * any uses of REJECT which flex missed.
375 */
376 #define REJECT reject_used_but_not_detected
377 #define yymore() yymore_used_but_not_detected
378 #define YY_MORE_ADJ 0
379 #define YY_RESTORE_YY_MORE_OFFSET
380 char *yytext;
381 #line 1 "expr.l"
382 #define INITIAL 0
383 #line 2 "expr.l"
384 #include "expr.cpp.h"
386 #ifndef __GNUC__
387 #include <io.h>
388 #define isatty _isatty
389 #endif
391 char *exprString;
392 int exprCol;
394 #define YY_INPUT(buf,result,max_size) \
395 { \
396 int c = *exprString++; \
397 exprCol++;\
398 result = (c == 0) ? YY_NULL : (buf[0] = c, 1); \
399 }
400 #define YY_MAIN 0
401 #line 400 "expr-lex.cpp"
403 /* Macros after this point can all be overridden by user definitions in
404 * section 1.
405 */
407 #ifndef YY_SKIP_YYWRAP
408 #ifdef __cplusplus
409 extern "C" int yywrap YY_PROTO(( void ));
410 #else
411 extern int yywrap YY_PROTO(( void ));
412 #endif
413 #endif
415 #ifndef YY_NO_UNPUT
416 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
417 #endif
419 #ifndef yytext_ptr
420 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
421 #endif
423 #ifdef YY_NEED_STRLEN
424 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
425 #endif
427 #ifndef YY_NO_INPUT
428 #ifdef __cplusplus
429 static int yyinput YY_PROTO(( void ));
430 #else
431 static int input YY_PROTO(( void ));
432 #endif
433 #endif
435 #if YY_STACK_USED
436 static int yy_start_stack_ptr = 0;
437 static int yy_start_stack_depth = 0;
438 static int *yy_start_stack = 0;
439 #ifndef YY_NO_PUSH_STATE
440 static void yy_push_state YY_PROTO(( int new_state ));
441 #endif
442 #ifndef YY_NO_POP_STATE
443 static void yy_pop_state YY_PROTO(( void ));
444 #endif
445 #ifndef YY_NO_TOP_STATE
446 static int yy_top_state YY_PROTO(( void ));
447 #endif
449 #else
450 #define YY_NO_PUSH_STATE 1
451 #define YY_NO_POP_STATE 1
452 #define YY_NO_TOP_STATE 1
453 #endif
455 #ifdef YY_MALLOC_DECL
456 YY_MALLOC_DECL
457 #else
458 #if __STDC__
459 #ifndef __cplusplus
460 #include <stdlib.h>
461 #endif
462 #else
463 /* Just try to get by without declaring the routines. This will fail
464 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
465 * or sizeof(void*) != sizeof(int).
466 */
467 #endif
468 #endif
470 /* Amount of stuff to slurp up with each read. */
471 #ifndef YY_READ_BUF_SIZE
472 #define YY_READ_BUF_SIZE 8192
473 #endif
475 /* Copy whatever the last rule matched to the standard output. */
477 #ifndef ECHO
478 /* This used to be an fputs(), but since the string might contain NUL's,
479 * we now use fwrite().
480 */
481 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
482 #endif
484 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
485 * is returned in "result".
486 */
487 #ifndef YY_INPUT
488 #define YY_INPUT(buf,result,max_size) \
489 if ( yy_current_buffer->yy_is_interactive ) \
490 { \
491 int c = '*', n; \
492 for ( n = 0; n < max_size && \
493 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
494 buf[n] = (char) c; \
495 if ( c == '\n' ) \
496 buf[n++] = (char) c; \
497 if ( c == EOF && ferror( yyin ) ) \
498 YY_FATAL_ERROR( "input in flex scanner failed" ); \
499 result = n; \
500 } \
501 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
502 && ferror( yyin ) ) \
503 YY_FATAL_ERROR( "input in flex scanner failed" );
504 #endif
506 /* No semi-colon after return; correct usage is to write "yyterminate();" -
507 * we don't want an extra ';' after the "return" because that will cause
508 * some compilers to complain about unreachable statements.
509 */
510 #ifndef yyterminate
511 #define yyterminate() return YY_NULL
512 #endif
514 /* Number of entries by which start-condition stack grows. */
515 #ifndef YY_START_STACK_INCR
516 #define YY_START_STACK_INCR 25
517 #endif
519 /* Report a fatal error. */
520 #ifndef YY_FATAL_ERROR
521 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
522 #endif
524 /* Default declaration of generated scanner - a define so the user can
525 * easily add parameters.
526 */
527 #ifndef YY_DECL
528 #define YY_DECL int yylex YY_PROTO(( void ))
529 #endif
531 /* Code executed at the beginning of each rule, after yytext and yyleng
532 * have been set up.
533 */
534 #ifndef YY_USER_ACTION
535 #define YY_USER_ACTION
536 #endif
538 /* Code executed at the end of each rule. */
539 #ifndef YY_BREAK
540 #define YY_BREAK break;
541 #endif
543 #define YY_RULE_SETUP \
544 YY_USER_ACTION
546 YY_DECL
547 {
548 register yy_state_type yy_current_state;
549 register char *yy_cp = NULL, *yy_bp = NULL;
550 register int yy_act;
552 #line 31 "expr.l"
555 #line 554 "expr-lex.cpp"
557 if ( yy_init )
558 {
559 yy_init = 0;
561 #ifdef YY_USER_INIT
562 YY_USER_INIT;
563 #endif
565 if ( ! yy_start )
566 yy_start = 1; /* first start state */
568 if ( ! yyin )
569 yyin = stdin;
571 if ( ! yyout )
572 yyout = stdout;
574 if ( ! yy_current_buffer )
575 yy_current_buffer =
576 yy_create_buffer( yyin, YY_BUF_SIZE );
578 yy_load_buffer_state();
579 }
581 while ( 1 ) /* loops until end-of-file is reached */
582 {
583 yy_cp = yy_c_buf_p;
585 /* Support of yytext. */
586 *yy_cp = yy_hold_char;
588 /* yy_bp points to the position in yy_ch_buf of the start of
589 * the current run.
590 */
591 yy_bp = yy_cp;
593 yy_current_state = yy_start;
594 yy_match:
595 do
596 {
597 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
598 if ( yy_accept[yy_current_state] )
599 {
600 yy_last_accepting_state = yy_current_state;
601 yy_last_accepting_cpos = yy_cp;
602 }
603 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
604 {
605 yy_current_state = (int) yy_def[yy_current_state];
606 if ( yy_current_state >= 24 )
607 yy_c = yy_meta[(unsigned int) yy_c];
608 }
609 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
610 ++yy_cp;
611 }
612 while ( yy_base[yy_current_state] != 33 );
614 yy_find_action:
615 yy_act = yy_accept[yy_current_state];
616 if ( yy_act == 0 )
617 { /* have to back up */
618 yy_cp = yy_last_accepting_cpos;
619 yy_current_state = yy_last_accepting_state;
620 yy_act = yy_accept[yy_current_state];
621 }
623 YY_DO_BEFORE_ACTION;
626 do_action: /* This label is used only to access EOF actions. */
629 switch ( yy_act )
630 { /* beginning of action switch */
631 case 0: /* must back up */
632 /* undo the effects of YY_DO_BEFORE_ACTION */
633 *yy_cp = yy_hold_char;
634 yy_cp = yy_last_accepting_cpos;
635 yy_current_state = yy_last_accepting_state;
636 goto yy_find_action;
638 case 1:
639 YY_RULE_SETUP
640 #line 33 "expr.l"
641 {
642 return TOKEN_SIZEOF;
643 }
644 YY_BREAK
645 case 2:
646 YY_RULE_SETUP
647 #line 37 "expr.l"
648 {
649 return TOKEN_IDENTIFIER;
650 }
651 YY_BREAK
652 case 3:
653 YY_RULE_SETUP
654 #line 41 "expr.l"
655 {
656 return TOKEN_NUMBER;
657 }
658 YY_BREAK
659 case 4:
660 YY_RULE_SETUP
661 #line 45 "expr.l"
662 {
663 return TOKEN_DOT;
664 }
665 YY_BREAK
666 case 5:
667 YY_RULE_SETUP
668 #line 49 "expr.l"
669 {
670 return TOKEN_ARROW;
671 }
672 YY_BREAK
673 case 6:
674 YY_RULE_SETUP
675 #line 53 "expr.l"
676 {
677 return TOKEN_ADDR;
678 }
679 YY_BREAK
680 case 7:
681 YY_RULE_SETUP
682 #line 57 "expr.l"
683 {
684 return TOKEN_STAR;
685 }
686 YY_BREAK
687 case 8:
688 YY_RULE_SETUP
689 #line 61 "expr.l"
691 YY_BREAK
692 case 9:
693 YY_RULE_SETUP
694 #line 63 "expr.l"
695 return *yytext;
696 YY_BREAK
697 case 10:
698 YY_RULE_SETUP
699 #line 65 "expr.l"
700 ECHO;
701 YY_BREAK
702 #line 701 "expr-lex.cpp"
703 case YY_STATE_EOF(INITIAL):
704 yyterminate();
706 case YY_END_OF_BUFFER:
707 {
708 /* Amount of text matched not including the EOB char. */
709 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
711 /* Undo the effects of YY_DO_BEFORE_ACTION. */
712 *yy_cp = yy_hold_char;
713 YY_RESTORE_YY_MORE_OFFSET
715 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
716 {
717 /* We're scanning a new file or input source. It's
718 * possible that this happened because the user
719 * just pointed yyin at a new source and called
720 * yylex(). If so, then we have to assure
721 * consistency between yy_current_buffer and our
722 * globals. Here is the right place to do so, because
723 * this is the first action (other than possibly a
724 * back-up) that will match for the new input source.
725 */
726 yy_n_chars = yy_current_buffer->yy_n_chars;
727 yy_current_buffer->yy_input_file = yyin;
728 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
729 }
731 /* Note that here we test for yy_c_buf_p "<=" to the position
732 * of the first EOB in the buffer, since yy_c_buf_p will
733 * already have been incremented past the NUL character
734 * (since all states make transitions on EOB to the
735 * end-of-buffer state). Contrast this with the test
736 * in input().
737 */
738 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
739 { /* This was really a NUL. */
740 yy_state_type yy_next_state;
742 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
744 yy_current_state = yy_get_previous_state();
746 /* Okay, we're now positioned to make the NUL
747 * transition. We couldn't have
748 * yy_get_previous_state() go ahead and do it
749 * for us because it doesn't know how to deal
750 * with the possibility of jamming (and we don't
751 * want to build jamming into it because then it
752 * will run more slowly).
753 */
755 yy_next_state = yy_try_NUL_trans( yy_current_state );
757 yy_bp = yytext_ptr + YY_MORE_ADJ;
759 if ( yy_next_state )
760 {
761 /* Consume the NUL. */
762 yy_cp = ++yy_c_buf_p;
763 yy_current_state = yy_next_state;
764 goto yy_match;
765 }
767 else
768 {
769 yy_cp = yy_c_buf_p;
770 goto yy_find_action;
771 }
772 }
774 else switch ( yy_get_next_buffer() )
775 {
776 case EOB_ACT_END_OF_FILE:
777 {
778 yy_did_buffer_switch_on_eof = 0;
780 if ( yywrap() )
781 {
782 /* Note: because we've taken care in
783 * yy_get_next_buffer() to have set up
784 * yytext, we can now set up
785 * yy_c_buf_p so that if some total
786 * hoser (like flex itself) wants to
787 * call the scanner after we return the
788 * YY_NULL, it'll still work - another
789 * YY_NULL will get returned.
790 */
791 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
793 yy_act = YY_STATE_EOF(YY_START);
794 goto do_action;
795 }
797 else
798 {
799 if ( ! yy_did_buffer_switch_on_eof )
800 YY_NEW_FILE;
801 }
802 break;
803 }
805 case EOB_ACT_CONTINUE_SCAN:
806 yy_c_buf_p =
807 yytext_ptr + yy_amount_of_matched_text;
809 yy_current_state = yy_get_previous_state();
811 yy_cp = yy_c_buf_p;
812 yy_bp = yytext_ptr + YY_MORE_ADJ;
813 goto yy_match;
815 case EOB_ACT_LAST_MATCH:
816 yy_c_buf_p =
817 &yy_current_buffer->yy_ch_buf[yy_n_chars];
819 yy_current_state = yy_get_previous_state();
821 yy_cp = yy_c_buf_p;
822 yy_bp = yytext_ptr + YY_MORE_ADJ;
823 goto yy_find_action;
824 }
825 break;
826 }
828 default:
829 YY_FATAL_ERROR(
830 "fatal flex scanner internal error--no action found" );
831 } /* end of action switch */
832 } /* end of scanning one token */
833 } /* end of yylex */
836 /* yy_get_next_buffer - try to read in a new buffer
837 *
838 * Returns a code representing an action:
839 * EOB_ACT_LAST_MATCH -
840 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
841 * EOB_ACT_END_OF_FILE - end of file
842 */
844 static int yy_get_next_buffer()
845 {
846 register char *dest = yy_current_buffer->yy_ch_buf;
847 register char *source = yytext_ptr;
848 register int number_to_move, i;
849 int ret_val;
851 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
852 YY_FATAL_ERROR(
853 "fatal flex scanner internal error--end of buffer missed" );
855 if ( yy_current_buffer->yy_fill_buffer == 0 )
856 { /* Don't try to fill the buffer, so this is an EOF. */
857 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
858 {
859 /* We matched a single character, the EOB, so
860 * treat this as a final EOF.
861 */
862 return EOB_ACT_END_OF_FILE;
863 }
865 else
866 {
867 /* We matched some text prior to the EOB, first
868 * process it.
869 */
870 return EOB_ACT_LAST_MATCH;
871 }
872 }
874 /* Try to read more data. */
876 /* First move last chars to start of buffer. */
877 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
879 for ( i = 0; i < number_to_move; ++i )
880 *(dest++) = *(source++);
882 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
883 /* don't do the read, it's not guaranteed to return an EOF,
884 * just force an EOF
885 */
886 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
888 else
889 {
890 int num_to_read =
891 yy_current_buffer->yy_buf_size - number_to_move - 1;
893 while ( num_to_read <= 0 )
894 { /* Not enough room in the buffer - grow it. */
895 #ifdef YY_USES_REJECT
896 YY_FATAL_ERROR(
897 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
898 #else
900 /* just a shorter name for the current buffer */
901 YY_BUFFER_STATE b = yy_current_buffer;
903 int yy_c_buf_p_offset =
904 (int) (yy_c_buf_p - b->yy_ch_buf);
906 if ( b->yy_is_our_buffer )
907 {
908 int new_size = b->yy_buf_size * 2;
910 if ( new_size <= 0 )
911 b->yy_buf_size += b->yy_buf_size / 8;
912 else
913 b->yy_buf_size *= 2;
915 b->yy_ch_buf = (char *)
916 /* Include room in for 2 EOB chars. */
917 yy_flex_realloc( (void *) b->yy_ch_buf,
918 b->yy_buf_size + 2 );
919 }
920 else
921 /* Can't grow it, we don't own it. */
922 b->yy_ch_buf = 0;
924 if ( ! b->yy_ch_buf )
925 YY_FATAL_ERROR(
926 "fatal error - scanner input buffer overflow" );
928 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
930 num_to_read = yy_current_buffer->yy_buf_size -
931 number_to_move - 1;
932 #endif
933 }
935 if ( num_to_read > YY_READ_BUF_SIZE )
936 num_to_read = YY_READ_BUF_SIZE;
938 /* Read in more data. */
939 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
940 yy_n_chars, num_to_read );
942 yy_current_buffer->yy_n_chars = yy_n_chars;
943 }
945 if ( yy_n_chars == 0 )
946 {
947 if ( number_to_move == YY_MORE_ADJ )
948 {
949 ret_val = EOB_ACT_END_OF_FILE;
950 yyrestart( yyin );
951 }
953 else
954 {
955 ret_val = EOB_ACT_LAST_MATCH;
956 yy_current_buffer->yy_buffer_status =
957 YY_BUFFER_EOF_PENDING;
958 }
959 }
961 else
962 ret_val = EOB_ACT_CONTINUE_SCAN;
964 yy_n_chars += number_to_move;
965 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
966 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
968 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
970 return ret_val;
971 }
974 /* yy_get_previous_state - get the state just before the EOB char was reached */
976 static yy_state_type yy_get_previous_state()
977 {
978 register yy_state_type yy_current_state;
979 register char *yy_cp;
981 yy_current_state = yy_start;
983 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
984 {
985 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
986 if ( yy_accept[yy_current_state] )
987 {
988 yy_last_accepting_state = yy_current_state;
989 yy_last_accepting_cpos = yy_cp;
990 }
991 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
992 {
993 yy_current_state = (int) yy_def[yy_current_state];
994 if ( yy_current_state >= 24 )
995 yy_c = yy_meta[(unsigned int) yy_c];
996 }
997 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
998 }
1000 return yy_current_state;
1004 /* yy_try_NUL_trans - try to make a transition on the NUL character
1006 * synopsis
1007 * next_state = yy_try_NUL_trans( current_state );
1008 */
1010 #ifdef YY_USE_PROTOS
1011 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1012 #else
1013 static yy_state_type yy_try_NUL_trans( yy_current_state )
1014 yy_state_type yy_current_state;
1015 #endif
1017 register int yy_is_jam;
1018 register char *yy_cp = yy_c_buf_p;
1020 register YY_CHAR yy_c = 1;
1021 if ( yy_accept[yy_current_state] )
1023 yy_last_accepting_state = yy_current_state;
1024 yy_last_accepting_cpos = yy_cp;
1026 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1028 yy_current_state = (int) yy_def[yy_current_state];
1029 if ( yy_current_state >= 24 )
1030 yy_c = yy_meta[(unsigned int) yy_c];
1032 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1033 yy_is_jam = (yy_current_state == 23);
1035 return yy_is_jam ? 0 : yy_current_state;
1039 #ifndef YY_NO_UNPUT
1040 #ifdef YY_USE_PROTOS
1041 static void yyunput( int c, register char *yy_bp )
1042 #else
1043 static void yyunput( c, yy_bp )
1044 int c;
1045 register char *yy_bp;
1046 #endif
1048 register char *yy_cp = yy_c_buf_p;
1050 /* undo effects of setting up yytext */
1051 *yy_cp = yy_hold_char;
1053 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1054 { /* need to shift things up to make room */
1055 /* +2 for EOB chars. */
1056 register int number_to_move = yy_n_chars + 2;
1057 register char *dest = &yy_current_buffer->yy_ch_buf[
1058 yy_current_buffer->yy_buf_size + 2];
1059 register char *source =
1060 &yy_current_buffer->yy_ch_buf[number_to_move];
1062 while ( source > yy_current_buffer->yy_ch_buf )
1063 *--dest = *--source;
1065 yy_cp += (int) (dest - source);
1066 yy_bp += (int) (dest - source);
1067 yy_current_buffer->yy_n_chars =
1068 yy_n_chars = yy_current_buffer->yy_buf_size;
1070 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1071 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1074 *--yy_cp = (char) c;
1077 yytext_ptr = yy_bp;
1078 yy_hold_char = *yy_cp;
1079 yy_c_buf_p = yy_cp;
1081 #endif /* ifndef YY_NO_UNPUT */
1084 #ifdef __cplusplus
1085 static int yyinput()
1086 #else
1087 static int input()
1088 #endif
1090 int c;
1092 *yy_c_buf_p = yy_hold_char;
1094 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1096 /* yy_c_buf_p now points to the character we want to return.
1097 * If this occurs *before* the EOB characters, then it's a
1098 * valid NUL; if not, then we've hit the end of the buffer.
1099 */
1100 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1101 /* This was really a NUL. */
1102 *yy_c_buf_p = '\0';
1104 else
1105 { /* need more input */
1106 int offset = yy_c_buf_p - yytext_ptr;
1107 ++yy_c_buf_p;
1109 switch ( yy_get_next_buffer() )
1111 case EOB_ACT_LAST_MATCH:
1112 /* This happens because yy_g_n_b()
1113 * sees that we've accumulated a
1114 * token and flags that we need to
1115 * try matching the token before
1116 * proceeding. But for input(),
1117 * there's no matching to consider.
1118 * So convert the EOB_ACT_LAST_MATCH
1119 * to EOB_ACT_END_OF_FILE.
1120 */
1122 /* Reset buffer status. */
1123 yyrestart( yyin );
1125 /* fall through */
1127 case EOB_ACT_END_OF_FILE:
1129 if ( yywrap() )
1130 return EOF;
1132 if ( ! yy_did_buffer_switch_on_eof )
1133 YY_NEW_FILE;
1134 #ifdef __cplusplus
1135 return yyinput();
1136 #else
1137 return input();
1138 #endif
1141 case EOB_ACT_CONTINUE_SCAN:
1142 yy_c_buf_p = yytext_ptr + offset;
1143 break;
1148 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1149 *yy_c_buf_p = '\0'; /* preserve yytext */
1150 yy_hold_char = *++yy_c_buf_p;
1153 return c;
1157 #ifdef YY_USE_PROTOS
1158 void yyrestart( FILE *input_file )
1159 #else
1160 void yyrestart( input_file )
1161 FILE *input_file;
1162 #endif
1164 if ( ! yy_current_buffer )
1165 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1167 yy_init_buffer( yy_current_buffer, input_file );
1168 yy_load_buffer_state();
1172 #ifdef YY_USE_PROTOS
1173 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1174 #else
1175 void yy_switch_to_buffer( new_buffer )
1176 YY_BUFFER_STATE new_buffer;
1177 #endif
1179 if ( yy_current_buffer == new_buffer )
1180 return;
1182 if ( yy_current_buffer )
1184 /* Flush out information for old buffer. */
1185 *yy_c_buf_p = yy_hold_char;
1186 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1187 yy_current_buffer->yy_n_chars = yy_n_chars;
1190 yy_current_buffer = new_buffer;
1191 yy_load_buffer_state();
1193 /* We don't actually know whether we did this switch during
1194 * EOF (yywrap()) processing, but the only time this flag
1195 * is looked at is after yywrap() is called, so it's safe
1196 * to go ahead and always set it.
1197 */
1198 yy_did_buffer_switch_on_eof = 1;
1202 #ifdef YY_USE_PROTOS
1203 void yy_load_buffer_state( void )
1204 #else
1205 void yy_load_buffer_state()
1206 #endif
1208 yy_n_chars = yy_current_buffer->yy_n_chars;
1209 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1210 yyin = yy_current_buffer->yy_input_file;
1211 yy_hold_char = *yy_c_buf_p;
1215 #ifdef YY_USE_PROTOS
1216 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1217 #else
1218 YY_BUFFER_STATE yy_create_buffer( file, size )
1219 FILE *file;
1220 int size;
1221 #endif
1223 YY_BUFFER_STATE b;
1225 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1226 if ( ! b )
1227 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1229 b->yy_buf_size = size;
1231 /* yy_ch_buf has to be 2 characters longer than the size given because
1232 * we need to put in 2 end-of-buffer characters.
1233 */
1234 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1235 if ( ! b->yy_ch_buf )
1236 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1238 b->yy_is_our_buffer = 1;
1240 yy_init_buffer( b, file );
1242 return b;
1246 #ifdef YY_USE_PROTOS
1247 void yy_delete_buffer( YY_BUFFER_STATE b )
1248 #else
1249 void yy_delete_buffer( b )
1250 YY_BUFFER_STATE b;
1251 #endif
1253 if ( ! b )
1254 return;
1256 if ( b == yy_current_buffer )
1257 yy_current_buffer = (YY_BUFFER_STATE) 0;
1259 if ( b->yy_is_our_buffer )
1260 yy_flex_free( (void *) b->yy_ch_buf );
1262 yy_flex_free( (void *) b );
1267 #ifdef YY_USE_PROTOS
1268 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1269 #else
1270 void yy_init_buffer( b, file )
1271 YY_BUFFER_STATE b;
1272 FILE *file;
1273 #endif
1277 yy_flush_buffer( b );
1279 b->yy_input_file = file;
1280 b->yy_fill_buffer = 1;
1282 #if YY_ALWAYS_INTERACTIVE
1283 b->yy_is_interactive = 1;
1284 #else
1285 #if YY_NEVER_INTERACTIVE
1286 b->yy_is_interactive = 0;
1287 #else
1288 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1289 #endif
1290 #endif
1294 #ifdef YY_USE_PROTOS
1295 void yy_flush_buffer( YY_BUFFER_STATE b )
1296 #else
1297 void yy_flush_buffer( b )
1298 YY_BUFFER_STATE b;
1299 #endif
1302 if ( ! b )
1303 return;
1305 b->yy_n_chars = 0;
1307 /* We always need two end-of-buffer characters. The first causes
1308 * a transition to the end-of-buffer state. The second causes
1309 * a jam in that state.
1310 */
1311 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1312 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1314 b->yy_buf_pos = &b->yy_ch_buf[0];
1316 b->yy_at_bol = 1;
1317 b->yy_buffer_status = YY_BUFFER_NEW;
1319 if ( b == yy_current_buffer )
1320 yy_load_buffer_state();
1324 #ifndef YY_NO_SCAN_BUFFER
1325 #ifdef YY_USE_PROTOS
1326 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1327 #else
1328 YY_BUFFER_STATE yy_scan_buffer( base, size )
1329 char *base;
1330 yy_size_t size;
1331 #endif
1333 YY_BUFFER_STATE b;
1335 if ( size < 2 ||
1336 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1337 base[size-1] != YY_END_OF_BUFFER_CHAR )
1338 /* They forgot to leave room for the EOB's. */
1339 return 0;
1341 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1342 if ( ! b )
1343 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1345 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1346 b->yy_buf_pos = b->yy_ch_buf = base;
1347 b->yy_is_our_buffer = 0;
1348 b->yy_input_file = 0;
1349 b->yy_n_chars = b->yy_buf_size;
1350 b->yy_is_interactive = 0;
1351 b->yy_at_bol = 1;
1352 b->yy_fill_buffer = 0;
1353 b->yy_buffer_status = YY_BUFFER_NEW;
1355 yy_switch_to_buffer( b );
1357 return b;
1359 #endif
1362 #ifndef YY_NO_SCAN_STRING
1363 #ifdef YY_USE_PROTOS
1364 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1365 #else
1366 YY_BUFFER_STATE yy_scan_string( yy_str )
1367 yyconst char *yy_str;
1368 #endif
1370 int len;
1371 for ( len = 0; yy_str[len]; ++len )
1374 return yy_scan_bytes( yy_str, len );
1376 #endif
1379 #ifndef YY_NO_SCAN_BYTES
1380 #ifdef YY_USE_PROTOS
1381 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1382 #else
1383 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1384 yyconst char *bytes;
1385 int len;
1386 #endif
1388 YY_BUFFER_STATE b;
1389 char *buf;
1390 yy_size_t n;
1391 int i;
1393 /* Get memory for full buffer, including space for trailing EOB's. */
1394 n = len + 2;
1395 buf = (char *) yy_flex_alloc( n );
1396 if ( ! buf )
1397 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1399 for ( i = 0; i < len; ++i )
1400 buf[i] = bytes[i];
1402 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1404 b = yy_scan_buffer( buf, n );
1405 if ( ! b )
1406 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1408 /* It's okay to grow etc. this buffer, and we should throw it
1409 * away when we're done.
1410 */
1411 b->yy_is_our_buffer = 1;
1413 return b;
1415 #endif
1418 #ifndef YY_NO_PUSH_STATE
1419 #ifdef YY_USE_PROTOS
1420 static void yy_push_state( int new_state )
1421 #else
1422 static void yy_push_state( new_state )
1423 int new_state;
1424 #endif
1426 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1428 yy_size_t new_size;
1430 yy_start_stack_depth += YY_START_STACK_INCR;
1431 new_size = yy_start_stack_depth * sizeof( int );
1433 if ( ! yy_start_stack )
1434 yy_start_stack = (int *) yy_flex_alloc( new_size );
1436 else
1437 yy_start_stack = (int *) yy_flex_realloc(
1438 (void *) yy_start_stack, new_size );
1440 if ( ! yy_start_stack )
1441 YY_FATAL_ERROR(
1442 "out of memory expanding start-condition stack" );
1445 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1447 BEGIN(new_state);
1449 #endif
1452 #ifndef YY_NO_POP_STATE
1453 static void yy_pop_state()
1455 if ( --yy_start_stack_ptr < 0 )
1456 YY_FATAL_ERROR( "start-condition stack underflow" );
1458 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1460 #endif
1463 #ifndef YY_NO_TOP_STATE
1464 static int yy_top_state()
1466 return yy_start_stack[yy_start_stack_ptr - 1];
1468 #endif
1470 #ifndef YY_EXIT_FAILURE
1471 #define YY_EXIT_FAILURE 2
1472 #endif
1474 #ifdef YY_USE_PROTOS
1475 static void yy_fatal_error( yyconst char msg[] )
1476 #else
1477 static void yy_fatal_error( msg )
1478 char msg[];
1479 #endif
1481 (void) fprintf( stderr, "%s\n", msg );
1482 exit( YY_EXIT_FAILURE );
1487 /* Redefine yyless() so it works in section 3 code. */
1489 #undef yyless
1490 #define yyless(n) \
1491 do \
1492 { \
1493 /* Undo effects of setting up yytext. */ \
1494 yytext[yyleng] = yy_hold_char; \
1495 yy_c_buf_p = yytext + n; \
1496 yy_hold_char = *yy_c_buf_p; \
1497 *yy_c_buf_p = '\0'; \
1498 yyleng = n; \
1499 } \
1500 while ( 0 )
1503 /* Internal utility routines. */
1505 #ifndef yytext_ptr
1506 #ifdef YY_USE_PROTOS
1507 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1508 #else
1509 static void yy_flex_strncpy( s1, s2, n )
1510 char *s1;
1511 yyconst char *s2;
1512 int n;
1513 #endif
1515 register int i;
1516 for ( i = 0; i < n; ++i )
1517 s1[i] = s2[i];
1519 #endif
1521 #ifdef YY_NEED_STRLEN
1522 #ifdef YY_USE_PROTOS
1523 static int yy_flex_strlen( yyconst char *s )
1524 #else
1525 static int yy_flex_strlen( s )
1526 yyconst char *s;
1527 #endif
1529 register int n;
1530 for ( n = 0; s[n]; ++n )
1533 return n;
1535 #endif
1538 #ifdef YY_USE_PROTOS
1539 static void *yy_flex_alloc( yy_size_t size )
1540 #else
1541 static void *yy_flex_alloc( size )
1542 yy_size_t size;
1543 #endif
1545 return (void *) malloc( size );
1548 #ifdef YY_USE_PROTOS
1549 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1550 #else
1551 static void *yy_flex_realloc( ptr, size )
1552 void *ptr;
1553 yy_size_t size;
1554 #endif
1556 /* The cast to (char *) in the following accommodates both
1557 * implementations that use char* generic pointers, and those
1558 * that use void* generic pointers. It works with the latter
1559 * because both ANSI C and C++ allow castless assignment from
1560 * any pointer type to void*, and deal with argument conversions
1561 * as though doing an assignment.
1562 */
1563 return (void *) realloc( (char *) ptr, size );
1566 #ifdef YY_USE_PROTOS
1567 static void yy_flex_free( void *ptr )
1568 #else
1569 static void yy_flex_free( ptr )
1570 void *ptr;
1571 #endif
1573 free( ptr );
1576 #if YY_MAIN
1577 int main()
1579 yylex();
1580 return 0;
1582 #endif
1583 #line 65 "expr.l"
1586 void exprCleanBuffer()
1588 yy_delete_buffer(yy_current_buffer);
1589 yy_init = 1;