source: cpp/f8-to-f1/conv_f8tof1_scanner.cpp @ 88

Last change on this file since 88 was 1, checked in by Maciej Komosinski, 16 years ago

added f8 (L-systems) representation and converter f8->f1

File size: 43.6 KB
Line 
1#line 2 "conv_f8tof1_scanner.cpp"
2
3#line 4 "conv_f8tof1_scanner.cpp"
4
5#define  YY_INT_ALIGNED short int
6
7/* A lexical scanner generated by flex */
8
9#define FLEX_SCANNER
10#define YY_FLEX_MAJOR_VERSION 2
11#define YY_FLEX_MINOR_VERSION 5
12#define YY_FLEX_SUBMINOR_VERSION 35
13#if YY_FLEX_SUBMINOR_VERSION > 0
14#define FLEX_BETA
15#endif
16
17    /* The c++ scanner is a mess. The FlexLexer.h header file relies on the
18     * following macro. This is required in order to pass the c++-multiple-scanners
19     * test in the regression suite. We get reports that it breaks inheritance.
20     * We will address this in a future release of flex, or omit the C++ scanner
21     * altogether.
22     */
23    #define yyFlexLexer yyFlexLexer
24
25/* First, we deal with  platform-specific or compiler-specific issues. */
26
27/* begin standard C headers. */
28
29/* end standard C headers. */
30
31/* flex integer type definitions */
32
33#ifndef FLEXINT_H
34#define FLEXINT_H
35
36/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
37
38#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
39
40/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
41 * if you want the limit (max/min) macros for int types.
42 */
43#ifndef __STDC_LIMIT_MACROS
44#define __STDC_LIMIT_MACROS 1
45#endif
46
47#include <inttypes.h>
48typedef int8_t flex_int8_t;
49typedef uint8_t flex_uint8_t;
50typedef int16_t flex_int16_t;
51typedef uint16_t flex_uint16_t;
52typedef int32_t flex_int32_t;
53typedef uint32_t flex_uint32_t;
54#else
55typedef signed char flex_int8_t;
56typedef short int flex_int16_t;
57typedef int flex_int32_t;
58typedef unsigned char flex_uint8_t;
59typedef unsigned short int flex_uint16_t;
60typedef unsigned int flex_uint32_t;
61
62/* Limits of integral types. */
63#ifndef INT8_MIN
64#define INT8_MIN               (-128)
65#endif
66#ifndef INT16_MIN
67#define INT16_MIN              (-32767-1)
68#endif
69#ifndef INT32_MIN
70#define INT32_MIN              (-2147483647-1)
71#endif
72#ifndef INT8_MAX
73#define INT8_MAX               (127)
74#endif
75#ifndef INT16_MAX
76#define INT16_MAX              (32767)
77#endif
78#ifndef INT32_MAX
79#define INT32_MAX              (2147483647)
80#endif
81#ifndef UINT8_MAX
82#define UINT8_MAX              (255U)
83#endif
84#ifndef UINT16_MAX
85#define UINT16_MAX             (65535U)
86#endif
87#ifndef UINT32_MAX
88#define UINT32_MAX             (4294967295U)
89#endif
90
91#endif /* ! C99 */
92
93#endif /* ! FLEXINT_H */
94
95/* begin standard C++ headers. */
96#include <iostream>
97#include <errno.h>
98#include <cstdlib>
99#include <cstring>
100/* end standard C++ headers. */
101
102#ifdef __cplusplus
103
104/* The "const" storage-class-modifier is valid. */
105#define YY_USE_CONST
106
107#else   /* ! __cplusplus */
108
109/* C99 requires __STDC__ to be defined as 1. */
110#if defined (__STDC__)
111
112#define YY_USE_CONST
113
114#endif  /* defined (__STDC__) */
115#endif  /* ! __cplusplus */
116
117#ifdef YY_USE_CONST
118#define yyconst const
119#else
120#define yyconst
121#endif
122
123/* Returned upon end-of-file. */
124#define YY_NULL 0
125
126/* Promotes a possibly negative, possibly signed char to an unsigned
127 * integer for use as an array index.  If the signed char is negative,
128 * we want to instead treat it as an 8-bit unsigned char, hence the
129 * double cast.
130 */
131#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
132
133/* Enter a start condition.  This macro really ought to take a parameter,
134 * but we do it the disgusting crufty way forced on us by the ()-less
135 * definition of BEGIN.
136 */
137#define BEGIN (yy_start) = 1 + 2 *
138
139/* Translate the current start state into a value that can be later handed
140 * to BEGIN to return to the state.  The YYSTATE alias is for lex
141 * compatibility.
142 */
143#define YY_START (((yy_start) - 1) / 2)
144#define YYSTATE YY_START
145
146/* Action number for EOF rule of a given start state. */
147#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
148
149/* Special action meaning "start processing a new file". */
150#define YY_NEW_FILE yyrestart( yyin  )
151
152#define YY_END_OF_BUFFER_CHAR 0
153
154/* Size of default input buffer. */
155#ifndef YY_BUF_SIZE
156#define YY_BUF_SIZE 16384
157#endif
158
159/* The state buf must be large enough to hold one state per character in the main buffer.
160 */
161#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
162
163#ifndef YY_TYPEDEF_YY_BUFFER_STATE
164#define YY_TYPEDEF_YY_BUFFER_STATE
165typedef struct yy_buffer_state *YY_BUFFER_STATE;
166#endif
167
168extern int yyleng;
169
170#define EOB_ACT_CONTINUE_SCAN 0
171#define EOB_ACT_END_OF_FILE 1
172#define EOB_ACT_LAST_MATCH 2
173
174    #define YY_LESS_LINENO(n)
175   
176/* Return all but the first "n" matched characters back to the input stream. */
177#define yyless(n) \
178        do \
179                { \
180                /* Undo effects of setting up yytext. */ \
181        int yyless_macro_arg = (n); \
182        YY_LESS_LINENO(yyless_macro_arg);\
183                *yy_cp = (yy_hold_char); \
184                YY_RESTORE_YY_MORE_OFFSET \
185                (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
186                YY_DO_BEFORE_ACTION; /* set up yytext again */ \
187                } \
188        while ( 0 )
189
190#define unput(c) yyunput( c, (yytext_ptr)  )
191
192#ifndef YY_TYPEDEF_YY_SIZE_T
193#define YY_TYPEDEF_YY_SIZE_T
194typedef size_t yy_size_t;
195#endif
196
197#ifndef YY_STRUCT_YY_BUFFER_STATE
198#define YY_STRUCT_YY_BUFFER_STATE
199struct yy_buffer_state
200        {
201
202        std::istream* yy_input_file;
203
204        char *yy_ch_buf;                /* input buffer */
205        char *yy_buf_pos;               /* current position in input buffer */
206
207        /* Size of input buffer in bytes, not including room for EOB
208         * characters.
209         */
210        yy_size_t yy_buf_size;
211
212        /* Number of characters read into yy_ch_buf, not including EOB
213         * characters.
214         */
215        int yy_n_chars;
216
217        /* Whether we "own" the buffer - i.e., we know we created it,
218         * and can realloc() it to grow it, and should free() it to
219         * delete it.
220         */
221        int yy_is_our_buffer;
222
223        /* Whether this is an "interactive" input source; if so, and
224         * if we're using stdio for input, then we want to use getc()
225         * instead of fread(), to make sure we stop fetching input after
226         * each newline.
227         */
228        int yy_is_interactive;
229
230        /* Whether we're considered to be at the beginning of a line.
231         * If so, '^' rules will be active on the next match, otherwise
232         * not.
233         */
234        int yy_at_bol;
235
236    int yy_bs_lineno; /**< The line count. */
237    int yy_bs_column; /**< The column count. */
238   
239        /* Whether to try to fill the input buffer when we reach the
240         * end of it.
241         */
242        int yy_fill_buffer;
243
244        int yy_buffer_status;
245
246#define YY_BUFFER_NEW 0
247#define YY_BUFFER_NORMAL 1
248        /* When an EOF's been seen but there's still some text to process
249         * then we mark the buffer as YY_EOF_PENDING, to indicate that we
250         * shouldn't try reading from the input source any more.  We might
251         * still have a bunch of tokens to match, though, because of
252         * possible backing-up.
253         *
254         * When we actually see the EOF, we change the status to "new"
255         * (via yyrestart()), so that the user can continue scanning by
256         * just pointing yyin at a new input file.
257         */
258#define YY_BUFFER_EOF_PENDING 2
259
260        };
261#endif /* !YY_STRUCT_YY_BUFFER_STATE */
262
263/* We provide macros for accessing buffer states in case in the
264 * future we want to put the buffer states in a more general
265 * "scanner state".
266 *
267 * Returns the top of the stack, or NULL.
268 */
269#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
270                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
271                          : NULL)
272
273/* Same as previous macro, but useful when we know that the buffer stack is not
274 * NULL or when we need an lvalue. For internal use only.
275 */
276#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
277
278void *yyalloc (yy_size_t  );
279void *yyrealloc (void *,yy_size_t  );
280void yyfree (void *  );
281
282#define yy_new_buffer yy_create_buffer
283
284#define yy_set_interactive(is_interactive) \
285        { \
286        if ( ! YY_CURRENT_BUFFER ){ \
287        yyensure_buffer_stack (); \
288                YY_CURRENT_BUFFER_LVALUE =    \
289            yy_create_buffer( yyin, YY_BUF_SIZE ); \
290        } \
291        YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
292        }
293
294#define yy_set_bol(at_bol) \
295        { \
296        if ( ! YY_CURRENT_BUFFER ){\
297        yyensure_buffer_stack (); \
298                YY_CURRENT_BUFFER_LVALUE =    \
299            yy_create_buffer( yyin, YY_BUF_SIZE ); \
300        } \
301        YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
302        }
303
304#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
305
306/* Begin user sect3 */
307
308typedef unsigned char YY_CHAR;
309
310#define yytext_ptr yytext
311#define YY_INTERACTIVE
312
313#include <FlexLexer.h>
314
315/* Done after the current pattern has been matched and before the
316 * corresponding action - sets up yytext.
317 */
318#define YY_DO_BEFORE_ACTION \
319        (yytext_ptr) = yy_bp; \
320        yyleng = (size_t) (yy_cp - yy_bp); \
321        (yy_hold_char) = *yy_cp; \
322        *yy_cp = '\0'; \
323        (yy_c_buf_p) = yy_cp;
324
325#define YY_NUM_RULES 28
326#define YY_END_OF_BUFFER 29
327/* This struct is not used in this scanner,
328   but its presence is necessary. */
329struct yy_trans_info
330        {
331        flex_int32_t yy_verify;
332        flex_int32_t yy_nxt;
333        };
334static yyconst flex_int16_t yy_accept[44] =
335    {   0,
336        0,    0,   29,   27,    4,   26,   27,   16,   17,   24,
337       22,   21,   23,   25,    3,   19,    6,    5,   11,   12,
338       27,   27,   27,   14,   20,   15,    4,    9,    0,    0,
339        3,    7,    8,   10,    2,    0,    1,   18,    3,    0,
340        0,   13,    0
341    } ;
342
343static yyconst flex_int32_t yy_ec[256] =
344    {   0,
345        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
346        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
347        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
348        1,    2,    4,    1,    1,    1,    1,    1,    1,    5,
349        6,    7,    8,    9,   10,   11,   12,   13,   13,   13,
350       13,   13,   13,   13,   13,   13,   13,   14,    1,   15,
351       16,   17,    1,    1,   18,    1,   18,    1,   18,   18,
352        1,    1,   18,    1,    1,   18,   18,    1,    1,   19,
353       18,   18,   18,    1,    1,    1,   18,   18,    1,    1,
354       20,   21,   22,   18,    1,    1,   18,    1,   18,    1,
355
356       18,   18,    1,    1,   18,    1,    1,   18,   18,   23,
357        1,    1,   18,   18,   18,    1,    1,    1,   18,    1,
358        1,    1,   24,   25,   26,    1,    1,    1,    1,    1,
359        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
360        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
361        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
362        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
363        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
364        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
365        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
366
367        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
368        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
369        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
370        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
371        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
372        1,    1,    1,    1,    1
373    } ;
374
375static yyconst flex_int32_t yy_meta[27] =
376    {   0,
377        1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
378        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
379        1,    1,    1,    1,    1,    1
380    } ;
381
382static yyconst flex_int16_t yy_base[45] =
383    {   0,
384        0,    0,   52,   53,   49,   53,   34,   53,   53,   53,
385       53,   53,   39,   53,   16,   53,   32,   31,   30,   53,
386       32,   24,   30,   53,   53,   53,   40,   53,   31,   27,
387       17,   53,   53,   53,   26,   17,   24,   53,   23,   14,
388       10,   13,   53,   32
389    } ;
390
391static yyconst flex_int16_t yy_def[45] =
392    {   0,
393       43,    1,   43,   43,   43,   43,   43,   43,   43,   43,
394       43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
395       43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
396       43,   43,   43,   43,   43,   44,   43,   43,   43,   44,
397       44,   44,    0,   43
398    } ;
399
400static yyconst flex_int16_t yy_nxt[80] =
401    {   0,
402        4,    5,    6,    7,    8,    9,   10,   11,   12,   13,
403        4,   14,   15,   16,   17,   18,   19,   20,   21,   20,
404       22,   20,   23,   24,   25,   26,   30,   30,   31,   31,
405       41,   42,   40,   41,   41,   39,   37,   41,   35,   39,
406       38,   27,   37,   36,   35,   34,   33,   32,   29,   28,
407       27,   43,    3,   43,   43,   43,   43,   43,   43,   43,
408       43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
409       43,   43,   43,   43,   43,   43,   43,   43,   43
410    } ;
411
412static yyconst flex_int16_t yy_chk[80] =
413    {   0,
414        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
415        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
416        1,    1,    1,    1,    1,    1,   15,   31,   15,   31,
417       41,   41,   44,   42,   40,   39,   37,   36,   35,   30,
418       29,   27,   23,   22,   21,   19,   18,   17,   13,    7,
419        5,    3,   43,   43,   43,   43,   43,   43,   43,   43,
420       43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
421       43,   43,   43,   43,   43,   43,   43,   43,   43
422    } ;
423
424/* The intent behind this definition is that it'll catch
425 * any uses of REJECT which flex missed.
426 */
427#define REJECT reject_used_but_not_detected
428#define yymore() yymore_used_but_not_detected
429#define YY_MORE_ADJ 0
430#define YY_RESTORE_YY_MORE_OFFSET
431#line 1 "conv_f8tof1_scanner.l"
432/*
433 *  conv_f8tof1_scanner.l
434 *  L-systemToF1
435 *
436 *  Created by Maciej Wajcht on 08-03-28.
437 *  Copyright 2008 __MyCompanyName__. All rights reserved.
438 *
439 */
440#line 10 "conv_f8tof1_scanner.l"
441#include "lexglobal.h"
442#include "conv_f8tof1_grammar.h"
443#include <string.h>
444#include <math.h>
445       
446        YYSTYPE yylval;
447        int line = 1, col = 1;
448        int yyFlexLexer::yywrap(void) {
449        //int yywrap(void) {
450                return 1;
451        }
452#line 453 "conv_f8tof1_scanner.cpp"
453
454#define INITIAL 0
455
456#ifndef YY_NO_UNISTD_H
457/* Special case for "unistd.h", since it is non-ANSI. We include it way
458 * down here because we want the user's section 1 to have been scanned first.
459 * The user has a chance to override it with an option.
460 */
461#include <unistd.h>
462#endif
463
464#ifndef YY_EXTRA_TYPE
465#define YY_EXTRA_TYPE void *
466#endif
467
468#ifndef yytext_ptr
469static void yy_flex_strncpy (char *,yyconst char *,int );
470#endif
471
472#ifdef YY_NEED_STRLEN
473static int yy_flex_strlen (yyconst char * );
474#endif
475
476#ifndef YY_NO_INPUT
477
478#endif
479
480/* Amount of stuff to slurp up with each read. */
481#ifndef YY_READ_BUF_SIZE
482#define YY_READ_BUF_SIZE 8192
483#endif
484
485/* Copy whatever the last rule matched to the standard output. */
486#ifndef ECHO
487#define ECHO LexerOutput( yytext, yyleng )
488#endif
489
490/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
491 * is returned in "result".
492 */
493#ifndef YY_INPUT
494#define YY_INPUT(buf,result,max_size) \
495\
496        if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
497                YY_FATAL_ERROR( "input in flex scanner failed" );
498
499#endif
500
501/* No semi-colon after return; correct usage is to write "yyterminate();" -
502 * we don't want an extra ';' after the "return" because that will cause
503 * some compilers to complain about unreachable statements.
504 */
505#ifndef yyterminate
506#define yyterminate() return YY_NULL
507#endif
508
509/* Number of entries by which start-condition stack grows. */
510#ifndef YY_START_STACK_INCR
511#define YY_START_STACK_INCR 25
512#endif
513
514/* Report a fatal error. */
515#ifndef YY_FATAL_ERROR
516#define YY_FATAL_ERROR(msg) LexerError( msg )
517#endif
518
519/* end tables serialization structures and prototypes */
520
521/* Default declaration of generated scanner - a define so the user can
522 * easily add parameters.
523 */
524#ifndef YY_DECL
525#define YY_DECL_IS_OURS 1
526#define YY_DECL int yyFlexLexer::yylex()
527#endif /* !YY_DECL */
528
529/* Code executed at the beginning of each rule, after yytext and yyleng
530 * have been set up.
531 */
532#ifndef YY_USER_ACTION
533#define YY_USER_ACTION
534#endif
535
536/* Code executed at the end of each rule. */
537#ifndef YY_BREAK
538#define YY_BREAK break;
539#endif
540
541#define YY_RULE_SETUP \
542        YY_USER_ACTION
543
544/** The main scanner function which does all the work.
545 */
546YY_DECL
547{
548        register yy_state_type yy_current_state;
549        register char *yy_cp, *yy_bp;
550        register int yy_act;
551   
552#line 22 "conv_f8tof1_scanner.l"
553
554
555#line 556 "conv_f8tof1_scanner.cpp"
556
557        if ( !(yy_init) )
558                {
559                (yy_init) = 1;
560
561#ifdef YY_USER_INIT
562                YY_USER_INIT;
563#endif
564
565                if ( ! (yy_start) )
566                        (yy_start) = 1; /* first start state */
567
568                if ( ! yyin )
569                        yyin = & std::cin;
570
571                if ( ! yyout )
572                        yyout = & std::cout;
573
574                if ( ! YY_CURRENT_BUFFER ) {
575                        yyensure_buffer_stack ();
576                        YY_CURRENT_BUFFER_LVALUE =
577                                yy_create_buffer( yyin, YY_BUF_SIZE );
578                }
579
580                yy_load_buffer_state(  );
581                }
582
583        while ( 1 )             /* loops until end-of-file is reached */
584                {
585                yy_cp = (yy_c_buf_p);
586
587                /* Support of yytext. */
588                *yy_cp = (yy_hold_char);
589
590                /* yy_bp points to the position in yy_ch_buf of the start of
591                 * the current run.
592                 */
593                yy_bp = yy_cp;
594
595                yy_current_state = (yy_start);
596yy_match:
597                do
598                        {
599                        register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
600                        if ( yy_accept[yy_current_state] )
601                                {
602                                (yy_last_accepting_state) = yy_current_state;
603                                (yy_last_accepting_cpos) = yy_cp;
604                                }
605                        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
606                                {
607                                yy_current_state = (int) yy_def[yy_current_state];
608                                if ( yy_current_state >= 44 )
609                                        yy_c = yy_meta[(unsigned int) yy_c];
610                                }
611                        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
612                        ++yy_cp;
613                        }
614                while ( yy_base[yy_current_state] != 53 );
615
616yy_find_action:
617                yy_act = yy_accept[yy_current_state];
618                if ( yy_act == 0 )
619                        { /* have to back up */
620                        yy_cp = (yy_last_accepting_cpos);
621                        yy_current_state = (yy_last_accepting_state);
622                        yy_act = yy_accept[yy_current_state];
623                        }
624
625                YY_DO_BEFORE_ACTION;
626
627do_action:      /* This label is used only to access EOF actions. */
628
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;
637
638case 1:
639YY_RULE_SETUP
640#line 24 "conv_f8tof1_scanner.l"
641{ col += yyleng;
642                                          yylval.strVal = yytext;
643                                          return PARAM_NAME;
644                                        }
645        YY_BREAK
646case 2:
647YY_RULE_SETUP
648#line 29 "conv_f8tof1_scanner.l"
649{ col += yyleng;
650                                          yylval.strVal = yytext;
651                                          return PROD_NAME;
652                                        }
653        YY_BREAK
654case 3:
655YY_RULE_SETUP
656#line 34 "conv_f8tof1_scanner.l"
657{ col += yyleng;
658                                          //yylval.dblVal = atof(yytext);
659                                          yylval.strVal = yytext;
660                                          return DOUBLE_VAL;
661                                        }
662        YY_BREAK
663case 4:
664YY_RULE_SETUP
665#line 40 "conv_f8tof1_scanner.l"
666{ col += yyleng; }               /* ignore but count white space */
667        YY_BREAK
668case 5:
669YY_RULE_SETUP
670#line 42 "conv_f8tof1_scanner.l"
671{ col += yyleng; yylval.strVal = yytext; return ASSIGN; }
672        YY_BREAK
673case 6:
674YY_RULE_SETUP
675#line 44 "conv_f8tof1_scanner.l"
676{ col += yyleng; yylval.strVal = yytext; return LESS; }
677        YY_BREAK
678case 7:
679YY_RULE_SETUP
680#line 45 "conv_f8tof1_scanner.l"
681{ col += yyleng; yylval.strVal = yytext; return LESS_EQUAL; }
682        YY_BREAK
683case 8:
684YY_RULE_SETUP
685#line 46 "conv_f8tof1_scanner.l"
686{ col += yyleng; yylval.strVal = yytext; return EQUAL; }
687        YY_BREAK
688case 9:
689YY_RULE_SETUP
690#line 47 "conv_f8tof1_scanner.l"
691{ col += yyleng; yylval.strVal = yytext; return NOT_EQUAL; }
692        YY_BREAK
693case 10:
694YY_RULE_SETUP
695#line 48 "conv_f8tof1_scanner.l"
696{ col += yyleng; yylval.strVal = yytext; return GREATER_EQUAL; }
697        YY_BREAK
698case 11:
699YY_RULE_SETUP
700#line 49 "conv_f8tof1_scanner.l"
701{ col += yyleng; yylval.strVal = yytext; return GREATER; }
702        YY_BREAK
703case 12:
704YY_RULE_SETUP
705#line 51 "conv_f8tof1_scanner.l"
706{ col += yyleng;
707                                          yylval.strVal = yytext;
708                                          return COMMAND;
709                                        }
710        YY_BREAK
711case 13:
712YY_RULE_SETUP
713#line 56 "conv_f8tof1_scanner.l"
714{ col += yyleng;
715                                          yylval.strVal = yytext;
716                                          return NEURON;
717                                        }
718        YY_BREAK
719case 14:
720YY_RULE_SETUP
721#line 61 "conv_f8tof1_scanner.l"
722{ col += yyleng; yylval.strVal = yytext; return FORLOOP_BEGIN; }
723        YY_BREAK
724case 15:
725YY_RULE_SETUP
726#line 62 "conv_f8tof1_scanner.l"
727{ col += yyleng; yylval.strVal = yytext; return FORLOOP_END; }
728        YY_BREAK
729case 16:
730YY_RULE_SETUP
731#line 64 "conv_f8tof1_scanner.l"
732{ col += yyleng; yylval.strVal = yytext; return LPAREN; }
733        YY_BREAK
734case 17:
735YY_RULE_SETUP
736#line 65 "conv_f8tof1_scanner.l"
737{ col += yyleng; yylval.strVal = yytext; return RPAREN; }
738        YY_BREAK
739case 18:
740YY_RULE_SETUP
741#line 67 "conv_f8tof1_scanner.l"
742{ col += yyleng; yylval.strVal = yytext; return DELIMETER; }
743        YY_BREAK
744case 19:
745YY_RULE_SETUP
746#line 69 "conv_f8tof1_scanner.l"
747{ col += yyleng; yylval.strVal = yytext; return SEMICOLON; }
748        YY_BREAK
749case 20:
750YY_RULE_SETUP
751#line 70 "conv_f8tof1_scanner.l"
752{ col += yyleng; yylval.strVal = yytext; return PIPE; }
753        YY_BREAK
754case 21:
755YY_RULE_SETUP
756#line 71 "conv_f8tof1_scanner.l"
757{ col += yyleng; yylval.strVal = yytext; return COMMA; }
758        YY_BREAK
759case 22:
760YY_RULE_SETUP
761#line 73 "conv_f8tof1_scanner.l"
762{ col += yyleng; yylval.strVal = yytext; return PLUS; }
763        YY_BREAK
764case 23:
765YY_RULE_SETUP
766#line 74 "conv_f8tof1_scanner.l"
767{ col += yyleng; yylval.strVal = yytext; return MINUS; }
768        YY_BREAK
769case 24:
770YY_RULE_SETUP
771#line 75 "conv_f8tof1_scanner.l"
772{ col += yyleng; yylval.strVal = yytext; return TIMES; }
773        YY_BREAK
774case 25:
775YY_RULE_SETUP
776#line 76 "conv_f8tof1_scanner.l"
777{ col += yyleng; yylval.strVal = yytext; return DIV; }
778        YY_BREAK
779case 26:
780/* rule 26 can match eol */
781YY_RULE_SETUP
782#line 78 "conv_f8tof1_scanner.l"
783{ col = 0; ++line; yylval.strVal = "\\n"; return NEWLINE; }
784        YY_BREAK
785case 27:
786YY_RULE_SETUP
787#line 80 "conv_f8tof1_scanner.l"
788{ col += yyleng; yylval.strVal = yytext; return -1; }
789        YY_BREAK
790case 28:
791YY_RULE_SETUP
792#line 82 "conv_f8tof1_scanner.l"
793ECHO;
794        YY_BREAK
795#line 796 "conv_f8tof1_scanner.cpp"
796case YY_STATE_EOF(INITIAL):
797        yyterminate();
798
799        case YY_END_OF_BUFFER:
800                {
801                /* Amount of text matched not including the EOB char. */
802                int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
803
804                /* Undo the effects of YY_DO_BEFORE_ACTION. */
805                *yy_cp = (yy_hold_char);
806                YY_RESTORE_YY_MORE_OFFSET
807
808                if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
809                        {
810                        /* We're scanning a new file or input source.  It's
811                         * possible that this happened because the user
812                         * just pointed yyin at a new source and called
813                         * yylex().  If so, then we have to assure
814                         * consistency between YY_CURRENT_BUFFER and our
815                         * globals.  Here is the right place to do so, because
816                         * this is the first action (other than possibly a
817                         * back-up) that will match for the new input source.
818                         */
819                        (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
820                        YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
821                        YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
822                        }
823
824                /* Note that here we test for yy_c_buf_p "<=" to the position
825                 * of the first EOB in the buffer, since yy_c_buf_p will
826                 * already have been incremented past the NUL character
827                 * (since all states make transitions on EOB to the
828                 * end-of-buffer state).  Contrast this with the test
829                 * in input().
830                 */
831                if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
832                        { /* This was really a NUL. */
833                        yy_state_type yy_next_state;
834
835                        (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
836
837                        yy_current_state = yy_get_previous_state(  );
838
839                        /* Okay, we're now positioned to make the NUL
840                         * transition.  We couldn't have
841                         * yy_get_previous_state() go ahead and do it
842                         * for us because it doesn't know how to deal
843                         * with the possibility of jamming (and we don't
844                         * want to build jamming into it because then it
845                         * will run more slowly).
846                         */
847
848                        yy_next_state = yy_try_NUL_trans( yy_current_state );
849
850                        yy_bp = (yytext_ptr) + YY_MORE_ADJ;
851
852                        if ( yy_next_state )
853                                {
854                                /* Consume the NUL. */
855                                yy_cp = ++(yy_c_buf_p);
856                                yy_current_state = yy_next_state;
857                                goto yy_match;
858                                }
859
860                        else
861                                {
862                                yy_cp = (yy_c_buf_p);
863                                goto yy_find_action;
864                                }
865                        }
866
867                else switch ( yy_get_next_buffer(  ) )
868                        {
869                        case EOB_ACT_END_OF_FILE:
870                                {
871                                (yy_did_buffer_switch_on_eof) = 0;
872
873                                if ( yywrap(  ) )
874                                        {
875                                        /* Note: because we've taken care in
876                                         * yy_get_next_buffer() to have set up
877                                         * yytext, we can now set up
878                                         * yy_c_buf_p so that if some total
879                                         * hoser (like flex itself) wants to
880                                         * call the scanner after we return the
881                                         * YY_NULL, it'll still work - another
882                                         * YY_NULL will get returned.
883                                         */
884                                        (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
885
886                                        yy_act = YY_STATE_EOF(YY_START);
887                                        goto do_action;
888                                        }
889
890                                else
891                                        {
892                                        if ( ! (yy_did_buffer_switch_on_eof) )
893                                                YY_NEW_FILE;
894                                        }
895                                break;
896                                }
897
898                        case EOB_ACT_CONTINUE_SCAN:
899                                (yy_c_buf_p) =
900                                        (yytext_ptr) + yy_amount_of_matched_text;
901
902                                yy_current_state = yy_get_previous_state(  );
903
904                                yy_cp = (yy_c_buf_p);
905                                yy_bp = (yytext_ptr) + YY_MORE_ADJ;
906                                goto yy_match;
907
908                        case EOB_ACT_LAST_MATCH:
909                                (yy_c_buf_p) =
910                                &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
911
912                                yy_current_state = yy_get_previous_state(  );
913
914                                yy_cp = (yy_c_buf_p);
915                                yy_bp = (yytext_ptr) + YY_MORE_ADJ;
916                                goto yy_find_action;
917                        }
918                break;
919                }
920
921        default:
922                YY_FATAL_ERROR(
923                        "fatal flex scanner internal error--no action found" );
924        } /* end of action switch */
925                } /* end of scanning one token */
926} /* end of yylex */
927
928/* The contents of this function are C++ specific, so the () macro is not used.
929 */
930yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout )
931{
932        yyin = arg_yyin;
933        yyout = arg_yyout;
934        yy_c_buf_p = 0;
935        yy_init = 0;
936        yy_start = 0;
937        yy_flex_debug = 0;
938        yylineno = 1;   // this will only get updated if %option yylineno
939
940        yy_did_buffer_switch_on_eof = 0;
941
942        yy_looking_for_trail_begin = 0;
943        yy_more_flag = 0;
944        yy_more_len = 0;
945        yy_more_offset = yy_prev_more_offset = 0;
946
947        yy_start_stack_ptr = yy_start_stack_depth = 0;
948        yy_start_stack = NULL;
949
950        yy_buffer_stack = 0;
951        yy_buffer_stack_top = 0;
952        yy_buffer_stack_max = 0;
953
954        yy_state_buf = 0;
955
956}
957
958/* The contents of this function are C++ specific, so the () macro is not used.
959 */
960yyFlexLexer::~yyFlexLexer()
961{
962        delete [] yy_state_buf;
963        yyfree(yy_start_stack  );
964        yy_delete_buffer( YY_CURRENT_BUFFER );
965        yyfree(yy_buffer_stack  );
966}
967
968/* The contents of this function are C++ specific, so the () macro is not used.
969 */
970void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out )
971{
972        if ( new_in )
973                {
974                yy_delete_buffer( YY_CURRENT_BUFFER );
975                yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE  ) );
976                }
977
978        if ( new_out )
979                yyout = new_out;
980}
981
982#ifdef YY_INTERACTIVE
983int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )
984#else
985int yyFlexLexer::LexerInput( char* buf, int max_size )
986#endif
987{
988        if ( yyin->eof() || yyin->fail() )
989                return 0;
990
991#ifdef YY_INTERACTIVE
992        yyin->get( buf[0] );
993
994        if ( yyin->eof() )
995                return 0;
996
997        if ( yyin->bad() )
998                return -1;
999
1000        return 1;
1001
1002#else
1003        (void) yyin->read( buf, max_size );
1004
1005        if ( yyin->bad() )
1006                return -1;
1007        else
1008                return yyin->gcount();
1009#endif
1010}
1011
1012void yyFlexLexer::LexerOutput( const char* buf, int size )
1013{
1014        (void) yyout->write( buf, size );
1015}
1016
1017/* yy_get_next_buffer - try to read in a new buffer
1018 *
1019 * Returns a code representing an action:
1020 *      EOB_ACT_LAST_MATCH -
1021 *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1022 *      EOB_ACT_END_OF_FILE - end of file
1023 */
1024int yyFlexLexer::yy_get_next_buffer()
1025{
1026        register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1027        register char *source = (yytext_ptr);
1028        register int number_to_move, i;
1029        int ret_val;
1030
1031        if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1032                YY_FATAL_ERROR(
1033                "fatal flex scanner internal error--end of buffer missed" );
1034
1035        if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1036                { /* Don't try to fill the buffer, so this is an EOF. */
1037                if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1038                        {
1039                        /* We matched a single character, the EOB, so
1040                         * treat this as a final EOF.
1041                         */
1042                        return EOB_ACT_END_OF_FILE;
1043                        }
1044
1045                else
1046                        {
1047                        /* We matched some text prior to the EOB, first
1048                         * process it.
1049                         */
1050                        return EOB_ACT_LAST_MATCH;
1051                        }
1052                }
1053
1054        /* Try to read more data. */
1055
1056        /* First move last chars to start of buffer. */
1057        number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1058
1059        for ( i = 0; i < number_to_move; ++i )
1060                *(dest++) = *(source++);
1061
1062        if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1063                /* don't do the read, it's not guaranteed to return an EOF,
1064                 * just force an EOF
1065                 */
1066                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1067
1068        else
1069                {
1070                        int num_to_read =
1071                        YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1072
1073                while ( num_to_read <= 0 )
1074                        { /* Not enough room in the buffer - grow it. */
1075
1076                        /* just a shorter name for the current buffer */
1077                        YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1078
1079                        int yy_c_buf_p_offset =
1080                                (int) ((yy_c_buf_p) - b->yy_ch_buf);
1081
1082                        if ( b->yy_is_our_buffer )
1083                                {
1084                                int new_size = b->yy_buf_size * 2;
1085
1086                                if ( new_size <= 0 )
1087                                        b->yy_buf_size += b->yy_buf_size / 8;
1088                                else
1089                                        b->yy_buf_size *= 2;
1090
1091                                b->yy_ch_buf = (char *)
1092                                        /* Include room in for 2 EOB chars. */
1093                                        yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
1094                                }
1095                        else
1096                                /* Can't grow it, we don't own it. */
1097                                b->yy_ch_buf = 0;
1098
1099                        if ( ! b->yy_ch_buf )
1100                                YY_FATAL_ERROR(
1101                                "fatal error - scanner input buffer overflow" );
1102
1103                        (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1104
1105                        num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1106                                                number_to_move - 1;
1107
1108                        }
1109
1110                if ( num_to_read > YY_READ_BUF_SIZE )
1111                        num_to_read = YY_READ_BUF_SIZE;
1112
1113                /* Read in more data. */
1114                YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1115                        (yy_n_chars), (size_t) num_to_read );
1116
1117                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1118                }
1119
1120        if ( (yy_n_chars) == 0 )
1121                {
1122                if ( number_to_move == YY_MORE_ADJ )
1123                        {
1124                        ret_val = EOB_ACT_END_OF_FILE;
1125                        yyrestart( yyin  );
1126                        }
1127
1128                else
1129                        {
1130                        ret_val = EOB_ACT_LAST_MATCH;
1131                        YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1132                                YY_BUFFER_EOF_PENDING;
1133                        }
1134                }
1135
1136        else
1137                ret_val = EOB_ACT_CONTINUE_SCAN;
1138
1139        if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1140                /* Extend the array by 50%, plus the number we really need. */
1141                yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1142                YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
1143                if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1144                        YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1145        }
1146
1147        (yy_n_chars) += number_to_move;
1148        YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1149        YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1150
1151        (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1152
1153        return ret_val;
1154}
1155
1156/* yy_get_previous_state - get the state just before the EOB char was reached */
1157
1158    yy_state_type yyFlexLexer::yy_get_previous_state()
1159{
1160        register yy_state_type yy_current_state;
1161        register char *yy_cp;
1162   
1163        yy_current_state = (yy_start);
1164
1165        for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1166                {
1167                register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1168                if ( yy_accept[yy_current_state] )
1169                        {
1170                        (yy_last_accepting_state) = yy_current_state;
1171                        (yy_last_accepting_cpos) = yy_cp;
1172                        }
1173                while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1174                        {
1175                        yy_current_state = (int) yy_def[yy_current_state];
1176                        if ( yy_current_state >= 44 )
1177                                yy_c = yy_meta[(unsigned int) yy_c];
1178                        }
1179                yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1180                }
1181
1182        return yy_current_state;
1183}
1184
1185/* yy_try_NUL_trans - try to make a transition on the NUL character
1186 *
1187 * synopsis
1188 *      next_state = yy_try_NUL_trans( current_state );
1189 */
1190    yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )
1191{
1192        register int yy_is_jam;
1193        register char *yy_cp = (yy_c_buf_p);
1194
1195        register YY_CHAR yy_c = 1;
1196        if ( yy_accept[yy_current_state] )
1197                {
1198                (yy_last_accepting_state) = yy_current_state;
1199                (yy_last_accepting_cpos) = yy_cp;
1200                }
1201        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1202                {
1203                yy_current_state = (int) yy_def[yy_current_state];
1204                if ( yy_current_state >= 44 )
1205                        yy_c = yy_meta[(unsigned int) yy_c];
1206                }
1207        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1208        yy_is_jam = (yy_current_state == 43);
1209
1210        return yy_is_jam ? 0 : yy_current_state;
1211}
1212
1213    void yyFlexLexer::yyunput( int c, register char* yy_bp)
1214{
1215        register char *yy_cp;
1216   
1217    yy_cp = (yy_c_buf_p);
1218
1219        /* undo effects of setting up yytext */
1220        *yy_cp = (yy_hold_char);
1221
1222        if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1223                { /* need to shift things up to make room */
1224                /* +2 for EOB chars. */
1225                register int number_to_move = (yy_n_chars) + 2;
1226                register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1227                                        YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1228                register char *source =
1229                                &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1230
1231                while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1232                        *--dest = *--source;
1233
1234                yy_cp += (int) (dest - source);
1235                yy_bp += (int) (dest - source);
1236                YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1237                        (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1238
1239                if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1240                        YY_FATAL_ERROR( "flex scanner push-back overflow" );
1241                }
1242
1243        *--yy_cp = (char) c;
1244
1245        (yytext_ptr) = yy_bp;
1246        (yy_hold_char) = *yy_cp;
1247        (yy_c_buf_p) = yy_cp;
1248}
1249
1250    int yyFlexLexer::yyinput()
1251{
1252        int c;
1253   
1254        *(yy_c_buf_p) = (yy_hold_char);
1255
1256        if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1257                {
1258                /* yy_c_buf_p now points to the character we want to return.
1259                 * If this occurs *before* the EOB characters, then it's a
1260                 * valid NUL; if not, then we've hit the end of the buffer.
1261                 */
1262                if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1263                        /* This was really a NUL. */
1264                        *(yy_c_buf_p) = '\0';
1265
1266                else
1267                        { /* need more input */
1268                        int offset = (yy_c_buf_p) - (yytext_ptr);
1269                        ++(yy_c_buf_p);
1270
1271                        switch ( yy_get_next_buffer(  ) )
1272                                {
1273                                case EOB_ACT_LAST_MATCH:
1274                                        /* This happens because yy_g_n_b()
1275                                         * sees that we've accumulated a
1276                                         * token and flags that we need to
1277                                         * try matching the token before
1278                                         * proceeding.  But for input(),
1279                                         * there's no matching to consider.
1280                                         * So convert the EOB_ACT_LAST_MATCH
1281                                         * to EOB_ACT_END_OF_FILE.
1282                                         */
1283
1284                                        /* Reset buffer status. */
1285                                        yyrestart( yyin );
1286
1287                                        /*FALLTHROUGH*/
1288
1289                                case EOB_ACT_END_OF_FILE:
1290                                        {
1291                                        if ( yywrap(  ) )
1292                                                return EOF;
1293
1294                                        if ( ! (yy_did_buffer_switch_on_eof) )
1295                                                YY_NEW_FILE;
1296#ifdef __cplusplus
1297                                        return yyinput();
1298#else
1299                                        return input();
1300#endif
1301                                        }
1302
1303                                case EOB_ACT_CONTINUE_SCAN:
1304                                        (yy_c_buf_p) = (yytext_ptr) + offset;
1305                                        break;
1306                                }
1307                        }
1308                }
1309
1310        c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
1311        *(yy_c_buf_p) = '\0';   /* preserve yytext */
1312        (yy_hold_char) = *++(yy_c_buf_p);
1313
1314        return c;
1315}
1316
1317/** Immediately switch to a different input stream.
1318 * @param input_file A readable stream.
1319 *
1320 * @note This function does not reset the start condition to @c INITIAL .
1321 */
1322    void yyFlexLexer::yyrestart( std::istream* input_file )
1323{
1324   
1325        if ( ! YY_CURRENT_BUFFER ){
1326        yyensure_buffer_stack ();
1327                YY_CURRENT_BUFFER_LVALUE =
1328            yy_create_buffer( yyin, YY_BUF_SIZE );
1329        }
1330
1331        yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1332        yy_load_buffer_state(  );
1333}
1334
1335/** Switch to a different input buffer.
1336 * @param new_buffer The new input buffer.
1337 *
1338 */
1339    void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1340{
1341   
1342        /* TODO. We should be able to replace this entire function body
1343         * with
1344         *              yypop_buffer_state();
1345         *              yypush_buffer_state(new_buffer);
1346     */
1347        yyensure_buffer_stack ();
1348        if ( YY_CURRENT_BUFFER == new_buffer )
1349                return;
1350
1351        if ( YY_CURRENT_BUFFER )
1352                {
1353                /* Flush out information for old buffer. */
1354                *(yy_c_buf_p) = (yy_hold_char);
1355                YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1356                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1357                }
1358
1359        YY_CURRENT_BUFFER_LVALUE = new_buffer;
1360        yy_load_buffer_state(  );
1361
1362        /* We don't actually know whether we did this switch during
1363         * EOF (yywrap()) processing, but the only time this flag
1364         * is looked at is after yywrap() is called, so it's safe
1365         * to go ahead and always set it.
1366         */
1367        (yy_did_buffer_switch_on_eof) = 1;
1368}
1369
1370    void yyFlexLexer::yy_load_buffer_state()
1371{
1372        (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1373        (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1374        yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1375        (yy_hold_char) = *(yy_c_buf_p);
1376}
1377
1378/** Allocate and initialize an input buffer state.
1379 * @param file A readable stream.
1380 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1381 *
1382 * @return the allocated buffer state.
1383 */
1384    YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size )
1385{
1386        YY_BUFFER_STATE b;
1387   
1388        b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
1389        if ( ! b )
1390                YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1391
1392        b->yy_buf_size = size;
1393
1394        /* yy_ch_buf has to be 2 characters longer than the size given because
1395         * we need to put in 2 end-of-buffer characters.
1396         */
1397        b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
1398        if ( ! b->yy_ch_buf )
1399                YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1400
1401        b->yy_is_our_buffer = 1;
1402
1403        yy_init_buffer( b, file );
1404
1405        return b;
1406}
1407
1408/** Destroy the buffer.
1409 * @param b a buffer created with yy_create_buffer()
1410 *
1411 */
1412    void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )
1413{
1414   
1415        if ( ! b )
1416                return;
1417
1418        if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1419                YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1420
1421        if ( b->yy_is_our_buffer )
1422                yyfree((void *) b->yy_ch_buf  );
1423
1424        yyfree((void *) b  );
1425}
1426
1427extern "C" int isatty (int );
1428
1429/* Initializes or reinitializes a buffer.
1430 * This function is sometimes called more than once on the same buffer,
1431 * such as during a yyrestart() or at EOF.
1432 */
1433    void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream* file )
1434
1435{
1436        int oerrno = errno;
1437   
1438        yy_flush_buffer( b );
1439
1440        b->yy_input_file = file;
1441        b->yy_fill_buffer = 1;
1442
1443    /* If b is the current buffer, then yy_init_buffer was _probably_
1444     * called from yyrestart() or through yy_get_next_buffer.
1445     * In that case, we don't want to reset the lineno or column.
1446     */
1447    if (b != YY_CURRENT_BUFFER){
1448        b->yy_bs_lineno = 1;
1449        b->yy_bs_column = 0;
1450    }
1451
1452        b->yy_is_interactive = 0;
1453        errno = oerrno;
1454}
1455
1456/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1457 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1458 *
1459 */
1460    void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b )
1461{
1462        if ( ! b )
1463                return;
1464
1465        b->yy_n_chars = 0;
1466
1467        /* We always need two end-of-buffer characters.  The first causes
1468         * a transition to the end-of-buffer state.  The second causes
1469         * a jam in that state.
1470         */
1471        b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1472        b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1473
1474        b->yy_buf_pos = &b->yy_ch_buf[0];
1475
1476        b->yy_at_bol = 1;
1477        b->yy_buffer_status = YY_BUFFER_NEW;
1478
1479        if ( b == YY_CURRENT_BUFFER )
1480                yy_load_buffer_state(  );
1481}
1482
1483/** Pushes the new state onto the stack. The new state becomes
1484 *  the current state. This function will allocate the stack
1485 *  if necessary.
1486 *  @param new_buffer The new state.
1487 * 
1488 */
1489void yyFlexLexer::yypush_buffer_state (YY_BUFFER_STATE new_buffer)
1490{
1491        if (new_buffer == NULL)
1492                return;
1493
1494        yyensure_buffer_stack();
1495
1496        /* This block is copied from yy_switch_to_buffer. */
1497        if ( YY_CURRENT_BUFFER )
1498                {
1499                /* Flush out information for old buffer. */
1500                *(yy_c_buf_p) = (yy_hold_char);
1501                YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1502                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1503                }
1504
1505        /* Only push if top exists. Otherwise, replace top. */
1506        if (YY_CURRENT_BUFFER)
1507                (yy_buffer_stack_top)++;
1508        YY_CURRENT_BUFFER_LVALUE = new_buffer;
1509
1510        /* copied from yy_switch_to_buffer. */
1511        yy_load_buffer_state(  );
1512        (yy_did_buffer_switch_on_eof) = 1;
1513}
1514
1515/** Removes and deletes the top of the stack, if present.
1516 *  The next element becomes the new top.
1517 * 
1518 */
1519void yyFlexLexer::yypop_buffer_state (void)
1520{
1521        if (!YY_CURRENT_BUFFER)
1522                return;
1523
1524        yy_delete_buffer(YY_CURRENT_BUFFER );
1525        YY_CURRENT_BUFFER_LVALUE = NULL;
1526        if ((yy_buffer_stack_top) > 0)
1527                --(yy_buffer_stack_top);
1528
1529        if (YY_CURRENT_BUFFER) {
1530                yy_load_buffer_state(  );
1531                (yy_did_buffer_switch_on_eof) = 1;
1532        }
1533}
1534
1535/* Allocates the stack if it does not exist.
1536 *  Guarantees space for at least one push.
1537 */
1538void yyFlexLexer::yyensure_buffer_stack(void)
1539{
1540        int num_to_alloc;
1541   
1542        if (!(yy_buffer_stack)) {
1543
1544                /* First allocation is just for 2 elements, since we don't know if this
1545                 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1546                 * immediate realloc on the next call.
1547         */
1548                num_to_alloc = 1;
1549                (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1550                                                                (num_to_alloc * sizeof(struct yy_buffer_state*)
1551                                                                );
1552                if ( ! (yy_buffer_stack) )
1553                        YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1554                                                                 
1555                memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1556                               
1557                (yy_buffer_stack_max) = num_to_alloc;
1558                (yy_buffer_stack_top) = 0;
1559                return;
1560        }
1561
1562        if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1563
1564                /* Increase the buffer to prepare for a possible push. */
1565                int grow_size = 8 /* arbitrary grow size */;
1566
1567                num_to_alloc = (yy_buffer_stack_max) + grow_size;
1568                (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1569                                                                ((yy_buffer_stack),
1570                                                                num_to_alloc * sizeof(struct yy_buffer_state*)
1571                                                                );
1572                if ( ! (yy_buffer_stack) )
1573                        YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1574
1575                /* zero only the new slots.*/
1576                memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1577                (yy_buffer_stack_max) = num_to_alloc;
1578        }
1579}
1580
1581    void yyFlexLexer::yy_push_state( int new_state )
1582{
1583        if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
1584                {
1585                yy_size_t new_size;
1586
1587                (yy_start_stack_depth) += YY_START_STACK_INCR;
1588                new_size = (yy_start_stack_depth) * sizeof( int );
1589
1590                if ( ! (yy_start_stack) )
1591                        (yy_start_stack) = (int *) yyalloc(new_size  );
1592
1593                else
1594                        (yy_start_stack) = (int *) yyrealloc((void *) (yy_start_stack),new_size  );
1595
1596                if ( ! (yy_start_stack) )
1597                        YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
1598                }
1599
1600        (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
1601
1602        BEGIN(new_state);
1603}
1604
1605    void yyFlexLexer::yy_pop_state()
1606{
1607        if ( --(yy_start_stack_ptr) < 0 )
1608                YY_FATAL_ERROR( "start-condition stack underflow" );
1609
1610        BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
1611}
1612
1613    int yyFlexLexer::yy_top_state()
1614{
1615        return (yy_start_stack)[(yy_start_stack_ptr) - 1];
1616}
1617
1618#ifndef YY_EXIT_FAILURE
1619#define YY_EXIT_FAILURE 2
1620#endif
1621
1622void yyFlexLexer::LexerError( yyconst char msg[] )
1623{
1624        std::cerr << msg << std::endl;
1625        exit( YY_EXIT_FAILURE );
1626}
1627
1628/* Redefine yyless() so it works in section 3 code. */
1629
1630#undef yyless
1631#define yyless(n) \
1632        do \
1633                { \
1634                /* Undo effects of setting up yytext. */ \
1635        int yyless_macro_arg = (n); \
1636        YY_LESS_LINENO(yyless_macro_arg);\
1637                yytext[yyleng] = (yy_hold_char); \
1638                (yy_c_buf_p) = yytext + yyless_macro_arg; \
1639                (yy_hold_char) = *(yy_c_buf_p); \
1640                *(yy_c_buf_p) = '\0'; \
1641                yyleng = yyless_macro_arg; \
1642                } \
1643        while ( 0 )
1644
1645/* Accessor  methods (get/set functions) to struct members. */
1646
1647/*
1648 * Internal utility routines.
1649 */
1650
1651#ifndef yytext_ptr
1652static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1653{
1654        register int i;
1655        for ( i = 0; i < n; ++i )
1656                s1[i] = s2[i];
1657}
1658#endif
1659
1660#ifdef YY_NEED_STRLEN
1661static int yy_flex_strlen (yyconst char * s )
1662{
1663        register int n;
1664        for ( n = 0; s[n]; ++n )
1665                ;
1666
1667        return n;
1668}
1669#endif
1670
1671void *yyalloc (yy_size_t  size )
1672{
1673        return (void *) malloc( size );
1674}
1675
1676void *yyrealloc  (void * ptr, yy_size_t  size )
1677{
1678        /* The cast to (char *) in the following accommodates both
1679         * implementations that use char* generic pointers, and those
1680         * that use void* generic pointers.  It works with the latter
1681         * because both ANSI C and C++ allow castless assignment from
1682         * any pointer type to void*, and deal with argument conversions
1683         * as though doing an assignment.
1684         */
1685        return (void *) realloc( (char *) ptr, size );
1686}
1687
1688void yyfree (void * ptr )
1689{
1690        free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
1691}
1692
1693#define YYTABLES_NAME "yytables"
1694
1695#line 82 "conv_f8tof1_scanner.l"
1696
1697
1698/**
1699  * reset the line and column count
1700  */
1701void reset_lexer(void)
1702{
1703        line = 1;
1704        col  = 1;   
1705}
1706
1707/**
1708  * yyerror() is invoked when the lexer or the parser encounter
1709  * an error. The error message is passed via *s
1710  */
1711void yyerror(char *s)
1712{
1713        printf("error: %s at line: %d col: %d\n",s,line,col);
1714}
1715
1716/*int yywrap(void)
1717{
1718        return 1;
1719}*/
1720
Note: See TracBrowser for help on using the repository browser.