File indexing completed on 2024-04-14 14:32:25

0001 #line 1 "libs/flex-out.cpp"
0002 
0003 #line 3 "libs/flex-out.cpp"
0004 
0005 #define  YY_INT_ALIGNED short int
0006 
0007 /* A lexical scanner generated by flex */
0008 
0009 #define FLEX_SCANNER
0010 #define YY_FLEX_MAJOR_VERSION 2
0011 #define YY_FLEX_MINOR_VERSION 6
0012 #define YY_FLEX_SUBMINOR_VERSION 4
0013 #if YY_FLEX_SUBMINOR_VERSION > 0
0014 #define FLEX_BETA
0015 #endif
0016 
0017 /* First, we deal with  platform-specific or compiler-specific issues. */
0018 
0019 /* begin standard C headers. */
0020 #include <stdio.h>
0021 #include <string.h>
0022 #include <errno.h>
0023 #include <stdlib.h>
0024 
0025 /* end standard C headers. */
0026 
0027 /* flex integer type definitions */
0028 
0029 #ifndef FLEXINT_H
0030 #define FLEXINT_H
0031 
0032 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
0033 
0034 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
0035 
0036 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
0037  * if you want the limit (max/min) macros for int types. 
0038  */
0039 #ifndef __STDC_LIMIT_MACROS
0040 #define __STDC_LIMIT_MACROS 1
0041 #endif
0042 
0043 #include <inttypes.h>
0044 typedef int8_t flex_int8_t;
0045 typedef uint8_t flex_uint8_t;
0046 typedef int16_t flex_int16_t;
0047 typedef uint16_t flex_uint16_t;
0048 typedef int32_t flex_int32_t;
0049 typedef uint32_t flex_uint32_t;
0050 #else
0051 typedef signed char flex_int8_t;
0052 typedef short int flex_int16_t;
0053 typedef int flex_int32_t;
0054 typedef unsigned char flex_uint8_t; 
0055 typedef unsigned short int flex_uint16_t;
0056 typedef unsigned int flex_uint32_t;
0057 
0058 /* Limits of integral types. */
0059 #ifndef INT8_MIN
0060 #define INT8_MIN               (-128)
0061 #endif
0062 #ifndef INT16_MIN
0063 #define INT16_MIN              (-32767-1)
0064 #endif
0065 #ifndef INT32_MIN
0066 #define INT32_MIN              (-2147483647-1)
0067 #endif
0068 #ifndef INT8_MAX
0069 #define INT8_MAX               (127)
0070 #endif
0071 #ifndef INT16_MAX
0072 #define INT16_MAX              (32767)
0073 #endif
0074 #ifndef INT32_MAX
0075 #define INT32_MAX              (2147483647)
0076 #endif
0077 #ifndef UINT8_MAX
0078 #define UINT8_MAX              (255U)
0079 #endif
0080 #ifndef UINT16_MAX
0081 #define UINT16_MAX             (65535U)
0082 #endif
0083 #ifndef UINT32_MAX
0084 #define UINT32_MAX             (4294967295U)
0085 #endif
0086 
0087 #ifndef SIZE_MAX
0088 #define SIZE_MAX               (~(size_t)0)
0089 #endif
0090 
0091 #endif /* ! C99 */
0092 
0093 #endif /* ! FLEXINT_H */
0094 
0095 /* begin standard C++ headers. */
0096 
0097 /* TODO: this is always defined, so inline it */
0098 #define yyconst const
0099 
0100 #if defined(__GNUC__) && __GNUC__ >= 3
0101 #define yynoreturn __attribute__((__noreturn__))
0102 #else
0103 #define yynoreturn
0104 #endif
0105 
0106 /* Returned upon end-of-file. */
0107 #define YY_NULL 0
0108 
0109 /* Promotes a possibly negative, possibly signed char to an
0110  *   integer in range [0..255] for use as an array index.
0111  */
0112 #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
0113 
0114 /* Enter a start condition.  This macro really ought to take a parameter,
0115  * but we do it the disgusting crufty way forced on us by the ()-less
0116  * definition of BEGIN.
0117  */
0118 #define BEGIN (yy_start) = 1 + 2 *
0119 /* Translate the current start state into a value that can be later handed
0120  * to BEGIN to return to the state.  The YYSTATE alias is for lex
0121  * compatibility.
0122  */
0123 #define YY_START (((yy_start) - 1) / 2)
0124 #define YYSTATE YY_START
0125 /* Action number for EOF rule of a given start state. */
0126 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
0127 /* Special action meaning "start processing a new file". */
0128 #define YY_NEW_FILE yyrestart( yyin  )
0129 #define YY_END_OF_BUFFER_CHAR 0
0130 
0131 /* Size of default input buffer. */
0132 #ifndef YY_BUF_SIZE
0133 #ifdef __ia64__
0134 /* On IA-64, the buffer size is 16k, not 8k.
0135  * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
0136  * Ditto for the __ia64__ case accordingly.
0137  */
0138 #define YY_BUF_SIZE 32768
0139 #else
0140 #define YY_BUF_SIZE 16384
0141 #endif /* __ia64__ */
0142 #endif
0143 
0144 /* The state buf must be large enough to hold one state per character in the main buffer.
0145  */
0146 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
0147 
0148 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
0149 #define YY_TYPEDEF_YY_BUFFER_STATE
0150 typedef struct yy_buffer_state *YY_BUFFER_STATE;
0151 #endif
0152 
0153 #ifndef YY_TYPEDEF_YY_SIZE_T
0154 #define YY_TYPEDEF_YY_SIZE_T
0155 typedef size_t yy_size_t;
0156 #endif
0157 
0158 extern int yyleng;
0159 
0160 extern FILE *yyin, *yyout;
0161 
0162 #define EOB_ACT_CONTINUE_SCAN 0
0163 #define EOB_ACT_END_OF_FILE 1
0164 #define EOB_ACT_LAST_MATCH 2
0165     
0166     #define YY_LESS_LINENO(n)
0167     #define YY_LINENO_REWIND_TO(ptr)
0168     
0169 /* Return all but the first "n" matched characters back to the input stream. */
0170 #define yyless(n) \
0171     do \
0172         { \
0173         /* Undo effects of setting up yytext. */ \
0174         int yyless_macro_arg = (n); \
0175         YY_LESS_LINENO(yyless_macro_arg);\
0176         *yy_cp = (yy_hold_char); \
0177         YY_RESTORE_YY_MORE_OFFSET \
0178         (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
0179         YY_DO_BEFORE_ACTION; /* set up yytext again */ \
0180         } \
0181     while ( 0 )
0182 #define unput(c) yyunput( c, (yytext_ptr)  )
0183 
0184 #ifndef YY_STRUCT_YY_BUFFER_STATE
0185 #define YY_STRUCT_YY_BUFFER_STATE
0186 struct yy_buffer_state
0187     {
0188     FILE *yy_input_file;
0189 
0190     char *yy_ch_buf;        /* input buffer */
0191     char *yy_buf_pos;       /* current position in input buffer */
0192 
0193     /* Size of input buffer in bytes, not including room for EOB
0194      * characters.
0195      */
0196     int yy_buf_size;
0197 
0198     /* Number of characters read into yy_ch_buf, not including EOB
0199      * characters.
0200      */
0201     int yy_n_chars;
0202 
0203     /* Whether we "own" the buffer - i.e., we know we created it,
0204      * and can realloc() it to grow it, and should free() it to
0205      * delete it.
0206      */
0207     int yy_is_our_buffer;
0208 
0209     /* Whether this is an "interactive" input source; if so, and
0210      * if we're using stdio for input, then we want to use getc()
0211      * instead of fread(), to make sure we stop fetching input after
0212      * each newline.
0213      */
0214     int yy_is_interactive;
0215 
0216     /* Whether we're considered to be at the beginning of a line.
0217      * If so, '^' rules will be active on the next match, otherwise
0218      * not.
0219      */
0220     int yy_at_bol;
0221 
0222     int yy_bs_lineno; /**< The line count. */
0223     int yy_bs_column; /**< The column count. */
0224 
0225     /* Whether to try to fill the input buffer when we reach the
0226      * end of it.
0227      */
0228     int yy_fill_buffer;
0229 
0230     int yy_buffer_status;
0231 
0232 #define YY_BUFFER_NEW 0
0233 #define YY_BUFFER_NORMAL 1
0234     /* When an EOF's been seen but there's still some text to process
0235      * then we mark the buffer as YY_EOF_PENDING, to indicate that we
0236      * shouldn't try reading from the input source any more.  We might
0237      * still have a bunch of tokens to match, though, because of
0238      * possible backing-up.
0239      *
0240      * When we actually see the EOF, we change the status to "new"
0241      * (via yyrestart()), so that the user can continue scanning by
0242      * just pointing yyin at a new input file.
0243      */
0244 #define YY_BUFFER_EOF_PENDING 2
0245 
0246     };
0247 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
0248 
0249 /* Stack of input buffers. */
0250 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
0251 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
0252 static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
0253 
0254 /* We provide macros for accessing buffer states in case in the
0255  * future we want to put the buffer states in a more general
0256  * "scanner state".
0257  *
0258  * Returns the top of the stack, or NULL.
0259  */
0260 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
0261                           ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
0262                           : NULL)
0263 /* Same as previous macro, but useful when we know that the buffer stack is not
0264  * NULL or when we need an lvalue. For internal use only.
0265  */
0266 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
0267 
0268 /* yy_hold_char holds the character lost when yytext is formed. */
0269 static char yy_hold_char;
0270 static int yy_n_chars;      /* number of characters read into yy_ch_buf */
0271 int yyleng;
0272 
0273 /* Points to current character in buffer. */
0274 static char *yy_c_buf_p = NULL;
0275 static int yy_init = 0;     /* whether we need to initialize */
0276 static int yy_start = 0;    /* start state number */
0277 
0278 /* Flag which is used to allow yywrap()'s to do buffer switches
0279  * instead of setting up a fresh yyin.  A bit of a hack ...
0280  */
0281 static int yy_did_buffer_switch_on_eof;
0282 
0283 void yyrestart ( FILE *input_file  );
0284 void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer  );
0285 YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size  );
0286 void yy_delete_buffer ( YY_BUFFER_STATE b  );
0287 void yy_flush_buffer ( YY_BUFFER_STATE b  );
0288 void yypush_buffer_state ( YY_BUFFER_STATE new_buffer  );
0289 void yypop_buffer_state ( void );
0290 
0291 static void yyensure_buffer_stack ( void );
0292 static void yy_load_buffer_state ( void );
0293 static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file  );
0294 #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
0295 
0296 YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size  );
0297 YY_BUFFER_STATE yy_scan_string ( const char *yy_str  );
0298 YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len  );
0299 
0300 void *yyalloc ( yy_size_t  );
0301 void *yyrealloc ( void *, yy_size_t  );
0302 void yyfree ( void *  );
0303 
0304 #define yy_new_buffer yy_create_buffer
0305 #define yy_set_interactive(is_interactive) \
0306     { \
0307     if ( ! YY_CURRENT_BUFFER ){ \
0308         yyensure_buffer_stack (); \
0309         YY_CURRENT_BUFFER_LVALUE =    \
0310             yy_create_buffer( yyin, YY_BUF_SIZE ); \
0311     } \
0312     YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
0313     }
0314 #define yy_set_bol(at_bol) \
0315     { \
0316     if ( ! YY_CURRENT_BUFFER ){\
0317         yyensure_buffer_stack (); \
0318         YY_CURRENT_BUFFER_LVALUE =    \
0319             yy_create_buffer( yyin, YY_BUF_SIZE ); \
0320     } \
0321     YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
0322     }
0323 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
0324 
0325 /* Begin user sect3 */
0326 
0327 #define yywrap() (/*CONSTCOND*/1)
0328 #define YY_SKIP_YYWRAP
0329 typedef flex_uint8_t YY_CHAR;
0330 
0331 FILE *yyin = NULL, *yyout = NULL;
0332 
0333 typedef int yy_state_type;
0334 
0335 extern int yylineno;
0336 int yylineno = 1;
0337 
0338 extern char *yytext;
0339 #ifdef yytext_ptr
0340 #undef yytext_ptr
0341 #endif
0342 #define yytext_ptr yytext
0343 
0344 static yy_state_type yy_get_previous_state ( void );
0345 static yy_state_type yy_try_NUL_trans ( yy_state_type current_state  );
0346 static int yy_get_next_buffer ( void );
0347 static void yynoreturn yy_fatal_error ( const char* msg  );
0348 
0349 /* Done after the current pattern has been matched and before the
0350  * corresponding action - sets up yytext.
0351  */
0352 #define YY_DO_BEFORE_ACTION \
0353     (yytext_ptr) = yy_bp; \
0354     yyleng = (int) (yy_cp - yy_bp); \
0355     (yy_hold_char) = *yy_cp; \
0356     *yy_cp = '\0'; \
0357     (yy_c_buf_p) = yy_cp;
0358 #define YY_NUM_RULES 21
0359 #define YY_END_OF_BUFFER 22
0360 /* This struct is not used in this scanner,
0361    but its presence is necessary. */
0362 struct yy_trans_info
0363     {
0364     flex_int32_t yy_verify;
0365     flex_int32_t yy_nxt;
0366     };
0367 static const flex_int16_t yy_accept[55] =
0368     {   0,
0369         0,    0,   22,   20,   19,   19,   18,   20,   20,   20,
0370        18,   18,    1,   14,   20,   12,   20,   20,   17,    0,
0371         6,    4,    3,   10,    0,    0,    0,    0,    1,   15,
0372        16,   13,    0,    5,    0,   11,    3,    0,    0,    0,
0373         2,    0,    0,    0,    0,    7,    0,    0,    0,    0,
0374         0,    8,    9,    0
0375     } ;
0376 
0377 static const YY_CHAR yy_ec[256] =
0378     {   0,
0379         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
0380         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
0381         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
0382         1,    4,    5,    6,    1,    7,    1,    8,    1,    9,
0383        10,   11,   11,   11,   11,   12,   11,   13,   13,   13,
0384        13,   13,   13,   13,   13,   13,   13,    1,    1,   14,
0385        15,   16,    1,    1,   17,   17,   17,   17,   17,   17,
0386        17,   17,   17,   17,   17,   17,   17,   17,   17,   17,
0387        17,   17,   17,   17,   17,   17,   17,   17,   17,   17,
0388         1,    1,    1,    1,   17,    1,   17,   18,   17,   19,
0389 
0390        20,   17,   21,   17,   22,   17,   17,   23,   17,   24,
0391        25,   17,   17,   26,   27,   28,   29,   17,   17,   17,
0392        17,   17,    1,   30,    1,    1,    1,    1,    1,    1,
0393         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
0394         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
0395         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
0396         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
0397         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
0398         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
0399         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
0400 
0401         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
0402         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
0403         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
0404         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
0405         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
0406         1,    1,    1,    1,    1
0407     } ;
0408 
0409 static const YY_CHAR yy_meta[31] =
0410     {   0,
0411         1,    1,    1,    2,    1,    1,    1,    1,    2,    1,
0412         1,    1,    3,    1,    1,    1,    3,    3,    3,    3,
0413         3,    3,    3,    3,    3,    3,    3,    3,    3,    1
0414     } ;
0415 
0416 static const flex_int16_t yy_base[59] =
0417     {   0,
0418         0,    0,   78,   79,   79,   79,   62,   70,   62,   66,
0419        12,   79,   20,   58,   57,   56,   31,   40,   79,   63,
0420        79,   55,    0,   79,   42,   42,   37,   51,   24,   79,
0421        79,   79,   34,   79,   37,   79,    0,   34,   34,   35,
0422        47,   41,   48,   35,   33,   79,   31,   34,   32,   42,
0423        35,   79,   79,   79,   46,   41,   48,   39
0424     } ;
0425 
0426 static const flex_int16_t yy_def[59] =
0427     {   0,
0428        54,    1,   54,   54,   54,   54,   54,   55,   56,   54,
0429        54,   54,   54,   54,   54,   54,   57,   54,   54,   55,
0430        54,   54,   58,   54,   54,   54,   54,   54,   54,   54,
0431        54,   54,   54,   54,   57,   54,   58,   54,   54,   54,
0432        54,   54,   54,   54,   54,   54,   54,   54,   54,   54,
0433        54,   54,   54,    0,   54,   54,   54,   54
0434     } ;
0435 
0436 static const flex_int16_t yy_nxt[110] =
0437     {   0,
0438         4,    5,    6,    5,    7,    8,    9,   10,   11,   12,
0439        12,   12,   13,   14,   15,   16,   17,   17,   17,   17,
0440        17,   17,   17,   17,   17,   17,   17,   17,   17,   18,
0441        25,   28,   29,   26,   33,   28,   29,   33,   27,   34,
0442        33,   37,   34,   23,   53,   34,   20,   20,   20,   35,
0443        35,   52,   51,   50,   49,   48,   47,   46,   45,   41,
0444        44,   43,   42,   41,   40,   39,   38,   22,   21,   36,
0445        32,   31,   30,   24,   22,   21,   19,   54,    3,   54,
0446        54,   54,   54,   54,   54,   54,   54,   54,   54,   54,
0447        54,   54,   54,   54,   54,   54,   54,   54,   54,   54,
0448 
0449        54,   54,   54,   54,   54,   54,   54,   54,   54
0450     } ;
0451 
0452 static const flex_int16_t yy_chk[110] =
0453     {   0,
0454         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
0455         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
0456         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
0457        11,   13,   13,   11,   17,   29,   29,   33,   11,   17,
0458        35,   58,   33,   56,   51,   35,   55,   55,   55,   57,
0459        57,   50,   49,   48,   47,   45,   44,   43,   42,   41,
0460        40,   39,   38,   28,   27,   26,   25,   22,   20,   18,
0461        16,   15,   14,   10,    9,    8,    7,    3,   54,   54,
0462        54,   54,   54,   54,   54,   54,   54,   54,   54,   54,
0463        54,   54,   54,   54,   54,   54,   54,   54,   54,   54,
0464 
0465        54,   54,   54,   54,   54,   54,   54,   54,   54
0466     } ;
0467 
0468 static yy_state_type yy_last_accepting_state;
0469 static char *yy_last_accepting_cpos;
0470 
0471 extern int yy_flex_debug;
0472 int yy_flex_debug = 0;
0473 
0474 /* The intent behind this definition is that it'll catch
0475  * any uses of REJECT which flex missed.
0476  */
0477 #define REJECT reject_used_but_not_detected
0478 #define yymore() yymore_used_but_not_detected
0479 #define YY_MORE_ADJ 0
0480 #define YY_RESTORE_YY_MORE_OFFSET
0481 char *yytext;
0482 #line 1 "libs/flex-input.lex"
0483 #line 4 "libs/flex-input.lex"
0484 /*
0485 Copyright 2005-2011 Tomas Mecir <kmuddy@kmuddy.com>
0486 Copyright 2005 Alex Bache <alexbache@ntlworld.com>
0487 
0488 This program is free software; you can redistribute it and/or
0489 modify it under the terms of the GNU General Public License as
0490 published by the Free Software Foundation; either version 2 of 
0491 the License, or (at your option) any later version.
0492 
0493 This program is distributed in the hope that it will be useful,
0494 but WITHOUT ANY WARRANTY; without even the implied warranty of
0495 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0496 GNU General Public License for more details.
0497 
0498 You should have received a copy of the GNU General Public License
0499 along with this program.  If not, see <http://www.gnu.org/licenses/>.
0500 */
0501     #include "cvalue.h"
0502     #include "bison-input.tab.hpp"
0503    
0504    void yyerror(char *);
0505    
0506    using namespace std;
0507    
0508    // Use global variables from Bison module
0509    extern const char *source;
0510    extern bool        new_source;
0511    extern bool        token_error;
0512 #line 512 "libs/flex-out.cpp"
0513 #line 513 "libs/flex-out.cpp"
0514 
0515 #define INITIAL 0
0516 
0517 #ifndef YY_NO_UNISTD_H
0518 /* Special case for "unistd.h", since it is non-ANSI. We include it way
0519  * down here because we want the user's section 1 to have been scanned first.
0520  * The user has a chance to override it with an option.
0521  */
0522 #include <unistd.h>
0523 #endif
0524 
0525 #ifndef YY_EXTRA_TYPE
0526 #define YY_EXTRA_TYPE void *
0527 #endif
0528 
0529 static int yy_init_globals ( void );
0530 
0531 /* Accessor methods to globals.
0532    These are made visible to non-reentrant scanners for convenience. */
0533 
0534 int yylex_destroy ( void );
0535 
0536 int yyget_debug ( void );
0537 
0538 void yyset_debug ( int debug_flag  );
0539 
0540 YY_EXTRA_TYPE yyget_extra ( void );
0541 
0542 void yyset_extra ( YY_EXTRA_TYPE user_defined  );
0543 
0544 FILE *yyget_in ( void );
0545 
0546 void yyset_in  ( FILE * _in_str  );
0547 
0548 FILE *yyget_out ( void );
0549 
0550 void yyset_out  ( FILE * _out_str  );
0551 
0552             int yyget_leng ( void );
0553 
0554 char *yyget_text ( void );
0555 
0556 int yyget_lineno ( void );
0557 
0558 void yyset_lineno ( int _line_number  );
0559 
0560 /* Macros after this point can all be overridden by user definitions in
0561  * section 1.
0562  */
0563 
0564 #ifndef YY_SKIP_YYWRAP
0565 #ifdef __cplusplus
0566 extern "C" int yywrap ( void );
0567 #else
0568 extern int yywrap ( void );
0569 #endif
0570 #endif
0571 
0572 #ifndef YY_NO_UNPUT
0573     
0574 #endif
0575 
0576 #ifndef yytext_ptr
0577 static void yy_flex_strncpy ( char *, const char *, int );
0578 #endif
0579 
0580 #ifdef YY_NEED_STRLEN
0581 static int yy_flex_strlen ( const char * );
0582 #endif
0583 
0584 #ifndef YY_NO_INPUT
0585 #ifdef __cplusplus
0586 static int yyinput ( void );
0587 #else
0588 static int input ( void );
0589 #endif
0590 
0591 #endif
0592 
0593 /* Amount of stuff to slurp up with each read. */
0594 #ifndef YY_READ_BUF_SIZE
0595 #ifdef __ia64__
0596 /* On IA-64, the buffer size is 16k, not 8k */
0597 #define YY_READ_BUF_SIZE 16384
0598 #else
0599 #define YY_READ_BUF_SIZE 8192
0600 #endif /* __ia64__ */
0601 #endif
0602 
0603 /* Copy whatever the last rule matched to the standard output. */
0604 #ifndef ECHO
0605 /* This used to be an fputs(), but since the string might contain NUL's,
0606  * we now use fwrite().
0607  */
0608 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
0609 #endif
0610 
0611 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
0612  * is returned in "result".
0613  */
0614 #ifndef YY_INPUT
0615 #define YY_INPUT(buf,result,max_size) \
0616     if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
0617         { \
0618         int c = '*'; \
0619         int n; \
0620         for ( n = 0; n < max_size && \
0621                  (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
0622             buf[n] = (char) c; \
0623         if ( c == '\n' ) \
0624             buf[n++] = (char) c; \
0625         if ( c == EOF && ferror( yyin ) ) \
0626             YY_FATAL_ERROR( "input in flex scanner failed" ); \
0627         result = n; \
0628         } \
0629     else \
0630         { \
0631         errno=0; \
0632         while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
0633             { \
0634             if( errno != EINTR) \
0635                 { \
0636                 YY_FATAL_ERROR( "input in flex scanner failed" ); \
0637                 break; \
0638                 } \
0639             errno=0; \
0640             clearerr(yyin); \
0641             } \
0642         }\
0643 \
0644 
0645 #endif
0646 
0647 /* No semi-colon after return; correct usage is to write "yyterminate();" -
0648  * we don't want an extra ';' after the "return" because that will cause
0649  * some compilers to complain about unreachable statements.
0650  */
0651 #ifndef yyterminate
0652 #define yyterminate() return YY_NULL
0653 #endif
0654 
0655 /* Number of entries by which start-condition stack grows. */
0656 #ifndef YY_START_STACK_INCR
0657 #define YY_START_STACK_INCR 25
0658 #endif
0659 
0660 /* Report a fatal error. */
0661 #ifndef YY_FATAL_ERROR
0662 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
0663 #endif
0664 
0665 /* end tables serialization structures and prototypes */
0666 
0667 /* Default declaration of generated scanner - a define so the user can
0668  * easily add parameters.
0669  */
0670 #ifndef YY_DECL
0671 #define YY_DECL_IS_OURS 1
0672 
0673 extern int yylex (void);
0674 
0675 #define YY_DECL int yylex (void)
0676 #endif /* !YY_DECL */
0677 
0678 /* Code executed at the beginning of each rule, after yytext and yyleng
0679  * have been set up.
0680  */
0681 #ifndef YY_USER_ACTION
0682 #define YY_USER_ACTION
0683 #endif
0684 
0685 /* Code executed at the end of each rule. */
0686 #ifndef YY_BREAK
0687 #define YY_BREAK /*LINTED*/break;
0688 #endif
0689 
0690 #define YY_RULE_SETUP \
0691     YY_USER_ACTION
0692 
0693 /** The main scanner function which does all the work.
0694  */
0695 YY_DECL
0696 {
0697     yy_state_type yy_current_state;
0698     char *yy_cp, *yy_bp;
0699     int yy_act;
0700     
0701     if ( !(yy_init) )
0702         {
0703         (yy_init) = 1;
0704 
0705 #ifdef YY_USER_INIT
0706         YY_USER_INIT;
0707 #endif
0708 
0709         if ( ! (yy_start) )
0710             (yy_start) = 1; /* first start state */
0711 
0712         if ( ! yyin )
0713             yyin = stdin;
0714 
0715         if ( ! yyout )
0716             yyout = stdout;
0717 
0718         if ( ! YY_CURRENT_BUFFER ) {
0719             yyensure_buffer_stack ();
0720             YY_CURRENT_BUFFER_LVALUE =
0721                 yy_create_buffer( yyin, YY_BUF_SIZE );
0722         }
0723 
0724         yy_load_buffer_state(  );
0725         }
0726 
0727     {
0728 #line 38 "libs/flex-input.lex"
0729 
0730 
0731 #line 41 "libs/flex-input.lex"
0732    if (new_source)
0733    {
0734       // cout << "Switching to new buffer\n";
0735       // cout.flush();
0736       
0737       yy_delete_buffer(YY_CURRENT_BUFFER);
0738       yy_switch_to_buffer(yy_scan_string(source));
0739       new_source = false;
0740    }
0741    
0742 
0743 #line 743 "libs/flex-out.cpp"
0744 
0745     while ( /*CONSTCOND*/1 )        /* loops until end-of-file is reached */
0746         {
0747         yy_cp = (yy_c_buf_p);
0748 
0749         /* Support of yytext. */
0750         *yy_cp = (yy_hold_char);
0751 
0752         /* yy_bp points to the position in yy_ch_buf of the start of
0753          * the current run.
0754          */
0755         yy_bp = yy_cp;
0756 
0757         yy_current_state = (yy_start);
0758 yy_match:
0759         do
0760             {
0761             YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
0762             if ( yy_accept[yy_current_state] )
0763                 {
0764                 (yy_last_accepting_state) = yy_current_state;
0765                 (yy_last_accepting_cpos) = yy_cp;
0766                 }
0767             while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
0768                 {
0769                 yy_current_state = (int) yy_def[yy_current_state];
0770                 if ( yy_current_state >= 55 )
0771                     yy_c = yy_meta[yy_c];
0772                 }
0773             yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
0774             ++yy_cp;
0775             }
0776         while ( yy_base[yy_current_state] != 79 );
0777 
0778 yy_find_action:
0779         yy_act = yy_accept[yy_current_state];
0780         if ( yy_act == 0 )
0781             { /* have to back up */
0782             yy_cp = (yy_last_accepting_cpos);
0783             yy_current_state = (yy_last_accepting_state);
0784             yy_act = yy_accept[yy_current_state];
0785             }
0786 
0787         YY_DO_BEFORE_ACTION;
0788 
0789 do_action:  /* This label is used only to access EOF actions. */
0790 
0791         switch ( yy_act )
0792     { /* beginning of action switch */
0793             case 0: /* must back up */
0794             /* undo the effects of YY_DO_BEFORE_ACTION */
0795             *yy_cp = (yy_hold_char);
0796             yy_cp = (yy_last_accepting_cpos);
0797             yy_current_state = (yy_last_accepting_state);
0798             goto yy_find_action;
0799 
0800 case 1:
0801 YY_RULE_SETUP
0802 #line 52 "libs/flex-input.lex"
0803 {
0804              // Integer
0805              yylval.int_val = atoi(yytext); 
0806              return INTEGER;
0807           }
0808     YY_BREAK
0809 case 2:
0810 YY_RULE_SETUP
0811 #line 58 "libs/flex-input.lex"
0812 {
0813                         // Double
0814                         yylval.double_val = QString(yytext).toDouble();
0815                         return DOUBLE_V;
0816                      }
0817     YY_BREAK
0818 case 3:
0819 YY_RULE_SETUP
0820 #line 64 "libs/flex-input.lex"
0821 {  
0822                                  // variable name
0823                                  yylval.string_val = strdup(yytext+1); 
0824                                  return STRING_V;
0825                               }
0826     YY_BREAK
0827 case 4:
0828 YY_RULE_SETUP
0829 #line 69 "libs/flex-input.lex"
0830 {  
0831                                  // variable name looking like $number
0832                                  yylval.string_val = strdup(yytext+1); 
0833                                  return STRING_V;
0834                               }
0835     YY_BREAK
0836 case 5:
0837 YY_RULE_SETUP
0838 #line 75 "libs/flex-input.lex"
0839 {  
0840                                    // Function name
0841                                    // strip the parenthesis
0842                                    yytext[yyleng-1]  = '\0';
0843                                    int len = yyleng-2;
0844                                    // strip the spaces too
0845                                    for (; len >= 0; --len)
0846                                      if (yytext[len] == ' ')
0847                                        yytext[len] = '\0';
0848                                      else
0849                                        break;
0850                                    yylval.string_val = strdup(yytext);
0851                                    return FUNCTION_NAME;
0852                                 }
0853     YY_BREAK
0854 case 6:
0855 /* rule 6 can match eol */
0856 YY_RULE_SETUP
0857 #line 90 "libs/flex-input.lex"
0858 {
0859               // String literal
0860               yytext[yyleng-1] = '\0';
0861               
0862               yylval.string_val = strdup(yytext+1);
0863               return STRING_LITERAL;
0864            }
0865     YY_BREAK
0866 case 7:
0867 YY_RULE_SETUP
0868 #line 98 "libs/flex-input.lex"
0869 { return INT_TYPECAST;    }
0870     YY_BREAK
0871 case 8:
0872 YY_RULE_SETUP
0873 #line 99 "libs/flex-input.lex"
0874 { return DOUBLE_TYPECAST; }
0875     YY_BREAK
0876 case 9:
0877 YY_RULE_SETUP
0878 #line 100 "libs/flex-input.lex"
0879 { return STRING_TYPECAST; }
0880     YY_BREAK
0881 case 10:
0882 YY_RULE_SETUP
0883 #line 102 "libs/flex-input.lex"
0884 { return AND; }
0885     YY_BREAK
0886 case 11:
0887 YY_RULE_SETUP
0888 #line 103 "libs/flex-input.lex"
0889 { return OR;  }
0890     YY_BREAK
0891 case 12:
0892 YY_RULE_SETUP
0893 #line 104 "libs/flex-input.lex"
0894 { return GT;  }
0895     YY_BREAK
0896 case 13:
0897 YY_RULE_SETUP
0898 #line 105 "libs/flex-input.lex"
0899 { return GE;  }
0900     YY_BREAK
0901 case 14:
0902 YY_RULE_SETUP
0903 #line 106 "libs/flex-input.lex"
0904 { return LT;  }
0905     YY_BREAK
0906 case 15:
0907 YY_RULE_SETUP
0908 #line 107 "libs/flex-input.lex"
0909 { return LE;  }
0910     YY_BREAK
0911 case 16:
0912 YY_RULE_SETUP
0913 #line 108 "libs/flex-input.lex"
0914 { return EQ;  }
0915     YY_BREAK
0916 case 17:
0917 YY_RULE_SETUP
0918 #line 109 "libs/flex-input.lex"
0919 { return NE;  }
0920     YY_BREAK
0921 case 18:
0922 YY_RULE_SETUP
0923 #line 111 "libs/flex-input.lex"
0924 { return *yytext; }
0925     YY_BREAK
0926 case 19:
0927 /* rule 19 can match eol */
0928 YY_RULE_SETUP
0929 #line 113 "libs/flex-input.lex"
0930 ;
0931     YY_BREAK
0932 case 20:
0933 YY_RULE_SETUP
0934 #line 115 "libs/flex-input.lex"
0935 { token_error = true; yyterminate(); }
0936     YY_BREAK
0937 case 21:
0938 YY_RULE_SETUP
0939 #line 117 "libs/flex-input.lex"
0940 ECHO;
0941     YY_BREAK
0942 #line 942 "libs/flex-out.cpp"
0943 case YY_STATE_EOF(INITIAL):
0944     yyterminate();
0945 
0946     case YY_END_OF_BUFFER:
0947         {
0948         /* Amount of text matched not including the EOB char. */
0949         int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
0950 
0951         /* Undo the effects of YY_DO_BEFORE_ACTION. */
0952         *yy_cp = (yy_hold_char);
0953         YY_RESTORE_YY_MORE_OFFSET
0954 
0955         if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
0956             {
0957             /* We're scanning a new file or input source.  It's
0958              * possible that this happened because the user
0959              * just pointed yyin at a new source and called
0960              * yylex().  If so, then we have to assure
0961              * consistency between YY_CURRENT_BUFFER and our
0962              * globals.  Here is the right place to do so, because
0963              * this is the first action (other than possibly a
0964              * back-up) that will match for the new input source.
0965              */
0966             (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
0967             YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
0968             YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
0969             }
0970 
0971         /* Note that here we test for yy_c_buf_p "<=" to the position
0972          * of the first EOB in the buffer, since yy_c_buf_p will
0973          * already have been incremented past the NUL character
0974          * (since all states make transitions on EOB to the
0975          * end-of-buffer state).  Contrast this with the test
0976          * in input().
0977          */
0978         if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
0979             { /* This was really a NUL. */
0980             yy_state_type yy_next_state;
0981 
0982             (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
0983 
0984             yy_current_state = yy_get_previous_state(  );
0985 
0986             /* Okay, we're now positioned to make the NUL
0987              * transition.  We couldn't have
0988              * yy_get_previous_state() go ahead and do it
0989              * for us because it doesn't know how to deal
0990              * with the possibility of jamming (and we don't
0991              * want to build jamming into it because then it
0992              * will run more slowly).
0993              */
0994 
0995             yy_next_state = yy_try_NUL_trans( yy_current_state );
0996 
0997             yy_bp = (yytext_ptr) + YY_MORE_ADJ;
0998 
0999             if ( yy_next_state )
1000                 {
1001                 /* Consume the NUL. */
1002                 yy_cp = ++(yy_c_buf_p);
1003                 yy_current_state = yy_next_state;
1004                 goto yy_match;
1005                 }
1006 
1007             else
1008                 {
1009                 yy_cp = (yy_c_buf_p);
1010                 goto yy_find_action;
1011                 }
1012             }
1013 
1014         else switch ( yy_get_next_buffer(  ) )
1015             {
1016             case EOB_ACT_END_OF_FILE:
1017                 {
1018                 (yy_did_buffer_switch_on_eof) = 0;
1019 
1020                 if ( yywrap(  ) )
1021                     {
1022                     /* Note: because we've taken care in
1023                      * yy_get_next_buffer() to have set up
1024                      * yytext, we can now set up
1025                      * yy_c_buf_p so that if some total
1026                      * hoser (like flex itself) wants to
1027                      * call the scanner after we return the
1028                      * YY_NULL, it'll still work - another
1029                      * YY_NULL will get returned.
1030                      */
1031                     (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1032 
1033                     yy_act = YY_STATE_EOF(YY_START);
1034                     goto do_action;
1035                     }
1036 
1037                 else
1038                     {
1039                     if ( ! (yy_did_buffer_switch_on_eof) )
1040                         YY_NEW_FILE;
1041                     }
1042                 break;
1043                 }
1044 
1045             case EOB_ACT_CONTINUE_SCAN:
1046                 (yy_c_buf_p) =
1047                     (yytext_ptr) + yy_amount_of_matched_text;
1048 
1049                 yy_current_state = yy_get_previous_state(  );
1050 
1051                 yy_cp = (yy_c_buf_p);
1052                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1053                 goto yy_match;
1054 
1055             case EOB_ACT_LAST_MATCH:
1056                 (yy_c_buf_p) =
1057                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1058 
1059                 yy_current_state = yy_get_previous_state(  );
1060 
1061                 yy_cp = (yy_c_buf_p);
1062                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1063                 goto yy_find_action;
1064             }
1065         break;
1066         }
1067 
1068     default:
1069         YY_FATAL_ERROR(
1070             "fatal flex scanner internal error--no action found" );
1071     } /* end of action switch */
1072         } /* end of scanning one token */
1073     } /* end of user's declarations */
1074 } /* end of yylex */
1075 
1076 /* yy_get_next_buffer - try to read in a new buffer
1077  *
1078  * Returns a code representing an action:
1079  *  EOB_ACT_LAST_MATCH -
1080  *  EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1081  *  EOB_ACT_END_OF_FILE - end of file
1082  */
1083 static int yy_get_next_buffer (void)
1084 {
1085         char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1086     char *source = (yytext_ptr);
1087     int number_to_move, i;
1088     int ret_val;
1089 
1090     if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1091         YY_FATAL_ERROR(
1092         "fatal flex scanner internal error--end of buffer missed" );
1093 
1094     if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1095         { /* Don't try to fill the buffer, so this is an EOF. */
1096         if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1097             {
1098             /* We matched a single character, the EOB, so
1099              * treat this as a final EOF.
1100              */
1101             return EOB_ACT_END_OF_FILE;
1102             }
1103 
1104         else
1105             {
1106             /* We matched some text prior to the EOB, first
1107              * process it.
1108              */
1109             return EOB_ACT_LAST_MATCH;
1110             }
1111         }
1112 
1113     /* Try to read more data. */
1114 
1115     /* First move last chars to start of buffer. */
1116     number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1117 
1118     for ( i = 0; i < number_to_move; ++i )
1119         *(dest++) = *(source++);
1120 
1121     if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1122         /* don't do the read, it's not guaranteed to return an EOF,
1123          * just force an EOF
1124          */
1125         YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1126 
1127     else
1128         {
1129             int num_to_read =
1130             YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1131 
1132         while ( num_to_read <= 0 )
1133             { /* Not enough room in the buffer - grow it. */
1134 
1135             /* just a shorter name for the current buffer */
1136             YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1137 
1138             int yy_c_buf_p_offset =
1139                 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1140 
1141             if ( b->yy_is_our_buffer )
1142                 {
1143                 int new_size = b->yy_buf_size * 2;
1144 
1145                 if ( new_size <= 0 )
1146                     b->yy_buf_size += b->yy_buf_size / 8;
1147                 else
1148                     b->yy_buf_size *= 2;
1149 
1150                 b->yy_ch_buf = (char *)
1151                     /* Include room in for 2 EOB chars. */
1152                     yyrealloc( (void *) b->yy_ch_buf,
1153                              (yy_size_t) (b->yy_buf_size + 2)  );
1154                 }
1155             else
1156                 /* Can't grow it, we don't own it. */
1157                 b->yy_ch_buf = NULL;
1158 
1159             if ( ! b->yy_ch_buf )
1160                 YY_FATAL_ERROR(
1161                 "fatal error - scanner input buffer overflow" );
1162 
1163             (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1164 
1165             num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1166                         number_to_move - 1;
1167 
1168             }
1169 
1170         if ( num_to_read > YY_READ_BUF_SIZE )
1171             num_to_read = YY_READ_BUF_SIZE;
1172 
1173         /* Read in more data. */
1174         YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1175             (yy_n_chars), num_to_read );
1176 
1177         YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1178         }
1179 
1180     if ( (yy_n_chars) == 0 )
1181         {
1182         if ( number_to_move == YY_MORE_ADJ )
1183             {
1184             ret_val = EOB_ACT_END_OF_FILE;
1185             yyrestart( yyin  );
1186             }
1187 
1188         else
1189             {
1190             ret_val = EOB_ACT_LAST_MATCH;
1191             YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1192                 YY_BUFFER_EOF_PENDING;
1193             }
1194         }
1195 
1196     else
1197         ret_val = EOB_ACT_CONTINUE_SCAN;
1198 
1199     if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1200         /* Extend the array by 50%, plus the number we really need. */
1201         int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1202         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1203             (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size  );
1204         if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1205             YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1206         /* "- 2" to take care of EOB's */
1207         YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1208     }
1209 
1210     (yy_n_chars) += number_to_move;
1211     YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1212     YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1213 
1214     (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1215 
1216     return ret_val;
1217 }
1218 
1219 /* yy_get_previous_state - get the state just before the EOB char was reached */
1220 
1221     static yy_state_type yy_get_previous_state (void)
1222 {
1223     yy_state_type yy_current_state;
1224     char *yy_cp;
1225     
1226     yy_current_state = (yy_start);
1227 
1228     for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1229         {
1230         YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1231         if ( yy_accept[yy_current_state] )
1232             {
1233             (yy_last_accepting_state) = yy_current_state;
1234             (yy_last_accepting_cpos) = yy_cp;
1235             }
1236         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1237             {
1238             yy_current_state = (int) yy_def[yy_current_state];
1239             if ( yy_current_state >= 55 )
1240                 yy_c = yy_meta[yy_c];
1241             }
1242         yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1243         }
1244 
1245     return yy_current_state;
1246 }
1247 
1248 /* yy_try_NUL_trans - try to make a transition on the NUL character
1249  *
1250  * synopsis
1251  *  next_state = yy_try_NUL_trans( current_state );
1252  */
1253     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
1254 {
1255     int yy_is_jam;
1256         char *yy_cp = (yy_c_buf_p);
1257 
1258     YY_CHAR yy_c = 1;
1259     if ( yy_accept[yy_current_state] )
1260         {
1261         (yy_last_accepting_state) = yy_current_state;
1262         (yy_last_accepting_cpos) = yy_cp;
1263         }
1264     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1265         {
1266         yy_current_state = (int) yy_def[yy_current_state];
1267         if ( yy_current_state >= 55 )
1268             yy_c = yy_meta[yy_c];
1269         }
1270     yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1271     yy_is_jam = (yy_current_state == 54);
1272 
1273         return yy_is_jam ? 0 : yy_current_state;
1274 }
1275 
1276 #ifndef YY_NO_UNPUT
1277 
1278 #endif
1279 
1280 #ifndef YY_NO_INPUT
1281 #ifdef __cplusplus
1282     static int yyinput (void)
1283 #else
1284     static int input  (void)
1285 #endif
1286 
1287 {
1288     int c;
1289     
1290     *(yy_c_buf_p) = (yy_hold_char);
1291 
1292     if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1293         {
1294         /* yy_c_buf_p now points to the character we want to return.
1295          * If this occurs *before* the EOB characters, then it's a
1296          * valid NUL; if not, then we've hit the end of the buffer.
1297          */
1298         if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1299             /* This was really a NUL. */
1300             *(yy_c_buf_p) = '\0';
1301 
1302         else
1303             { /* need more input */
1304             int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
1305             ++(yy_c_buf_p);
1306 
1307             switch ( yy_get_next_buffer(  ) )
1308                 {
1309                 case EOB_ACT_LAST_MATCH:
1310                     /* This happens because yy_g_n_b()
1311                      * sees that we've accumulated a
1312                      * token and flags that we need to
1313                      * try matching the token before
1314                      * proceeding.  But for input(),
1315                      * there's no matching to consider.
1316                      * So convert the EOB_ACT_LAST_MATCH
1317                      * to EOB_ACT_END_OF_FILE.
1318                      */
1319 
1320                     /* Reset buffer status. */
1321                     yyrestart( yyin );
1322 
1323                     /*FALLTHROUGH*/
1324 
1325                 case EOB_ACT_END_OF_FILE:
1326                     {
1327                     if ( yywrap(  ) )
1328                         return 0;
1329 
1330                     if ( ! (yy_did_buffer_switch_on_eof) )
1331                         YY_NEW_FILE;
1332 #ifdef __cplusplus
1333                     return yyinput();
1334 #else
1335                     return input();
1336 #endif
1337                     }
1338 
1339                 case EOB_ACT_CONTINUE_SCAN:
1340                     (yy_c_buf_p) = (yytext_ptr) + offset;
1341                     break;
1342                 }
1343             }
1344         }
1345 
1346     c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
1347     *(yy_c_buf_p) = '\0';   /* preserve yytext */
1348     (yy_hold_char) = *++(yy_c_buf_p);
1349 
1350     return c;
1351 }
1352 #endif  /* ifndef YY_NO_INPUT */
1353 
1354 /** Immediately switch to a different input stream.
1355  * @param input_file A readable stream.
1356  * 
1357  * @note This function does not reset the start condition to @c INITIAL .
1358  */
1359     void yyrestart  (FILE * input_file )
1360 {
1361     
1362     if ( ! YY_CURRENT_BUFFER ){
1363         yyensure_buffer_stack ();
1364         YY_CURRENT_BUFFER_LVALUE =
1365             yy_create_buffer( yyin, YY_BUF_SIZE );
1366     }
1367 
1368     yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1369     yy_load_buffer_state(  );
1370 }
1371 
1372 /** Switch to a different input buffer.
1373  * @param new_buffer The new input buffer.
1374  * 
1375  */
1376     void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
1377 {
1378     
1379     /* TODO. We should be able to replace this entire function body
1380      * with
1381      *      yypop_buffer_state();
1382      *      yypush_buffer_state(new_buffer);
1383      */
1384     yyensure_buffer_stack ();
1385     if ( YY_CURRENT_BUFFER == new_buffer )
1386         return;
1387 
1388     if ( YY_CURRENT_BUFFER )
1389         {
1390         /* Flush out information for old buffer. */
1391         *(yy_c_buf_p) = (yy_hold_char);
1392         YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1393         YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1394         }
1395 
1396     YY_CURRENT_BUFFER_LVALUE = new_buffer;
1397     yy_load_buffer_state(  );
1398 
1399     /* We don't actually know whether we did this switch during
1400      * EOF (yywrap()) processing, but the only time this flag
1401      * is looked at is after yywrap() is called, so it's safe
1402      * to go ahead and always set it.
1403      */
1404     (yy_did_buffer_switch_on_eof) = 1;
1405 }
1406 
1407 static void yy_load_buffer_state  (void)
1408 {
1409         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1410     (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1411     yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1412     (yy_hold_char) = *(yy_c_buf_p);
1413 }
1414 
1415 /** Allocate and initialize an input buffer state.
1416  * @param file A readable stream.
1417  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1418  * 
1419  * @return the allocated buffer state.
1420  */
1421     YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
1422 {
1423     YY_BUFFER_STATE b;
1424     
1425     b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state )  );
1426     if ( ! b )
1427         YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1428 
1429     b->yy_buf_size = size;
1430 
1431     /* yy_ch_buf has to be 2 characters longer than the size given because
1432      * we need to put in 2 end-of-buffer characters.
1433      */
1434     b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2)  );
1435     if ( ! b->yy_ch_buf )
1436         YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1437 
1438     b->yy_is_our_buffer = 1;
1439 
1440     yy_init_buffer( b, file );
1441 
1442     return b;
1443 }
1444 
1445 /** Destroy the buffer.
1446  * @param b a buffer created with yy_create_buffer()
1447  * 
1448  */
1449     void yy_delete_buffer (YY_BUFFER_STATE  b )
1450 {
1451     
1452     if ( ! b )
1453         return;
1454 
1455     if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1456         YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1457 
1458     if ( b->yy_is_our_buffer )
1459         yyfree( (void *) b->yy_ch_buf  );
1460 
1461     yyfree( (void *) b  );
1462 }
1463 
1464 /* Initializes or reinitializes a buffer.
1465  * This function is sometimes called more than once on the same buffer,
1466  * such as during a yyrestart() or at EOF.
1467  */
1468     static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
1469 
1470 {
1471     int oerrno = errno;
1472     
1473     yy_flush_buffer( b );
1474 
1475     b->yy_input_file = file;
1476     b->yy_fill_buffer = 1;
1477 
1478     /* If b is the current buffer, then yy_init_buffer was _probably_
1479      * called from yyrestart() or through yy_get_next_buffer.
1480      * In that case, we don't want to reset the lineno or column.
1481      */
1482     if (b != YY_CURRENT_BUFFER){
1483         b->yy_bs_lineno = 1;
1484         b->yy_bs_column = 0;
1485     }
1486 
1487         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1488     
1489     errno = oerrno;
1490 }
1491 
1492 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1493  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1494  * 
1495  */
1496     void yy_flush_buffer (YY_BUFFER_STATE  b )
1497 {
1498         if ( ! b )
1499         return;
1500 
1501     b->yy_n_chars = 0;
1502 
1503     /* We always need two end-of-buffer characters.  The first causes
1504      * a transition to the end-of-buffer state.  The second causes
1505      * a jam in that state.
1506      */
1507     b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1508     b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1509 
1510     b->yy_buf_pos = &b->yy_ch_buf[0];
1511 
1512     b->yy_at_bol = 1;
1513     b->yy_buffer_status = YY_BUFFER_NEW;
1514 
1515     if ( b == YY_CURRENT_BUFFER )
1516         yy_load_buffer_state(  );
1517 }
1518 
1519 /** Pushes the new state onto the stack. The new state becomes
1520  *  the current state. This function will allocate the stack
1521  *  if necessary.
1522  *  @param new_buffer The new state.
1523  *  
1524  */
1525 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1526 {
1527         if (new_buffer == NULL)
1528         return;
1529 
1530     yyensure_buffer_stack();
1531 
1532     /* This block is copied from yy_switch_to_buffer. */
1533     if ( YY_CURRENT_BUFFER )
1534         {
1535         /* Flush out information for old buffer. */
1536         *(yy_c_buf_p) = (yy_hold_char);
1537         YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1538         YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1539         }
1540 
1541     /* Only push if top exists. Otherwise, replace top. */
1542     if (YY_CURRENT_BUFFER)
1543         (yy_buffer_stack_top)++;
1544     YY_CURRENT_BUFFER_LVALUE = new_buffer;
1545 
1546     /* copied from yy_switch_to_buffer. */
1547     yy_load_buffer_state(  );
1548     (yy_did_buffer_switch_on_eof) = 1;
1549 }
1550 
1551 /** Removes and deletes the top of the stack, if present.
1552  *  The next element becomes the new top.
1553  *  
1554  */
1555 void yypop_buffer_state (void)
1556 {
1557         if (!YY_CURRENT_BUFFER)
1558         return;
1559 
1560     yy_delete_buffer(YY_CURRENT_BUFFER );
1561     YY_CURRENT_BUFFER_LVALUE = NULL;
1562     if ((yy_buffer_stack_top) > 0)
1563         --(yy_buffer_stack_top);
1564 
1565     if (YY_CURRENT_BUFFER) {
1566         yy_load_buffer_state(  );
1567         (yy_did_buffer_switch_on_eof) = 1;
1568     }
1569 }
1570 
1571 /* Allocates the stack if it does not exist.
1572  *  Guarantees space for at least one push.
1573  */
1574 static void yyensure_buffer_stack (void)
1575 {
1576     yy_size_t num_to_alloc;
1577     
1578     if (!(yy_buffer_stack)) {
1579 
1580         /* First allocation is just for 2 elements, since we don't know if this
1581          * scanner will even need a stack. We use 2 instead of 1 to avoid an
1582          * immediate realloc on the next call.
1583          */
1584       num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1585         (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1586                                 (num_to_alloc * sizeof(struct yy_buffer_state*)
1587                                 );
1588         if ( ! (yy_buffer_stack) )
1589             YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1590 
1591         memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1592 
1593         (yy_buffer_stack_max) = num_to_alloc;
1594         (yy_buffer_stack_top) = 0;
1595         return;
1596     }
1597 
1598     if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1599 
1600         /* Increase the buffer to prepare for a possible push. */
1601         yy_size_t grow_size = 8 /* arbitrary grow size */;
1602 
1603         num_to_alloc = (yy_buffer_stack_max) + grow_size;
1604         (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1605                                 ((yy_buffer_stack),
1606                                 num_to_alloc * sizeof(struct yy_buffer_state*)
1607                                 );
1608         if ( ! (yy_buffer_stack) )
1609             YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1610 
1611         /* zero only the new slots.*/
1612         memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1613         (yy_buffer_stack_max) = num_to_alloc;
1614     }
1615 }
1616 
1617 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1618  * @param base the character buffer
1619  * @param size the size in bytes of the character buffer
1620  * 
1621  * @return the newly allocated buffer state object.
1622  */
1623 YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
1624 {
1625     YY_BUFFER_STATE b;
1626     
1627     if ( size < 2 ||
1628          base[size-2] != YY_END_OF_BUFFER_CHAR ||
1629          base[size-1] != YY_END_OF_BUFFER_CHAR )
1630         /* They forgot to leave room for the EOB's. */
1631         return NULL;
1632 
1633     b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state )  );
1634     if ( ! b )
1635         YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1636 
1637     b->yy_buf_size = (int) (size - 2);  /* "- 2" to take care of EOB's */
1638     b->yy_buf_pos = b->yy_ch_buf = base;
1639     b->yy_is_our_buffer = 0;
1640     b->yy_input_file = NULL;
1641     b->yy_n_chars = b->yy_buf_size;
1642     b->yy_is_interactive = 0;
1643     b->yy_at_bol = 1;
1644     b->yy_fill_buffer = 0;
1645     b->yy_buffer_status = YY_BUFFER_NEW;
1646 
1647     yy_switch_to_buffer( b  );
1648 
1649     return b;
1650 }
1651 
1652 /** Setup the input buffer state to scan a string. The next call to yylex() will
1653  * scan from a @e copy of @a str.
1654  * @param yystr a NUL-terminated string to scan
1655  * 
1656  * @return the newly allocated buffer state object.
1657  * @note If you want to scan bytes that may contain NUL values, then use
1658  *       yy_scan_bytes() instead.
1659  */
1660 YY_BUFFER_STATE yy_scan_string (const char * yystr )
1661 {
1662     
1663     return yy_scan_bytes( yystr, (int) strlen(yystr) );
1664 }
1665 
1666 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1667  * scan from a @e copy of @a bytes.
1668  * @param yybytes the byte buffer to scan
1669  * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1670  * 
1671  * @return the newly allocated buffer state object.
1672  */
1673 YY_BUFFER_STATE yy_scan_bytes  (const char * yybytes, int  _yybytes_len )
1674 {
1675     YY_BUFFER_STATE b;
1676     char *buf;
1677     yy_size_t n;
1678     int i;
1679     
1680     /* Get memory for full buffer, including space for trailing EOB's. */
1681     n = (yy_size_t) (_yybytes_len + 2);
1682     buf = (char *) yyalloc( n  );
1683     if ( ! buf )
1684         YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1685 
1686     for ( i = 0; i < _yybytes_len; ++i )
1687         buf[i] = yybytes[i];
1688 
1689     buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1690 
1691     b = yy_scan_buffer( buf, n );
1692     if ( ! b )
1693         YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1694 
1695     /* It's okay to grow etc. this buffer, and we should throw it
1696      * away when we're done.
1697      */
1698     b->yy_is_our_buffer = 1;
1699 
1700     return b;
1701 }
1702 
1703 #ifndef YY_EXIT_FAILURE
1704 #define YY_EXIT_FAILURE 2
1705 #endif
1706 
1707 static void yynoreturn yy_fatal_error (const char* msg )
1708 {
1709             fprintf( stderr, "%s\n", msg );
1710     exit( YY_EXIT_FAILURE );
1711 }
1712 
1713 /* Redefine yyless() so it works in section 3 code. */
1714 
1715 #undef yyless
1716 #define yyless(n) \
1717     do \
1718         { \
1719         /* Undo effects of setting up yytext. */ \
1720         int yyless_macro_arg = (n); \
1721         YY_LESS_LINENO(yyless_macro_arg);\
1722         yytext[yyleng] = (yy_hold_char); \
1723         (yy_c_buf_p) = yytext + yyless_macro_arg; \
1724         (yy_hold_char) = *(yy_c_buf_p); \
1725         *(yy_c_buf_p) = '\0'; \
1726         yyleng = yyless_macro_arg; \
1727         } \
1728     while ( 0 )
1729 
1730 /* Accessor  methods (get/set functions) to struct members. */
1731 
1732 /** Get the current line number.
1733  * 
1734  */
1735 int yyget_lineno  (void)
1736 {
1737     
1738     return yylineno;
1739 }
1740 
1741 /** Get the input stream.
1742  * 
1743  */
1744 FILE *yyget_in  (void)
1745 {
1746         return yyin;
1747 }
1748 
1749 /** Get the output stream.
1750  * 
1751  */
1752 FILE *yyget_out  (void)
1753 {
1754         return yyout;
1755 }
1756 
1757 /** Get the length of the current token.
1758  * 
1759  */
1760 int yyget_leng  (void)
1761 {
1762         return yyleng;
1763 }
1764 
1765 /** Get the current token.
1766  * 
1767  */
1768 
1769 char *yyget_text  (void)
1770 {
1771         return yytext;
1772 }
1773 
1774 /** Set the current line number.
1775  * @param _line_number line number
1776  * 
1777  */
1778 void yyset_lineno (int  _line_number )
1779 {
1780     
1781     yylineno = _line_number;
1782 }
1783 
1784 /** Set the input stream. This does not discard the current
1785  * input buffer.
1786  * @param _in_str A readable stream.
1787  * 
1788  * @see yy_switch_to_buffer
1789  */
1790 void yyset_in (FILE *  _in_str )
1791 {
1792         yyin = _in_str ;
1793 }
1794 
1795 void yyset_out (FILE *  _out_str )
1796 {
1797         yyout = _out_str ;
1798 }
1799 
1800 int yyget_debug  (void)
1801 {
1802         return yy_flex_debug;
1803 }
1804 
1805 void yyset_debug (int  _bdebug )
1806 {
1807         yy_flex_debug = _bdebug ;
1808 }
1809 
1810 static int yy_init_globals (void)
1811 {
1812         /* Initialization is the same as for the non-reentrant scanner.
1813      * This function is called from yylex_destroy(), so don't allocate here.
1814      */
1815 
1816     (yy_buffer_stack) = NULL;
1817     (yy_buffer_stack_top) = 0;
1818     (yy_buffer_stack_max) = 0;
1819     (yy_c_buf_p) = NULL;
1820     (yy_init) = 0;
1821     (yy_start) = 0;
1822 
1823 /* Defined in main.c */
1824 #ifdef YY_STDINIT
1825     yyin = stdin;
1826     yyout = stdout;
1827 #else
1828     yyin = NULL;
1829     yyout = NULL;
1830 #endif
1831 
1832     /* For future reference: Set errno on error, since we are called by
1833      * yylex_init()
1834      */
1835     return 0;
1836 }
1837 
1838 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
1839 int yylex_destroy  (void)
1840 {
1841     
1842     /* Pop the buffer stack, destroying each element. */
1843     while(YY_CURRENT_BUFFER){
1844         yy_delete_buffer( YY_CURRENT_BUFFER  );
1845         YY_CURRENT_BUFFER_LVALUE = NULL;
1846         yypop_buffer_state();
1847     }
1848 
1849     /* Destroy the stack itself. */
1850     yyfree((yy_buffer_stack) );
1851     (yy_buffer_stack) = NULL;
1852 
1853     /* Reset the globals. This is important in a non-reentrant scanner so the next time
1854      * yylex() is called, initialization will occur. */
1855     yy_init_globals( );
1856 
1857     return 0;
1858 }
1859 
1860 /*
1861  * Internal utility routines.
1862  */
1863 
1864 #ifndef yytext_ptr
1865 static void yy_flex_strncpy (char* s1, const char * s2, int n )
1866 {
1867         
1868     int i;
1869     for ( i = 0; i < n; ++i )
1870         s1[i] = s2[i];
1871 }
1872 #endif
1873 
1874 #ifdef YY_NEED_STRLEN
1875 static int yy_flex_strlen (const char * s )
1876 {
1877     int n;
1878     for ( n = 0; s[n]; ++n )
1879         ;
1880 
1881     return n;
1882 }
1883 #endif
1884 
1885 void *yyalloc (yy_size_t  size )
1886 {
1887             return malloc(size);
1888 }
1889 
1890 void *yyrealloc  (void * ptr, yy_size_t  size )
1891 {
1892         
1893     /* The cast to (char *) in the following accommodates both
1894      * implementations that use char* generic pointers, and those
1895      * that use void* generic pointers.  It works with the latter
1896      * because both ANSI C and C++ allow castless assignment from
1897      * any pointer type to void*, and deal with argument conversions
1898      * as though doing an assignment.
1899      */
1900     return realloc(ptr, size);
1901 }
1902 
1903 void yyfree (void * ptr )
1904 {
1905             free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
1906 }
1907 
1908 #define YYTABLES_NAME "yytables"
1909 
1910 #line 117 "libs/flex-input.lex"
1911 
1912