Mercurial > vba-linux
diff src/sdl/expr-lex.cpp @ 1:f9f4f1b99eed
importing src directory
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 03 Mar 2012 10:31:27 -0600 |
parents | |
children |
line wrap: on
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/sdl/expr-lex.cpp Sat Mar 03 10:31:27 2012 -0600 1.3 @@ -0,0 +1,1590 @@ 1.4 +#line 2 "expr-lex.cpp" 1.5 +/* A lexical scanner generated by flex */ 1.6 + 1.7 +/* Scanner skeleton version: 1.8 + * $Header: /cvsroot/vba/VisualBoyAdvance/src/expr-lex.cpp,v 1.2 2003/06/06 14:17:21 forgotten Exp $ 1.9 + */ 1.10 + 1.11 +#define FLEX_SCANNER 1.12 +#define YY_FLEX_MAJOR_VERSION 2 1.13 +#define YY_FLEX_MINOR_VERSION 5 1.14 + 1.15 +#include <stdio.h> 1.16 +#ifdef __GNUC__ 1.17 +#include <unistd.h> 1.18 +#endif 1.19 + 1.20 + 1.21 +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ 1.22 +#ifdef c_plusplus 1.23 +#ifndef __cplusplus 1.24 +#define __cplusplus 1.25 +#endif 1.26 +#endif 1.27 + 1.28 + 1.29 +#ifdef __cplusplus 1.30 + 1.31 +#include <stdlib.h> 1.32 + 1.33 +/* Use prototypes in function declarations. */ 1.34 +#define YY_USE_PROTOS 1.35 + 1.36 +/* The "const" storage-class-modifier is valid. */ 1.37 +#define YY_USE_CONST 1.38 + 1.39 +#else /* ! __cplusplus */ 1.40 + 1.41 +#if __STDC__ 1.42 + 1.43 +#define YY_USE_PROTOS 1.44 +#define YY_USE_CONST 1.45 + 1.46 +#endif /* __STDC__ */ 1.47 +#endif /* ! __cplusplus */ 1.48 + 1.49 +#ifdef __TURBOC__ 1.50 + #pragma warn -rch 1.51 + #pragma warn -use 1.52 +#include <io.h> 1.53 +#include <stdlib.h> 1.54 +#define YY_USE_CONST 1.55 +#define YY_USE_PROTOS 1.56 +#endif 1.57 + 1.58 +#ifdef YY_USE_CONST 1.59 +#define yyconst const 1.60 +#else 1.61 +#define yyconst 1.62 +#endif 1.63 + 1.64 + 1.65 +#ifdef YY_USE_PROTOS 1.66 +#define YY_PROTO(proto) proto 1.67 +#else 1.68 +#define YY_PROTO(proto) () 1.69 +#endif 1.70 + 1.71 +/* Returned upon end-of-file. */ 1.72 +#define YY_NULL 0 1.73 + 1.74 +/* Promotes a possibly negative, possibly signed char to an unsigned 1.75 + * integer for use as an array index. If the signed char is negative, 1.76 + * we want to instead treat it as an 8-bit unsigned char, hence the 1.77 + * double cast. 1.78 + */ 1.79 +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) 1.80 + 1.81 +/* Enter a start condition. This macro really ought to take a parameter, 1.82 + * but we do it the disgusting crufty way forced on us by the ()-less 1.83 + * definition of BEGIN. 1.84 + */ 1.85 +#define BEGIN yy_start = 1 + 2 * 1.86 + 1.87 +/* Translate the current start state into a value that can be later handed 1.88 + * to BEGIN to return to the state. The YYSTATE alias is for lex 1.89 + * compatibility. 1.90 + */ 1.91 +#define YY_START ((yy_start - 1) / 2) 1.92 +#define YYSTATE YY_START 1.93 + 1.94 +/* Action number for EOF rule of a given start state. */ 1.95 +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 1.96 + 1.97 +/* Special action meaning "start processing a new file". */ 1.98 +#define YY_NEW_FILE yyrestart( yyin ) 1.99 + 1.100 +#define YY_END_OF_BUFFER_CHAR 0 1.101 + 1.102 +/* Size of default input buffer. */ 1.103 +#define YY_BUF_SIZE 16384 1.104 + 1.105 +typedef struct yy_buffer_state *YY_BUFFER_STATE; 1.106 + 1.107 +extern int yyleng; 1.108 +extern FILE *yyin, *yyout; 1.109 + 1.110 +#define EOB_ACT_CONTINUE_SCAN 0 1.111 +#define EOB_ACT_END_OF_FILE 1 1.112 +#define EOB_ACT_LAST_MATCH 2 1.113 + 1.114 +/* The funky do-while in the following #define is used to turn the definition 1.115 + * int a single C statement (which needs a semi-colon terminator). This 1.116 + * avoids problems with code like: 1.117 + * 1.118 + * if ( condition_holds ) 1.119 + * yyless( 5 ); 1.120 + * else 1.121 + * do_something_else(); 1.122 + * 1.123 + * Prior to using the do-while the compiler would get upset at the 1.124 + * "else" because it interpreted the "if" statement as being all 1.125 + * done when it reached the ';' after the yyless() call. 1.126 + */ 1.127 + 1.128 +/* Return all but the first 'n' matched characters back to the input stream. */ 1.129 + 1.130 +#define yyless(n) \ 1.131 + do \ 1.132 + { \ 1.133 + /* Undo effects of setting up yytext. */ \ 1.134 + *yy_cp = yy_hold_char; \ 1.135 + YY_RESTORE_YY_MORE_OFFSET \ 1.136 + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ 1.137 + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ 1.138 + } \ 1.139 + while ( 0 ) 1.140 + 1.141 +#define unput(c) yyunput( c, yytext_ptr ) 1.142 + 1.143 +/* The following is because we cannot portably get our hands on size_t 1.144 + * (without autoconf's help, which isn't available because we want 1.145 + * flex-generated scanners to compile on their own). 1.146 + */ 1.147 +typedef unsigned int yy_size_t; 1.148 + 1.149 + 1.150 +struct yy_buffer_state 1.151 + { 1.152 + FILE *yy_input_file; 1.153 + 1.154 + char *yy_ch_buf; /* input buffer */ 1.155 + char *yy_buf_pos; /* current position in input buffer */ 1.156 + 1.157 + /* Size of input buffer in bytes, not including room for EOB 1.158 + * characters. 1.159 + */ 1.160 + yy_size_t yy_buf_size; 1.161 + 1.162 + /* Number of characters read into yy_ch_buf, not including EOB 1.163 + * characters. 1.164 + */ 1.165 + int yy_n_chars; 1.166 + 1.167 + /* Whether we "own" the buffer - i.e., we know we created it, 1.168 + * and can realloc() it to grow it, and should free() it to 1.169 + * delete it. 1.170 + */ 1.171 + int yy_is_our_buffer; 1.172 + 1.173 + /* Whether this is an "interactive" input source; if so, and 1.174 + * if we're using stdio for input, then we want to use getc() 1.175 + * instead of fread(), to make sure we stop fetching input after 1.176 + * each newline. 1.177 + */ 1.178 + int yy_is_interactive; 1.179 + 1.180 + /* Whether we're considered to be at the beginning of a line. 1.181 + * If so, '^' rules will be active on the next match, otherwise 1.182 + * not. 1.183 + */ 1.184 + int yy_at_bol; 1.185 + 1.186 + /* Whether to try to fill the input buffer when we reach the 1.187 + * end of it. 1.188 + */ 1.189 + int yy_fill_buffer; 1.190 + 1.191 + int yy_buffer_status; 1.192 +#define YY_BUFFER_NEW 0 1.193 +#define YY_BUFFER_NORMAL 1 1.194 + /* When an EOF's been seen but there's still some text to process 1.195 + * then we mark the buffer as YY_EOF_PENDING, to indicate that we 1.196 + * shouldn't try reading from the input source any more. We might 1.197 + * still have a bunch of tokens to match, though, because of 1.198 + * possible backing-up. 1.199 + * 1.200 + * When we actually see the EOF, we change the status to "new" 1.201 + * (via yyrestart()), so that the user can continue scanning by 1.202 + * just pointing yyin at a new input file. 1.203 + */ 1.204 +#define YY_BUFFER_EOF_PENDING 2 1.205 + }; 1.206 + 1.207 +static YY_BUFFER_STATE yy_current_buffer = 0; 1.208 + 1.209 +/* We provide macros for accessing buffer states in case in the 1.210 + * future we want to put the buffer states in a more general 1.211 + * "scanner state". 1.212 + */ 1.213 +#define YY_CURRENT_BUFFER yy_current_buffer 1.214 + 1.215 + 1.216 +/* yy_hold_char holds the character lost when yytext is formed. */ 1.217 +static char yy_hold_char; 1.218 + 1.219 +static int yy_n_chars; /* number of characters read into yy_ch_buf */ 1.220 + 1.221 + 1.222 +int yyleng; 1.223 + 1.224 +/* Points to current character in buffer. */ 1.225 +static char *yy_c_buf_p = (char *) 0; 1.226 +static int yy_init = 1; /* whether we need to initialize */ 1.227 +static int yy_start = 0; /* start state number */ 1.228 + 1.229 +/* Flag which is used to allow yywrap()'s to do buffer switches 1.230 + * instead of setting up a fresh yyin. A bit of a hack ... 1.231 + */ 1.232 +static int yy_did_buffer_switch_on_eof; 1.233 + 1.234 +void yyrestart YY_PROTO(( FILE *input_file )); 1.235 + 1.236 +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); 1.237 +void yy_load_buffer_state YY_PROTO(( void )); 1.238 +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); 1.239 +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); 1.240 +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); 1.241 +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); 1.242 +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) 1.243 + 1.244 +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); 1.245 +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); 1.246 +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); 1.247 + 1.248 +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); 1.249 +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); 1.250 +static void yy_flex_free YY_PROTO(( void * )); 1.251 + 1.252 +#define yy_new_buffer yy_create_buffer 1.253 + 1.254 +#define yy_set_interactive(is_interactive) \ 1.255 + { \ 1.256 + if ( ! yy_current_buffer ) \ 1.257 + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ 1.258 + yy_current_buffer->yy_is_interactive = is_interactive; \ 1.259 + } 1.260 + 1.261 +#define yy_set_bol(at_bol) \ 1.262 + { \ 1.263 + if ( ! yy_current_buffer ) \ 1.264 + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ 1.265 + yy_current_buffer->yy_at_bol = at_bol; \ 1.266 + } 1.267 + 1.268 +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) 1.269 + 1.270 + 1.271 +#define yywrap() 1 1.272 +#define YY_SKIP_YYWRAP 1.273 +typedef unsigned char YY_CHAR; 1.274 +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; 1.275 +typedef int yy_state_type; 1.276 +extern char *yytext; 1.277 +#define yytext_ptr yytext 1.278 + 1.279 +static yy_state_type yy_get_previous_state YY_PROTO(( void )); 1.280 +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); 1.281 +static int yy_get_next_buffer YY_PROTO(( void )); 1.282 +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); 1.283 + 1.284 +/* Done after the current pattern has been matched and before the 1.285 + * corresponding action - sets up yytext. 1.286 + */ 1.287 +#define YY_DO_BEFORE_ACTION \ 1.288 + yytext_ptr = yy_bp; \ 1.289 + yyleng = (int) (yy_cp - yy_bp); \ 1.290 + yy_hold_char = *yy_cp; \ 1.291 + *yy_cp = '\0'; \ 1.292 + yy_c_buf_p = yy_cp; 1.293 + 1.294 +#define YY_NUM_RULES 10 1.295 +#define YY_END_OF_BUFFER 11 1.296 +static yyconst short int yy_accept[24] = 1.297 + { 0, 1.298 + 0, 0, 11, 9, 8, 8, 6, 7, 9, 4, 1.299 + 3, 2, 2, 8, 5, 3, 2, 2, 2, 2, 1.300 + 2, 1, 0 1.301 + } ; 1.302 + 1.303 +static yyconst int yy_ec[256] = 1.304 + { 0, 1.305 + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1.306 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.307 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.308 + 1, 2, 1, 1, 1, 1, 1, 4, 1, 1, 1.309 + 1, 5, 1, 1, 6, 7, 1, 8, 8, 8, 1.310 + 8, 8, 8, 8, 8, 8, 8, 1, 1, 1, 1.311 + 1, 9, 1, 1, 10, 10, 10, 10, 10, 10, 1.312 + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1.313 + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1.314 + 1, 1, 1, 1, 10, 1, 10, 10, 10, 10, 1.315 + 1.316 + 11, 12, 10, 10, 13, 10, 10, 10, 10, 10, 1.317 + 14, 10, 10, 10, 15, 10, 10, 10, 10, 10, 1.318 + 10, 16, 1, 1, 1, 1, 1, 1, 1, 1, 1.319 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.320 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.321 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.322 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.323 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.324 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.325 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.326 + 1.327 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.328 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.329 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.330 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.331 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.332 + 1, 1, 1, 1, 1 1.333 + } ; 1.334 + 1.335 +static yyconst int yy_meta[17] = 1.336 + { 0, 1.337 + 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1.338 + 2, 2, 2, 2, 2, 2 1.339 + } ; 1.340 + 1.341 +static yyconst short int yy_base[25] = 1.342 + { 0, 1.343 + 0, 0, 32, 33, 15, 17, 33, 33, 22, 33, 1.344 + 22, 0, 16, 19, 33, 20, 0, 11, 15, 11, 1.345 + 12, 0, 33, 21 1.346 + } ; 1.347 + 1.348 +static yyconst short int yy_def[25] = 1.349 + { 0, 1.350 + 23, 1, 23, 23, 23, 23, 23, 23, 23, 23, 1.351 + 23, 24, 24, 23, 23, 23, 24, 24, 24, 24, 1.352 + 24, 24, 0, 23 1.353 + } ; 1.354 + 1.355 +static yyconst short int yy_nxt[50] = 1.356 + { 0, 1.357 + 4, 5, 6, 7, 8, 9, 10, 11, 4, 12, 1.358 + 12, 12, 12, 12, 13, 12, 14, 14, 14, 14, 1.359 + 14, 14, 17, 22, 21, 20, 19, 16, 18, 16, 1.360 + 15, 23, 3, 23, 23, 23, 23, 23, 23, 23, 1.361 + 23, 23, 23, 23, 23, 23, 23, 23, 23 1.362 + } ; 1.363 + 1.364 +static yyconst short int yy_chk[50] = 1.365 + { 0, 1.366 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.367 + 1, 1, 1, 1, 1, 1, 5, 5, 6, 6, 1.368 + 14, 14, 24, 21, 20, 19, 18, 16, 13, 11, 1.369 + 9, 3, 23, 23, 23, 23, 23, 23, 23, 23, 1.370 + 23, 23, 23, 23, 23, 23, 23, 23, 23 1.371 + } ; 1.372 + 1.373 +static yy_state_type yy_last_accepting_state; 1.374 +static char *yy_last_accepting_cpos; 1.375 + 1.376 +/* The intent behind this definition is that it'll catch 1.377 + * any uses of REJECT which flex missed. 1.378 + */ 1.379 +#define REJECT reject_used_but_not_detected 1.380 +#define yymore() yymore_used_but_not_detected 1.381 +#define YY_MORE_ADJ 0 1.382 +#define YY_RESTORE_YY_MORE_OFFSET 1.383 +char *yytext; 1.384 +#line 1 "expr.l" 1.385 +#define INITIAL 0 1.386 +#line 2 "expr.l" 1.387 +#include "expr.cpp.h" 1.388 + 1.389 +#ifndef __GNUC__ 1.390 +#include <io.h> 1.391 +#define isatty _isatty 1.392 +#endif 1.393 + 1.394 +char *exprString; 1.395 +int exprCol; 1.396 + 1.397 +#define YY_INPUT(buf,result,max_size) \ 1.398 + { \ 1.399 + int c = *exprString++; \ 1.400 + exprCol++;\ 1.401 + result = (c == 0) ? YY_NULL : (buf[0] = c, 1); \ 1.402 + } 1.403 +#define YY_MAIN 0 1.404 +#line 400 "expr-lex.cpp" 1.405 + 1.406 +/* Macros after this point can all be overridden by user definitions in 1.407 + * section 1. 1.408 + */ 1.409 + 1.410 +#ifndef YY_SKIP_YYWRAP 1.411 +#ifdef __cplusplus 1.412 +extern "C" int yywrap YY_PROTO(( void )); 1.413 +#else 1.414 +extern int yywrap YY_PROTO(( void )); 1.415 +#endif 1.416 +#endif 1.417 + 1.418 +#ifndef YY_NO_UNPUT 1.419 +static void yyunput YY_PROTO(( int c, char *buf_ptr )); 1.420 +#endif 1.421 + 1.422 +#ifndef yytext_ptr 1.423 +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); 1.424 +#endif 1.425 + 1.426 +#ifdef YY_NEED_STRLEN 1.427 +static int yy_flex_strlen YY_PROTO(( yyconst char * )); 1.428 +#endif 1.429 + 1.430 +#ifndef YY_NO_INPUT 1.431 +#ifdef __cplusplus 1.432 +static int yyinput YY_PROTO(( void )); 1.433 +#else 1.434 +static int input YY_PROTO(( void )); 1.435 +#endif 1.436 +#endif 1.437 + 1.438 +#if YY_STACK_USED 1.439 +static int yy_start_stack_ptr = 0; 1.440 +static int yy_start_stack_depth = 0; 1.441 +static int *yy_start_stack = 0; 1.442 +#ifndef YY_NO_PUSH_STATE 1.443 +static void yy_push_state YY_PROTO(( int new_state )); 1.444 +#endif 1.445 +#ifndef YY_NO_POP_STATE 1.446 +static void yy_pop_state YY_PROTO(( void )); 1.447 +#endif 1.448 +#ifndef YY_NO_TOP_STATE 1.449 +static int yy_top_state YY_PROTO(( void )); 1.450 +#endif 1.451 + 1.452 +#else 1.453 +#define YY_NO_PUSH_STATE 1 1.454 +#define YY_NO_POP_STATE 1 1.455 +#define YY_NO_TOP_STATE 1 1.456 +#endif 1.457 + 1.458 +#ifdef YY_MALLOC_DECL 1.459 +YY_MALLOC_DECL 1.460 +#else 1.461 +#if __STDC__ 1.462 +#ifndef __cplusplus 1.463 +#include <stdlib.h> 1.464 +#endif 1.465 +#else 1.466 +/* Just try to get by without declaring the routines. This will fail 1.467 + * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) 1.468 + * or sizeof(void*) != sizeof(int). 1.469 + */ 1.470 +#endif 1.471 +#endif 1.472 + 1.473 +/* Amount of stuff to slurp up with each read. */ 1.474 +#ifndef YY_READ_BUF_SIZE 1.475 +#define YY_READ_BUF_SIZE 8192 1.476 +#endif 1.477 + 1.478 +/* Copy whatever the last rule matched to the standard output. */ 1.479 + 1.480 +#ifndef ECHO 1.481 +/* This used to be an fputs(), but since the string might contain NUL's, 1.482 + * we now use fwrite(). 1.483 + */ 1.484 +#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) 1.485 +#endif 1.486 + 1.487 +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, 1.488 + * is returned in "result". 1.489 + */ 1.490 +#ifndef YY_INPUT 1.491 +#define YY_INPUT(buf,result,max_size) \ 1.492 + if ( yy_current_buffer->yy_is_interactive ) \ 1.493 + { \ 1.494 + int c = '*', n; \ 1.495 + for ( n = 0; n < max_size && \ 1.496 + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 1.497 + buf[n] = (char) c; \ 1.498 + if ( c == '\n' ) \ 1.499 + buf[n++] = (char) c; \ 1.500 + if ( c == EOF && ferror( yyin ) ) \ 1.501 + YY_FATAL_ERROR( "input in flex scanner failed" ); \ 1.502 + result = n; \ 1.503 + } \ 1.504 + else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ 1.505 + && ferror( yyin ) ) \ 1.506 + YY_FATAL_ERROR( "input in flex scanner failed" ); 1.507 +#endif 1.508 + 1.509 +/* No semi-colon after return; correct usage is to write "yyterminate();" - 1.510 + * we don't want an extra ';' after the "return" because that will cause 1.511 + * some compilers to complain about unreachable statements. 1.512 + */ 1.513 +#ifndef yyterminate 1.514 +#define yyterminate() return YY_NULL 1.515 +#endif 1.516 + 1.517 +/* Number of entries by which start-condition stack grows. */ 1.518 +#ifndef YY_START_STACK_INCR 1.519 +#define YY_START_STACK_INCR 25 1.520 +#endif 1.521 + 1.522 +/* Report a fatal error. */ 1.523 +#ifndef YY_FATAL_ERROR 1.524 +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) 1.525 +#endif 1.526 + 1.527 +/* Default declaration of generated scanner - a define so the user can 1.528 + * easily add parameters. 1.529 + */ 1.530 +#ifndef YY_DECL 1.531 +#define YY_DECL int yylex YY_PROTO(( void )) 1.532 +#endif 1.533 + 1.534 +/* Code executed at the beginning of each rule, after yytext and yyleng 1.535 + * have been set up. 1.536 + */ 1.537 +#ifndef YY_USER_ACTION 1.538 +#define YY_USER_ACTION 1.539 +#endif 1.540 + 1.541 +/* Code executed at the end of each rule. */ 1.542 +#ifndef YY_BREAK 1.543 +#define YY_BREAK break; 1.544 +#endif 1.545 + 1.546 +#define YY_RULE_SETUP \ 1.547 + YY_USER_ACTION 1.548 + 1.549 +YY_DECL 1.550 + { 1.551 + register yy_state_type yy_current_state; 1.552 + register char *yy_cp = NULL, *yy_bp = NULL; 1.553 + register int yy_act; 1.554 + 1.555 +#line 31 "expr.l" 1.556 + 1.557 + 1.558 +#line 554 "expr-lex.cpp" 1.559 + 1.560 + if ( yy_init ) 1.561 + { 1.562 + yy_init = 0; 1.563 + 1.564 +#ifdef YY_USER_INIT 1.565 + YY_USER_INIT; 1.566 +#endif 1.567 + 1.568 + if ( ! yy_start ) 1.569 + yy_start = 1; /* first start state */ 1.570 + 1.571 + if ( ! yyin ) 1.572 + yyin = stdin; 1.573 + 1.574 + if ( ! yyout ) 1.575 + yyout = stdout; 1.576 + 1.577 + if ( ! yy_current_buffer ) 1.578 + yy_current_buffer = 1.579 + yy_create_buffer( yyin, YY_BUF_SIZE ); 1.580 + 1.581 + yy_load_buffer_state(); 1.582 + } 1.583 + 1.584 + while ( 1 ) /* loops until end-of-file is reached */ 1.585 + { 1.586 + yy_cp = yy_c_buf_p; 1.587 + 1.588 + /* Support of yytext. */ 1.589 + *yy_cp = yy_hold_char; 1.590 + 1.591 + /* yy_bp points to the position in yy_ch_buf of the start of 1.592 + * the current run. 1.593 + */ 1.594 + yy_bp = yy_cp; 1.595 + 1.596 + yy_current_state = yy_start; 1.597 +yy_match: 1.598 + do 1.599 + { 1.600 + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; 1.601 + if ( yy_accept[yy_current_state] ) 1.602 + { 1.603 + yy_last_accepting_state = yy_current_state; 1.604 + yy_last_accepting_cpos = yy_cp; 1.605 + } 1.606 + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1.607 + { 1.608 + yy_current_state = (int) yy_def[yy_current_state]; 1.609 + if ( yy_current_state >= 24 ) 1.610 + yy_c = yy_meta[(unsigned int) yy_c]; 1.611 + } 1.612 + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1.613 + ++yy_cp; 1.614 + } 1.615 + while ( yy_base[yy_current_state] != 33 ); 1.616 + 1.617 +yy_find_action: 1.618 + yy_act = yy_accept[yy_current_state]; 1.619 + if ( yy_act == 0 ) 1.620 + { /* have to back up */ 1.621 + yy_cp = yy_last_accepting_cpos; 1.622 + yy_current_state = yy_last_accepting_state; 1.623 + yy_act = yy_accept[yy_current_state]; 1.624 + } 1.625 + 1.626 + YY_DO_BEFORE_ACTION; 1.627 + 1.628 + 1.629 +do_action: /* This label is used only to access EOF actions. */ 1.630 + 1.631 + 1.632 + switch ( yy_act ) 1.633 + { /* beginning of action switch */ 1.634 + case 0: /* must back up */ 1.635 + /* undo the effects of YY_DO_BEFORE_ACTION */ 1.636 + *yy_cp = yy_hold_char; 1.637 + yy_cp = yy_last_accepting_cpos; 1.638 + yy_current_state = yy_last_accepting_state; 1.639 + goto yy_find_action; 1.640 + 1.641 +case 1: 1.642 +YY_RULE_SETUP 1.643 +#line 33 "expr.l" 1.644 +{ 1.645 + return TOKEN_SIZEOF; 1.646 +} 1.647 + YY_BREAK 1.648 +case 2: 1.649 +YY_RULE_SETUP 1.650 +#line 37 "expr.l" 1.651 +{ 1.652 + return TOKEN_IDENTIFIER; 1.653 +} 1.654 + YY_BREAK 1.655 +case 3: 1.656 +YY_RULE_SETUP 1.657 +#line 41 "expr.l" 1.658 +{ 1.659 + return TOKEN_NUMBER; 1.660 +} 1.661 + YY_BREAK 1.662 +case 4: 1.663 +YY_RULE_SETUP 1.664 +#line 45 "expr.l" 1.665 +{ 1.666 + return TOKEN_DOT; 1.667 +} 1.668 + YY_BREAK 1.669 +case 5: 1.670 +YY_RULE_SETUP 1.671 +#line 49 "expr.l" 1.672 +{ 1.673 + return TOKEN_ARROW; 1.674 +} 1.675 + YY_BREAK 1.676 +case 6: 1.677 +YY_RULE_SETUP 1.678 +#line 53 "expr.l" 1.679 +{ 1.680 + return TOKEN_ADDR; 1.681 +} 1.682 + YY_BREAK 1.683 +case 7: 1.684 +YY_RULE_SETUP 1.685 +#line 57 "expr.l" 1.686 +{ 1.687 + return TOKEN_STAR; 1.688 +} 1.689 + YY_BREAK 1.690 +case 8: 1.691 +YY_RULE_SETUP 1.692 +#line 61 "expr.l" 1.693 + 1.694 + YY_BREAK 1.695 +case 9: 1.696 +YY_RULE_SETUP 1.697 +#line 63 "expr.l" 1.698 +return *yytext; 1.699 + YY_BREAK 1.700 +case 10: 1.701 +YY_RULE_SETUP 1.702 +#line 65 "expr.l" 1.703 +ECHO; 1.704 + YY_BREAK 1.705 +#line 701 "expr-lex.cpp" 1.706 +case YY_STATE_EOF(INITIAL): 1.707 + yyterminate(); 1.708 + 1.709 + case YY_END_OF_BUFFER: 1.710 + { 1.711 + /* Amount of text matched not including the EOB char. */ 1.712 + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; 1.713 + 1.714 + /* Undo the effects of YY_DO_BEFORE_ACTION. */ 1.715 + *yy_cp = yy_hold_char; 1.716 + YY_RESTORE_YY_MORE_OFFSET 1.717 + 1.718 + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) 1.719 + { 1.720 + /* We're scanning a new file or input source. It's 1.721 + * possible that this happened because the user 1.722 + * just pointed yyin at a new source and called 1.723 + * yylex(). If so, then we have to assure 1.724 + * consistency between yy_current_buffer and our 1.725 + * globals. Here is the right place to do so, because 1.726 + * this is the first action (other than possibly a 1.727 + * back-up) that will match for the new input source. 1.728 + */ 1.729 + yy_n_chars = yy_current_buffer->yy_n_chars; 1.730 + yy_current_buffer->yy_input_file = yyin; 1.731 + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; 1.732 + } 1.733 + 1.734 + /* Note that here we test for yy_c_buf_p "<=" to the position 1.735 + * of the first EOB in the buffer, since yy_c_buf_p will 1.736 + * already have been incremented past the NUL character 1.737 + * (since all states make transitions on EOB to the 1.738 + * end-of-buffer state). Contrast this with the test 1.739 + * in input(). 1.740 + */ 1.741 + if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) 1.742 + { /* This was really a NUL. */ 1.743 + yy_state_type yy_next_state; 1.744 + 1.745 + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; 1.746 + 1.747 + yy_current_state = yy_get_previous_state(); 1.748 + 1.749 + /* Okay, we're now positioned to make the NUL 1.750 + * transition. We couldn't have 1.751 + * yy_get_previous_state() go ahead and do it 1.752 + * for us because it doesn't know how to deal 1.753 + * with the possibility of jamming (and we don't 1.754 + * want to build jamming into it because then it 1.755 + * will run more slowly). 1.756 + */ 1.757 + 1.758 + yy_next_state = yy_try_NUL_trans( yy_current_state ); 1.759 + 1.760 + yy_bp = yytext_ptr + YY_MORE_ADJ; 1.761 + 1.762 + if ( yy_next_state ) 1.763 + { 1.764 + /* Consume the NUL. */ 1.765 + yy_cp = ++yy_c_buf_p; 1.766 + yy_current_state = yy_next_state; 1.767 + goto yy_match; 1.768 + } 1.769 + 1.770 + else 1.771 + { 1.772 + yy_cp = yy_c_buf_p; 1.773 + goto yy_find_action; 1.774 + } 1.775 + } 1.776 + 1.777 + else switch ( yy_get_next_buffer() ) 1.778 + { 1.779 + case EOB_ACT_END_OF_FILE: 1.780 + { 1.781 + yy_did_buffer_switch_on_eof = 0; 1.782 + 1.783 + if ( yywrap() ) 1.784 + { 1.785 + /* Note: because we've taken care in 1.786 + * yy_get_next_buffer() to have set up 1.787 + * yytext, we can now set up 1.788 + * yy_c_buf_p so that if some total 1.789 + * hoser (like flex itself) wants to 1.790 + * call the scanner after we return the 1.791 + * YY_NULL, it'll still work - another 1.792 + * YY_NULL will get returned. 1.793 + */ 1.794 + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; 1.795 + 1.796 + yy_act = YY_STATE_EOF(YY_START); 1.797 + goto do_action; 1.798 + } 1.799 + 1.800 + else 1.801 + { 1.802 + if ( ! yy_did_buffer_switch_on_eof ) 1.803 + YY_NEW_FILE; 1.804 + } 1.805 + break; 1.806 + } 1.807 + 1.808 + case EOB_ACT_CONTINUE_SCAN: 1.809 + yy_c_buf_p = 1.810 + yytext_ptr + yy_amount_of_matched_text; 1.811 + 1.812 + yy_current_state = yy_get_previous_state(); 1.813 + 1.814 + yy_cp = yy_c_buf_p; 1.815 + yy_bp = yytext_ptr + YY_MORE_ADJ; 1.816 + goto yy_match; 1.817 + 1.818 + case EOB_ACT_LAST_MATCH: 1.819 + yy_c_buf_p = 1.820 + &yy_current_buffer->yy_ch_buf[yy_n_chars]; 1.821 + 1.822 + yy_current_state = yy_get_previous_state(); 1.823 + 1.824 + yy_cp = yy_c_buf_p; 1.825 + yy_bp = yytext_ptr + YY_MORE_ADJ; 1.826 + goto yy_find_action; 1.827 + } 1.828 + break; 1.829 + } 1.830 + 1.831 + default: 1.832 + YY_FATAL_ERROR( 1.833 + "fatal flex scanner internal error--no action found" ); 1.834 + } /* end of action switch */ 1.835 + } /* end of scanning one token */ 1.836 + } /* end of yylex */ 1.837 + 1.838 + 1.839 +/* yy_get_next_buffer - try to read in a new buffer 1.840 + * 1.841 + * Returns a code representing an action: 1.842 + * EOB_ACT_LAST_MATCH - 1.843 + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position 1.844 + * EOB_ACT_END_OF_FILE - end of file 1.845 + */ 1.846 + 1.847 +static int yy_get_next_buffer() 1.848 + { 1.849 + register char *dest = yy_current_buffer->yy_ch_buf; 1.850 + register char *source = yytext_ptr; 1.851 + register int number_to_move, i; 1.852 + int ret_val; 1.853 + 1.854 + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) 1.855 + YY_FATAL_ERROR( 1.856 + "fatal flex scanner internal error--end of buffer missed" ); 1.857 + 1.858 + if ( yy_current_buffer->yy_fill_buffer == 0 ) 1.859 + { /* Don't try to fill the buffer, so this is an EOF. */ 1.860 + if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) 1.861 + { 1.862 + /* We matched a single character, the EOB, so 1.863 + * treat this as a final EOF. 1.864 + */ 1.865 + return EOB_ACT_END_OF_FILE; 1.866 + } 1.867 + 1.868 + else 1.869 + { 1.870 + /* We matched some text prior to the EOB, first 1.871 + * process it. 1.872 + */ 1.873 + return EOB_ACT_LAST_MATCH; 1.874 + } 1.875 + } 1.876 + 1.877 + /* Try to read more data. */ 1.878 + 1.879 + /* First move last chars to start of buffer. */ 1.880 + number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; 1.881 + 1.882 + for ( i = 0; i < number_to_move; ++i ) 1.883 + *(dest++) = *(source++); 1.884 + 1.885 + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) 1.886 + /* don't do the read, it's not guaranteed to return an EOF, 1.887 + * just force an EOF 1.888 + */ 1.889 + yy_current_buffer->yy_n_chars = yy_n_chars = 0; 1.890 + 1.891 + else 1.892 + { 1.893 + int num_to_read = 1.894 + yy_current_buffer->yy_buf_size - number_to_move - 1; 1.895 + 1.896 + while ( num_to_read <= 0 ) 1.897 + { /* Not enough room in the buffer - grow it. */ 1.898 +#ifdef YY_USES_REJECT 1.899 + YY_FATAL_ERROR( 1.900 +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); 1.901 +#else 1.902 + 1.903 + /* just a shorter name for the current buffer */ 1.904 + YY_BUFFER_STATE b = yy_current_buffer; 1.905 + 1.906 + int yy_c_buf_p_offset = 1.907 + (int) (yy_c_buf_p - b->yy_ch_buf); 1.908 + 1.909 + if ( b->yy_is_our_buffer ) 1.910 + { 1.911 + int new_size = b->yy_buf_size * 2; 1.912 + 1.913 + if ( new_size <= 0 ) 1.914 + b->yy_buf_size += b->yy_buf_size / 8; 1.915 + else 1.916 + b->yy_buf_size *= 2; 1.917 + 1.918 + b->yy_ch_buf = (char *) 1.919 + /* Include room in for 2 EOB chars. */ 1.920 + yy_flex_realloc( (void *) b->yy_ch_buf, 1.921 + b->yy_buf_size + 2 ); 1.922 + } 1.923 + else 1.924 + /* Can't grow it, we don't own it. */ 1.925 + b->yy_ch_buf = 0; 1.926 + 1.927 + if ( ! b->yy_ch_buf ) 1.928 + YY_FATAL_ERROR( 1.929 + "fatal error - scanner input buffer overflow" ); 1.930 + 1.931 + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; 1.932 + 1.933 + num_to_read = yy_current_buffer->yy_buf_size - 1.934 + number_to_move - 1; 1.935 +#endif 1.936 + } 1.937 + 1.938 + if ( num_to_read > YY_READ_BUF_SIZE ) 1.939 + num_to_read = YY_READ_BUF_SIZE; 1.940 + 1.941 + /* Read in more data. */ 1.942 + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), 1.943 + yy_n_chars, num_to_read ); 1.944 + 1.945 + yy_current_buffer->yy_n_chars = yy_n_chars; 1.946 + } 1.947 + 1.948 + if ( yy_n_chars == 0 ) 1.949 + { 1.950 + if ( number_to_move == YY_MORE_ADJ ) 1.951 + { 1.952 + ret_val = EOB_ACT_END_OF_FILE; 1.953 + yyrestart( yyin ); 1.954 + } 1.955 + 1.956 + else 1.957 + { 1.958 + ret_val = EOB_ACT_LAST_MATCH; 1.959 + yy_current_buffer->yy_buffer_status = 1.960 + YY_BUFFER_EOF_PENDING; 1.961 + } 1.962 + } 1.963 + 1.964 + else 1.965 + ret_val = EOB_ACT_CONTINUE_SCAN; 1.966 + 1.967 + yy_n_chars += number_to_move; 1.968 + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; 1.969 + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; 1.970 + 1.971 + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; 1.972 + 1.973 + return ret_val; 1.974 + } 1.975 + 1.976 + 1.977 +/* yy_get_previous_state - get the state just before the EOB char was reached */ 1.978 + 1.979 +static yy_state_type yy_get_previous_state() 1.980 + { 1.981 + register yy_state_type yy_current_state; 1.982 + register char *yy_cp; 1.983 + 1.984 + yy_current_state = yy_start; 1.985 + 1.986 + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) 1.987 + { 1.988 + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 1.989 + if ( yy_accept[yy_current_state] ) 1.990 + { 1.991 + yy_last_accepting_state = yy_current_state; 1.992 + yy_last_accepting_cpos = yy_cp; 1.993 + } 1.994 + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1.995 + { 1.996 + yy_current_state = (int) yy_def[yy_current_state]; 1.997 + if ( yy_current_state >= 24 ) 1.998 + yy_c = yy_meta[(unsigned int) yy_c]; 1.999 + } 1.1000 + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1.1001 + } 1.1002 + 1.1003 + return yy_current_state; 1.1004 + } 1.1005 + 1.1006 + 1.1007 +/* yy_try_NUL_trans - try to make a transition on the NUL character 1.1008 + * 1.1009 + * synopsis 1.1010 + * next_state = yy_try_NUL_trans( current_state ); 1.1011 + */ 1.1012 + 1.1013 +#ifdef YY_USE_PROTOS 1.1014 +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) 1.1015 +#else 1.1016 +static yy_state_type yy_try_NUL_trans( yy_current_state ) 1.1017 +yy_state_type yy_current_state; 1.1018 +#endif 1.1019 + { 1.1020 + register int yy_is_jam; 1.1021 + register char *yy_cp = yy_c_buf_p; 1.1022 + 1.1023 + register YY_CHAR yy_c = 1; 1.1024 + if ( yy_accept[yy_current_state] ) 1.1025 + { 1.1026 + yy_last_accepting_state = yy_current_state; 1.1027 + yy_last_accepting_cpos = yy_cp; 1.1028 + } 1.1029 + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1.1030 + { 1.1031 + yy_current_state = (int) yy_def[yy_current_state]; 1.1032 + if ( yy_current_state >= 24 ) 1.1033 + yy_c = yy_meta[(unsigned int) yy_c]; 1.1034 + } 1.1035 + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1.1036 + yy_is_jam = (yy_current_state == 23); 1.1037 + 1.1038 + return yy_is_jam ? 0 : yy_current_state; 1.1039 + } 1.1040 + 1.1041 + 1.1042 +#ifndef YY_NO_UNPUT 1.1043 +#ifdef YY_USE_PROTOS 1.1044 +static void yyunput( int c, register char *yy_bp ) 1.1045 +#else 1.1046 +static void yyunput( c, yy_bp ) 1.1047 +int c; 1.1048 +register char *yy_bp; 1.1049 +#endif 1.1050 + { 1.1051 + register char *yy_cp = yy_c_buf_p; 1.1052 + 1.1053 + /* undo effects of setting up yytext */ 1.1054 + *yy_cp = yy_hold_char; 1.1055 + 1.1056 + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) 1.1057 + { /* need to shift things up to make room */ 1.1058 + /* +2 for EOB chars. */ 1.1059 + register int number_to_move = yy_n_chars + 2; 1.1060 + register char *dest = &yy_current_buffer->yy_ch_buf[ 1.1061 + yy_current_buffer->yy_buf_size + 2]; 1.1062 + register char *source = 1.1063 + &yy_current_buffer->yy_ch_buf[number_to_move]; 1.1064 + 1.1065 + while ( source > yy_current_buffer->yy_ch_buf ) 1.1066 + *--dest = *--source; 1.1067 + 1.1068 + yy_cp += (int) (dest - source); 1.1069 + yy_bp += (int) (dest - source); 1.1070 + yy_current_buffer->yy_n_chars = 1.1071 + yy_n_chars = yy_current_buffer->yy_buf_size; 1.1072 + 1.1073 + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) 1.1074 + YY_FATAL_ERROR( "flex scanner push-back overflow" ); 1.1075 + } 1.1076 + 1.1077 + *--yy_cp = (char) c; 1.1078 + 1.1079 + 1.1080 + yytext_ptr = yy_bp; 1.1081 + yy_hold_char = *yy_cp; 1.1082 + yy_c_buf_p = yy_cp; 1.1083 + } 1.1084 +#endif /* ifndef YY_NO_UNPUT */ 1.1085 + 1.1086 + 1.1087 +#ifdef __cplusplus 1.1088 +static int yyinput() 1.1089 +#else 1.1090 +static int input() 1.1091 +#endif 1.1092 + { 1.1093 + int c; 1.1094 + 1.1095 + *yy_c_buf_p = yy_hold_char; 1.1096 + 1.1097 + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) 1.1098 + { 1.1099 + /* yy_c_buf_p now points to the character we want to return. 1.1100 + * If this occurs *before* the EOB characters, then it's a 1.1101 + * valid NUL; if not, then we've hit the end of the buffer. 1.1102 + */ 1.1103 + if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) 1.1104 + /* This was really a NUL. */ 1.1105 + *yy_c_buf_p = '\0'; 1.1106 + 1.1107 + else 1.1108 + { /* need more input */ 1.1109 + int offset = yy_c_buf_p - yytext_ptr; 1.1110 + ++yy_c_buf_p; 1.1111 + 1.1112 + switch ( yy_get_next_buffer() ) 1.1113 + { 1.1114 + case EOB_ACT_LAST_MATCH: 1.1115 + /* This happens because yy_g_n_b() 1.1116 + * sees that we've accumulated a 1.1117 + * token and flags that we need to 1.1118 + * try matching the token before 1.1119 + * proceeding. But for input(), 1.1120 + * there's no matching to consider. 1.1121 + * So convert the EOB_ACT_LAST_MATCH 1.1122 + * to EOB_ACT_END_OF_FILE. 1.1123 + */ 1.1124 + 1.1125 + /* Reset buffer status. */ 1.1126 + yyrestart( yyin ); 1.1127 + 1.1128 + /* fall through */ 1.1129 + 1.1130 + case EOB_ACT_END_OF_FILE: 1.1131 + { 1.1132 + if ( yywrap() ) 1.1133 + return EOF; 1.1134 + 1.1135 + if ( ! yy_did_buffer_switch_on_eof ) 1.1136 + YY_NEW_FILE; 1.1137 +#ifdef __cplusplus 1.1138 + return yyinput(); 1.1139 +#else 1.1140 + return input(); 1.1141 +#endif 1.1142 + } 1.1143 + 1.1144 + case EOB_ACT_CONTINUE_SCAN: 1.1145 + yy_c_buf_p = yytext_ptr + offset; 1.1146 + break; 1.1147 + } 1.1148 + } 1.1149 + } 1.1150 + 1.1151 + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ 1.1152 + *yy_c_buf_p = '\0'; /* preserve yytext */ 1.1153 + yy_hold_char = *++yy_c_buf_p; 1.1154 + 1.1155 + 1.1156 + return c; 1.1157 + } 1.1158 + 1.1159 + 1.1160 +#ifdef YY_USE_PROTOS 1.1161 +void yyrestart( FILE *input_file ) 1.1162 +#else 1.1163 +void yyrestart( input_file ) 1.1164 +FILE *input_file; 1.1165 +#endif 1.1166 + { 1.1167 + if ( ! yy_current_buffer ) 1.1168 + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); 1.1169 + 1.1170 + yy_init_buffer( yy_current_buffer, input_file ); 1.1171 + yy_load_buffer_state(); 1.1172 + } 1.1173 + 1.1174 + 1.1175 +#ifdef YY_USE_PROTOS 1.1176 +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) 1.1177 +#else 1.1178 +void yy_switch_to_buffer( new_buffer ) 1.1179 +YY_BUFFER_STATE new_buffer; 1.1180 +#endif 1.1181 + { 1.1182 + if ( yy_current_buffer == new_buffer ) 1.1183 + return; 1.1184 + 1.1185 + if ( yy_current_buffer ) 1.1186 + { 1.1187 + /* Flush out information for old buffer. */ 1.1188 + *yy_c_buf_p = yy_hold_char; 1.1189 + yy_current_buffer->yy_buf_pos = yy_c_buf_p; 1.1190 + yy_current_buffer->yy_n_chars = yy_n_chars; 1.1191 + } 1.1192 + 1.1193 + yy_current_buffer = new_buffer; 1.1194 + yy_load_buffer_state(); 1.1195 + 1.1196 + /* We don't actually know whether we did this switch during 1.1197 + * EOF (yywrap()) processing, but the only time this flag 1.1198 + * is looked at is after yywrap() is called, so it's safe 1.1199 + * to go ahead and always set it. 1.1200 + */ 1.1201 + yy_did_buffer_switch_on_eof = 1; 1.1202 + } 1.1203 + 1.1204 + 1.1205 +#ifdef YY_USE_PROTOS 1.1206 +void yy_load_buffer_state( void ) 1.1207 +#else 1.1208 +void yy_load_buffer_state() 1.1209 +#endif 1.1210 + { 1.1211 + yy_n_chars = yy_current_buffer->yy_n_chars; 1.1212 + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; 1.1213 + yyin = yy_current_buffer->yy_input_file; 1.1214 + yy_hold_char = *yy_c_buf_p; 1.1215 + } 1.1216 + 1.1217 + 1.1218 +#ifdef YY_USE_PROTOS 1.1219 +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) 1.1220 +#else 1.1221 +YY_BUFFER_STATE yy_create_buffer( file, size ) 1.1222 +FILE *file; 1.1223 +int size; 1.1224 +#endif 1.1225 + { 1.1226 + YY_BUFFER_STATE b; 1.1227 + 1.1228 + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); 1.1229 + if ( ! b ) 1.1230 + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 1.1231 + 1.1232 + b->yy_buf_size = size; 1.1233 + 1.1234 + /* yy_ch_buf has to be 2 characters longer than the size given because 1.1235 + * we need to put in 2 end-of-buffer characters. 1.1236 + */ 1.1237 + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); 1.1238 + if ( ! b->yy_ch_buf ) 1.1239 + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 1.1240 + 1.1241 + b->yy_is_our_buffer = 1; 1.1242 + 1.1243 + yy_init_buffer( b, file ); 1.1244 + 1.1245 + return b; 1.1246 + } 1.1247 + 1.1248 + 1.1249 +#ifdef YY_USE_PROTOS 1.1250 +void yy_delete_buffer( YY_BUFFER_STATE b ) 1.1251 +#else 1.1252 +void yy_delete_buffer( b ) 1.1253 +YY_BUFFER_STATE b; 1.1254 +#endif 1.1255 + { 1.1256 + if ( ! b ) 1.1257 + return; 1.1258 + 1.1259 + if ( b == yy_current_buffer ) 1.1260 + yy_current_buffer = (YY_BUFFER_STATE) 0; 1.1261 + 1.1262 + if ( b->yy_is_our_buffer ) 1.1263 + yy_flex_free( (void *) b->yy_ch_buf ); 1.1264 + 1.1265 + yy_flex_free( (void *) b ); 1.1266 + } 1.1267 + 1.1268 + 1.1269 + 1.1270 +#ifdef YY_USE_PROTOS 1.1271 +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) 1.1272 +#else 1.1273 +void yy_init_buffer( b, file ) 1.1274 +YY_BUFFER_STATE b; 1.1275 +FILE *file; 1.1276 +#endif 1.1277 + 1.1278 + 1.1279 + { 1.1280 + yy_flush_buffer( b ); 1.1281 + 1.1282 + b->yy_input_file = file; 1.1283 + b->yy_fill_buffer = 1; 1.1284 + 1.1285 +#if YY_ALWAYS_INTERACTIVE 1.1286 + b->yy_is_interactive = 1; 1.1287 +#else 1.1288 +#if YY_NEVER_INTERACTIVE 1.1289 + b->yy_is_interactive = 0; 1.1290 +#else 1.1291 + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; 1.1292 +#endif 1.1293 +#endif 1.1294 + } 1.1295 + 1.1296 + 1.1297 +#ifdef YY_USE_PROTOS 1.1298 +void yy_flush_buffer( YY_BUFFER_STATE b ) 1.1299 +#else 1.1300 +void yy_flush_buffer( b ) 1.1301 +YY_BUFFER_STATE b; 1.1302 +#endif 1.1303 + 1.1304 + { 1.1305 + if ( ! b ) 1.1306 + return; 1.1307 + 1.1308 + b->yy_n_chars = 0; 1.1309 + 1.1310 + /* We always need two end-of-buffer characters. The first causes 1.1311 + * a transition to the end-of-buffer state. The second causes 1.1312 + * a jam in that state. 1.1313 + */ 1.1314 + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; 1.1315 + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; 1.1316 + 1.1317 + b->yy_buf_pos = &b->yy_ch_buf[0]; 1.1318 + 1.1319 + b->yy_at_bol = 1; 1.1320 + b->yy_buffer_status = YY_BUFFER_NEW; 1.1321 + 1.1322 + if ( b == yy_current_buffer ) 1.1323 + yy_load_buffer_state(); 1.1324 + } 1.1325 + 1.1326 + 1.1327 +#ifndef YY_NO_SCAN_BUFFER 1.1328 +#ifdef YY_USE_PROTOS 1.1329 +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) 1.1330 +#else 1.1331 +YY_BUFFER_STATE yy_scan_buffer( base, size ) 1.1332 +char *base; 1.1333 +yy_size_t size; 1.1334 +#endif 1.1335 + { 1.1336 + YY_BUFFER_STATE b; 1.1337 + 1.1338 + if ( size < 2 || 1.1339 + base[size-2] != YY_END_OF_BUFFER_CHAR || 1.1340 + base[size-1] != YY_END_OF_BUFFER_CHAR ) 1.1341 + /* They forgot to leave room for the EOB's. */ 1.1342 + return 0; 1.1343 + 1.1344 + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); 1.1345 + if ( ! b ) 1.1346 + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); 1.1347 + 1.1348 + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ 1.1349 + b->yy_buf_pos = b->yy_ch_buf = base; 1.1350 + b->yy_is_our_buffer = 0; 1.1351 + b->yy_input_file = 0; 1.1352 + b->yy_n_chars = b->yy_buf_size; 1.1353 + b->yy_is_interactive = 0; 1.1354 + b->yy_at_bol = 1; 1.1355 + b->yy_fill_buffer = 0; 1.1356 + b->yy_buffer_status = YY_BUFFER_NEW; 1.1357 + 1.1358 + yy_switch_to_buffer( b ); 1.1359 + 1.1360 + return b; 1.1361 + } 1.1362 +#endif 1.1363 + 1.1364 + 1.1365 +#ifndef YY_NO_SCAN_STRING 1.1366 +#ifdef YY_USE_PROTOS 1.1367 +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) 1.1368 +#else 1.1369 +YY_BUFFER_STATE yy_scan_string( yy_str ) 1.1370 +yyconst char *yy_str; 1.1371 +#endif 1.1372 + { 1.1373 + int len; 1.1374 + for ( len = 0; yy_str[len]; ++len ) 1.1375 + ; 1.1376 + 1.1377 + return yy_scan_bytes( yy_str, len ); 1.1378 + } 1.1379 +#endif 1.1380 + 1.1381 + 1.1382 +#ifndef YY_NO_SCAN_BYTES 1.1383 +#ifdef YY_USE_PROTOS 1.1384 +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) 1.1385 +#else 1.1386 +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) 1.1387 +yyconst char *bytes; 1.1388 +int len; 1.1389 +#endif 1.1390 + { 1.1391 + YY_BUFFER_STATE b; 1.1392 + char *buf; 1.1393 + yy_size_t n; 1.1394 + int i; 1.1395 + 1.1396 + /* Get memory for full buffer, including space for trailing EOB's. */ 1.1397 + n = len + 2; 1.1398 + buf = (char *) yy_flex_alloc( n ); 1.1399 + if ( ! buf ) 1.1400 + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); 1.1401 + 1.1402 + for ( i = 0; i < len; ++i ) 1.1403 + buf[i] = bytes[i]; 1.1404 + 1.1405 + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; 1.1406 + 1.1407 + b = yy_scan_buffer( buf, n ); 1.1408 + if ( ! b ) 1.1409 + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); 1.1410 + 1.1411 + /* It's okay to grow etc. this buffer, and we should throw it 1.1412 + * away when we're done. 1.1413 + */ 1.1414 + b->yy_is_our_buffer = 1; 1.1415 + 1.1416 + return b; 1.1417 + } 1.1418 +#endif 1.1419 + 1.1420 + 1.1421 +#ifndef YY_NO_PUSH_STATE 1.1422 +#ifdef YY_USE_PROTOS 1.1423 +static void yy_push_state( int new_state ) 1.1424 +#else 1.1425 +static void yy_push_state( new_state ) 1.1426 +int new_state; 1.1427 +#endif 1.1428 + { 1.1429 + if ( yy_start_stack_ptr >= yy_start_stack_depth ) 1.1430 + { 1.1431 + yy_size_t new_size; 1.1432 + 1.1433 + yy_start_stack_depth += YY_START_STACK_INCR; 1.1434 + new_size = yy_start_stack_depth * sizeof( int ); 1.1435 + 1.1436 + if ( ! yy_start_stack ) 1.1437 + yy_start_stack = (int *) yy_flex_alloc( new_size ); 1.1438 + 1.1439 + else 1.1440 + yy_start_stack = (int *) yy_flex_realloc( 1.1441 + (void *) yy_start_stack, new_size ); 1.1442 + 1.1443 + if ( ! yy_start_stack ) 1.1444 + YY_FATAL_ERROR( 1.1445 + "out of memory expanding start-condition stack" ); 1.1446 + } 1.1447 + 1.1448 + yy_start_stack[yy_start_stack_ptr++] = YY_START; 1.1449 + 1.1450 + BEGIN(new_state); 1.1451 + } 1.1452 +#endif 1.1453 + 1.1454 + 1.1455 +#ifndef YY_NO_POP_STATE 1.1456 +static void yy_pop_state() 1.1457 + { 1.1458 + if ( --yy_start_stack_ptr < 0 ) 1.1459 + YY_FATAL_ERROR( "start-condition stack underflow" ); 1.1460 + 1.1461 + BEGIN(yy_start_stack[yy_start_stack_ptr]); 1.1462 + } 1.1463 +#endif 1.1464 + 1.1465 + 1.1466 +#ifndef YY_NO_TOP_STATE 1.1467 +static int yy_top_state() 1.1468 + { 1.1469 + return yy_start_stack[yy_start_stack_ptr - 1]; 1.1470 + } 1.1471 +#endif 1.1472 + 1.1473 +#ifndef YY_EXIT_FAILURE 1.1474 +#define YY_EXIT_FAILURE 2 1.1475 +#endif 1.1476 + 1.1477 +#ifdef YY_USE_PROTOS 1.1478 +static void yy_fatal_error( yyconst char msg[] ) 1.1479 +#else 1.1480 +static void yy_fatal_error( msg ) 1.1481 +char msg[]; 1.1482 +#endif 1.1483 + { 1.1484 + (void) fprintf( stderr, "%s\n", msg ); 1.1485 + exit( YY_EXIT_FAILURE ); 1.1486 + } 1.1487 + 1.1488 + 1.1489 + 1.1490 +/* Redefine yyless() so it works in section 3 code. */ 1.1491 + 1.1492 +#undef yyless 1.1493 +#define yyless(n) \ 1.1494 + do \ 1.1495 + { \ 1.1496 + /* Undo effects of setting up yytext. */ \ 1.1497 + yytext[yyleng] = yy_hold_char; \ 1.1498 + yy_c_buf_p = yytext + n; \ 1.1499 + yy_hold_char = *yy_c_buf_p; \ 1.1500 + *yy_c_buf_p = '\0'; \ 1.1501 + yyleng = n; \ 1.1502 + } \ 1.1503 + while ( 0 ) 1.1504 + 1.1505 + 1.1506 +/* Internal utility routines. */ 1.1507 + 1.1508 +#ifndef yytext_ptr 1.1509 +#ifdef YY_USE_PROTOS 1.1510 +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) 1.1511 +#else 1.1512 +static void yy_flex_strncpy( s1, s2, n ) 1.1513 +char *s1; 1.1514 +yyconst char *s2; 1.1515 +int n; 1.1516 +#endif 1.1517 + { 1.1518 + register int i; 1.1519 + for ( i = 0; i < n; ++i ) 1.1520 + s1[i] = s2[i]; 1.1521 + } 1.1522 +#endif 1.1523 + 1.1524 +#ifdef YY_NEED_STRLEN 1.1525 +#ifdef YY_USE_PROTOS 1.1526 +static int yy_flex_strlen( yyconst char *s ) 1.1527 +#else 1.1528 +static int yy_flex_strlen( s ) 1.1529 +yyconst char *s; 1.1530 +#endif 1.1531 + { 1.1532 + register int n; 1.1533 + for ( n = 0; s[n]; ++n ) 1.1534 + ; 1.1535 + 1.1536 + return n; 1.1537 + } 1.1538 +#endif 1.1539 + 1.1540 + 1.1541 +#ifdef YY_USE_PROTOS 1.1542 +static void *yy_flex_alloc( yy_size_t size ) 1.1543 +#else 1.1544 +static void *yy_flex_alloc( size ) 1.1545 +yy_size_t size; 1.1546 +#endif 1.1547 + { 1.1548 + return (void *) malloc( size ); 1.1549 + } 1.1550 + 1.1551 +#ifdef YY_USE_PROTOS 1.1552 +static void *yy_flex_realloc( void *ptr, yy_size_t size ) 1.1553 +#else 1.1554 +static void *yy_flex_realloc( ptr, size ) 1.1555 +void *ptr; 1.1556 +yy_size_t size; 1.1557 +#endif 1.1558 + { 1.1559 + /* The cast to (char *) in the following accommodates both 1.1560 + * implementations that use char* generic pointers, and those 1.1561 + * that use void* generic pointers. It works with the latter 1.1562 + * because both ANSI C and C++ allow castless assignment from 1.1563 + * any pointer type to void*, and deal with argument conversions 1.1564 + * as though doing an assignment. 1.1565 + */ 1.1566 + return (void *) realloc( (char *) ptr, size ); 1.1567 + } 1.1568 + 1.1569 +#ifdef YY_USE_PROTOS 1.1570 +static void yy_flex_free( void *ptr ) 1.1571 +#else 1.1572 +static void yy_flex_free( ptr ) 1.1573 +void *ptr; 1.1574 +#endif 1.1575 + { 1.1576 + free( ptr ); 1.1577 + } 1.1578 + 1.1579 +#if YY_MAIN 1.1580 +int main() 1.1581 + { 1.1582 + yylex(); 1.1583 + return 0; 1.1584 + } 1.1585 +#endif 1.1586 +#line 65 "expr.l" 1.1587 + 1.1588 + 1.1589 +void exprCleanBuffer() 1.1590 +{ 1.1591 + yy_delete_buffer(yy_current_buffer); 1.1592 + yy_init = 1; 1.1593 +}