/home/cern/BDSIM_new/parser/lex.yy.c

00001 
00002 #line 3 "lex.yy.c"
00003 
00004 #define  YY_INT_ALIGNED short int
00005 
00006 /* A lexical scanner generated by flex */
00007 
00008 #define FLEX_SCANNER
00009 #define YY_FLEX_MAJOR_VERSION 2
00010 #define YY_FLEX_MINOR_VERSION 5
00011 #define YY_FLEX_SUBMINOR_VERSION 33
00012 #if YY_FLEX_SUBMINOR_VERSION > 0
00013 #define FLEX_BETA
00014 #endif
00015 
00016 /* First, we deal with  platform-specific or compiler-specific issues. */
00017 
00018 /* begin standard C headers. */
00019 #include <stdio.h>
00020 #include <string.h>
00021 #include <errno.h>
00022 #include <stdlib.h>
00023 
00024 /* end standard C headers. */
00025 
00026 /* flex integer type definitions */
00027 
00028 #ifndef FLEXINT_H
00029 #define FLEXINT_H
00030 
00031 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
00032 
00033 #if __STDC_VERSION__ >= 199901L
00034 
00035 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
00036  * if you want the limit (max/min) macros for int types. 
00037  */
00038 #ifndef __STDC_LIMIT_MACROS
00039 #define __STDC_LIMIT_MACROS 1
00040 #endif
00041 
00042 #include <inttypes.h>
00043 typedef int8_t flex_int8_t;
00044 typedef uint8_t flex_uint8_t;
00045 typedef int16_t flex_int16_t;
00046 typedef uint16_t flex_uint16_t;
00047 typedef int32_t flex_int32_t;
00048 typedef uint32_t flex_uint32_t;
00049 #else
00050 typedef signed char flex_int8_t;
00051 typedef short int flex_int16_t;
00052 typedef int flex_int32_t;
00053 typedef unsigned char flex_uint8_t; 
00054 typedef unsigned short int flex_uint16_t;
00055 typedef unsigned int flex_uint32_t;
00056 #endif /* ! C99 */
00057 
00058 /* Limits of integral types. */
00059 #ifndef INT8_MIN
00060 #define INT8_MIN               (-128)
00061 #endif
00062 #ifndef INT16_MIN
00063 #define INT16_MIN              (-32767-1)
00064 #endif
00065 #ifndef INT32_MIN
00066 #define INT32_MIN              (-2147483647-1)
00067 #endif
00068 #ifndef INT8_MAX
00069 #define INT8_MAX               (127)
00070 #endif
00071 #ifndef INT16_MAX
00072 #define INT16_MAX              (32767)
00073 #endif
00074 #ifndef INT32_MAX
00075 #define INT32_MAX              (2147483647)
00076 #endif
00077 #ifndef UINT8_MAX
00078 #define UINT8_MAX              (255U)
00079 #endif
00080 #ifndef UINT16_MAX
00081 #define UINT16_MAX             (65535U)
00082 #endif
00083 #ifndef UINT32_MAX
00084 #define UINT32_MAX             (4294967295U)
00085 #endif
00086 
00087 #endif /* ! FLEXINT_H */
00088 
00089 #ifdef __cplusplus
00090 
00091 /* The "const" storage-class-modifier is valid. */
00092 #define YY_USE_CONST
00093 
00094 #else   /* ! __cplusplus */
00095 
00096 #if __STDC__
00097 
00098 #define YY_USE_CONST
00099 
00100 #endif  /* __STDC__ */
00101 #endif  /* ! __cplusplus */
00102 
00103 #ifdef YY_USE_CONST
00104 #define yyconst const
00105 #else
00106 #define yyconst
00107 #endif
00108 
00109 /* Returned upon end-of-file. */
00110 #define YY_NULL 0
00111 
00112 /* Promotes a possibly negative, possibly signed char to an unsigned
00113  * integer for use as an array index.  If the signed char is negative,
00114  * we want to instead treat it as an 8-bit unsigned char, hence the
00115  * double cast.
00116  */
00117 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
00118 
00119 /* Enter a start condition.  This macro really ought to take a parameter,
00120  * but we do it the disgusting crufty way forced on us by the ()-less
00121  * definition of BEGIN.
00122  */
00123 #define BEGIN (yy_start) = 1 + 2 *
00124 
00125 /* Translate the current start state into a value that can be later handed
00126  * to BEGIN to return to the state.  The YYSTATE alias is for lex
00127  * compatibility.
00128  */
00129 #define YY_START (((yy_start) - 1) / 2)
00130 #define YYSTATE YY_START
00131 
00132 /* Action number for EOF rule of a given start state. */
00133 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
00134 
00135 /* Special action meaning "start processing a new file". */
00136 #define YY_NEW_FILE yyrestart(yyin  )
00137 
00138 #define YY_END_OF_BUFFER_CHAR 0
00139 
00140 /* Size of default input buffer. */
00141 #ifndef YY_BUF_SIZE
00142 #define YY_BUF_SIZE 16384
00143 #endif
00144 
00145 /* The state buf must be large enough to hold one state per character in the main buffer.
00146  */
00147 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
00148 
00149 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
00150 #define YY_TYPEDEF_YY_BUFFER_STATE
00151 typedef struct yy_buffer_state *YY_BUFFER_STATE;
00152 #endif
00153 
00154 extern int yyleng;
00155 
00156 extern FILE *yyin, *yyout;
00157 
00158 #define EOB_ACT_CONTINUE_SCAN 0
00159 #define EOB_ACT_END_OF_FILE 1
00160 #define EOB_ACT_LAST_MATCH 2
00161 
00162     #define YY_LESS_LINENO(n)
00163     
00164 /* Return all but the first "n" matched characters back to the input stream. */
00165 #define yyless(n) \
00166         do \
00167                 { \
00168                 /* Undo effects of setting up yytext. */ \
00169         int yyless_macro_arg = (n); \
00170         YY_LESS_LINENO(yyless_macro_arg);\
00171                 *yy_cp = (yy_hold_char); \
00172                 YY_RESTORE_YY_MORE_OFFSET \
00173                 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
00174                 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
00175                 } \
00176         while ( 0 )
00177 
00178 #define unput(c) yyunput( c, (yytext_ptr)  )
00179 
00180 /* The following is because we cannot portably get our hands on size_t
00181  * (without autoconf's help, which isn't available because we want
00182  * flex-generated scanners to compile on their own).
00183  */
00184 
00185 #ifndef YY_TYPEDEF_YY_SIZE_T
00186 #define YY_TYPEDEF_YY_SIZE_T
00187 typedef unsigned int yy_size_t;
00188 #endif
00189 
00190 #ifndef YY_STRUCT_YY_BUFFER_STATE
00191 #define YY_STRUCT_YY_BUFFER_STATE
00192 struct yy_buffer_state
00193         {
00194         FILE *yy_input_file;
00195 
00196         char *yy_ch_buf;                /* input buffer */
00197         char *yy_buf_pos;               /* current position in input buffer */
00198 
00199         /* Size of input buffer in bytes, not including room for EOB
00200          * characters.
00201          */
00202         yy_size_t yy_buf_size;
00203 
00204         /* Number of characters read into yy_ch_buf, not including EOB
00205          * characters.
00206          */
00207         int yy_n_chars;
00208 
00209         /* Whether we "own" the buffer - i.e., we know we created it,
00210          * and can realloc() it to grow it, and should free() it to
00211          * delete it.
00212          */
00213         int yy_is_our_buffer;
00214 
00215         /* Whether this is an "interactive" input source; if so, and
00216          * if we're using stdio for input, then we want to use getc()
00217          * instead of fread(), to make sure we stop fetching input after
00218          * each newline.
00219          */
00220         int yy_is_interactive;
00221 
00222         /* Whether we're considered to be at the beginning of a line.
00223          * If so, '^' rules will be active on the next match, otherwise
00224          * not.
00225          */
00226         int yy_at_bol;
00227 
00228     int yy_bs_lineno; 
00229     int yy_bs_column; 
00231         /* Whether to try to fill the input buffer when we reach the
00232          * end of it.
00233          */
00234         int yy_fill_buffer;
00235 
00236         int yy_buffer_status;
00237 
00238 #define YY_BUFFER_NEW 0
00239 #define YY_BUFFER_NORMAL 1
00240         /* When an EOF's been seen but there's still some text to process
00241          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
00242          * shouldn't try reading from the input source any more.  We might
00243          * still have a bunch of tokens to match, though, because of
00244          * possible backing-up.
00245          *
00246          * When we actually see the EOF, we change the status to "new"
00247          * (via yyrestart()), so that the user can continue scanning by
00248          * just pointing yyin at a new input file.
00249          */
00250 #define YY_BUFFER_EOF_PENDING 2
00251 
00252         };
00253 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
00254 
00255 /* Stack of input buffers. */
00256 static size_t yy_buffer_stack_top = 0; 
00257 static size_t yy_buffer_stack_max = 0; 
00258 static YY_BUFFER_STATE * yy_buffer_stack = 0; 
00260 /* We provide macros for accessing buffer states in case in the
00261  * future we want to put the buffer states in a more general
00262  * "scanner state".
00263  *
00264  * Returns the top of the stack, or NULL.
00265  */
00266 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
00267                           ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
00268                           : NULL)
00269 
00270 /* Same as previous macro, but useful when we know that the buffer stack is not
00271  * NULL or when we need an lvalue. For internal use only.
00272  */
00273 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
00274 
00275 /* yy_hold_char holds the character lost when yytext is formed. */
00276 static char yy_hold_char;
00277 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
00278 int yyleng;
00279 
00280 /* Points to current character in buffer. */
00281 static char *yy_c_buf_p = (char *) 0;
00282 static int yy_init = 0;         /* whether we need to initialize */
00283 static int yy_start = 0;        /* start state number */
00284 
00285 /* Flag which is used to allow yywrap()'s to do buffer switches
00286  * instead of setting up a fresh yyin.  A bit of a hack ...
00287  */
00288 static int yy_did_buffer_switch_on_eof;
00289 
00290 void yyrestart (FILE *input_file  );
00291 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
00292 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
00293 void yy_delete_buffer (YY_BUFFER_STATE b  );
00294 void yy_flush_buffer (YY_BUFFER_STATE b  );
00295 void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
00296 void yypop_buffer_state (void );
00297 
00298 static void yyensure_buffer_stack (void );
00299 static void yy_load_buffer_state (void );
00300 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
00301 
00302 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
00303 
00304 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
00305 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
00306 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len  );
00307 
00308 void *yyalloc (yy_size_t  );
00309 void *yyrealloc (void *,yy_size_t  );
00310 void yyfree (void *  );
00311 
00312 #define yy_new_buffer yy_create_buffer
00313 
00314 #define yy_set_interactive(is_interactive) \
00315         { \
00316         if ( ! YY_CURRENT_BUFFER ){ \
00317         yyensure_buffer_stack (); \
00318                 YY_CURRENT_BUFFER_LVALUE =    \
00319             yy_create_buffer(yyin,YY_BUF_SIZE ); \
00320         } \
00321         YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
00322         }
00323 
00324 #define yy_set_bol(at_bol) \
00325         { \
00326         if ( ! YY_CURRENT_BUFFER ){\
00327         yyensure_buffer_stack (); \
00328                 YY_CURRENT_BUFFER_LVALUE =    \
00329             yy_create_buffer(yyin,YY_BUF_SIZE ); \
00330         } \
00331         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
00332         }
00333 
00334 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
00335 
00336 /* Begin user sect3 */
00337 
00338 typedef unsigned char YY_CHAR;
00339 
00340 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
00341 
00342 typedef int yy_state_type;
00343 
00344 extern int yylineno;
00345 
00346 int yylineno = 1;
00347 
00348 extern char *yytext;
00349 #define yytext_ptr yytext
00350 
00351 static yy_state_type yy_get_previous_state (void );
00352 static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
00353 static int yy_get_next_buffer (void );
00354 static void yy_fatal_error (yyconst char msg[]  );
00355 
00356 /* Done after the current pattern has been matched and before the
00357  * corresponding action - sets up yytext.
00358  */
00359 #define YY_DO_BEFORE_ACTION \
00360         (yytext_ptr) = yy_bp; \
00361         yyleng = (size_t) (yy_cp - yy_bp); \
00362         (yy_hold_char) = *yy_cp; \
00363         *yy_cp = '\0'; \
00364         (yy_c_buf_p) = yy_cp;
00365 
00366 #define YY_NUM_RULES 64
00367 #define YY_END_OF_BUFFER 65
00368 /* This struct is not used in this scanner,
00369    but its presence is necessary. */
00370 struct yy_trans_info
00371         {
00372         flex_int32_t yy_verify;
00373         flex_int32_t yy_nxt;
00374         };
00375 static yyconst flex_int16_t yy_accept[283] =
00376     {   0,
00377         0,    0,   61,   61,    0,    0,   65,   60,    1,   63,
00378        60,   60,   59,    2,    2,   60,   60,   60,   60,   59,
00379        59,   59,   59,   59,   59,   59,   59,   59,   59,   59,
00380        59,   59,   59,   59,   59,   59,   59,   59,   59,   62,
00381        61,   64,    1,    0,    7,    0,   57,   59,    2,    0,
00382         2,    2,   58,    3,    5,    6,    4,   59,   59,   59,
00383        59,   59,   59,   59,   59,   59,   59,   59,   59,   59,
00384        59,   59,   59,   39,   59,   59,   59,   59,   59,   59,
00385        59,   59,   59,   59,   59,   59,   59,   59,   59,   59,
00386        59,   59,   59,   59,   59,   59,   59,   59,   59,   59,
00387 
00388        59,   62,   61,    0,    2,   59,   59,   59,   59,   59,
00389        59,   59,   38,   59,   59,   59,   59,   59,   59,   59,
00390        43,   59,   40,   28,   59,   59,   59,   59,   59,   59,
00391        59,   59,   59,   59,   59,   59,   59,   59,   59,   59,
00392        59,   59,   59,   59,   59,   59,   59,   59,   59,   59,
00393        59,   51,   59,   59,   31,   45,   59,   59,   59,   59,
00394        59,   59,   56,   48,   23,   59,   41,   59,   59,   59,
00395        59,   59,   33,   59,   59,   59,   59,   59,   59,   27,
00396        59,   59,   59,   59,   22,   59,   59,   59,   59,   59,
00397        59,   50,   59,   59,   59,   59,   59,   42,   54,   59,
00398 
00399        59,   59,    9,   59,   59,   14,   59,   59,   32,   59,
00400        59,   59,   59,   59,   59,   47,   59,   37,   13,   59,
00401        59,   59,   12,   59,   59,   59,   59,   55,   15,   34,
00402        59,   59,   11,   59,   59,   59,   16,    8,   30,   59,
00403        59,   46,   36,   59,   49,   59,   52,   59,   59,   59,
00404        29,   59,   53,   24,   59,   44,   59,   59,   59,   59,
00405        59,   59,   59,   59,   35,   59,   19,   59,   10,   59,
00406        21,   59,   59,   20,   59,   18,   59,   26,   17,   59,
00407        25,    0
00408     } ;
00409 
00410 static yyconst flex_int32_t yy_ec[256] =
00411     {   0,
00412         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
00413         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00414         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00415         1,    2,    4,    5,    6,    1,    1,    1,    1,    1,
00416         1,    1,    7,    1,    7,    8,    1,    9,   10,   10,
00417        11,   10,   10,   10,   10,   10,   10,   12,   13,   14,
00418        15,   16,    1,    1,   18,   19,   20,   21,   22,   23,
00419        24,   25,   26,    6,   27,   28,   29,   30,   31,   32,
00420        33,   34,   35,   36,   37,   38,   39,   40,   41,    6,
00421         1,    1,    1,    1,   17,    1,   18,   19,   20,   21,
00422 
00423        22,   23,   24,   25,   26,    6,   27,   28,   29,   30,
00424        31,   32,   33,   34,   35,   36,   37,   38,   39,   40,
00425        41,    6,    1,    7,    1,    1,    1,    1,    1,    1,
00426         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00427         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00428         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00429         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00430         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00431         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00432         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00433 
00434         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00435         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00436         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00437         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00438         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00439         1,    1,    1,    1,    1
00440     } ;
00441 
00442 static yyconst flex_int32_t yy_meta[42] =
00443     {   0,
00444         1,    2,    2,    1,    1,    3,    1,    1,    3,    3,
00445         3,    1,    2,    1,    1,    1,    3,    3,    3,    3,
00446         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
00447         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
00448         3
00449     } ;
00450 
00451 static yyconst flex_int16_t yy_base[288] =
00452     {   0,
00453         0,    0,   40,   42,    0,    0,  325,  326,  322,  326,
00454       320,  317,    0,   37,   41,  306,   41,  305,  304,   22,
00455       296,   29,   35,   45,   36,  299,  289,   47,  289,   50,
00456        53,   54,   57,  277,   62,   70,   59,  278,  285,    0,
00457       309,  326,  308,  306,  326,  303,  326,    0,   93,   98,
00458       101,  108,  326,  326,  326,  326,  326,  285,  275,   96,
00459       277,  286,  267,  270,  275,  271,   69,   91,  278,  270,
00460       263,  261,  269,    0,  274,  273,  257,  261,   61,  262,
00461       253,  252,  253,  254,  259,  266,  253,  260,  250,  244,
00462       259,  249,  255,  236,  247,  243,  255,  242,  245,  248,
00463 
00464       243,    0,  266,  118,  124,  233,  237,  236,  238,  245,
00465       234,  232,    0,  229,  236,  226,  226,  228,  226,  232,
00466         0,  231,    0,    0,  232,  223,  223,  227,  226,  220,
00467       225,  209,  207,  217,  216,  219,  210,  218,  214,  207,
00468       208,  198,  216,  201,  202,  195,  208,  197,  198,  197,
00469       191,    0,  205,  188,    0,    0,  193,  213,  195,  188,
00470       191,  182,    0,    0,    0,  195,    0,  186,  188,  177,
00471       191,  178,    0,  189,  188,  183,  176,  176,  175,    0,
00472       169,  170,  181,  181,    0,  167,  162,  171,  177,  160,
00473       166,    0,  160,  172,  158,  165,  157,    0,    0,  161,
00474 
00475       161,  166,    0,  157,  168,    0,  164,  150,    0,  149,
00476       159,  149,  149,  149,  157,    0,  140,    0,    0,  146,
00477       149,  152,    0,  141,  141,  148,  142,    0,    0,    0,
00478       151,  146,    0,  131,  137,  143,    0,    0,    0,  133,
00479       135,    0,    0,  130,    0,  125,    0,  129,  133,  127,
00480         0,  121,    0,    0,  134,    0,  127,  132,  122,  111,
00481       123,  129,  115,  117,    0,  124,    0,  103,    0,  103,
00482         0,   95,   88,    0,   99,    0,   88,    0,    0,   66,
00483         0,  326,  135,  138,  141,   75,  144
00484     } ;
00485 
00486 static yyconst flex_int16_t yy_def[288] =
00487     {   0,
00488       282,    1,  283,  283,    1,    1,  282,  282,  282,  282,
00489       284,  285,  286,  282,  282,  282,  282,  282,  282,  286,
00490       286,  286,  286,  286,  286,  286,  286,  286,  286,  286,
00491       286,  286,  286,  286,  286,  286,  286,  286,  286,  287,
00492       282,  282,  282,  284,  282,  285,  282,  286,  282,  282,
00493       282,  282,  282,  282,  282,  282,  282,  286,  286,  286,
00494       286,  286,  286,  286,  286,  286,  286,  286,  286,  286,
00495       286,  286,  286,  286,  286,  286,  286,  286,  286,  286,
00496       286,  286,  286,  286,  286,  286,  286,  286,  286,  286,
00497       286,  286,  286,  286,  286,  286,  286,  286,  286,  286,
00498 
00499       286,  287,  282,  282,  282,  286,  286,  286,  286,  286,
00500       286,  286,  286,  286,  286,  286,  286,  286,  286,  286,
00501       286,  286,  286,  286,  286,  286,  286,  286,  286,  286,
00502       286,  286,  286,  286,  286,  286,  286,  286,  286,  286,
00503       286,  286,  286,  286,  286,  286,  286,  286,  286,  286,
00504       286,  286,  286,  286,  286,  286,  286,  286,  286,  286,
00505       286,  286,  286,  286,  286,  286,  286,  286,  286,  286,
00506       286,  286,  286,  286,  286,  286,  286,  286,  286,  286,
00507       286,  286,  286,  286,  286,  286,  286,  286,  286,  286,
00508       286,  286,  286,  286,  286,  286,  286,  286,  286,  286,
00509 
00510       286,  286,  286,  286,  286,  286,  286,  286,  286,  286,
00511       286,  286,  286,  286,  286,  286,  286,  286,  286,  286,
00512       286,  286,  286,  286,  286,  286,  286,  286,  286,  286,
00513       286,  286,  286,  286,  286,  286,  286,  286,  286,  286,
00514       286,  286,  286,  286,  286,  286,  286,  286,  286,  286,
00515       286,  286,  286,  286,  286,  286,  286,  286,  286,  286,
00516       286,  286,  286,  286,  286,  286,  286,  286,  286,  286,
00517       286,  286,  286,  286,  286,  286,  286,  286,  286,  286,
00518       286,    0,  282,  282,  282,  282,  282
00519     } ;
00520 
00521 static yyconst flex_int16_t yy_nxt[368] =
00522     {   0,
00523         8,    9,   10,   11,   12,   13,    8,   14,   15,   15,
00524        15,   16,    8,   17,   18,   19,    8,   20,   21,   22,
00525        23,   24,   25,   26,   27,   28,   29,   30,   31,   13,
00526        32,   33,   34,   35,   36,   37,   38,   39,   13,   13,
00527        13,   41,   42,   41,   42,   49,   49,   49,   51,   52,
00528        52,   52,   42,   58,   42,   54,   55,   59,   50,   61,
00529        64,   70,   50,   62,   67,   63,   71,   77,   65,   74,
00530        79,   66,   68,   81,   69,   78,   75,   48,   83,   87,
00531        88,   89,   84,   90,   91,   82,  281,   92,   93,   80,
00532        85,   94,   97,  117,  130,   98,  131,   99,  280,  118,
00533 
00534        95,   49,   49,   49,  104,   96,  105,  105,  105,   49,
00535        49,   49,  119,  108,   50,   51,   52,   52,   52,  109,
00536       279,  278,   50,  277,  276,  120,  105,  105,  105,   50,
00537       275,  110,  105,  105,  105,   40,   40,   40,   44,   44,
00538        44,   46,   46,   46,  102,  274,  102,  273,  272,  271,
00539       270,  269,  268,  267,  266,  265,  264,  263,  262,  261,
00540       260,  259,  258,  257,  256,  255,  254,  253,  252,  251,
00541       250,  249,  248,  247,  246,  245,  244,  243,  242,  241,
00542       240,  239,  238,  237,  236,  235,  234,  233,  232,  231,
00543       230,  229,  228,  227,  226,  225,  224,  223,  222,  221,
00544 
00545       220,  219,  218,  217,  216,  215,  214,  213,  212,  211,
00546       210,  209,  208,  207,  206,  205,  204,  203,  202,  201,
00547       200,  199,  198,  197,  196,  195,  194,  193,  192,  191,
00548       190,  189,  188,  187,  186,  185,  184,  183,  182,  181,
00549       180,  179,  178,  177,  176,  175,  174,  173,  172,  171,
00550       170,  169,  168,  167,  166,  165,  164,  163,  162,  161,
00551       160,  159,  158,  157,  156,  155,  154,  103,  153,  152,
00552       151,  150,  149,  148,  147,  146,  145,  144,  143,  142,
00553       141,  140,  139,  138,  137,  136,  135,  134,  133,  132,
00554       129,  128,  127,  126,  125,  124,  123,  122,  121,  116,
00555 
00556       115,  114,  113,  112,  111,  107,  106,   47,   45,   43,
00557       103,  101,  100,   86,   76,   73,   72,   60,   57,   56,
00558        53,   47,   45,   43,  282,    7,  282,  282,  282,  282,
00559       282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
00560       282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
00561       282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
00562       282,  282,  282,  282,  282,  282,  282
00563     } ;
00564 
00565 static yyconst flex_int16_t yy_chk[368] =
00566     {   0,
00567         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00568         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00569         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00570         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00571         1,    3,    3,    4,    4,   14,   14,   14,   15,   15,
00572        15,   15,    3,   20,    4,   17,   17,   20,   14,   22,
00573        23,   25,   15,   22,   24,   22,   25,   30,   23,   28,
00574        31,   23,   24,   32,   24,   30,   28,  286,   33,   35,
00575        35,   35,   33,   35,   35,   32,  280,   36,   36,   31,
00576        33,   36,   37,   67,   79,   37,   79,   37,  277,   67,
00577 
00578        36,   49,   49,   49,   50,   36,   50,   50,   50,   51,
00579        51,   51,   68,   60,   49,   52,   52,   52,   52,   60,
00580       275,  273,   51,  272,  270,   68,  104,  104,  104,   52,
00581       268,   60,  105,  105,  105,  283,  283,  283,  284,  284,
00582       284,  285,  285,  285,  287,  266,  287,  264,  263,  262,
00583       261,  260,  259,  258,  257,  255,  252,  250,  249,  248,
00584       246,  244,  241,  240,  236,  235,  234,  232,  231,  227,
00585       226,  225,  224,  222,  221,  220,  217,  215,  214,  213,
00586       212,  211,  210,  208,  207,  205,  204,  202,  201,  200,
00587       197,  196,  195,  194,  193,  191,  190,  189,  188,  187,
00588 
00589       186,  184,  183,  182,  181,  179,  178,  177,  176,  175,
00590       174,  172,  171,  170,  169,  168,  166,  162,  161,  160,
00591       159,  158,  157,  154,  153,  151,  150,  149,  148,  147,
00592       146,  145,  144,  143,  142,  141,  140,  139,  138,  137,
00593       136,  135,  134,  133,  132,  131,  130,  129,  128,  127,
00594       126,  125,  122,  120,  119,  118,  117,  116,  115,  114,
00595       112,  111,  110,  109,  108,  107,  106,  103,  101,  100,
00596        99,   98,   97,   96,   95,   94,   93,   92,   91,   90,
00597        89,   88,   87,   86,   85,   84,   83,   82,   81,   80,
00598        78,   77,   76,   75,   73,   72,   71,   70,   69,   66,
00599 
00600        65,   64,   63,   62,   61,   59,   58,   46,   44,   43,
00601        41,   39,   38,   34,   29,   27,   26,   21,   19,   18,
00602        16,   12,   11,    9,    7,  282,  282,  282,  282,  282,
00603       282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
00604       282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
00605       282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
00606       282,  282,  282,  282,  282,  282,  282
00607     } ;
00608 
00609 static yy_state_type yy_last_accepting_state;
00610 static char *yy_last_accepting_cpos;
00611 
00612 extern int yy_flex_debug;
00613 int yy_flex_debug = 0;
00614 
00615 /* The intent behind this definition is that it'll catch
00616  * any uses of REJECT which flex missed.
00617  */
00618 #define REJECT reject_used_but_not_detected
00619 #define yymore() yymore_used_but_not_detected
00620 #define YY_MORE_ADJ 0
00621 #define YY_RESTORE_YY_MORE_OFFSET
00622 char *yytext;
00623 #line 1 "parser.l"
00624 /*
00625  *  Lexical analyzer for gmad bison parser  
00626  *  Ilya Agapov, 2005
00627  *  
00628 */
00629 
00630 /*
00631 %option yylineno
00632 */
00633 #line 16 "parser.l"
00634   
00635 #include <iostream>
00636 #include <cstring>
00637 #include "parser.tab.h"
00638 #include "sym_table.h"
00639   
00640 using namespace std;
00641  
00642 int match_var(char *name);
00643 struct symtab * symlook(char *s);
00644 extern struct symtab *symtab;
00645 extern int yyerror(char *s);
00646 
00647 #ifdef _WIN32
00648 #include <io.h>
00649 #define YY_NO_UNISTD_H 1
00650 #endif
00651 
00652 #define MAX_INCLUDE_DEPTH 10
00653 YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
00654 char include_filename_stack[MAX_INCLUDE_DEPTH][32];
00655 int include_linenum_stack[MAX_INCLUDE_DEPTH];
00656 int include_stack_ptr = 0;
00657 
00658 int line_num = 1;
00659 char* yyfilename;
00660 
00661 
00662 
00663 
00664 #line 665 "lex.yy.c"
00665 
00666 #define INITIAL 0
00667 #define incl 1
00668 #define ERROR 2
00669 
00670 #ifndef YY_NO_UNISTD_H
00671 /* Special case for "unistd.h", since it is non-ANSI. We include it way
00672  * down here because we want the user's section 1 to have been scanned first.
00673  * The user has a chance to override it with an option.
00674  */
00675 #include <unistd.h>
00676 #endif
00677 
00678 #ifndef YY_EXTRA_TYPE
00679 #define YY_EXTRA_TYPE void *
00680 #endif
00681 
00682 static int yy_init_globals (void );
00683 
00684 /* Macros after this point can all be overridden by user definitions in
00685  * section 1.
00686  */
00687 
00688 #ifndef YY_SKIP_YYWRAP
00689 #ifdef __cplusplus
00690 extern "C" int yywrap (void );
00691 #else
00692 extern int yywrap (void );
00693 #endif
00694 #endif
00695 
00696     static void yyunput (int c,char *buf_ptr  );
00697     
00698 #ifndef yytext_ptr
00699 static void yy_flex_strncpy (char *,yyconst char *,int );
00700 #endif
00701 
00702 #ifdef YY_NEED_STRLEN
00703 static int yy_flex_strlen (yyconst char * );
00704 #endif
00705 
00706 #ifndef YY_NO_INPUT
00707 
00708 #ifdef __cplusplus
00709 static int yyinput (void );
00710 #else
00711 static int input (void );
00712 #endif
00713 
00714 #endif
00715 
00716 /* Amount of stuff to slurp up with each read. */
00717 #ifndef YY_READ_BUF_SIZE
00718 #define YY_READ_BUF_SIZE 8192
00719 #endif
00720 
00721 /* Copy whatever the last rule matched to the standard output. */
00722 #ifndef ECHO
00723 /* This used to be an fputs(), but since the string might contain NUL's,
00724  * we now use fwrite().
00725  */
00726 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
00727 #endif
00728 
00729 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
00730  * is returned in "result".
00731  */
00732 #ifndef YY_INPUT
00733 #define YY_INPUT(buf,result,max_size) \
00734         if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
00735                 { \
00736                 int c = '*'; \
00737                 size_t n; \
00738                 for ( n = 0; n < max_size && \
00739                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
00740                         buf[n] = (char) c; \
00741                 if ( c == '\n' ) \
00742                         buf[n++] = (char) c; \
00743                 if ( c == EOF && ferror( yyin ) ) \
00744                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
00745                 result = n; \
00746                 } \
00747         else \
00748                 { \
00749                 errno=0; \
00750                 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
00751                         { \
00752                         if( errno != EINTR) \
00753                                 { \
00754                                 YY_FATAL_ERROR( "input in flex scanner failed" ); \
00755                                 break; \
00756                                 } \
00757                         errno=0; \
00758                         clearerr(yyin); \
00759                         } \
00760                 }\
00761 \
00762 
00763 #endif
00764 
00765 /* No semi-colon after return; correct usage is to write "yyterminate();" -
00766  * we don't want an extra ';' after the "return" because that will cause
00767  * some compilers to complain about unreachable statements.
00768  */
00769 #ifndef yyterminate
00770 #define yyterminate() return YY_NULL
00771 #endif
00772 
00773 /* Number of entries by which start-condition stack grows. */
00774 #ifndef YY_START_STACK_INCR
00775 #define YY_START_STACK_INCR 25
00776 #endif
00777 
00778 /* Report a fatal error. */
00779 #ifndef YY_FATAL_ERROR
00780 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
00781 #endif
00782 
00783 /* end tables serialization structures and prototypes */
00784 
00785 /* Default declaration of generated scanner - a define so the user can
00786  * easily add parameters.
00787  */
00788 #ifndef YY_DECL
00789 #define YY_DECL_IS_OURS 1
00790 
00791 extern int yylex (void);
00792 
00793 #define YY_DECL int yylex (void)
00794 #endif /* !YY_DECL */
00795 
00796 /* Code executed at the beginning of each rule, after yytext and yyleng
00797  * have been set up.
00798  */
00799 #ifndef YY_USER_ACTION
00800 #define YY_USER_ACTION
00801 #endif
00802 
00803 /* Code executed at the end of each rule. */
00804 #ifndef YY_BREAK
00805 #define YY_BREAK break;
00806 #endif
00807 
00808 #define YY_RULE_SETUP \
00809         YY_USER_ACTION
00810 
00813 YY_DECL
00814 {
00815         register yy_state_type yy_current_state;
00816         register char *yy_cp, *yy_bp;
00817         register int yy_act;
00818     
00819 #line 49 "parser.l"
00820 
00821 
00822 #line 823 "lex.yy.c"
00823 
00824         if ( !(yy_init) )
00825                 {
00826                 (yy_init) = 1;
00827 
00828 #ifdef YY_USER_INIT
00829                 YY_USER_INIT;
00830 #endif
00831 
00832                 if ( ! (yy_start) )
00833                         (yy_start) = 1; /* first start state */
00834 
00835                 if ( ! yyin )
00836                         yyin = stdin;
00837 
00838                 if ( ! yyout )
00839                         yyout = stdout;
00840 
00841                 if ( ! YY_CURRENT_BUFFER ) {
00842                         yyensure_buffer_stack ();
00843                         YY_CURRENT_BUFFER_LVALUE =
00844                                 yy_create_buffer(yyin,YY_BUF_SIZE );
00845                 }
00846 
00847                 yy_load_buffer_state( );
00848                 }
00849 
00850         while ( 1 )             /* loops until end-of-file is reached */
00851                 {
00852                 yy_cp = (yy_c_buf_p);
00853 
00854                 /* Support of yytext. */
00855                 *yy_cp = (yy_hold_char);
00856 
00857                 /* yy_bp points to the position in yy_ch_buf of the start of
00858                  * the current run.
00859                  */
00860                 yy_bp = yy_cp;
00861 
00862                 yy_current_state = (yy_start);
00863 yy_match:
00864                 do
00865                         {
00866                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
00867                         if ( yy_accept[yy_current_state] )
00868                                 {
00869                                 (yy_last_accepting_state) = yy_current_state;
00870                                 (yy_last_accepting_cpos) = yy_cp;
00871                                 }
00872                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
00873                                 {
00874                                 yy_current_state = (int) yy_def[yy_current_state];
00875                                 if ( yy_current_state >= 283 )
00876                                         yy_c = yy_meta[(unsigned int) yy_c];
00877                                 }
00878                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
00879                         ++yy_cp;
00880                         }
00881                 while ( yy_base[yy_current_state] != 326 );
00882 
00883 yy_find_action:
00884                 yy_act = yy_accept[yy_current_state];
00885                 if ( yy_act == 0 )
00886                         { /* have to back up */
00887                         yy_cp = (yy_last_accepting_cpos);
00888                         yy_current_state = (yy_last_accepting_state);
00889                         yy_act = yy_accept[yy_current_state];
00890                         }
00891 
00892                 YY_DO_BEFORE_ACTION;
00893 
00894 do_action:      /* This label is used only to access EOF actions. */
00895 
00896                 switch ( yy_act )
00897         { /* beginning of action switch */
00898                         case 0: /* must back up */
00899                         /* undo the effects of YY_DO_BEFORE_ACTION */
00900                         *yy_cp = (yy_hold_char);
00901                         yy_cp = (yy_last_accepting_cpos);
00902                         yy_current_state = (yy_last_accepting_state);
00903                         goto yy_find_action;
00904 
00905 case 1:
00906 YY_RULE_SETUP
00907 #line 51 "parser.l"
00908 //ignore whitespaces
00909         YY_BREAK
00910 case 2:
00911 YY_RULE_SETUP
00912 #line 53 "parser.l"
00913 { yylval.dval=atof(yytext); return NUMBER; }
00914         YY_BREAK
00915 case 3:
00916 YY_RULE_SETUP
00917 #line 56 "parser.l"
00918 { return LE; }
00919         YY_BREAK
00920 case 4:
00921 YY_RULE_SETUP
00922 #line 57 "parser.l"
00923 { return GE; }
00924         YY_BREAK
00925 case 5:
00926 YY_RULE_SETUP
00927 #line 58 "parser.l"
00928 { return NE; }
00929         YY_BREAK
00930 case 6:
00931 YY_RULE_SETUP
00932 #line 59 "parser.l"
00933 { return EQ; }
00934         YY_BREAK
00935 case 7:
00936 /* rule 7 can match eol */
00937 *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
00938 (yy_c_buf_p) = yy_cp -= 1;
00939 YY_DO_BEFORE_ACTION; /* set up yytext again */
00940 YY_RULE_SETUP
00941 #line 61 "parser.l"
00942 { }    // comments - ignore
00943         YY_BREAK
00944 case 8:
00945 YY_RULE_SETUP
00946 #line 63 "parser.l"
00947 { return MARKER; } // reserved elements
00948         YY_BREAK
00949 case 9:
00950 YY_RULE_SETUP
00951 #line 64 "parser.l"
00952 { return DRIFT; }
00953         YY_BREAK
00954 case 10:
00955 YY_RULE_SETUP
00956 #line 65 "parser.l"
00957 { return RF; }
00958         YY_BREAK
00959 case 11:
00960 YY_RULE_SETUP
00961 #line 66 "parser.l"
00962 { return DIPOLE; }
00963         YY_BREAK
00964 case 12:
00965 YY_RULE_SETUP
00966 #line 67 "parser.l"
00967 { return SBEND; } 
00968         YY_BREAK
00969 case 13:
00970 YY_RULE_SETUP
00971 #line 68 "parser.l"
00972 {return RBEND; }
00973         YY_BREAK
00974 case 14:
00975 YY_RULE_SETUP
00976 #line 69 "parser.l"
00977 { return HKICK; }
00978         YY_BREAK
00979 case 15:
00980 YY_RULE_SETUP
00981 #line 70 "parser.l"
00982 { return VKICK; }
00983         YY_BREAK
00984 case 16:
00985 YY_RULE_SETUP
00986 #line 71 "parser.l"
00987 { return KICK; } 
00988         YY_BREAK
00989 case 17:
00990 YY_RULE_SETUP
00991 #line 72 "parser.l"
00992 { return QUADRUPOLE; }
00993         YY_BREAK
00994 case 18:
00995 YY_RULE_SETUP
00996 #line 73 "parser.l"
00997 { return SEXTUPOLE; }
00998         YY_BREAK
00999 case 19:
01000 YY_RULE_SETUP
01001 #line 74 "parser.l"
01002 { return OCTUPOLE; }
01003         YY_BREAK
01004 case 20:
01005 YY_RULE_SETUP
01006 #line 75 "parser.l"
01007 { return MULTIPOLE; }
01008         YY_BREAK
01009 case 21:
01010 YY_RULE_SETUP
01011 #line 76 "parser.l"
01012 { return SOLENOID; }
01013         YY_BREAK
01014 case 22:
01015 YY_RULE_SETUP
01016 #line 77 "parser.l"
01017 { return RCOL;}
01018         YY_BREAK
01019 case 23:
01020 YY_RULE_SETUP
01021 #line 78 "parser.l"
01022 { return ECOL; } 
01023         YY_BREAK
01024 case 24:
01025 YY_RULE_SETUP
01026 #line 79 "parser.l"
01027 { return ELEMENT; }
01028         YY_BREAK
01029 case 25:
01030 YY_RULE_SETUP
01031 #line 80 "parser.l"
01032 { return TRANSFORM3D ; }
01033         YY_BREAK
01034 case 26:
01035 YY_RULE_SETUP
01036 #line 81 "parser.l"
01037 { return COLLIMATOR; }
01038         YY_BREAK
01039 case 27:
01040 YY_RULE_SETUP
01041 #line 82 "parser.l"
01042 { return PIPE; }
01043         YY_BREAK
01044 case 28:
01045 YY_RULE_SETUP
01046 #line 83 "parser.l"
01047 { return GAS; }
01048         YY_BREAK
01049 case 29:
01050 YY_RULE_SETUP
01051 #line 84 "parser.l"
01052 { return TUNNEL; }
01053         YY_BREAK
01054 case 30:
01055 YY_RULE_SETUP
01056 #line 85 "parser.l"
01057 { return MATERIAL; }
01058         YY_BREAK
01059 case 31:
01060 YY_RULE_SETUP
01061 #line 86 "parser.l"
01062 { return ATOM; }
01063         YY_BREAK
01064 case 32:
01065 YY_RULE_SETUP
01066 #line 87 "parser.l"
01067 { return LASER; }
01068         YY_BREAK
01069 case 33:
01070 YY_RULE_SETUP
01071 #line 89 "parser.l"
01072 { return LINE; } 
01073         YY_BREAK
01074 case 34:
01075 YY_RULE_SETUP
01076 #line 91 "parser.l"
01077 {return APERTURE; } // reserved keywords
01078         YY_BREAK
01079 case 35:
01080 YY_RULE_SETUP
01081 #line 92 "parser.l"
01082 { return FILENAME; }
01083         YY_BREAK
01084 case 36:
01085 YY_RULE_SETUP
01086 #line 93 "parser.l"
01087 { return PERIOD; }
01088         YY_BREAK
01089 case 37:
01090 YY_RULE_SETUP
01091 #line 94 "parser.l"
01092 { return RANGE; }
01093         YY_BREAK
01094 case 38:
01095 YY_RULE_SETUP
01096 #line 95 "parser.l"
01097 { return CUT; }
01098         YY_BREAK
01099 case 39:
01100 YY_RULE_SETUP
01101 #line 97 "parser.l"
01102 { return IF; }
01103         YY_BREAK
01104 case 40:
01105 YY_RULE_SETUP
01106 #line 98 "parser.l"
01107 { return FOR; }
01108         YY_BREAK
01109 case 41:
01110 YY_RULE_SETUP
01111 #line 99 "parser.l"
01112 { return ELSE; } 
01113         YY_BREAK
01114 case 42:
01115 YY_RULE_SETUP
01116 #line 100 "parser.l"
01117 { return BEGN; }
01118         YY_BREAK
01119 case 43:
01120 YY_RULE_SETUP
01121 #line 101 "parser.l"
01122 { return END; }
01123         YY_BREAK
01124 case 44:
01125 YY_RULE_SETUP
01126 #line 104 "parser.l"
01127 BEGIN(incl);  //reserved commands
01128         YY_BREAK
01129 case 45:
01130 YY_RULE_SETUP
01131 #line 106 "parser.l"
01132 { return BEAM; }
01133         YY_BREAK
01134 case 46:
01135 YY_RULE_SETUP
01136 #line 107 "parser.l"
01137 { return OPTION; }
01138         YY_BREAK
01139 case 47:
01140 YY_RULE_SETUP
01141 #line 108 "parser.l"
01142 { return PRINT; }
01143         YY_BREAK
01144 case 48:
01145 YY_RULE_SETUP
01146 #line 109 "parser.l"
01147 { return ECHO; }
01148         YY_BREAK
01149 case 49:
01150 YY_RULE_SETUP
01151 #line 110 "parser.l"
01152 { return STOP; }
01153         YY_BREAK
01154 case 50:
01155 YY_RULE_SETUP
01156 #line 111 "parser.l"
01157 {return STOP;}
01158         YY_BREAK
01159 case 51:
01160 YY_RULE_SETUP
01161 #line 112 "parser.l"
01162 { return USE; }
01163         YY_BREAK
01164 case 52:
01165 YY_RULE_SETUP
01166 #line 113 "parser.l"
01167 { return SAMPLE; }
01168         YY_BREAK
01169 case 53:
01170 YY_RULE_SETUP
01171 #line 114 "parser.l"
01172 { return CSAMPLE; }
01173         YY_BREAK
01174 case 54:
01175 YY_RULE_SETUP
01176 #line 115 "parser.l"
01177 { return BETA0; } 
01178         YY_BREAK
01179 case 55:
01180 YY_RULE_SETUP
01181 #line 116 "parser.l"
01182 { return TWISS; }
01183         YY_BREAK
01184 case 56:
01185 YY_RULE_SETUP
01186 #line 117 "parser.l"
01187 { return DUMP; }
01188         YY_BREAK
01189 case 57:
01190 /* rule 57 can match eol */
01191 YY_RULE_SETUP
01192 #line 119 "parser.l"
01193 {
01194   //strip quotes
01195   
01196   yylval.str=yytext+1;
01197   yylval.str[strlen(yylval.str)-1]='\0';
01198   return STR; 
01199 }
01200         YY_BREAK
01201 case 58:
01202 YY_RULE_SETUP
01203 #line 127 "parser.l"
01204 { return '=';}  // alternative assignment 
01205         YY_BREAK
01206 case 59:
01207 YY_RULE_SETUP
01208 #line 129 "parser.l"
01209 {
01210      struct symtab *sp = symlook(yytext);
01211      yylval.symp=sp;
01212      if(sp->funcptr)
01213        return FUNC;
01214      else 
01215      if(sp->type == _ARRAY)
01216        return VECVAR;
01217      else
01218        return VARIABLE; 
01219 }
01220         YY_BREAK
01221 case 60:
01222 YY_RULE_SETUP
01223 #line 140 "parser.l"
01224 { return yytext[0]; }
01225         YY_BREAK
01226 case 61:
01227 YY_RULE_SETUP
01228 #line 142 "parser.l"
01229 // eat the whitespace
01230         YY_BREAK
01231 case 62:
01232 YY_RULE_SETUP
01233 #line 143 "parser.l"
01234 {
01235   printf("reading file %s \n",yytext);
01236   if( include_stack_ptr >= MAX_INCLUDE_DEPTH )
01237     {
01238       fprintf(stderr , "Error : Include depth exceeds %d\n",MAX_INCLUDE_DEPTH);
01239       exit(1);
01240     }
01241   else
01242     {
01243       yyin = fopen(yytext, "r");
01244       if(yyin)
01245         {
01246           //printf("saving to stack buffer n %d, file %s\n",include_stack_ptr,yyfilename );
01247           // save info to the stack and load new buffer
01248           include_linenum_stack[include_stack_ptr] = line_num;
01249           line_num = 1;
01250           strncpy(include_filename_stack[include_stack_ptr], yyfilename, 32);
01251           strncpy(yyfilename,yytext,32); 
01252           include_stack[include_stack_ptr++] = YY_CURRENT_BUFFER;
01253           strncpy(include_filename_stack[include_stack_ptr], yyfilename, 32);
01254           yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE ) );
01255           //printf("done saving to stack\n");
01256         }
01257       else
01258         {
01259           fprintf(stderr, "Error : can't open %s\n", yytext);
01260           exit(1);
01261         }
01262     }
01263   BEGIN(INITIAL);
01264 }
01265         YY_BREAK
01266 case YY_STATE_EOF(INITIAL):
01267 case YY_STATE_EOF(incl):
01268 case YY_STATE_EOF(ERROR):
01269 #line 175 "parser.l"
01270 {
01271   if (--include_stack_ptr < 0)
01272     {
01273       yyterminate();
01274     }
01275   else
01276     {
01277       // restore the previous buffer info
01278       //printf("switching to previous buffer with %s\n", include_filename_stack[include_stack_ptr]);
01279       yy_delete_buffer(YY_CURRENT_BUFFER);
01280       yy_switch_to_buffer(include_stack[include_stack_ptr]);
01281       strncpy( yyfilename, include_filename_stack[include_stack_ptr], 32) ;
01282       line_num = include_linenum_stack[include_stack_ptr];
01283       
01284     }
01285 }
01286         YY_BREAK
01287 case 63:
01288 /* rule 63 can match eol */
01289 YY_RULE_SETUP
01290 #line 192 "parser.l"
01291 line_num++;
01292         YY_BREAK
01293 case 64:
01294 YY_RULE_SETUP
01295 #line 193 "parser.l"
01296 ECHO;
01297         YY_BREAK
01298 #line 1299 "lex.yy.c"
01299 
01300         case YY_END_OF_BUFFER:
01301                 {
01302                 /* Amount of text matched not including the EOB char. */
01303                 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
01304 
01305                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
01306                 *yy_cp = (yy_hold_char);
01307                 YY_RESTORE_YY_MORE_OFFSET
01308 
01309                 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
01310                         {
01311                         /* We're scanning a new file or input source.  It's
01312                          * possible that this happened because the user
01313                          * just pointed yyin at a new source and called
01314                          * yylex().  If so, then we have to assure
01315                          * consistency between YY_CURRENT_BUFFER and our
01316                          * globals.  Here is the right place to do so, because
01317                          * this is the first action (other than possibly a
01318                          * back-up) that will match for the new input source.
01319                          */
01320                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
01321                         YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
01322                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
01323                         }
01324 
01325                 /* Note that here we test for yy_c_buf_p "<=" to the position
01326                  * of the first EOB in the buffer, since yy_c_buf_p will
01327                  * already have been incremented past the NUL character
01328                  * (since all states make transitions on EOB to the
01329                  * end-of-buffer state).  Contrast this with the test
01330                  * in input().
01331                  */
01332                 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
01333                         { /* This was really a NUL. */
01334                         yy_state_type yy_next_state;
01335 
01336                         (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
01337 
01338                         yy_current_state = yy_get_previous_state(  );
01339 
01340                         /* Okay, we're now positioned to make the NUL
01341                          * transition.  We couldn't have
01342                          * yy_get_previous_state() go ahead and do it
01343                          * for us because it doesn't know how to deal
01344                          * with the possibility of jamming (and we don't
01345                          * want to build jamming into it because then it
01346                          * will run more slowly).
01347                          */
01348 
01349                         yy_next_state = yy_try_NUL_trans( yy_current_state );
01350 
01351                         yy_bp = (yytext_ptr) + YY_MORE_ADJ;
01352 
01353                         if ( yy_next_state )
01354                                 {
01355                                 /* Consume the NUL. */
01356                                 yy_cp = ++(yy_c_buf_p);
01357                                 yy_current_state = yy_next_state;
01358                                 goto yy_match;
01359                                 }
01360 
01361                         else
01362                                 {
01363                                 yy_cp = (yy_c_buf_p);
01364                                 goto yy_find_action;
01365                                 }
01366                         }
01367 
01368                 else switch ( yy_get_next_buffer(  ) )
01369                         {
01370                         case EOB_ACT_END_OF_FILE:
01371                                 {
01372                                 (yy_did_buffer_switch_on_eof) = 0;
01373 
01374                                 if ( yywrap( ) )
01375                                         {
01376                                         /* Note: because we've taken care in
01377                                          * yy_get_next_buffer() to have set up
01378                                          * yytext, we can now set up
01379                                          * yy_c_buf_p so that if some total
01380                                          * hoser (like flex itself) wants to
01381                                          * call the scanner after we return the
01382                                          * YY_NULL, it'll still work - another
01383                                          * YY_NULL will get returned.
01384                                          */
01385                                         (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
01386 
01387                                         yy_act = YY_STATE_EOF(YY_START);
01388                                         goto do_action;
01389                                         }
01390 
01391                                 else
01392                                         {
01393                                         if ( ! (yy_did_buffer_switch_on_eof) )
01394                                                 YY_NEW_FILE;
01395                                         }
01396                                 break;
01397                                 }
01398 
01399                         case EOB_ACT_CONTINUE_SCAN:
01400                                 (yy_c_buf_p) =
01401                                         (yytext_ptr) + yy_amount_of_matched_text;
01402 
01403                                 yy_current_state = yy_get_previous_state(  );
01404 
01405                                 yy_cp = (yy_c_buf_p);
01406                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
01407                                 goto yy_match;
01408 
01409                         case EOB_ACT_LAST_MATCH:
01410                                 (yy_c_buf_p) =
01411                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
01412 
01413                                 yy_current_state = yy_get_previous_state(  );
01414 
01415                                 yy_cp = (yy_c_buf_p);
01416                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
01417                                 goto yy_find_action;
01418                         }
01419                 break;
01420                 }
01421 
01422         default:
01423                 YY_FATAL_ERROR(
01424                         "fatal flex scanner internal error--no action found" );
01425         } /* end of action switch */
01426                 } /* end of scanning one token */
01427 } /* end of yylex */
01428 
01429 /* yy_get_next_buffer - try to read in a new buffer
01430  *
01431  * Returns a code representing an action:
01432  *      EOB_ACT_LAST_MATCH -
01433  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
01434  *      EOB_ACT_END_OF_FILE - end of file
01435  */
01436 static int yy_get_next_buffer (void)
01437 {
01438         register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
01439         register char *source = (yytext_ptr);
01440         register int number_to_move, i;
01441         int ret_val;
01442 
01443         if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
01444                 YY_FATAL_ERROR(
01445                 "fatal flex scanner internal error--end of buffer missed" );
01446 
01447         if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
01448                 { /* Don't try to fill the buffer, so this is an EOF. */
01449                 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
01450                         {
01451                         /* We matched a single character, the EOB, so
01452                          * treat this as a final EOF.
01453                          */
01454                         return EOB_ACT_END_OF_FILE;
01455                         }
01456 
01457                 else
01458                         {
01459                         /* We matched some text prior to the EOB, first
01460                          * process it.
01461                          */
01462                         return EOB_ACT_LAST_MATCH;
01463                         }
01464                 }
01465 
01466         /* Try to read more data. */
01467 
01468         /* First move last chars to start of buffer. */
01469         number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
01470 
01471         for ( i = 0; i < number_to_move; ++i )
01472                 *(dest++) = *(source++);
01473 
01474         if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
01475                 /* don't do the read, it's not guaranteed to return an EOF,
01476                  * just force an EOF
01477                  */
01478                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
01479 
01480         else
01481                 {
01482                         int num_to_read =
01483                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
01484 
01485                 while ( num_to_read <= 0 )
01486                         { /* Not enough room in the buffer - grow it. */
01487 
01488                         /* just a shorter name for the current buffer */
01489                         YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
01490 
01491                         int yy_c_buf_p_offset =
01492                                 (int) ((yy_c_buf_p) - b->yy_ch_buf);
01493 
01494                         if ( b->yy_is_our_buffer )
01495                                 {
01496                                 int new_size = b->yy_buf_size * 2;
01497 
01498                                 if ( new_size <= 0 )
01499                                         b->yy_buf_size += b->yy_buf_size / 8;
01500                                 else
01501                                         b->yy_buf_size *= 2;
01502 
01503                                 b->yy_ch_buf = (char *)
01504                                         /* Include room in for 2 EOB chars. */
01505                                         yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
01506                                 }
01507                         else
01508                                 /* Can't grow it, we don't own it. */
01509                                 b->yy_ch_buf = 0;
01510 
01511                         if ( ! b->yy_ch_buf )
01512                                 YY_FATAL_ERROR(
01513                                 "fatal error - scanner input buffer overflow" );
01514 
01515                         (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
01516 
01517                         num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
01518                                                 number_to_move - 1;
01519 
01520                         }
01521 
01522                 if ( num_to_read > YY_READ_BUF_SIZE )
01523                         num_to_read = YY_READ_BUF_SIZE;
01524 
01525                 /* Read in more data. */
01526                 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
01527                         (yy_n_chars), (size_t) num_to_read );
01528 
01529                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
01530                 }
01531 
01532         if ( (yy_n_chars) == 0 )
01533                 {
01534                 if ( number_to_move == YY_MORE_ADJ )
01535                         {
01536                         ret_val = EOB_ACT_END_OF_FILE;
01537                         yyrestart(yyin  );
01538                         }
01539 
01540                 else
01541                         {
01542                         ret_val = EOB_ACT_LAST_MATCH;
01543                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
01544                                 YY_BUFFER_EOF_PENDING;
01545                         }
01546                 }
01547 
01548         else
01549                 ret_val = EOB_ACT_CONTINUE_SCAN;
01550 
01551         (yy_n_chars) += number_to_move;
01552         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
01553         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
01554 
01555         (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
01556 
01557         return ret_val;
01558 }
01559 
01560 /* yy_get_previous_state - get the state just before the EOB char was reached */
01561 
01562     static yy_state_type yy_get_previous_state (void)
01563 {
01564         register yy_state_type yy_current_state;
01565         register char *yy_cp;
01566     
01567         yy_current_state = (yy_start);
01568 
01569         for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
01570                 {
01571                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
01572                 if ( yy_accept[yy_current_state] )
01573                         {
01574                         (yy_last_accepting_state) = yy_current_state;
01575                         (yy_last_accepting_cpos) = yy_cp;
01576                         }
01577                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01578                         {
01579                         yy_current_state = (int) yy_def[yy_current_state];
01580                         if ( yy_current_state >= 283 )
01581                                 yy_c = yy_meta[(unsigned int) yy_c];
01582                         }
01583                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01584                 }
01585 
01586         return yy_current_state;
01587 }
01588 
01589 /* yy_try_NUL_trans - try to make a transition on the NUL character
01590  *
01591  * synopsis
01592  *      next_state = yy_try_NUL_trans( current_state );
01593  */
01594     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
01595 {
01596         register int yy_is_jam;
01597         register char *yy_cp = (yy_c_buf_p);
01598 
01599         register YY_CHAR yy_c = 1;
01600         if ( yy_accept[yy_current_state] )
01601                 {
01602                 (yy_last_accepting_state) = yy_current_state;
01603                 (yy_last_accepting_cpos) = yy_cp;
01604                 }
01605         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01606                 {
01607                 yy_current_state = (int) yy_def[yy_current_state];
01608                 if ( yy_current_state >= 283 )
01609                         yy_c = yy_meta[(unsigned int) yy_c];
01610                 }
01611         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01612         yy_is_jam = (yy_current_state == 282);
01613 
01614         return yy_is_jam ? 0 : yy_current_state;
01615 }
01616 
01617     static void yyunput (int c, register char * yy_bp )
01618 {
01619         register char *yy_cp;
01620     
01621     yy_cp = (yy_c_buf_p);
01622 
01623         /* undo effects of setting up yytext */
01624         *yy_cp = (yy_hold_char);
01625 
01626         if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
01627                 { /* need to shift things up to make room */
01628                 /* +2 for EOB chars. */
01629                 register int number_to_move = (yy_n_chars) + 2;
01630                 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
01631                                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
01632                 register char *source =
01633                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
01634 
01635                 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
01636                         *--dest = *--source;
01637 
01638                 yy_cp += (int) (dest - source);
01639                 yy_bp += (int) (dest - source);
01640                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
01641                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
01642 
01643                 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
01644                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
01645                 }
01646 
01647         *--yy_cp = (char) c;
01648 
01649         (yytext_ptr) = yy_bp;
01650         (yy_hold_char) = *yy_cp;
01651         (yy_c_buf_p) = yy_cp;
01652 }
01653 
01654 #ifndef YY_NO_INPUT
01655 #ifdef __cplusplus
01656     static int yyinput (void)
01657 #else
01658     static int input  (void)
01659 #endif
01660 
01661 {
01662         int c;
01663     
01664         *(yy_c_buf_p) = (yy_hold_char);
01665 
01666         if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
01667                 {
01668                 /* yy_c_buf_p now points to the character we want to return.
01669                  * If this occurs *before* the EOB characters, then it's a
01670                  * valid NUL; if not, then we've hit the end of the buffer.
01671                  */
01672                 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
01673                         /* This was really a NUL. */
01674                         *(yy_c_buf_p) = '\0';
01675 
01676                 else
01677                         { /* need more input */
01678                         int offset = (yy_c_buf_p) - (yytext_ptr);
01679                         ++(yy_c_buf_p);
01680 
01681                         switch ( yy_get_next_buffer(  ) )
01682                                 {
01683                                 case EOB_ACT_LAST_MATCH:
01684                                         /* This happens because yy_g_n_b()
01685                                          * sees that we've accumulated a
01686                                          * token and flags that we need to
01687                                          * try matching the token before
01688                                          * proceeding.  But for input(),
01689                                          * there's no matching to consider.
01690                                          * So convert the EOB_ACT_LAST_MATCH
01691                                          * to EOB_ACT_END_OF_FILE.
01692                                          */
01693 
01694                                         /* Reset buffer status. */
01695                                         yyrestart(yyin );
01696 
01697                                         /*FALLTHROUGH*/
01698 
01699                                 case EOB_ACT_END_OF_FILE:
01700                                         {
01701                                         if ( yywrap( ) )
01702                                                 return EOF;
01703 
01704                                         if ( ! (yy_did_buffer_switch_on_eof) )
01705                                                 YY_NEW_FILE;
01706 #ifdef __cplusplus
01707                                         return yyinput();
01708 #else
01709                                         return input();
01710 #endif
01711                                         }
01712 
01713                                 case EOB_ACT_CONTINUE_SCAN:
01714                                         (yy_c_buf_p) = (yytext_ptr) + offset;
01715                                         break;
01716                                 }
01717                         }
01718                 }
01719 
01720         c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
01721         *(yy_c_buf_p) = '\0';   /* preserve yytext */
01722         (yy_hold_char) = *++(yy_c_buf_p);
01723 
01724         return c;
01725 }
01726 #endif  /* ifndef YY_NO_INPUT */
01727 
01733     void yyrestart  (FILE * input_file )
01734 {
01735     
01736         if ( ! YY_CURRENT_BUFFER ){
01737         yyensure_buffer_stack ();
01738                 YY_CURRENT_BUFFER_LVALUE =
01739             yy_create_buffer(yyin,YY_BUF_SIZE );
01740         }
01741 
01742         yy_init_buffer(YY_CURRENT_BUFFER,input_file );
01743         yy_load_buffer_state( );
01744 }
01745 
01750     void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
01751 {
01752     
01753         /* TODO. We should be able to replace this entire function body
01754          * with
01755          *              yypop_buffer_state();
01756          *              yypush_buffer_state(new_buffer);
01757      */
01758         yyensure_buffer_stack ();
01759         if ( YY_CURRENT_BUFFER == new_buffer )
01760                 return;
01761 
01762         if ( YY_CURRENT_BUFFER )
01763                 {
01764                 /* Flush out information for old buffer. */
01765                 *(yy_c_buf_p) = (yy_hold_char);
01766                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
01767                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
01768                 }
01769 
01770         YY_CURRENT_BUFFER_LVALUE = new_buffer;
01771         yy_load_buffer_state( );
01772 
01773         /* We don't actually know whether we did this switch during
01774          * EOF (yywrap()) processing, but the only time this flag
01775          * is looked at is after yywrap() is called, so it's safe
01776          * to go ahead and always set it.
01777          */
01778         (yy_did_buffer_switch_on_eof) = 1;
01779 }
01780 
01781 static void yy_load_buffer_state  (void)
01782 {
01783         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
01784         (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
01785         yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
01786         (yy_hold_char) = *(yy_c_buf_p);
01787 }
01788 
01795     YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
01796 {
01797         YY_BUFFER_STATE b;
01798     
01799         b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
01800         if ( ! b )
01801                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
01802 
01803         b->yy_buf_size = size;
01804 
01805         /* yy_ch_buf has to be 2 characters longer than the size given because
01806          * we need to put in 2 end-of-buffer characters.
01807          */
01808         b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
01809         if ( ! b->yy_ch_buf )
01810                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
01811 
01812         b->yy_is_our_buffer = 1;
01813 
01814         yy_init_buffer(b,file );
01815 
01816         return b;
01817 }
01818 
01823     void yy_delete_buffer (YY_BUFFER_STATE  b )
01824 {
01825     
01826         if ( ! b )
01827                 return;
01828 
01829         if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
01830                 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
01831 
01832         if ( b->yy_is_our_buffer )
01833                 yyfree((void *) b->yy_ch_buf  );
01834 
01835         yyfree((void *) b  );
01836 }
01837 
01838 #ifndef __cplusplus
01839 extern int isatty (int );
01840 #endif /* __cplusplus */
01841     
01842 /* Initializes or reinitializes a buffer.
01843  * This function is sometimes called more than once on the same buffer,
01844  * such as during a yyrestart() or at EOF.
01845  */
01846     static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
01847 
01848 {
01849         int oerrno = errno;
01850     
01851         yy_flush_buffer(b );
01852 
01853         b->yy_input_file = file;
01854         b->yy_fill_buffer = 1;
01855 
01856     /* If b is the current buffer, then yy_init_buffer was _probably_
01857      * called from yyrestart() or through yy_get_next_buffer.
01858      * In that case, we don't want to reset the lineno or column.
01859      */
01860     if (b != YY_CURRENT_BUFFER){
01861         b->yy_bs_lineno = 1;
01862         b->yy_bs_column = 0;
01863     }
01864 
01865         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
01866     
01867         errno = oerrno;
01868 }
01869 
01874     void yy_flush_buffer (YY_BUFFER_STATE  b )
01875 {
01876         if ( ! b )
01877                 return;
01878 
01879         b->yy_n_chars = 0;
01880 
01881         /* We always need two end-of-buffer characters.  The first causes
01882          * a transition to the end-of-buffer state.  The second causes
01883          * a jam in that state.
01884          */
01885         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
01886         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
01887 
01888         b->yy_buf_pos = &b->yy_ch_buf[0];
01889 
01890         b->yy_at_bol = 1;
01891         b->yy_buffer_status = YY_BUFFER_NEW;
01892 
01893         if ( b == YY_CURRENT_BUFFER )
01894                 yy_load_buffer_state( );
01895 }
01896 
01903 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
01904 {
01905         if (new_buffer == NULL)
01906                 return;
01907 
01908         yyensure_buffer_stack();
01909 
01910         /* This block is copied from yy_switch_to_buffer. */
01911         if ( YY_CURRENT_BUFFER )
01912                 {
01913                 /* Flush out information for old buffer. */
01914                 *(yy_c_buf_p) = (yy_hold_char);
01915                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
01916                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
01917                 }
01918 
01919         /* Only push if top exists. Otherwise, replace top. */
01920         if (YY_CURRENT_BUFFER)
01921                 (yy_buffer_stack_top)++;
01922         YY_CURRENT_BUFFER_LVALUE = new_buffer;
01923 
01924         /* copied from yy_switch_to_buffer. */
01925         yy_load_buffer_state( );
01926         (yy_did_buffer_switch_on_eof) = 1;
01927 }
01928 
01933 void yypop_buffer_state (void)
01934 {
01935         if (!YY_CURRENT_BUFFER)
01936                 return;
01937 
01938         yy_delete_buffer(YY_CURRENT_BUFFER );
01939         YY_CURRENT_BUFFER_LVALUE = NULL;
01940         if ((yy_buffer_stack_top) > 0)
01941                 --(yy_buffer_stack_top);
01942 
01943         if (YY_CURRENT_BUFFER) {
01944                 yy_load_buffer_state( );
01945                 (yy_did_buffer_switch_on_eof) = 1;
01946         }
01947 }
01948 
01949 /* Allocates the stack if it does not exist.
01950  *  Guarantees space for at least one push.
01951  */
01952 static void yyensure_buffer_stack (void)
01953 {
01954         int num_to_alloc;
01955     
01956         if (!(yy_buffer_stack)) {
01957 
01958                 /* First allocation is just for 2 elements, since we don't know if this
01959                  * scanner will even need a stack. We use 2 instead of 1 to avoid an
01960                  * immediate realloc on the next call.
01961          */
01962                 num_to_alloc = 1;
01963                 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
01964                                                                 (num_to_alloc * sizeof(struct yy_buffer_state*)
01965                                                                 );
01966                 
01967                 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
01968                                 
01969                 (yy_buffer_stack_max) = num_to_alloc;
01970                 (yy_buffer_stack_top) = 0;
01971                 return;
01972         }
01973 
01974         if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
01975 
01976                 /* Increase the buffer to prepare for a possible push. */
01977                 int grow_size = 8 /* arbitrary grow size */;
01978 
01979                 num_to_alloc = (yy_buffer_stack_max) + grow_size;
01980                 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
01981                                                                 ((yy_buffer_stack),
01982                                                                 num_to_alloc * sizeof(struct yy_buffer_state*)
01983                                                                 );
01984 
01985                 /* zero only the new slots.*/
01986                 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
01987                 (yy_buffer_stack_max) = num_to_alloc;
01988         }
01989 }
01990 
01997 YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
01998 {
01999         YY_BUFFER_STATE b;
02000     
02001         if ( size < 2 ||
02002              base[size-2] != YY_END_OF_BUFFER_CHAR ||
02003              base[size-1] != YY_END_OF_BUFFER_CHAR )
02004                 /* They forgot to leave room for the EOB's. */
02005                 return 0;
02006 
02007         b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
02008         if ( ! b )
02009                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
02010 
02011         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
02012         b->yy_buf_pos = b->yy_ch_buf = base;
02013         b->yy_is_our_buffer = 0;
02014         b->yy_input_file = 0;
02015         b->yy_n_chars = b->yy_buf_size;
02016         b->yy_is_interactive = 0;
02017         b->yy_at_bol = 1;
02018         b->yy_fill_buffer = 0;
02019         b->yy_buffer_status = YY_BUFFER_NEW;
02020 
02021         yy_switch_to_buffer(b  );
02022 
02023         return b;
02024 }
02025 
02034 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
02035 {
02036     
02037         return yy_scan_bytes(yystr,strlen(yystr) );
02038 }
02039 
02047 YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
02048 {
02049         YY_BUFFER_STATE b;
02050         char *buf;
02051         yy_size_t n;
02052         int i;
02053     
02054         /* Get memory for full buffer, including space for trailing EOB's. */
02055         n = _yybytes_len + 2;
02056         buf = (char *) yyalloc(n  );
02057         if ( ! buf )
02058                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
02059 
02060         for ( i = 0; i < _yybytes_len; ++i )
02061                 buf[i] = yybytes[i];
02062 
02063         buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
02064 
02065         b = yy_scan_buffer(buf,n );
02066         if ( ! b )
02067                 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
02068 
02069         /* It's okay to grow etc. this buffer, and we should throw it
02070          * away when we're done.
02071          */
02072         b->yy_is_our_buffer = 1;
02073 
02074         return b;
02075 }
02076 
02077 #ifndef YY_EXIT_FAILURE
02078 #define YY_EXIT_FAILURE 2
02079 #endif
02080 
02081 static void yy_fatal_error (yyconst char* msg )
02082 {
02083         (void) fprintf( stderr, "%s\n", msg );
02084         exit( YY_EXIT_FAILURE );
02085 }
02086 
02087 /* Redefine yyless() so it works in section 3 code. */
02088 
02089 #undef yyless
02090 #define yyless(n) \
02091         do \
02092                 { \
02093                 /* Undo effects of setting up yytext. */ \
02094         int yyless_macro_arg = (n); \
02095         YY_LESS_LINENO(yyless_macro_arg);\
02096                 yytext[yyleng] = (yy_hold_char); \
02097                 (yy_c_buf_p) = yytext + yyless_macro_arg; \
02098                 (yy_hold_char) = *(yy_c_buf_p); \
02099                 *(yy_c_buf_p) = '\0'; \
02100                 yyleng = yyless_macro_arg; \
02101                 } \
02102         while ( 0 )
02103 
02104 /* Accessor  methods (get/set functions) to struct members. */
02105 
02109 int yyget_lineno  (void)
02110 {
02111         
02112     return yylineno;
02113 }
02114 
02118 FILE *yyget_in  (void)
02119 {
02120         return yyin;
02121 }
02122 
02126 FILE *yyget_out  (void)
02127 {
02128         return yyout;
02129 }
02130 
02134 int yyget_leng  (void)
02135 {
02136         return yyleng;
02137 }
02138 
02143 char *yyget_text  (void)
02144 {
02145         return yytext;
02146 }
02147 
02152 void yyset_lineno (int  line_number )
02153 {
02154     
02155     yylineno = line_number;
02156 }
02157 
02164 void yyset_in (FILE *  in_str )
02165 {
02166         yyin = in_str ;
02167 }
02168 
02169 void yyset_out (FILE *  out_str )
02170 {
02171         yyout = out_str ;
02172 }
02173 
02174 int yyget_debug  (void)
02175 {
02176         return yy_flex_debug;
02177 }
02178 
02179 void yyset_debug (int  bdebug )
02180 {
02181         yy_flex_debug = bdebug ;
02182 }
02183 
02184 static int yy_init_globals (void)
02185 {
02186         /* Initialization is the same as for the non-reentrant scanner.
02187      * This function is called from yylex_destroy(), so don't allocate here.
02188      */
02189 
02190     (yy_buffer_stack) = 0;
02191     (yy_buffer_stack_top) = 0;
02192     (yy_buffer_stack_max) = 0;
02193     (yy_c_buf_p) = (char *) 0;
02194     (yy_init) = 0;
02195     (yy_start) = 0;
02196 
02197 /* Defined in main.c */
02198 #ifdef YY_STDINIT
02199     yyin = stdin;
02200     yyout = stdout;
02201 #else
02202     yyin = (FILE *) 0;
02203     yyout = (FILE *) 0;
02204 #endif
02205 
02206     /* For future reference: Set errno on error, since we are called by
02207      * yylex_init()
02208      */
02209     return 0;
02210 }
02211 
02212 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
02213 int yylex_destroy  (void)
02214 {
02215     
02216     /* Pop the buffer stack, destroying each element. */
02217         while(YY_CURRENT_BUFFER){
02218                 yy_delete_buffer(YY_CURRENT_BUFFER  );
02219                 YY_CURRENT_BUFFER_LVALUE = NULL;
02220                 yypop_buffer_state();
02221         }
02222 
02223         /* Destroy the stack itself. */
02224         yyfree((yy_buffer_stack) );
02225         (yy_buffer_stack) = NULL;
02226 
02227     /* Reset the globals. This is important in a non-reentrant scanner so the next time
02228      * yylex() is called, initialization will occur. */
02229     yy_init_globals( );
02230 
02231     return 0;
02232 }
02233 
02234 /*
02235  * Internal utility routines.
02236  */
02237 
02238 #ifndef yytext_ptr
02239 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
02240 {
02241         register int i;
02242         for ( i = 0; i < n; ++i )
02243                 s1[i] = s2[i];
02244 }
02245 #endif
02246 
02247 #ifdef YY_NEED_STRLEN
02248 static int yy_flex_strlen (yyconst char * s )
02249 {
02250         register int n;
02251         for ( n = 0; s[n]; ++n )
02252                 ;
02253 
02254         return n;
02255 }
02256 #endif
02257 
02258 void *yyalloc (yy_size_t  size )
02259 {
02260         return (void *) malloc( size );
02261 }
02262 
02263 void *yyrealloc  (void * ptr, yy_size_t  size )
02264 {
02265         /* The cast to (char *) in the following accommodates both
02266          * implementations that use char* generic pointers, and those
02267          * that use void* generic pointers.  It works with the latter
02268          * because both ANSI C and C++ allow castless assignment from
02269          * any pointer type to void*, and deal with argument conversions
02270          * as though doing an assignment.
02271          */
02272         return (void *) realloc( (char *) ptr, size );
02273 }
02274 
02275 void yyfree (void * ptr )
02276 {
02277         free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
02278 }
02279 
02280 #define YYTABLES_NAME "yytables"
02281 
02282 #line 193 "parser.l"
02283 
02284 
02285 
02286 
02287 struct symtab * symlook(char *s)
02288 {
02289   struct symtab *sp;
02290   for( sp=symtab;sp<&symtab[NSYMS];sp++) {
02291     if(sp->name && !strcmp(sp->name,s)) return sp;
02292     if(!sp->name) {sp->name=strdup(s); return sp;}
02293   }
02294   yyerror("too many symbols");
02295   exit(1);
02296 }
02297 
02298 

Generated on Wed Mar 5 17:25:22 2008 for BDSIM by  doxygen 1.5.3