Add a line to KNOWN_BUGS about `let' inconsistently forcing values.
[proto.git] / src / compiler / enumlexer.cpp
blob60bfd5f0b6106ea36ca6e8934143df0089425aef
1 #define yy_create_buffer zz_create_buffer
2 #define yy_delete_buffer zz_delete_buffer
3 #define yy_scan_buffer zz_scan_buffer
4 #define yy_scan_string zz_scan_string
5 #define yy_scan_bytes zz_scan_bytes
6 #define yy_flex_debug zz_flex_debug
7 #define yy_init_buffer zz_init_buffer
8 #define yy_flush_buffer zz_flush_buffer
9 #define yy_load_buffer_state zz_load_buffer_state
10 #define yy_switch_to_buffer zz_switch_to_buffer
11 #define yyin zzin
12 #define yyleng zzleng
13 #define yylex zzlex
14 #define yyout zzout
15 #define yyrestart zzrestart
16 #define yytext zztext
17 #define yywrap zzwrap
19 #line 20 "enumlexer.cpp"
20 /* A lexical scanner generated by flex */
22 /* Scanner skeleton version:
23 * $Header: /cvs/root/flex/flex/skel.c,v 1.2 2004/05/07 00:28:17 jkh Exp $
26 #define FLEX_SCANNER
27 #define YY_FLEX_MAJOR_VERSION 2
28 #define YY_FLEX_MINOR_VERSION 5
30 #include <stdio.h>
33 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
34 #ifdef c_plusplus
35 #ifndef __cplusplus
36 #define __cplusplus
37 #endif
38 #endif
41 #ifdef __cplusplus
43 #include <stdlib.h>
44 #include <unistd.h>
46 /* Use prototypes in function declarations. */
47 #define YY_USE_PROTOS
49 /* The "const" storage-class-modifier is valid. */
50 #define YY_USE_CONST
52 #else /* ! __cplusplus */
54 #if __STDC__
56 #define YY_USE_PROTOS
57 #define YY_USE_CONST
59 #endif /* __STDC__ */
60 #endif /* ! __cplusplus */
62 #ifdef __TURBOC__
63 #pragma warn -rch
64 #pragma warn -use
65 #include <io.h>
66 #include <stdlib.h>
67 #define YY_USE_CONST
68 #define YY_USE_PROTOS
69 #endif
71 #ifdef YY_USE_CONST
72 #define yyconst const
73 #else
74 #define yyconst
75 #endif
78 #ifdef YY_USE_PROTOS
79 #define YY_PROTO(proto) proto
80 #else
81 #define YY_PROTO(proto) ()
82 #endif
84 /* Returned upon end-of-file. */
85 #define YY_NULL 0
87 /* Promotes a possibly negative, possibly signed char to an unsigned
88 * integer for use as an array index. If the signed char is negative,
89 * we want to instead treat it as an 8-bit unsigned char, hence the
90 * double cast.
92 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
94 /* Enter a start condition. This macro really ought to take a parameter,
95 * but we do it the disgusting crufty way forced on us by the ()-less
96 * definition of BEGIN.
98 #define BEGIN yy_start = 1 + 2 *
100 /* Translate the current start state into a value that can be later handed
101 * to BEGIN to return to the state. The YYSTATE alias is for lex
102 * compatibility.
104 #define YY_START ((yy_start - 1) / 2)
105 #define YYSTATE YY_START
107 /* Action number for EOF rule of a given start state. */
108 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
110 /* Special action meaning "start processing a new file". */
111 #define YY_NEW_FILE yyrestart( yyin )
113 #define YY_END_OF_BUFFER_CHAR 0
115 /* Size of default input buffer. */
116 #define YY_BUF_SIZE 16384
118 typedef struct yy_buffer_state *YY_BUFFER_STATE;
120 extern int yyleng;
121 extern FILE *yyin, *yyout;
123 #define EOB_ACT_CONTINUE_SCAN 0
124 #define EOB_ACT_END_OF_FILE 1
125 #define EOB_ACT_LAST_MATCH 2
127 /* The funky do-while in the following #define is used to turn the definition
128 * int a single C statement (which needs a semi-colon terminator). This
129 * avoids problems with code like:
131 * if ( condition_holds )
132 * yyless( 5 );
133 * else
134 * do_something_else();
136 * Prior to using the do-while the compiler would get upset at the
137 * "else" because it interpreted the "if" statement as being all
138 * done when it reached the ';' after the yyless() call.
141 /* Return all but the first 'n' matched characters back to the input stream. */
143 #define yyless(n) \
144 do \
146 /* Undo effects of setting up yytext. */ \
147 *yy_cp = yy_hold_char; \
148 YY_RESTORE_YY_MORE_OFFSET \
149 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
150 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
152 while ( 0 )
154 #define unput(c) yyunput( c, yytext_ptr )
156 /* The following is because we cannot portably get our hands on size_t
157 * (without autoconf's help, which isn't available because we want
158 * flex-generated scanners to compile on their own).
160 typedef unsigned int yy_size_t;
163 struct yy_buffer_state
165 FILE *yy_input_file;
167 char *yy_ch_buf; /* input buffer */
168 char *yy_buf_pos; /* current position in input buffer */
170 /* Size of input buffer in bytes, not including room for EOB
171 * characters.
173 yy_size_t yy_buf_size;
175 /* Number of characters read into yy_ch_buf, not including EOB
176 * characters.
178 int yy_n_chars;
180 /* Whether we "own" the buffer - i.e., we know we created it,
181 * and can realloc() it to grow it, and should free() it to
182 * delete it.
184 int yy_is_our_buffer;
186 /* Whether this is an "interactive" input source; if so, and
187 * if we're using stdio for input, then we want to use getc()
188 * instead of fread(), to make sure we stop fetching input after
189 * each newline.
191 int yy_is_interactive;
193 /* Whether we're considered to be at the beginning of a line.
194 * If so, '^' rules will be active on the next match, otherwise
195 * not.
197 int yy_at_bol;
199 /* Whether to try to fill the input buffer when we reach the
200 * end of it.
202 int yy_fill_buffer;
204 int yy_buffer_status;
205 #define YY_BUFFER_NEW 0
206 #define YY_BUFFER_NORMAL 1
207 /* When an EOF's been seen but there's still some text to process
208 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
209 * shouldn't try reading from the input source any more. We might
210 * still have a bunch of tokens to match, though, because of
211 * possible backing-up.
213 * When we actually see the EOF, we change the status to "new"
214 * (via yyrestart()), so that the user can continue scanning by
215 * just pointing yyin at a new input file.
217 #define YY_BUFFER_EOF_PENDING 2
220 static YY_BUFFER_STATE yy_current_buffer = 0;
222 /* We provide macros for accessing buffer states in case in the
223 * future we want to put the buffer states in a more general
224 * "scanner state".
226 #define YY_CURRENT_BUFFER yy_current_buffer
229 /* yy_hold_char holds the character lost when yytext is formed. */
230 static char yy_hold_char;
232 static int yy_n_chars; /* number of characters read into yy_ch_buf */
235 int yyleng;
237 /* Points to current character in buffer. */
238 static char *yy_c_buf_p = (char *) 0;
239 static int yy_init = 1; /* whether we need to initialize */
240 static int yy_start = 0; /* start state number */
242 /* Flag which is used to allow yywrap()'s to do buffer switches
243 * instead of setting up a fresh yyin. A bit of a hack ...
245 static int yy_did_buffer_switch_on_eof;
247 void yyrestart YY_PROTO(( FILE *input_file ));
249 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
250 void yy_load_buffer_state YY_PROTO(( void ));
251 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
252 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
253 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
254 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
255 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
257 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
258 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
259 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
261 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
262 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
263 static void yy_flex_free YY_PROTO(( void * ));
265 #define yy_new_buffer yy_create_buffer
267 #define yy_set_interactive(is_interactive) \
269 if ( ! yy_current_buffer ) \
270 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
271 yy_current_buffer->yy_is_interactive = is_interactive; \
274 #define yy_set_bol(at_bol) \
276 if ( ! yy_current_buffer ) \
277 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
278 yy_current_buffer->yy_at_bol = at_bol; \
281 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
283 typedef unsigned char YY_CHAR;
284 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
285 typedef int yy_state_type;
286 extern char *yytext;
287 #define yytext_ptr yytext
289 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
290 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
291 static int yy_get_next_buffer YY_PROTO(( void ));
292 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
294 /* Done after the current pattern has been matched and before the
295 * corresponding action - sets up yytext.
297 #define YY_DO_BEFORE_ACTION \
298 yytext_ptr = yy_bp; \
299 yyleng = (int) (yy_cp - yy_bp); \
300 yy_hold_char = *yy_cp; \
301 *yy_cp = '\0'; \
302 yy_c_buf_p = yy_cp;
304 #define YY_NUM_RULES 15
305 #define YY_END_OF_BUFFER 16
306 static yyconst short int yy_accept[70] =
307 { 0,
308 0, 0, 16, 15, 1, 13, 15, 14, 12, 7,
309 14, 14, 14, 14, 14, 6, 10, 1, 3, 0,
310 14, 14, 14, 14, 14, 14, 0, 2, 14, 14,
311 14, 14, 14, 14, 14, 14, 5, 14, 14, 14,
312 14, 14, 14, 14, 14, 14, 14, 14, 14, 4,
313 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
314 9, 14, 8, 14, 14, 14, 14, 11, 0
317 static yyconst int yy_ec[256] =
318 { 0,
319 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
320 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
321 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
322 1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
323 1, 4, 1, 5, 1, 1, 6, 7, 7, 7,
324 7, 7, 7, 7, 7, 7, 7, 1, 8, 1,
325 9, 1, 1, 1, 10, 7, 11, 12, 13, 14,
326 7, 7, 7, 7, 7, 15, 16, 7, 17, 18,
327 7, 19, 20, 21, 7, 7, 7, 22, 7, 7,
328 1, 1, 1, 1, 23, 1, 7, 7, 7, 24,
330 25, 26, 7, 7, 7, 7, 7, 7, 27, 28,
331 7, 29, 7, 7, 7, 30, 31, 7, 7, 7,
332 32, 7, 33, 1, 34, 1, 1, 1, 1, 1,
333 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
334 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
335 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
336 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
337 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
338 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
339 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
341 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
342 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
343 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
344 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
345 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
346 1, 1, 1, 1, 1
349 static yyconst int yy_meta[35] =
350 { 0,
351 1, 1, 1, 1, 1, 1, 2, 1, 1, 2,
352 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
353 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
354 2, 2, 1, 1
357 static yyconst short int yy_base[72] =
358 { 0,
359 0, 0, 91, 92, 33, 92, 33, 0, 92, 92,
360 73, 79, 73, 59, 54, 92, 92, 38, 92, 82,
361 0, 65, 61, 72, 50, 51, 76, 92, 65, 54,
362 55, 48, 49, 50, 61, 57, 0, 46, 58, 52,
363 50, 41, 49, 52, 44, 36, 49, 37, 43, 0,
364 35, 40, 33, 38, 36, 36, 34, 31, 32, 29,
365 0, 37, 0, 30, 34, 32, 24, 0, 92, 36,
369 static yyconst short int yy_def[72] =
370 { 0,
371 69, 1, 69, 69, 69, 69, 69, 70, 69, 69,
372 70, 70, 70, 70, 70, 69, 69, 69, 69, 71,
373 70, 70, 70, 70, 70, 70, 71, 69, 70, 70,
374 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
375 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
376 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
377 70, 70, 70, 70, 70, 70, 70, 70, 0, 69,
381 static yyconst short int yy_nxt[127] =
382 { 0,
383 4, 5, 5, 4, 6, 7, 8, 9, 10, 8,
384 11, 8, 8, 8, 8, 12, 8, 13, 8, 8,
385 8, 8, 8, 8, 14, 8, 8, 8, 8, 15,
386 8, 8, 16, 17, 18, 18, 19, 21, 20, 18,
387 18, 27, 27, 68, 67, 66, 65, 64, 63, 62,
388 61, 60, 59, 58, 57, 56, 55, 54, 53, 52,
389 51, 50, 49, 48, 47, 46, 45, 44, 43, 42,
390 41, 40, 39, 38, 37, 36, 35, 34, 28, 33,
391 32, 31, 30, 29, 28, 26, 25, 24, 23, 22,
392 69, 3, 69, 69, 69, 69, 69, 69, 69, 69,
394 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
395 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
396 69, 69, 69, 69, 69, 69
399 static yyconst short int yy_chk[127] =
400 { 0,
401 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
404 1, 1, 1, 1, 5, 5, 7, 70, 7, 18,
405 18, 71, 71, 67, 66, 65, 64, 62, 60, 59,
406 58, 57, 56, 55, 54, 53, 52, 51, 49, 48,
407 47, 46, 45, 44, 43, 42, 41, 40, 39, 38,
408 36, 35, 34, 33, 32, 31, 30, 29, 27, 26,
409 25, 24, 23, 22, 20, 15, 14, 13, 12, 11,
410 3, 69, 69, 69, 69, 69, 69, 69, 69, 69,
412 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
413 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
414 69, 69, 69, 69, 69, 69
417 static yy_state_type yy_last_accepting_state;
418 static char *yy_last_accepting_cpos;
420 /* The intent behind this definition is that it'll catch
421 * any uses of REJECT which flex missed.
423 #define REJECT reject_used_but_not_detected
424 #define yymore() yymore_used_but_not_detected
425 #define YY_MORE_ADJ 0
426 #define YY_RESTORE_YY_MORE_OFFSET
427 char *yytext;
428 #line 1 "one_enum.flex"
429 #define INITIAL 0
430 /* a flex scanner for reading a C file containing one platform enum
431 Copyright (C) 2005-2008, Jonathan Bachrach, Jacob Beal, and contributors
432 listed in the AUTHORS file in the MIT Proto distribution's top directory.
434 This file is part of MIT Proto, and is distributed under the terms of
435 the GNU General Public License, with a linking exception, as described
436 in the file LICENSE in the MIT Proto distribution's top directory.
438 #line 11 "one_enum.flex"
439 #define YY_BREAK { if(oecur->error) return 1; } break;
440 #define YY_DECL int zzlex( void )
442 #include <list>
443 #include <string>
444 #include "compiler-utils.h"
445 #include <stdio.h>
447 extern "C" int zzwrap() { return 1; }
449 int zzlex();
451 struct EnumLexer {
452 bool ready_for_entry, error; int step; list<string> *p_ops;
453 void read_error(string err) { *cperr << "Platform description file is not a parsable 'single enum' file: " << err << " .\n"; error=true; }
455 string ibuf;
456 EnumLexer(istream *in, ostream *out) {
457 ready_for_entry=true; error=false; step=0; p_ops = new list<string>;
458 // setup input stream; output is discarded
459 yyout = tmpfile();
460 ibuf = "";
461 while(in->good()) ibuf+=in->get();
462 ibuf[ibuf.size()-1]=0;
463 yy_scan_string(ibuf.c_str());
465 virtual ~EnumLexer() {} // nothing to clean up: p_ops is somebody else's prob
467 // returns NULL on error
468 list<string>* tokenize() {
469 yylex();
470 if(!error && step<9) { read_error("file not closed by ';'"); }
471 if(error) { delete p_ops; return NULL;
472 } else { return p_ops; }
476 EnumLexer* oecur;
478 #line 479 "enumlexer.cpp"
480 /* Macros after this point can all be overridden by user definitions in
481 * section 1.
484 #ifndef YY_SKIP_YYWRAP
485 #ifdef __cplusplus
486 extern "C" int yywrap YY_PROTO(( void ));
487 #else
488 extern int yywrap YY_PROTO(( void ));
489 #endif
490 #endif
492 #ifndef YY_NO_UNPUT
493 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
494 #endif
496 #ifndef yytext_ptr
497 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
498 #endif
500 #ifdef YY_NEED_STRLEN
501 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
502 #endif
504 #ifndef YY_NO_INPUT
505 #ifdef __cplusplus
506 static int yyinput YY_PROTO(( void ));
507 #else
508 static int input YY_PROTO(( void ));
509 #endif
510 #endif
512 #if YY_STACK_USED
513 static int yy_start_stack_ptr = 0;
514 static int yy_start_stack_depth = 0;
515 static int *yy_start_stack = 0;
516 #ifndef YY_NO_PUSH_STATE
517 static void yy_push_state YY_PROTO(( int new_state ));
518 #endif
519 #ifndef YY_NO_POP_STATE
520 static void yy_pop_state YY_PROTO(( void ));
521 #endif
522 #ifndef YY_NO_TOP_STATE
523 static int yy_top_state YY_PROTO(( void ));
524 #endif
526 #else
527 #define YY_NO_PUSH_STATE 1
528 #define YY_NO_POP_STATE 1
529 #define YY_NO_TOP_STATE 1
530 #endif
532 #ifdef YY_MALLOC_DECL
533 YY_MALLOC_DECL
534 #else
535 #if __STDC__
536 #ifndef __cplusplus
537 #include <stdlib.h>
538 #endif
539 #else
540 /* Just try to get by without declaring the routines. This will fail
541 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
542 * or sizeof(void*) != sizeof(int).
544 #endif
545 #endif
547 /* Amount of stuff to slurp up with each read. */
548 #ifndef YY_READ_BUF_SIZE
549 #define YY_READ_BUF_SIZE 8192
550 #endif
552 /* Copy whatever the last rule matched to the standard output. */
554 #ifndef ECHO
555 /* This used to be an fputs(), but since the string might contain NUL's,
556 * we now use fwrite().
558 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
559 #endif
561 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
562 * is returned in "result".
564 #ifndef YY_INPUT
565 #define YY_INPUT(buf,result,max_size) \
566 if ( yy_current_buffer->yy_is_interactive ) \
568 int c = '*', n; \
569 for ( n = 0; n < max_size && \
570 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
571 buf[n] = (char) c; \
572 if ( c == '\n' ) \
573 buf[n++] = (char) c; \
574 if ( c == EOF && ferror( yyin ) ) \
575 YY_FATAL_ERROR( "input in flex scanner failed" ); \
576 result = n; \
578 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
579 && ferror( yyin ) ) \
580 YY_FATAL_ERROR( "input in flex scanner failed" );
581 #endif
583 /* No semi-colon after return; correct usage is to write "yyterminate();" -
584 * we don't want an extra ';' after the "return" because that will cause
585 * some compilers to complain about unreachable statements.
587 #ifndef yyterminate
588 #define yyterminate() return YY_NULL
589 #endif
591 /* Number of entries by which start-condition stack grows. */
592 #ifndef YY_START_STACK_INCR
593 #define YY_START_STACK_INCR 25
594 #endif
596 /* Report a fatal error. */
597 #ifndef YY_FATAL_ERROR
598 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
599 #endif
601 /* Default declaration of generated scanner - a define so the user can
602 * easily add parameters.
604 #ifndef YY_DECL
605 #define YY_DECL int yylex YY_PROTO(( void ))
606 #endif
608 /* Code executed at the beginning of each rule, after yytext and yyleng
609 * have been set up.
611 #ifndef YY_USER_ACTION
612 #define YY_USER_ACTION
613 #endif
615 /* Code executed at the end of each rule. */
616 #ifndef YY_BREAK
617 #define YY_BREAK break;
618 #endif
620 #define YY_RULE_SETUP \
621 YY_USER_ACTION
623 YY_DECL
625 register yy_state_type yy_current_state;
626 register char *yy_cp, *yy_bp;
627 register int yy_act;
629 #line 53 "one_enum.flex"
632 #line 633 "enumlexer.cpp"
634 if ( yy_init )
636 yy_init = 0;
638 #ifdef YY_USER_INIT
639 YY_USER_INIT;
640 #endif
642 if ( ! yy_start )
643 yy_start = 1; /* first start state */
645 if ( ! yyin )
646 yyin = stdin;
648 if ( ! yyout )
649 yyout = stdout;
651 if ( ! yy_current_buffer )
652 yy_current_buffer =
653 yy_create_buffer( yyin, YY_BUF_SIZE );
655 yy_load_buffer_state();
658 while ( 1 ) /* loops until end-of-file is reached */
660 yy_cp = yy_c_buf_p;
662 /* Support of yytext. */
663 *yy_cp = yy_hold_char;
665 /* yy_bp points to the position in yy_ch_buf of the start of
666 * the current run.
668 yy_bp = yy_cp;
670 yy_current_state = yy_start;
671 yy_match:
674 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
675 if ( yy_accept[yy_current_state] )
677 yy_last_accepting_state = yy_current_state;
678 yy_last_accepting_cpos = yy_cp;
680 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
682 yy_current_state = (int) yy_def[yy_current_state];
683 if ( yy_current_state >= 70 )
684 yy_c = yy_meta[(unsigned int) yy_c];
686 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
687 ++yy_cp;
689 while ( yy_base[yy_current_state] != 92 );
691 yy_find_action:
692 yy_act = yy_accept[yy_current_state];
693 if ( yy_act == 0 )
694 { /* have to back up */
695 yy_cp = yy_last_accepting_cpos;
696 yy_current_state = yy_last_accepting_state;
697 yy_act = yy_accept[yy_current_state];
700 YY_DO_BEFORE_ACTION;
703 do_action: /* This label is used only to access EOF actions. */
706 switch ( yy_act )
707 { /* beginning of action switch */
708 case 0: /* must back up */
709 /* undo the effects of YY_DO_BEFORE_ACTION */
710 *yy_cp = yy_hold_char;
711 yy_cp = yy_last_accepting_cpos;
712 yy_current_state = yy_last_accepting_state;
713 goto yy_find_action;
715 case 1:
716 YY_RULE_SETUP
717 #line 55 "one_enum.flex"
718 /* consume whitespace */
719 YY_BREAK
720 case 2:
721 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
722 yy_c_buf_p = yy_cp -= 1;
723 YY_DO_BEFORE_ACTION; /* set up yytext again */
724 YY_RULE_SETUP
725 #line 56 "one_enum.flex"
726 /* consume C++ comments */
727 YY_BREAK
728 case 3:
729 YY_RULE_SETUP
730 #line 57 "one_enum.flex"
731 { register int c; /* consume C comments */
732 for ( ; ; ) {
733 while ( (c = yyinput()) != '*' && c != EOF )
734 ; /* eat up text of comment */
735 if ( c == '*' ) {
736 while ( (c = yyinput()) == '*' ) ;
737 if ( c == '/' )
738 break; /* found the end */
740 if ( c == EOF ) {
741 oecur->read_error("file ended w. unclosed C comment");
742 break;
746 YY_BREAK
747 case 4:
748 YY_RULE_SETUP
749 #line 73 "one_enum.flex"
750 { if(oecur->step==0) oecur->step++; else oecur->read_error("wrong location of 'typedef'"); }
751 YY_BREAK
752 case 5:
753 YY_RULE_SETUP
754 #line 74 "one_enum.flex"
755 { if(oecur->step==1) oecur->step++; else oecur->read_error("wrong location of 'enum'"); }
756 YY_BREAK
757 case 6:
758 YY_RULE_SETUP
759 #line 75 "one_enum.flex"
760 { if(oecur->step==2) oecur->step++; else oecur->read_error("wrong location of '{'"); }
761 YY_BREAK
762 case 7:
763 YY_RULE_SETUP
764 #line 76 "one_enum.flex"
765 { if(oecur->step==3) oecur->step++; else oecur->read_error("wrong location of '='"); }
766 YY_BREAK
767 case 8:
768 YY_RULE_SETUP
769 #line 77 "one_enum.flex"
770 { if(oecur->step==4) oecur->step++; else oecur->read_error("wrong location of 'CORE_CMD_OPS'"); }
771 YY_BREAK
772 case 9:
773 YY_RULE_SETUP
774 #line 78 "one_enum.flex"
775 { if(oecur->step==5) oecur->step++; else oecur->read_error("wrong location of 'MAX_CMD_OPS'"); }
776 YY_BREAK
777 case 10:
778 YY_RULE_SETUP
779 #line 79 "one_enum.flex"
780 { if(oecur->step==6) oecur->step++; else oecur->read_error("wrong location of '}'"); }
781 YY_BREAK
782 case 11:
783 YY_RULE_SETUP
784 #line 80 "one_enum.flex"
785 { if(oecur->step==7) oecur->step++; else oecur->read_error("wrong location of 'PLATFORM_OPCODES'"); }
786 YY_BREAK
787 case 12:
788 YY_RULE_SETUP
789 #line 81 "one_enum.flex"
790 { if(oecur->step==8) oecur->step++; else oecur->read_error("wrong location of ';'"); }
791 YY_BREAK
792 case 13:
793 YY_RULE_SETUP
794 #line 83 "one_enum.flex"
795 { if(oecur->ready_for_entry) oecur->read_error("bad comma location"); else oecur->ready_for_entry=true; }
796 YY_BREAK
797 case 14:
798 YY_RULE_SETUP
799 #line 85 "one_enum.flex"
800 { if(!oecur->ready_for_entry ||
801 (oecur->step==2 && !oecur->p_ops->empty()) ||
802 (oecur->step==4 && oecur->p_ops->empty())) oecur->read_error("Bad constituent");
803 else { oecur->p_ops->push_back(string(yytext));
804 oecur->ready_for_entry=false;
806 YY_BREAK
807 case 15:
808 YY_RULE_SETUP
809 #line 93 "one_enum.flex"
810 ECHO;
811 YY_BREAK
812 #line 813 "enumlexer.cpp"
813 case YY_STATE_EOF(INITIAL):
814 yyterminate();
816 case YY_END_OF_BUFFER:
818 /* Amount of text matched not including the EOB char. */
819 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
821 /* Undo the effects of YY_DO_BEFORE_ACTION. */
822 *yy_cp = yy_hold_char;
823 YY_RESTORE_YY_MORE_OFFSET
825 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
827 /* We're scanning a new file or input source. It's
828 * possible that this happened because the user
829 * just pointed yyin at a new source and called
830 * yylex(). If so, then we have to assure
831 * consistency between yy_current_buffer and our
832 * globals. Here is the right place to do so, because
833 * this is the first action (other than possibly a
834 * back-up) that will match for the new input source.
836 yy_n_chars = yy_current_buffer->yy_n_chars;
837 yy_current_buffer->yy_input_file = yyin;
838 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
841 /* Note that here we test for yy_c_buf_p "<=" to the position
842 * of the first EOB in the buffer, since yy_c_buf_p will
843 * already have been incremented past the NUL character
844 * (since all states make transitions on EOB to the
845 * end-of-buffer state). Contrast this with the test
846 * in input().
848 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
849 { /* This was really a NUL. */
850 yy_state_type yy_next_state;
852 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
854 yy_current_state = yy_get_previous_state();
856 /* Okay, we're now positioned to make the NUL
857 * transition. We couldn't have
858 * yy_get_previous_state() go ahead and do it
859 * for us because it doesn't know how to deal
860 * with the possibility of jamming (and we don't
861 * want to build jamming into it because then it
862 * will run more slowly).
865 yy_next_state = yy_try_NUL_trans( yy_current_state );
867 yy_bp = yytext_ptr + YY_MORE_ADJ;
869 if ( yy_next_state )
871 /* Consume the NUL. */
872 yy_cp = ++yy_c_buf_p;
873 yy_current_state = yy_next_state;
874 goto yy_match;
877 else
879 yy_cp = yy_c_buf_p;
880 goto yy_find_action;
884 else switch ( yy_get_next_buffer() )
886 case EOB_ACT_END_OF_FILE:
888 yy_did_buffer_switch_on_eof = 0;
890 if ( yywrap() )
892 /* Note: because we've taken care in
893 * yy_get_next_buffer() to have set up
894 * yytext, we can now set up
895 * yy_c_buf_p so that if some total
896 * hoser (like flex itself) wants to
897 * call the scanner after we return the
898 * YY_NULL, it'll still work - another
899 * YY_NULL will get returned.
901 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
903 yy_act = YY_STATE_EOF(YY_START);
904 goto do_action;
907 else
909 if ( ! yy_did_buffer_switch_on_eof )
910 YY_NEW_FILE;
912 break;
915 case EOB_ACT_CONTINUE_SCAN:
916 yy_c_buf_p =
917 yytext_ptr + yy_amount_of_matched_text;
919 yy_current_state = yy_get_previous_state();
921 yy_cp = yy_c_buf_p;
922 yy_bp = yytext_ptr + YY_MORE_ADJ;
923 goto yy_match;
925 case EOB_ACT_LAST_MATCH:
926 yy_c_buf_p =
927 &yy_current_buffer->yy_ch_buf[yy_n_chars];
929 yy_current_state = yy_get_previous_state();
931 yy_cp = yy_c_buf_p;
932 yy_bp = yytext_ptr + YY_MORE_ADJ;
933 goto yy_find_action;
935 break;
938 default:
939 YY_FATAL_ERROR(
940 "fatal flex scanner internal error--no action found" );
941 } /* end of action switch */
942 } /* end of scanning one token */
943 } /* end of yylex */
946 /* yy_get_next_buffer - try to read in a new buffer
948 * Returns a code representing an action:
949 * EOB_ACT_LAST_MATCH -
950 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
951 * EOB_ACT_END_OF_FILE - end of file
954 static int yy_get_next_buffer()
956 register char *dest = yy_current_buffer->yy_ch_buf;
957 register char *source = yytext_ptr;
958 register int number_to_move, i;
959 int ret_val;
961 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
962 YY_FATAL_ERROR(
963 "fatal flex scanner internal error--end of buffer missed" );
965 if ( yy_current_buffer->yy_fill_buffer == 0 )
966 { /* Don't try to fill the buffer, so this is an EOF. */
967 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
969 /* We matched a single character, the EOB, so
970 * treat this as a final EOF.
972 return EOB_ACT_END_OF_FILE;
975 else
977 /* We matched some text prior to the EOB, first
978 * process it.
980 return EOB_ACT_LAST_MATCH;
984 /* Try to read more data. */
986 /* First move last chars to start of buffer. */
987 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
989 for ( i = 0; i < number_to_move; ++i )
990 *(dest++) = *(source++);
992 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
993 /* don't do the read, it's not guaranteed to return an EOF,
994 * just force an EOF
996 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
998 else
1000 int num_to_read =
1001 yy_current_buffer->yy_buf_size - number_to_move - 1;
1003 while ( num_to_read <= 0 )
1004 { /* Not enough room in the buffer - grow it. */
1005 #ifdef YY_USES_REJECT
1006 YY_FATAL_ERROR(
1007 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1008 #else
1010 /* just a shorter name for the current buffer */
1011 YY_BUFFER_STATE b = yy_current_buffer;
1013 int yy_c_buf_p_offset =
1014 (int) (yy_c_buf_p - b->yy_ch_buf);
1016 if ( b->yy_is_our_buffer )
1018 int new_size = b->yy_buf_size * 2;
1020 if ( new_size <= 0 )
1021 b->yy_buf_size += b->yy_buf_size / 8;
1022 else
1023 b->yy_buf_size *= 2;
1025 b->yy_ch_buf = (char *)
1026 /* Include room in for 2 EOB chars. */
1027 yy_flex_realloc( (void *) b->yy_ch_buf,
1028 b->yy_buf_size + 2 );
1030 else
1031 /* Can't grow it, we don't own it. */
1032 b->yy_ch_buf = 0;
1034 if ( ! b->yy_ch_buf )
1035 YY_FATAL_ERROR(
1036 "fatal error - scanner input buffer overflow" );
1038 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1040 num_to_read = yy_current_buffer->yy_buf_size -
1041 number_to_move - 1;
1042 #endif
1045 if ( num_to_read > YY_READ_BUF_SIZE )
1046 num_to_read = YY_READ_BUF_SIZE;
1048 /* Read in more data. */
1049 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1050 yy_n_chars, num_to_read );
1052 yy_current_buffer->yy_n_chars = yy_n_chars;
1055 if ( yy_n_chars == 0 )
1057 if ( number_to_move == YY_MORE_ADJ )
1059 ret_val = EOB_ACT_END_OF_FILE;
1060 yyrestart( yyin );
1063 else
1065 ret_val = EOB_ACT_LAST_MATCH;
1066 yy_current_buffer->yy_buffer_status =
1067 YY_BUFFER_EOF_PENDING;
1071 else
1072 ret_val = EOB_ACT_CONTINUE_SCAN;
1074 yy_n_chars += number_to_move;
1075 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1076 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1078 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1080 return ret_val;
1084 /* yy_get_previous_state - get the state just before the EOB char was reached */
1086 static yy_state_type yy_get_previous_state()
1088 register yy_state_type yy_current_state;
1089 register char *yy_cp;
1091 yy_current_state = yy_start;
1093 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1095 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1096 if ( yy_accept[yy_current_state] )
1098 yy_last_accepting_state = yy_current_state;
1099 yy_last_accepting_cpos = yy_cp;
1101 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1103 yy_current_state = (int) yy_def[yy_current_state];
1104 if ( yy_current_state >= 70 )
1105 yy_c = yy_meta[(unsigned int) yy_c];
1107 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1110 return yy_current_state;
1114 /* yy_try_NUL_trans - try to make a transition on the NUL character
1116 * synopsis
1117 * next_state = yy_try_NUL_trans( current_state );
1120 #ifdef YY_USE_PROTOS
1121 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1122 #else
1123 static yy_state_type yy_try_NUL_trans( yy_current_state )
1124 yy_state_type yy_current_state;
1125 #endif
1127 register int yy_is_jam;
1128 register char *yy_cp = yy_c_buf_p;
1130 register YY_CHAR yy_c = 1;
1131 if ( yy_accept[yy_current_state] )
1133 yy_last_accepting_state = yy_current_state;
1134 yy_last_accepting_cpos = yy_cp;
1136 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1138 yy_current_state = (int) yy_def[yy_current_state];
1139 if ( yy_current_state >= 70 )
1140 yy_c = yy_meta[(unsigned int) yy_c];
1142 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1143 yy_is_jam = (yy_current_state == 69);
1145 return yy_is_jam ? 0 : yy_current_state;
1149 #ifndef YY_NO_UNPUT
1150 #ifdef YY_USE_PROTOS
1151 static void yyunput( int c, register char *yy_bp )
1152 #else
1153 static void yyunput( c, yy_bp )
1154 int c;
1155 register char *yy_bp;
1156 #endif
1158 register char *yy_cp = yy_c_buf_p;
1160 /* undo effects of setting up yytext */
1161 *yy_cp = yy_hold_char;
1163 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1164 { /* need to shift things up to make room */
1165 /* +2 for EOB chars. */
1166 register int number_to_move = yy_n_chars + 2;
1167 register char *dest = &yy_current_buffer->yy_ch_buf[
1168 yy_current_buffer->yy_buf_size + 2];
1169 register char *source =
1170 &yy_current_buffer->yy_ch_buf[number_to_move];
1172 while ( source > yy_current_buffer->yy_ch_buf )
1173 *--dest = *--source;
1175 yy_cp += (int) (dest - source);
1176 yy_bp += (int) (dest - source);
1177 yy_current_buffer->yy_n_chars =
1178 yy_n_chars = yy_current_buffer->yy_buf_size;
1180 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1181 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1184 *--yy_cp = (char) c;
1187 yytext_ptr = yy_bp;
1188 yy_hold_char = *yy_cp;
1189 yy_c_buf_p = yy_cp;
1191 #endif /* ifndef YY_NO_UNPUT */
1194 #ifdef __cplusplus
1195 static int yyinput()
1196 #else
1197 static int input()
1198 #endif
1200 int c;
1202 *yy_c_buf_p = yy_hold_char;
1204 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1206 /* yy_c_buf_p now points to the character we want to return.
1207 * If this occurs *before* the EOB characters, then it's a
1208 * valid NUL; if not, then we've hit the end of the buffer.
1210 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1211 /* This was really a NUL. */
1212 *yy_c_buf_p = '\0';
1214 else
1215 { /* need more input */
1216 int offset = yy_c_buf_p - yytext_ptr;
1217 ++yy_c_buf_p;
1219 switch ( yy_get_next_buffer() )
1221 case EOB_ACT_LAST_MATCH:
1222 /* This happens because yy_g_n_b()
1223 * sees that we've accumulated a
1224 * token and flags that we need to
1225 * try matching the token before
1226 * proceeding. But for input(),
1227 * there's no matching to consider.
1228 * So convert the EOB_ACT_LAST_MATCH
1229 * to EOB_ACT_END_OF_FILE.
1232 /* Reset buffer status. */
1233 yyrestart( yyin );
1235 /* fall through */
1237 case EOB_ACT_END_OF_FILE:
1239 if ( yywrap() )
1240 return EOF;
1242 if ( ! yy_did_buffer_switch_on_eof )
1243 YY_NEW_FILE;
1244 #ifdef __cplusplus
1245 return yyinput();
1246 #else
1247 return input();
1248 #endif
1251 case EOB_ACT_CONTINUE_SCAN:
1252 yy_c_buf_p = yytext_ptr + offset;
1253 break;
1258 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1259 *yy_c_buf_p = '\0'; /* preserve yytext */
1260 yy_hold_char = *++yy_c_buf_p;
1263 return c;
1267 #ifdef YY_USE_PROTOS
1268 void yyrestart( FILE *input_file )
1269 #else
1270 void yyrestart( input_file )
1271 FILE *input_file;
1272 #endif
1274 if ( ! yy_current_buffer )
1275 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1277 yy_init_buffer( yy_current_buffer, input_file );
1278 yy_load_buffer_state();
1282 #ifdef YY_USE_PROTOS
1283 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1284 #else
1285 void yy_switch_to_buffer( new_buffer )
1286 YY_BUFFER_STATE new_buffer;
1287 #endif
1289 if ( yy_current_buffer == new_buffer )
1290 return;
1292 if ( yy_current_buffer )
1294 /* Flush out information for old buffer. */
1295 *yy_c_buf_p = yy_hold_char;
1296 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1297 yy_current_buffer->yy_n_chars = yy_n_chars;
1300 yy_current_buffer = new_buffer;
1301 yy_load_buffer_state();
1303 /* We don't actually know whether we did this switch during
1304 * EOF (yywrap()) processing, but the only time this flag
1305 * is looked at is after yywrap() is called, so it's safe
1306 * to go ahead and always set it.
1308 yy_did_buffer_switch_on_eof = 1;
1312 #ifdef YY_USE_PROTOS
1313 void yy_load_buffer_state( void )
1314 #else
1315 void yy_load_buffer_state()
1316 #endif
1318 yy_n_chars = yy_current_buffer->yy_n_chars;
1319 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1320 yyin = yy_current_buffer->yy_input_file;
1321 yy_hold_char = *yy_c_buf_p;
1325 #ifdef YY_USE_PROTOS
1326 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1327 #else
1328 YY_BUFFER_STATE yy_create_buffer( file, size )
1329 FILE *file;
1330 int size;
1331 #endif
1333 YY_BUFFER_STATE b;
1335 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1336 if ( ! b )
1337 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1339 b->yy_buf_size = size;
1341 /* yy_ch_buf has to be 2 characters longer than the size given because
1342 * we need to put in 2 end-of-buffer characters.
1344 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1345 if ( ! b->yy_ch_buf )
1346 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1348 b->yy_is_our_buffer = 1;
1350 yy_init_buffer( b, file );
1352 return b;
1356 #ifdef YY_USE_PROTOS
1357 void yy_delete_buffer( YY_BUFFER_STATE b )
1358 #else
1359 void yy_delete_buffer( b )
1360 YY_BUFFER_STATE b;
1361 #endif
1363 if ( ! b )
1364 return;
1366 if ( b == yy_current_buffer )
1367 yy_current_buffer = (YY_BUFFER_STATE) 0;
1369 if ( b->yy_is_our_buffer )
1370 yy_flex_free( (void *) b->yy_ch_buf );
1372 yy_flex_free( (void *) b );
1376 #ifndef YY_ALWAYS_INTERACTIVE
1377 #ifndef YY_NEVER_INTERACTIVE
1378 extern int isatty YY_PROTO(( int ));
1379 #endif
1380 #endif
1382 #ifdef YY_USE_PROTOS
1383 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1384 #else
1385 void yy_init_buffer( b, file )
1386 YY_BUFFER_STATE b;
1387 FILE *file;
1388 #endif
1392 yy_flush_buffer( b );
1394 b->yy_input_file = file;
1395 b->yy_fill_buffer = 1;
1397 #if YY_ALWAYS_INTERACTIVE
1398 b->yy_is_interactive = 1;
1399 #else
1400 #if YY_NEVER_INTERACTIVE
1401 b->yy_is_interactive = 0;
1402 #else
1403 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1404 #endif
1405 #endif
1409 #ifdef YY_USE_PROTOS
1410 void yy_flush_buffer( YY_BUFFER_STATE b )
1411 #else
1412 void yy_flush_buffer( b )
1413 YY_BUFFER_STATE b;
1414 #endif
1417 if ( ! b )
1418 return;
1420 b->yy_n_chars = 0;
1422 /* We always need two end-of-buffer characters. The first causes
1423 * a transition to the end-of-buffer state. The second causes
1424 * a jam in that state.
1426 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1427 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1429 b->yy_buf_pos = &b->yy_ch_buf[0];
1431 b->yy_at_bol = 1;
1432 b->yy_buffer_status = YY_BUFFER_NEW;
1434 if ( b == yy_current_buffer )
1435 yy_load_buffer_state();
1439 #ifndef YY_NO_SCAN_BUFFER
1440 #ifdef YY_USE_PROTOS
1441 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1442 #else
1443 YY_BUFFER_STATE yy_scan_buffer( base, size )
1444 char *base;
1445 yy_size_t size;
1446 #endif
1448 YY_BUFFER_STATE b;
1450 if ( size < 2 ||
1451 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1452 base[size-1] != YY_END_OF_BUFFER_CHAR )
1453 /* They forgot to leave room for the EOB's. */
1454 return 0;
1456 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1457 if ( ! b )
1458 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1460 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1461 b->yy_buf_pos = b->yy_ch_buf = base;
1462 b->yy_is_our_buffer = 0;
1463 b->yy_input_file = 0;
1464 b->yy_n_chars = b->yy_buf_size;
1465 b->yy_is_interactive = 0;
1466 b->yy_at_bol = 1;
1467 b->yy_fill_buffer = 0;
1468 b->yy_buffer_status = YY_BUFFER_NEW;
1470 yy_switch_to_buffer( b );
1472 return b;
1474 #endif
1477 #ifndef YY_NO_SCAN_STRING
1478 #ifdef YY_USE_PROTOS
1479 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1480 #else
1481 YY_BUFFER_STATE yy_scan_string( yy_str )
1482 yyconst char *yy_str;
1483 #endif
1485 int len;
1486 for ( len = 0; yy_str[len]; ++len )
1489 return yy_scan_bytes( yy_str, len );
1491 #endif
1494 #ifndef YY_NO_SCAN_BYTES
1495 #ifdef YY_USE_PROTOS
1496 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1497 #else
1498 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1499 yyconst char *bytes;
1500 int len;
1501 #endif
1503 YY_BUFFER_STATE b;
1504 char *buf;
1505 yy_size_t n;
1506 int i;
1508 /* Get memory for full buffer, including space for trailing EOB's. */
1509 n = len + 2;
1510 buf = (char *) yy_flex_alloc( n );
1511 if ( ! buf )
1512 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1514 for ( i = 0; i < len; ++i )
1515 buf[i] = bytes[i];
1517 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1519 b = yy_scan_buffer( buf, n );
1520 if ( ! b )
1521 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1523 /* It's okay to grow etc. this buffer, and we should throw it
1524 * away when we're done.
1526 b->yy_is_our_buffer = 1;
1528 return b;
1530 #endif
1533 #ifndef YY_NO_PUSH_STATE
1534 #ifdef YY_USE_PROTOS
1535 static void yy_push_state( int new_state )
1536 #else
1537 static void yy_push_state( new_state )
1538 int new_state;
1539 #endif
1541 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1543 yy_size_t new_size;
1545 yy_start_stack_depth += YY_START_STACK_INCR;
1546 new_size = yy_start_stack_depth * sizeof( int );
1548 if ( ! yy_start_stack )
1549 yy_start_stack = (int *) yy_flex_alloc( new_size );
1551 else
1552 yy_start_stack = (int *) yy_flex_realloc(
1553 (void *) yy_start_stack, new_size );
1555 if ( ! yy_start_stack )
1556 YY_FATAL_ERROR(
1557 "out of memory expanding start-condition stack" );
1560 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1562 BEGIN(new_state);
1564 #endif
1567 #ifndef YY_NO_POP_STATE
1568 static void yy_pop_state()
1570 if ( --yy_start_stack_ptr < 0 )
1571 YY_FATAL_ERROR( "start-condition stack underflow" );
1573 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1575 #endif
1578 #ifndef YY_NO_TOP_STATE
1579 static int yy_top_state()
1581 return yy_start_stack[yy_start_stack_ptr - 1];
1583 #endif
1585 #ifndef YY_EXIT_FAILURE
1586 #define YY_EXIT_FAILURE 2
1587 #endif
1589 #ifdef YY_USE_PROTOS
1590 static void yy_fatal_error( yyconst char msg[] )
1591 #else
1592 static void yy_fatal_error( msg )
1593 char msg[];
1594 #endif
1596 (void) fprintf( stderr, "%s\n", msg );
1597 exit( YY_EXIT_FAILURE );
1602 /* Redefine yyless() so it works in section 3 code. */
1604 #undef yyless
1605 #define yyless(n) \
1606 do \
1608 /* Undo effects of setting up yytext. */ \
1609 yytext[yyleng] = yy_hold_char; \
1610 yy_c_buf_p = yytext + n; \
1611 yy_hold_char = *yy_c_buf_p; \
1612 *yy_c_buf_p = '\0'; \
1613 yyleng = n; \
1615 while ( 0 )
1618 /* Internal utility routines. */
1620 #ifndef yytext_ptr
1621 #ifdef YY_USE_PROTOS
1622 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1623 #else
1624 static void yy_flex_strncpy( s1, s2, n )
1625 char *s1;
1626 yyconst char *s2;
1627 int n;
1628 #endif
1630 register int i;
1631 for ( i = 0; i < n; ++i )
1632 s1[i] = s2[i];
1634 #endif
1636 #ifdef YY_NEED_STRLEN
1637 #ifdef YY_USE_PROTOS
1638 static int yy_flex_strlen( yyconst char *s )
1639 #else
1640 static int yy_flex_strlen( s )
1641 yyconst char *s;
1642 #endif
1644 register int n;
1645 for ( n = 0; s[n]; ++n )
1648 return n;
1650 #endif
1653 #ifdef YY_USE_PROTOS
1654 static void *yy_flex_alloc( yy_size_t size )
1655 #else
1656 static void *yy_flex_alloc( size )
1657 yy_size_t size;
1658 #endif
1660 return (void *) malloc( size );
1663 #ifdef YY_USE_PROTOS
1664 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1665 #else
1666 static void *yy_flex_realloc( ptr, size )
1667 void *ptr;
1668 yy_size_t size;
1669 #endif
1671 /* The cast to (char *) in the following accommodates both
1672 * implementations that use char* generic pointers, and those
1673 * that use void* generic pointers. It works with the latter
1674 * because both ANSI C and C++ allow castless assignment from
1675 * any pointer type to void*, and deal with argument conversions
1676 * as though doing an assignment.
1678 return (void *) realloc( (char *) ptr, size );
1681 #ifdef YY_USE_PROTOS
1682 static void yy_flex_free( void *ptr )
1683 #else
1684 static void yy_flex_free( ptr )
1685 void *ptr;
1686 #endif
1688 free( ptr );
1691 #if YY_MAIN
1692 int main()
1694 yylex();
1695 return 0;
1697 #endif
1698 #line 93 "one_enum.flex"
1701 list<string>* read_enum(istream* in, ostream* out=NULL) {
1702 string dump;
1703 if(out==NULL) out=new ostringstream();
1704 EnumLexer lex(in,out); oecur=&lex;
1705 return lex.tokenize();
1707 list<string>* read_enum(string in) {
1708 return read_enum(new istringstream(in));