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