tying to deal with a flex problem
[proto.git] / src / compiler / lexer.cpp
blob7f84556af661e6bb6a0c436c778f18ad62f3bbb6
1 #line 2 "lexer.cpp"
2 /* A lexical scanner generated by flex */
4 /* Scanner skeleton version:
5 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
6 */
8 #define FLEX_SCANNER
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 5
14 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
15 #ifdef c_plusplus
16 #ifndef __cplusplus
17 #define __cplusplus
18 #endif
19 #endif
22 #ifdef __cplusplus
24 #include <stdlib.h>
25 class istream;
26 #include <unistd.h>
28 /* Use prototypes in function declarations. */
29 #define YY_USE_PROTOS
31 /* The "const" storage-class-modifier is valid. */
32 #define YY_USE_CONST
34 #else /* ! __cplusplus */
36 #if __STDC__
38 #define YY_USE_PROTOS
39 #define YY_USE_CONST
41 #endif /* __STDC__ */
42 #endif /* ! __cplusplus */
44 #ifdef __TURBOC__
45 #pragma warn -rch
46 #pragma warn -use
47 #include <io.h>
48 #include <stdlib.h>
49 #define YY_USE_CONST
50 #define YY_USE_PROTOS
51 #endif
53 #ifdef YY_USE_CONST
54 #define yyconst const
55 #else
56 #define yyconst
57 #endif
60 #ifdef YY_USE_PROTOS
61 #define YY_PROTO(proto) proto
62 #else
63 #define YY_PROTO(proto) ()
64 #endif
66 /* Returned upon end-of-file. */
67 #define YY_NULL 0
69 /* Promotes a possibly negative, possibly signed char to an unsigned
70 * integer for use as an array index. If the signed char is negative,
71 * we want to instead treat it as an 8-bit unsigned char, hence the
72 * double cast.
74 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
76 /* Enter a start condition. This macro really ought to take a parameter,
77 * but we do it the disgusting crufty way forced on us by the ()-less
78 * definition of BEGIN.
80 #define BEGIN yy_start = 1 + 2 *
82 /* Translate the current start state into a value that can be later handed
83 * to BEGIN to return to the state. The YYSTATE alias is for lex
84 * compatibility.
86 #define YY_START ((yy_start - 1) / 2)
87 #define YYSTATE YY_START
89 /* Action number for EOF rule of a given start state. */
90 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
92 /* Special action meaning "start processing a new file". */
93 #define YY_NEW_FILE yyrestart( yyin )
95 #define YY_END_OF_BUFFER_CHAR 0
97 /* Size of default input buffer. */
98 #define YY_BUF_SIZE 16384
100 typedef struct yy_buffer_state *YY_BUFFER_STATE;
102 extern int yyleng;
104 #define EOB_ACT_CONTINUE_SCAN 0
105 #define EOB_ACT_END_OF_FILE 1
106 #define EOB_ACT_LAST_MATCH 2
108 /* The funky do-while in the following #define is used to turn the definition
109 * int a single C statement (which needs a semi-colon terminator). This
110 * avoids problems with code like:
112 * if ( condition_holds )
113 * yyless( 5 );
114 * else
115 * do_something_else();
117 * Prior to using the do-while the compiler would get upset at the
118 * "else" because it interpreted the "if" statement as being all
119 * done when it reached the ';' after the yyless() call.
122 /* Return all but the first 'n' matched characters back to the input stream. */
124 #define yyless(n) \
125 do \
127 /* Undo effects of setting up yytext. */ \
128 *yy_cp = yy_hold_char; \
129 YY_RESTORE_YY_MORE_OFFSET \
130 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
131 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
133 while ( 0 )
135 #define unput(c) yyunput( c, yytext_ptr )
137 /* The following is because we cannot portably get our hands on size_t
138 * (without autoconf's help, which isn't available because we want
139 * flex-generated scanners to compile on their own).
141 typedef unsigned int yy_size_t;
144 struct yy_buffer_state
146 istream* yy_input_file;
148 char *yy_ch_buf; /* input buffer */
149 char *yy_buf_pos; /* current position in input buffer */
151 /* Size of input buffer in bytes, not including room for EOB
152 * characters.
154 yy_size_t yy_buf_size;
156 /* Number of characters read into yy_ch_buf, not including EOB
157 * characters.
159 int yy_n_chars;
161 /* Whether we "own" the buffer - i.e., we know we created it,
162 * and can realloc() it to grow it, and should free() it to
163 * delete it.
165 int yy_is_our_buffer;
167 /* Whether this is an "interactive" input source; if so, and
168 * if we're using stdio for input, then we want to use getc()
169 * instead of fread(), to make sure we stop fetching input after
170 * each newline.
172 int yy_is_interactive;
174 /* Whether we're considered to be at the beginning of a line.
175 * If so, '^' rules will be active on the next match, otherwise
176 * not.
178 int yy_at_bol;
180 /* Whether to try to fill the input buffer when we reach the
181 * end of it.
183 int yy_fill_buffer;
185 int yy_buffer_status;
186 #define YY_BUFFER_NEW 0
187 #define YY_BUFFER_NORMAL 1
188 /* When an EOF's been seen but there's still some text to process
189 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
190 * shouldn't try reading from the input source any more. We might
191 * still have a bunch of tokens to match, though, because of
192 * possible backing-up.
194 * When we actually see the EOF, we change the status to "new"
195 * (via yyrestart()), so that the user can continue scanning by
196 * just pointing yyin at a new input file.
198 #define YY_BUFFER_EOF_PENDING 2
202 /* We provide macros for accessing buffer states in case in the
203 * future we want to put the buffer states in a more general
204 * "scanner state".
206 #define YY_CURRENT_BUFFER yy_current_buffer
210 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
211 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
212 static void yy_flex_free YY_PROTO(( void * ));
214 #define yy_new_buffer yy_create_buffer
216 #define yy_set_interactive(is_interactive) \
218 if ( ! yy_current_buffer ) \
219 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
220 yy_current_buffer->yy_is_interactive = is_interactive; \
223 #define yy_set_bol(at_bol) \
225 if ( ! yy_current_buffer ) \
226 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
227 yy_current_buffer->yy_at_bol = at_bol; \
230 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
233 #define YY_USES_REJECT
234 typedef unsigned char YY_CHAR;
235 #define yytext_ptr yytext
236 #define YY_INTERACTIVE
238 #include <FlexLexer.h>
239 int yyFlexLexer::yylex()
241 LexerError( "yyFlexLexer::yylex invoked but %option yyclass used" );
242 return 0;
245 #define YY_DECL int SExprLexer::yylex()
248 /* Done after the current pattern has been matched and before the
249 * corresponding action - sets up yytext.
251 #define YY_DO_BEFORE_ACTION \
252 yytext_ptr = yy_bp; \
253 yyleng = (int) (yy_cp - yy_bp); \
254 yy_hold_char = *yy_cp; \
255 *yy_cp = '\0'; \
256 yy_c_buf_p = yy_cp;
258 #define YY_NUM_RULES 14
259 #define YY_END_OF_BUFFER 15
260 static yyconst short int yy_acclist[62] =
261 { 0,
262 15, 13, 14, 1, 14, 12, 13, 14, 6, 13,
263 14, 3, 13, 14, 4, 13, 14, 11, 13, 14,
264 7, 11, 13, 14, 11, 13, 14, 11, 13, 14,
265 9, 11, 14, 13, 14, 11, 14, 5, 13, 14,
266 12, 14, 1, 11, 8, 11, 9, 11, 10, 11,
267 9, 11, 11, 2, 11, 9, 11, 9, 11, 10,
271 static yyconst short int yy_accept[35] =
272 { 0,
273 1, 1, 1, 2, 4, 6, 9, 12, 15, 18,
274 21, 25, 28, 31, 34, 36, 38, 41, 43, 44,
275 45, 46, 47, 49, 51, 53, 54, 54, 55, 56,
276 58, 60, 62, 62
279 static yyconst int yy_ec[256] =
280 { 0,
281 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
282 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
283 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
284 1, 2, 4, 4, 4, 4, 4, 4, 5, 6,
285 7, 8, 8, 9, 10, 11, 8, 12, 12, 12,
286 12, 12, 12, 12, 12, 12, 12, 4, 13, 8,
287 8, 8, 8, 14, 15, 15, 15, 15, 15, 15,
288 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
289 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
290 4, 4, 4, 4, 8, 16, 15, 15, 15, 15,
292 17, 15, 15, 15, 15, 15, 15, 15, 15, 15,
293 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
294 15, 15, 18, 4, 18, 4, 1, 1, 1, 1,
295 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
296 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
297 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
298 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
299 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
300 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
301 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
303 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
304 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
305 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
306 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
307 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
308 1, 1, 1, 1, 1
311 static yyconst int yy_meta[19] =
312 { 0,
313 1, 1, 1, 1, 1, 1, 1, 2, 2, 2,
314 2, 2, 1, 1, 2, 1, 2, 1
317 static yyconst short int yy_base[36] =
318 { 0,
319 0, 0, 43, 44, 17, 44, 44, 44, 44, 0,
320 28, 10, 29, 12, 37, 0, 44, 44, 22, 0,
321 44, 27, 0, 14, 15, 26, 34, 44, 24, 0,
322 23, 18, 44, 26, 32
325 static yyconst short int yy_def[36] =
326 { 0,
327 33, 1, 33, 33, 33, 33, 33, 33, 33, 34,
328 34, 34, 34, 12, 35, 34, 33, 33, 33, 34,
329 33, 34, 14, 34, 34, 34, 35, 33, 34, 25,
330 34, 34, 0, 33, 33
333 static yyconst short int yy_nxt[63] =
334 { 0,
335 4, 5, 5, 6, 7, 8, 9, 10, 11, 12,
336 13, 14, 15, 4, 16, 17, 16, 18, 19, 19,
337 22, 23, 25, 19, 19, 24, 30, 20, 26, 32,
338 29, 26, 27, 27, 31, 32, 28, 31, 24, 28,
339 24, 21, 33, 3, 33, 33, 33, 33, 33, 33,
340 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
341 33, 33
344 static yyconst short int yy_chk[63] =
345 { 0,
346 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
347 1, 1, 1, 1, 1, 1, 1, 1, 5, 5,
348 12, 12, 14, 19, 19, 24, 25, 34, 14, 32,
349 24, 25, 35, 35, 31, 29, 27, 26, 22, 15,
350 13, 11, 3, 33, 33, 33, 33, 33, 33, 33,
351 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
352 33, 33
355 #define REJECT \
357 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
358 yy_cp = yy_full_match; /* restore poss. backed-over text */ \
359 ++yy_lp; \
360 goto find_rule; \
362 #define yymore() yymore_used_but_not_detected
363 #define YY_MORE_ADJ 0
364 #define YY_RESTORE_YY_MORE_OFFSET
365 #line 1 "proto_syntax.flex"
366 #define INITIAL 0
367 /* a flex++ scanner for Proto
368 Copyright (C) 2005-2008, Jonathan Bachrach, Jacob Beal, and contributors
369 listed in the AUTHORS file in the MIT Proto distribution's top directory.
371 This file is part of MIT Proto, and is distributed under the terms of
372 the GNU General Public License, with a linking exception, as described
373 in the file LICENSE in the MIT Proto distribution's top directory.
375 Used: alphanumeric, *+-./<=>?_
376 Special: ;'(),`@
377 Reserved: !"#$%&:[\]^{|}~
379 #line 22 "proto_syntax.flex"
380 #define YY_BREAK { if(error) return 1; } break;
382 #include "sexpr.h"
383 #include "utils.h"
385 //int yywrap() { return 1; }
387 class SExprLexer : public yyFlexLexer {
388 SE_List* base; // the implicit wrapping "all" for compilation
389 stack<SE_List*> enclosure; // what SExprs enclose the current parse?
390 stack<bool> wraps; // are these SExprs normal or character macro wrappers?
391 bool error;
392 string name; // name of code source (e.g. file, "command-line")
394 void compile_error(Attribute* context,string msg) {
395 *cperr << context->to_str() << ": " << msg << endl;
396 error=true;
399 public:
400 SExprLexer(string name, istream* in=0, ostream* out=0) : yyFlexLexer(in,out) {
401 error = false; this->name=name;
402 base = new SE_List(); base->add(new SE_Symbol("ALL"));
403 enclosure.push(base); wraps.push(false);
406 virtual ~SExprLexer() {} // nothing to clean up: base becomes a problem of others
408 // returns NULL on error
409 SExpr* tokenize() {
410 yylex();
411 if(enclosure.top()!=base) {
412 compile_error(enclosure.top()->attributes["CONTEXT"],"Missing right parenthesis");
414 if(error) { delete base; return NULL;
415 } else if(base->len()==2) { return base->children[1]; // single SEXpr
416 } else { return base; }
419 protected:
420 Context* context() { return new Context(name,lineno()); }
422 // start a new sexpr, contained within the current context
423 void start_compound_sexpr() {
424 SE_List *e = new SE_List(); e->attributes["CONTEXT"]=context();
425 enclosure.top()->add(e);
426 enclosure.push(e); wraps.push(false);
429 void end_compound_sexpr() {
430 if(wraps.top() && enclosure.top()->children.size()<=1) {
431 compile_error(enclosure.top()->attributes["CONTEXT"],
432 "Wrapper macro " + enclosure.top()->op()->to_str() +
433 " is not applied to anything");
434 } else if(enclosure.top()==base) {
435 compile_error(context(),"Too many right parentheses");
436 } else {
437 enclosure.pop(); wraps.pop();
438 if(wraps.top()) { // if the next layer is a macro wrapper, finish it too
439 end_compound_sexpr();
444 // single character macros like ' create wrappers around the next SExpr
445 void wrap_next_sexpr(SE_Symbol* symbol) {
446 symbol->attributes["CONTEXT"]=context();
447 SE_List* s = new SE_List();
448 s->add(symbol); enclosure.top()->add(s);
449 enclosure.push(s); wraps.push(true);
452 void add_sexpr(SExpr* s) {
453 s->attributes["CONTEXT"]=context();
454 enclosure.top()->add(s);
455 if(wraps.top()) { end_compound_sexpr(); }
458 int yylex(); // prototype for lexing function
461 #line 462 "lexer.cpp"
463 /* Macros after this point can all be overridden by user definitions in
464 * section 1.
467 #ifndef YY_SKIP_YYWRAP
468 #ifdef __cplusplus
469 extern "C" int yywrap YY_PROTO(( void ));
470 #else
471 extern int yywrap YY_PROTO(( void ));
472 #endif
473 #endif
476 #ifndef yytext_ptr
477 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
478 #endif
480 #ifdef YY_NEED_STRLEN
481 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
482 #endif
484 #ifndef YY_NO_INPUT
485 #endif
487 #if YY_STACK_USED
488 static int yy_start_stack_ptr = 0;
489 static int yy_start_stack_depth = 0;
490 static int *yy_start_stack = 0;
491 #ifndef YY_NO_PUSH_STATE
492 static void yy_push_state YY_PROTO(( int new_state ));
493 #endif
494 #ifndef YY_NO_POP_STATE
495 static void yy_pop_state YY_PROTO(( void ));
496 #endif
497 #ifndef YY_NO_TOP_STATE
498 static int yy_top_state YY_PROTO(( void ));
499 #endif
501 #else
502 #define YY_NO_PUSH_STATE 1
503 #define YY_NO_POP_STATE 1
504 #define YY_NO_TOP_STATE 1
505 #endif
507 #ifdef YY_MALLOC_DECL
508 YY_MALLOC_DECL
509 #else
510 #if __STDC__
511 #ifndef __cplusplus
512 #include <stdlib.h>
513 #endif
514 #else
515 /* Just try to get by without declaring the routines. This will fail
516 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
517 * or sizeof(void*) != sizeof(int).
519 #endif
520 #endif
522 /* Amount of stuff to slurp up with each read. */
523 #ifndef YY_READ_BUF_SIZE
524 #define YY_READ_BUF_SIZE 8192
525 #endif
527 /* Copy whatever the last rule matched to the standard output. */
529 #ifndef ECHO
530 #define ECHO LexerOutput( yytext, yyleng )
531 #endif
533 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
534 * is returned in "result".
536 #ifndef YY_INPUT
537 #define YY_INPUT(buf,result,max_size) \
538 if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
539 YY_FATAL_ERROR( "input in flex scanner failed" );
540 #endif
542 /* No semi-colon after return; correct usage is to write "yyterminate();" -
543 * we don't want an extra ';' after the "return" because that will cause
544 * some compilers to complain about unreachable statements.
546 #ifndef yyterminate
547 #define yyterminate() return YY_NULL
548 #endif
550 /* Number of entries by which start-condition stack grows. */
551 #ifndef YY_START_STACK_INCR
552 #define YY_START_STACK_INCR 25
553 #endif
555 /* Report a fatal error. */
556 #ifndef YY_FATAL_ERROR
557 #define YY_FATAL_ERROR(msg) LexerError( msg )
558 #endif
560 /* Default declaration of generated scanner - a define so the user can
561 * easily add parameters.
563 #ifndef YY_DECL
564 #define YY_DECL int yyFlexLexer::yylex()
565 #endif
567 /* Code executed at the beginning of each rule, after yytext and yyleng
568 * have been set up.
570 #ifndef YY_USER_ACTION
571 #define YY_USER_ACTION
572 #endif
574 /* Code executed at the end of each rule. */
575 #ifndef YY_BREAK
576 #define YY_BREAK break;
577 #endif
579 #define YY_RULE_SETUP \
580 YY_USER_ACTION
582 YY_DECL
584 register yy_state_type yy_current_state;
585 register char *yy_cp, *yy_bp;
586 register int yy_act;
588 #line 106 "proto_syntax.flex"
591 #line 592 "lexer.cpp"
593 if ( yy_init )
595 yy_init = 0;
597 #ifdef YY_USER_INIT
598 YY_USER_INIT;
599 #endif
601 if ( ! yy_start )
602 yy_start = 1; /* first start state */
604 if ( ! yyin )
605 yyin = &cin;
607 if ( ! yyout )
608 yyout = &cout;
610 if ( ! yy_current_buffer )
611 yy_current_buffer =
612 yy_create_buffer( yyin, YY_BUF_SIZE );
614 yy_load_buffer_state();
617 while ( 1 ) /* loops until end-of-file is reached */
619 yy_cp = yy_c_buf_p;
621 /* Support of yytext. */
622 *yy_cp = yy_hold_char;
624 /* yy_bp points to the position in yy_ch_buf of the start of
625 * the current run.
627 yy_bp = yy_cp;
629 yy_current_state = yy_start;
630 yy_state_ptr = yy_state_buf;
631 *yy_state_ptr++ = yy_current_state;
632 yy_match:
635 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
636 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
638 yy_current_state = (int) yy_def[yy_current_state];
639 if ( yy_current_state >= 34 )
640 yy_c = yy_meta[(unsigned int) yy_c];
642 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
643 *yy_state_ptr++ = yy_current_state;
644 ++yy_cp;
646 while ( yy_base[yy_current_state] != 44 );
648 yy_find_action:
649 yy_current_state = *--yy_state_ptr;
650 yy_lp = yy_accept[yy_current_state];
651 find_rule: /* we branch to this label when backing up */
652 for ( ; ; ) /* until we find what rule we matched */
654 if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
656 yy_act = yy_acclist[yy_lp];
658 yy_full_match = yy_cp;
659 break;
662 --yy_cp;
663 yy_current_state = *--yy_state_ptr;
664 yy_lp = yy_accept[yy_current_state];
667 YY_DO_BEFORE_ACTION;
669 if ( yy_act != YY_END_OF_BUFFER )
671 int yyl;
672 for ( yyl = 0; yyl < yyleng; ++yyl )
673 if ( yytext[yyl] == '\n' )
674 ++yylineno;
677 do_action: /* This label is used only to access EOF actions. */
680 switch ( yy_act )
681 { /* beginning of action switch */
682 case 1:
683 YY_RULE_SETUP
684 #line 108 "proto_syntax.flex"
685 /* consume whitespace */
686 YY_BREAK
687 case 2:
688 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
689 yy_c_buf_p = yy_cp -= 1;
690 YY_DO_BEFORE_ACTION; /* set up yytext again */
691 YY_RULE_SETUP
692 #line 109 "proto_syntax.flex"
693 /* consume comments */
694 YY_BREAK
695 case 3:
696 YY_RULE_SETUP
697 #line 111 "proto_syntax.flex"
698 start_compound_sexpr();
699 YY_BREAK
700 case 4:
701 YY_RULE_SETUP
702 #line 112 "proto_syntax.flex"
703 end_compound_sexpr();
704 YY_BREAK
705 case 5:
706 YY_RULE_SETUP
707 #line 114 "proto_syntax.flex"
708 wrap_next_sexpr(new SE_Symbol("QUASIQUOTE"));
709 YY_BREAK
710 case 6:
711 YY_RULE_SETUP
712 #line 115 "proto_syntax.flex"
713 wrap_next_sexpr(new SE_Symbol("QUOTE"));
714 YY_BREAK
715 case 7:
716 YY_RULE_SETUP
717 #line 116 "proto_syntax.flex"
718 wrap_next_sexpr(new SE_Symbol("COMMA"));
719 YY_BREAK
720 case 8:
721 YY_RULE_SETUP
722 #line 117 "proto_syntax.flex"
723 wrap_next_sexpr(new SE_Symbol("COMMA-SPLICE"));
724 YY_BREAK
725 case 9:
726 #line 120 "proto_syntax.flex"
727 case 10:
728 YY_RULE_SETUP
729 #line 120 "proto_syntax.flex"
730 add_sexpr(new SE_Scalar(atof(YYText())));
731 YY_BREAK
732 case 11:
733 YY_RULE_SETUP
734 #line 122 "proto_syntax.flex"
735 add_sexpr(new SE_Symbol(YYText()));
736 YY_BREAK
737 case 12:
738 YY_RULE_SETUP
739 #line 124 "proto_syntax.flex"
740 compile_error(context(),"Illegal use of reserved character '"+string(YYText())+"'");
741 YY_BREAK
742 case 13:
743 YY_RULE_SETUP
744 #line 125 "proto_syntax.flex"
745 compile_error(context(),"Unrecognized character: '"+string(YYText())+"'");
746 YY_BREAK
747 case 14:
748 YY_RULE_SETUP
749 #line 127 "proto_syntax.flex"
750 ECHO;
751 YY_BREAK
752 #line 753 "lexer.cpp"
753 case YY_STATE_EOF(INITIAL):
754 yyterminate();
756 case YY_END_OF_BUFFER:
758 /* Amount of text matched not including the EOB char. */
759 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
761 /* Undo the effects of YY_DO_BEFORE_ACTION. */
762 *yy_cp = yy_hold_char;
763 YY_RESTORE_YY_MORE_OFFSET
765 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
767 /* We're scanning a new file or input source. It's
768 * possible that this happened because the user
769 * just pointed yyin at a new source and called
770 * yylex(). If so, then we have to assure
771 * consistency between yy_current_buffer and our
772 * globals. Here is the right place to do so, because
773 * this is the first action (other than possibly a
774 * back-up) that will match for the new input source.
776 yy_n_chars = yy_current_buffer->yy_n_chars;
777 yy_current_buffer->yy_input_file = yyin;
778 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
781 /* Note that here we test for yy_c_buf_p "<=" to the position
782 * of the first EOB in the buffer, since yy_c_buf_p will
783 * already have been incremented past the NUL character
784 * (since all states make transitions on EOB to the
785 * end-of-buffer state). Contrast this with the test
786 * in input().
788 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
789 { /* This was really a NUL. */
790 yy_state_type yy_next_state;
792 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
794 yy_current_state = yy_get_previous_state();
796 /* Okay, we're now positioned to make the NUL
797 * transition. We couldn't have
798 * yy_get_previous_state() go ahead and do it
799 * for us because it doesn't know how to deal
800 * with the possibility of jamming (and we don't
801 * want to build jamming into it because then it
802 * will run more slowly).
805 yy_next_state = yy_try_NUL_trans( yy_current_state );
807 yy_bp = yytext_ptr + YY_MORE_ADJ;
809 if ( yy_next_state )
811 /* Consume the NUL. */
812 yy_cp = ++yy_c_buf_p;
813 yy_current_state = yy_next_state;
814 goto yy_match;
817 else
819 yy_cp = yy_c_buf_p;
820 goto yy_find_action;
824 else switch ( yy_get_next_buffer() )
826 case EOB_ACT_END_OF_FILE:
828 yy_did_buffer_switch_on_eof = 0;
830 if ( yywrap() )
832 /* Note: because we've taken care in
833 * yy_get_next_buffer() to have set up
834 * yytext, we can now set up
835 * yy_c_buf_p so that if some total
836 * hoser (like flex itself) wants to
837 * call the scanner after we return the
838 * YY_NULL, it'll still work - another
839 * YY_NULL will get returned.
841 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
843 yy_act = YY_STATE_EOF(YY_START);
844 goto do_action;
847 else
849 if ( ! yy_did_buffer_switch_on_eof )
850 YY_NEW_FILE;
852 break;
855 case EOB_ACT_CONTINUE_SCAN:
856 yy_c_buf_p =
857 yytext_ptr + yy_amount_of_matched_text;
859 yy_current_state = yy_get_previous_state();
861 yy_cp = yy_c_buf_p;
862 yy_bp = yytext_ptr + YY_MORE_ADJ;
863 goto yy_match;
865 case EOB_ACT_LAST_MATCH:
866 yy_c_buf_p =
867 &yy_current_buffer->yy_ch_buf[yy_n_chars];
869 yy_current_state = yy_get_previous_state();
871 yy_cp = yy_c_buf_p;
872 yy_bp = yytext_ptr + YY_MORE_ADJ;
873 goto yy_find_action;
875 break;
878 default:
879 YY_FATAL_ERROR(
880 "fatal flex scanner internal error--no action found" );
881 } /* end of action switch */
882 } /* end of scanning one token */
883 } /* end of yylex */
885 yyFlexLexer::yyFlexLexer( istream* arg_yyin, ostream* arg_yyout )
887 yyin = arg_yyin;
888 yyout = arg_yyout;
889 yy_c_buf_p = 0;
890 yy_init = 1;
891 yy_start = 0;
892 yy_flex_debug = 0;
893 yylineno = 1; // this will only get updated if %option yylineno
895 yy_did_buffer_switch_on_eof = 0;
897 yy_looking_for_trail_begin = 0;
898 yy_more_flag = 0;
899 yy_more_len = 0;
900 yy_more_offset = yy_prev_more_offset = 0;
902 yy_start_stack_ptr = yy_start_stack_depth = 0;
903 yy_start_stack = 0;
905 yy_current_buffer = 0;
907 #ifdef YY_USES_REJECT
908 yy_state_buf = new yy_state_type[YY_BUF_SIZE + 2];
909 #else
910 yy_state_buf = 0;
911 #endif
914 yyFlexLexer::~yyFlexLexer()
916 delete yy_state_buf;
917 yy_delete_buffer( yy_current_buffer );
920 void yyFlexLexer::switch_streams( istream* new_in, ostream* new_out )
922 if ( new_in )
924 yy_delete_buffer( yy_current_buffer );
925 yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) );
928 if ( new_out )
929 yyout = new_out;
932 #ifdef YY_INTERACTIVE
933 int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )
934 #else
935 int yyFlexLexer::LexerInput( char* buf, int max_size )
936 #endif
938 if ( yyin->eof() || yyin->fail() )
939 return 0;
941 #ifdef YY_INTERACTIVE
942 yyin->get( buf[0] );
944 if ( yyin->eof() )
945 return 0;
947 if ( yyin->bad() )
948 return -1;
950 return 1;
952 #else
953 (void) yyin->read( buf, max_size );
955 if ( yyin->bad() )
956 return -1;
957 else
958 return yyin->gcount();
959 #endif
962 void yyFlexLexer::LexerOutput( const char* buf, int size )
964 (void) yyout->write( buf, size );
967 /* yy_get_next_buffer - try to read in a new buffer
969 * Returns a code representing an action:
970 * EOB_ACT_LAST_MATCH -
971 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
972 * EOB_ACT_END_OF_FILE - end of file
975 int yyFlexLexer::yy_get_next_buffer()
977 register char *dest = yy_current_buffer->yy_ch_buf;
978 register char *source = yytext_ptr;
979 register int number_to_move, i;
980 int ret_val;
982 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
983 YY_FATAL_ERROR(
984 "fatal flex scanner internal error--end of buffer missed" );
986 if ( yy_current_buffer->yy_fill_buffer == 0 )
987 { /* Don't try to fill the buffer, so this is an EOF. */
988 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
990 /* We matched a single character, the EOB, so
991 * treat this as a final EOF.
993 return EOB_ACT_END_OF_FILE;
996 else
998 /* We matched some text prior to the EOB, first
999 * process it.
1001 return EOB_ACT_LAST_MATCH;
1005 /* Try to read more data. */
1007 /* First move last chars to start of buffer. */
1008 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1010 for ( i = 0; i < number_to_move; ++i )
1011 *(dest++) = *(source++);
1013 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1014 /* don't do the read, it's not guaranteed to return an EOF,
1015 * just force an EOF
1017 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1019 else
1021 int num_to_read =
1022 yy_current_buffer->yy_buf_size - number_to_move - 1;
1024 while ( num_to_read <= 0 )
1025 { /* Not enough room in the buffer - grow it. */
1026 #ifdef YY_USES_REJECT
1027 YY_FATAL_ERROR(
1028 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1029 #else
1031 /* just a shorter name for the current buffer */
1032 YY_BUFFER_STATE b = yy_current_buffer;
1034 int yy_c_buf_p_offset =
1035 (int) (yy_c_buf_p - b->yy_ch_buf);
1037 if ( b->yy_is_our_buffer )
1039 int new_size = b->yy_buf_size * 2;
1041 if ( new_size <= 0 )
1042 b->yy_buf_size += b->yy_buf_size / 8;
1043 else
1044 b->yy_buf_size *= 2;
1046 b->yy_ch_buf = (char *)
1047 /* Include room in for 2 EOB chars. */
1048 yy_flex_realloc( (void *) b->yy_ch_buf,
1049 b->yy_buf_size + 2 );
1051 else
1052 /* Can't grow it, we don't own it. */
1053 b->yy_ch_buf = 0;
1055 if ( ! b->yy_ch_buf )
1056 YY_FATAL_ERROR(
1057 "fatal error - scanner input buffer overflow" );
1059 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1061 num_to_read = yy_current_buffer->yy_buf_size -
1062 number_to_move - 1;
1063 #endif
1066 if ( num_to_read > YY_READ_BUF_SIZE )
1067 num_to_read = YY_READ_BUF_SIZE;
1069 /* Read in more data. */
1070 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1071 yy_n_chars, num_to_read );
1073 yy_current_buffer->yy_n_chars = yy_n_chars;
1076 if ( yy_n_chars == 0 )
1078 if ( number_to_move == YY_MORE_ADJ )
1080 ret_val = EOB_ACT_END_OF_FILE;
1081 yyrestart( yyin );
1084 else
1086 ret_val = EOB_ACT_LAST_MATCH;
1087 yy_current_buffer->yy_buffer_status =
1088 YY_BUFFER_EOF_PENDING;
1092 else
1093 ret_val = EOB_ACT_CONTINUE_SCAN;
1095 yy_n_chars += number_to_move;
1096 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1097 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1099 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1101 return ret_val;
1105 /* yy_get_previous_state - get the state just before the EOB char was reached */
1107 yy_state_type yyFlexLexer::yy_get_previous_state()
1109 register yy_state_type yy_current_state;
1110 register char *yy_cp;
1112 yy_current_state = yy_start;
1113 yy_state_ptr = yy_state_buf;
1114 *yy_state_ptr++ = yy_current_state;
1116 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1118 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1119 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1121 yy_current_state = (int) yy_def[yy_current_state];
1122 if ( yy_current_state >= 34 )
1123 yy_c = yy_meta[(unsigned int) yy_c];
1125 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1126 *yy_state_ptr++ = yy_current_state;
1129 return yy_current_state;
1133 /* yy_try_NUL_trans - try to make a transition on the NUL character
1135 * synopsis
1136 * next_state = yy_try_NUL_trans( current_state );
1139 yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )
1141 register int yy_is_jam;
1143 register YY_CHAR yy_c = 1;
1144 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1146 yy_current_state = (int) yy_def[yy_current_state];
1147 if ( yy_current_state >= 34 )
1148 yy_c = yy_meta[(unsigned int) yy_c];
1150 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1151 yy_is_jam = (yy_current_state == 33);
1152 if ( ! yy_is_jam )
1153 *yy_state_ptr++ = yy_current_state;
1155 return yy_is_jam ? 0 : yy_current_state;
1159 void yyFlexLexer::yyunput( int c, register char* yy_bp )
1161 register char *yy_cp = yy_c_buf_p;
1163 /* undo effects of setting up yytext */
1164 *yy_cp = yy_hold_char;
1166 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1167 { /* need to shift things up to make room */
1168 /* +2 for EOB chars. */
1169 register int number_to_move = yy_n_chars + 2;
1170 register char *dest = &yy_current_buffer->yy_ch_buf[
1171 yy_current_buffer->yy_buf_size + 2];
1172 register char *source =
1173 &yy_current_buffer->yy_ch_buf[number_to_move];
1175 while ( source > yy_current_buffer->yy_ch_buf )
1176 *--dest = *--source;
1178 yy_cp += (int) (dest - source);
1179 yy_bp += (int) (dest - source);
1180 yy_current_buffer->yy_n_chars =
1181 yy_n_chars = yy_current_buffer->yy_buf_size;
1183 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1184 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1187 *--yy_cp = (char) c;
1189 if ( c == '\n' )
1190 --yylineno;
1192 yytext_ptr = yy_bp;
1193 yy_hold_char = *yy_cp;
1194 yy_c_buf_p = yy_cp;
1198 int yyFlexLexer::yyinput()
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;
1262 if ( c == '\n' )
1263 ++yylineno;
1265 return c;
1269 void yyFlexLexer::yyrestart( istream* input_file )
1271 if ( ! yy_current_buffer )
1272 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1274 yy_init_buffer( yy_current_buffer, input_file );
1275 yy_load_buffer_state();
1279 void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1281 if ( yy_current_buffer == new_buffer )
1282 return;
1284 if ( yy_current_buffer )
1286 /* Flush out information for old buffer. */
1287 *yy_c_buf_p = yy_hold_char;
1288 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1289 yy_current_buffer->yy_n_chars = yy_n_chars;
1292 yy_current_buffer = new_buffer;
1293 yy_load_buffer_state();
1295 /* We don't actually know whether we did this switch during
1296 * EOF (yywrap()) processing, but the only time this flag
1297 * is looked at is after yywrap() is called, so it's safe
1298 * to go ahead and always set it.
1300 yy_did_buffer_switch_on_eof = 1;
1304 void yyFlexLexer::yy_load_buffer_state()
1306 yy_n_chars = yy_current_buffer->yy_n_chars;
1307 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1308 yyin = yy_current_buffer->yy_input_file;
1309 yy_hold_char = *yy_c_buf_p;
1313 YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( istream* file, int size )
1315 YY_BUFFER_STATE b;
1317 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1318 if ( ! b )
1319 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1321 b->yy_buf_size = size;
1323 /* yy_ch_buf has to be 2 characters longer than the size given because
1324 * we need to put in 2 end-of-buffer characters.
1326 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1327 if ( ! b->yy_ch_buf )
1328 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1330 b->yy_is_our_buffer = 1;
1332 yy_init_buffer( b, file );
1334 return b;
1338 void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )
1340 if ( ! b )
1341 return;
1343 if ( b == yy_current_buffer )
1344 yy_current_buffer = (YY_BUFFER_STATE) 0;
1346 if ( b->yy_is_our_buffer )
1347 yy_flex_free( (void *) b->yy_ch_buf );
1349 yy_flex_free( (void *) b );
1353 extern "C" int isatty YY_PROTO(( int ));
1354 void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, istream* file )
1357 yy_flush_buffer( b );
1359 b->yy_input_file = file;
1360 b->yy_fill_buffer = 1;
1362 b->yy_is_interactive = 0;
1366 void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b )
1368 if ( ! b )
1369 return;
1371 b->yy_n_chars = 0;
1373 /* We always need two end-of-buffer characters. The first causes
1374 * a transition to the end-of-buffer state. The second causes
1375 * a jam in that state.
1377 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1378 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1380 b->yy_buf_pos = &b->yy_ch_buf[0];
1382 b->yy_at_bol = 1;
1383 b->yy_buffer_status = YY_BUFFER_NEW;
1385 if ( b == yy_current_buffer )
1386 yy_load_buffer_state();
1390 #ifndef YY_NO_SCAN_BUFFER
1391 #endif
1394 #ifndef YY_NO_SCAN_STRING
1395 #endif
1398 #ifndef YY_NO_SCAN_BYTES
1399 #endif
1402 #ifndef YY_NO_PUSH_STATE
1403 void yyFlexLexer::yy_push_state( int new_state )
1405 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1407 yy_size_t new_size;
1409 yy_start_stack_depth += YY_START_STACK_INCR;
1410 new_size = yy_start_stack_depth * sizeof( int );
1412 if ( ! yy_start_stack )
1413 yy_start_stack = (int *) yy_flex_alloc( new_size );
1415 else
1416 yy_start_stack = (int *) yy_flex_realloc(
1417 (void *) yy_start_stack, new_size );
1419 if ( ! yy_start_stack )
1420 YY_FATAL_ERROR(
1421 "out of memory expanding start-condition stack" );
1424 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1426 BEGIN(new_state);
1428 #endif
1431 #ifndef YY_NO_POP_STATE
1432 void yyFlexLexer::yy_pop_state()
1434 if ( --yy_start_stack_ptr < 0 )
1435 YY_FATAL_ERROR( "start-condition stack underflow" );
1437 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1439 #endif
1442 #ifndef YY_NO_TOP_STATE
1443 int yyFlexLexer::yy_top_state()
1445 return yy_start_stack[yy_start_stack_ptr - 1];
1447 #endif
1449 #ifndef YY_EXIT_FAILURE
1450 #define YY_EXIT_FAILURE 2
1451 #endif
1454 void yyFlexLexer::LexerError( yyconst char msg[] )
1456 cerr << msg << '\n';
1457 exit( YY_EXIT_FAILURE );
1461 /* Redefine yyless() so it works in section 3 code. */
1463 #undef yyless
1464 #define yyless(n) \
1465 do \
1467 /* Undo effects of setting up yytext. */ \
1468 yytext[yyleng] = yy_hold_char; \
1469 yy_c_buf_p = yytext + n; \
1470 yy_hold_char = *yy_c_buf_p; \
1471 *yy_c_buf_p = '\0'; \
1472 yyleng = n; \
1474 while ( 0 )
1477 /* Internal utility routines. */
1479 #ifndef yytext_ptr
1480 #ifdef YY_USE_PROTOS
1481 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1482 #else
1483 static void yy_flex_strncpy( s1, s2, n )
1484 char *s1;
1485 yyconst char *s2;
1486 int n;
1487 #endif
1489 register int i;
1490 for ( i = 0; i < n; ++i )
1491 s1[i] = s2[i];
1493 #endif
1495 #ifdef YY_NEED_STRLEN
1496 #ifdef YY_USE_PROTOS
1497 static int yy_flex_strlen( yyconst char *s )
1498 #else
1499 static int yy_flex_strlen( s )
1500 yyconst char *s;
1501 #endif
1503 register int n;
1504 for ( n = 0; s[n]; ++n )
1507 return n;
1509 #endif
1512 #ifdef YY_USE_PROTOS
1513 static void *yy_flex_alloc( yy_size_t size )
1514 #else
1515 static void *yy_flex_alloc( size )
1516 yy_size_t size;
1517 #endif
1519 return (void *) malloc( size );
1522 #ifdef YY_USE_PROTOS
1523 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1524 #else
1525 static void *yy_flex_realloc( ptr, size )
1526 void *ptr;
1527 yy_size_t size;
1528 #endif
1530 /* The cast to (char *) in the following accommodates both
1531 * implementations that use char* generic pointers, and those
1532 * that use void* generic pointers. It works with the latter
1533 * because both ANSI C and C++ allow castless assignment from
1534 * any pointer type to void*, and deal with argument conversions
1535 * as though doing an assignment.
1537 return (void *) realloc( (char *) ptr, size );
1540 #ifdef YY_USE_PROTOS
1541 static void yy_flex_free( void *ptr )
1542 #else
1543 static void yy_flex_free( ptr )
1544 void *ptr;
1545 #endif
1547 free( ptr );
1550 #if YY_MAIN
1551 int main()
1553 yylex();
1554 return 0;
1556 #endif
1557 #line 127 "proto_syntax.flex"
1560 SExpr* read_sexpr(string name, string in)
1561 { return read_sexpr(name,new istringstream(in)); }
1562 SExpr* read_sexpr(string name, istream* in, ostream* out)
1563 { SExprLexer lex(name,in,out); return lex.tokenize(); }