2 #define YY_INT_ALIGNED short int
4 /* A lexical scanner generated by flex */
6 #define yy_create_buffer ExprIntrp_create_buffer
7 #define yy_delete_buffer ExprIntrp_delete_buffer
8 #define yy_scan_buffer ExprIntrp_scan_buffer
9 #define yy_scan_string ExprIntrp_scan_string
10 #define yy_scan_bytes ExprIntrp_scan_bytes
11 #define yy_init_buffer ExprIntrp_init_buffer
12 #define yy_flush_buffer ExprIntrp_flush_buffer
13 #define yy_load_buffer_state ExprIntrp_load_buffer_state
14 #define yy_switch_to_buffer ExprIntrp_switch_to_buffer
15 #define yypush_buffer_state ExprIntrppush_buffer_state
16 #define yypop_buffer_state ExprIntrppop_buffer_state
17 #define yyensure_buffer_stack ExprIntrpensure_buffer_stack
18 #define yy_flex_debug ExprIntrp_flex_debug
19 #define yyin ExprIntrpin
20 #define yyleng ExprIntrpleng
21 #define yylex ExprIntrplex
22 #define yylineno ExprIntrplineno
23 #define yyout ExprIntrpout
24 #define yyrestart ExprIntrprestart
25 #define yytext ExprIntrptext
26 #define yywrap ExprIntrpwrap
27 #define yyalloc ExprIntrpalloc
28 #define yyrealloc ExprIntrprealloc
29 #define yyfree ExprIntrpfree
32 #define YY_FLEX_MAJOR_VERSION 2
33 #define YY_FLEX_MINOR_VERSION 6
34 #define YY_FLEX_SUBMINOR_VERSION 4
35 #if YY_FLEX_SUBMINOR_VERSION > 0
39 #ifdef yy_create_buffer
40 #define ExprIntrp_create_buffer_ALREADY_DEFINED
42 #define yy_create_buffer ExprIntrp_create_buffer
45 #ifdef yy_delete_buffer
46 #define ExprIntrp_delete_buffer_ALREADY_DEFINED
48 #define yy_delete_buffer ExprIntrp_delete_buffer
52 #define ExprIntrp_scan_buffer_ALREADY_DEFINED
54 #define yy_scan_buffer ExprIntrp_scan_buffer
58 #define ExprIntrp_scan_string_ALREADY_DEFINED
60 #define yy_scan_string ExprIntrp_scan_string
64 #define ExprIntrp_scan_bytes_ALREADY_DEFINED
66 #define yy_scan_bytes ExprIntrp_scan_bytes
70 #define ExprIntrp_init_buffer_ALREADY_DEFINED
72 #define yy_init_buffer ExprIntrp_init_buffer
75 #ifdef yy_flush_buffer
76 #define ExprIntrp_flush_buffer_ALREADY_DEFINED
78 #define yy_flush_buffer ExprIntrp_flush_buffer
81 #ifdef yy_load_buffer_state
82 #define ExprIntrp_load_buffer_state_ALREADY_DEFINED
84 #define yy_load_buffer_state ExprIntrp_load_buffer_state
87 #ifdef yy_switch_to_buffer
88 #define ExprIntrp_switch_to_buffer_ALREADY_DEFINED
90 #define yy_switch_to_buffer ExprIntrp_switch_to_buffer
93 #ifdef yypush_buffer_state
94 #define ExprIntrppush_buffer_state_ALREADY_DEFINED
96 #define yypush_buffer_state ExprIntrppush_buffer_state
99 #ifdef yypop_buffer_state
100 #define ExprIntrppop_buffer_state_ALREADY_DEFINED
102 #define yypop_buffer_state ExprIntrppop_buffer_state
105 #ifdef yyensure_buffer_stack
106 #define ExprIntrpensure_buffer_stack_ALREADY_DEFINED
108 #define yyensure_buffer_stack ExprIntrpensure_buffer_stack
112 #define ExprIntrplex_ALREADY_DEFINED
114 #define yylex ExprIntrplex
118 #define ExprIntrprestart_ALREADY_DEFINED
120 #define yyrestart ExprIntrprestart
124 #define ExprIntrplex_init_ALREADY_DEFINED
126 #define yylex_init ExprIntrplex_init
129 #ifdef yylex_init_extra
130 #define ExprIntrplex_init_extra_ALREADY_DEFINED
132 #define yylex_init_extra ExprIntrplex_init_extra
136 #define ExprIntrplex_destroy_ALREADY_DEFINED
138 #define yylex_destroy ExprIntrplex_destroy
142 #define ExprIntrpget_debug_ALREADY_DEFINED
144 #define yyget_debug ExprIntrpget_debug
148 #define ExprIntrpset_debug_ALREADY_DEFINED
150 #define yyset_debug ExprIntrpset_debug
154 #define ExprIntrpget_extra_ALREADY_DEFINED
156 #define yyget_extra ExprIntrpget_extra
160 #define ExprIntrpset_extra_ALREADY_DEFINED
162 #define yyset_extra ExprIntrpset_extra
166 #define ExprIntrpget_in_ALREADY_DEFINED
168 #define yyget_in ExprIntrpget_in
172 #define ExprIntrpset_in_ALREADY_DEFINED
174 #define yyset_in ExprIntrpset_in
178 #define ExprIntrpget_out_ALREADY_DEFINED
180 #define yyget_out ExprIntrpget_out
184 #define ExprIntrpset_out_ALREADY_DEFINED
186 #define yyset_out ExprIntrpset_out
190 #define ExprIntrpget_leng_ALREADY_DEFINED
192 #define yyget_leng ExprIntrpget_leng
196 #define ExprIntrpget_text_ALREADY_DEFINED
198 #define yyget_text ExprIntrpget_text
202 #define ExprIntrpget_lineno_ALREADY_DEFINED
204 #define yyget_lineno ExprIntrpget_lineno
208 #define ExprIntrpset_lineno_ALREADY_DEFINED
210 #define yyset_lineno ExprIntrpset_lineno
214 #define ExprIntrpwrap_ALREADY_DEFINED
216 #define yywrap ExprIntrpwrap
220 #define ExprIntrpalloc_ALREADY_DEFINED
222 #define yyalloc ExprIntrpalloc
226 #define ExprIntrprealloc_ALREADY_DEFINED
228 #define yyrealloc ExprIntrprealloc
232 #define ExprIntrpfree_ALREADY_DEFINED
234 #define yyfree ExprIntrpfree
238 #define ExprIntrptext_ALREADY_DEFINED
240 #define yytext ExprIntrptext
244 #define ExprIntrpleng_ALREADY_DEFINED
246 #define yyleng ExprIntrpleng
250 #define ExprIntrpin_ALREADY_DEFINED
252 #define yyin ExprIntrpin
256 #define ExprIntrpout_ALREADY_DEFINED
258 #define yyout ExprIntrpout
262 #define ExprIntrp_flex_debug_ALREADY_DEFINED
264 #define yy_flex_debug ExprIntrp_flex_debug
268 #define ExprIntrplineno_ALREADY_DEFINED
270 #define yylineno ExprIntrplineno
273 /* First, we deal with platform-specific or compiler-specific issues. */
275 /* begin standard C headers. */
281 /* end standard C headers. */
283 /* flex integer type definitions */
288 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
290 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
292 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
293 * if you want the limit (max/min) macros for int types.
295 #ifndef __STDC_LIMIT_MACROS
296 #define __STDC_LIMIT_MACROS 1
299 #include <inttypes.h>
300 typedef int8_t flex_int8_t;
301 typedef uint8_t flex_uint8_t;
302 typedef int16_t flex_int16_t;
303 typedef uint16_t flex_uint16_t;
304 typedef int32_t flex_int32_t;
305 typedef uint32_t flex_uint32_t;
307 typedef signed char flex_int8_t;
308 typedef short int flex_int16_t;
309 typedef int flex_int32_t;
310 typedef unsigned char flex_uint8_t;
311 typedef unsigned short int flex_uint16_t;
312 typedef unsigned int flex_uint32_t;
314 /* Limits of integral types. */
316 #define INT8_MIN (-128)
319 #define INT16_MIN (-32767-1)
322 #define INT32_MIN (-2147483647-1)
325 #define INT8_MAX (127)
328 #define INT16_MAX (32767)
331 #define INT32_MAX (2147483647)
334 #define UINT8_MAX (255U)
337 #define UINT16_MAX (65535U)
340 #define UINT32_MAX (4294967295U)
344 #define SIZE_MAX (~(size_t)0)
349 #endif /* ! FLEXINT_H */
351 /* begin standard C++ headers. */
353 /* TODO: this is always defined, so inline it */
354 #define yyconst const
356 #if defined(__GNUC__) && __GNUC__ >= 3
357 #define yynoreturn __attribute__((__noreturn__))
362 /* Returned upon end-of-file. */
365 /* Promotes a possibly negative, possibly signed char to an
366 * integer in range [0..255] for use as an array index.
368 #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
370 /* Enter a start condition. This macro really ought to take a parameter,
371 * but we do it the disgusting crufty way forced on us by the ()-less
372 * definition of BEGIN.
374 #define BEGIN (yy_start) = 1 + 2 *
375 /* Translate the current start state into a value that can be later handed
376 * to BEGIN to return to the state. The YYSTATE alias is for lex
379 #define YY_START (((yy_start) - 1) / 2)
380 #define YYSTATE YY_START
381 /* Action number for EOF rule of a given start state. */
382 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
383 /* Special action meaning "start processing a new file". */
384 #define YY_NEW_FILE yyrestart( yyin )
385 #define YY_END_OF_BUFFER_CHAR 0
387 /* Size of default input buffer. */
390 /* On IA-64, the buffer size is 16k, not 8k.
391 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
392 * Ditto for the __ia64__ case accordingly.
394 #define YY_BUF_SIZE 32768
396 #define YY_BUF_SIZE 16384
397 #endif /* __ia64__ */
400 /* The state buf must be large enough to hold one state per character in the main buffer.
402 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
404 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
405 #define YY_TYPEDEF_YY_BUFFER_STATE
406 typedef struct yy_buffer_state *YY_BUFFER_STATE;
409 #ifndef YY_TYPEDEF_YY_SIZE_T
410 #define YY_TYPEDEF_YY_SIZE_T
411 typedef size_t yy_size_t;
416 extern FILE *yyin, *yyout;
418 #define EOB_ACT_CONTINUE_SCAN 0
419 #define EOB_ACT_END_OF_FILE 1
420 #define EOB_ACT_LAST_MATCH 2
422 #define YY_LESS_LINENO(n)
423 #define YY_LINENO_REWIND_TO(ptr)
425 /* Return all but the first "n" matched characters back to the input stream. */
429 /* Undo effects of setting up yytext. */ \
430 int yyless_macro_arg = (n); \
431 YY_LESS_LINENO(yyless_macro_arg);\
432 *yy_cp = (yy_hold_char); \
433 YY_RESTORE_YY_MORE_OFFSET \
434 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
435 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
438 #define unput(c) yyunput( c, (yytext_ptr) )
440 #ifndef YY_STRUCT_YY_BUFFER_STATE
441 #define YY_STRUCT_YY_BUFFER_STATE
442 struct yy_buffer_state
446 char *yy_ch_buf; /* input buffer */
447 char *yy_buf_pos; /* current position in input buffer */
449 /* Size of input buffer in bytes, not including room for EOB
454 /* Number of characters read into yy_ch_buf, not including EOB
459 /* Whether we "own" the buffer - i.e., we know we created it,
460 * and can realloc() it to grow it, and should free() it to
463 int yy_is_our_buffer;
465 /* Whether this is an "interactive" input source; if so, and
466 * if we're using stdio for input, then we want to use getc()
467 * instead of fread(), to make sure we stop fetching input after
470 int yy_is_interactive;
472 /* Whether we're considered to be at the beginning of a line.
473 * If so, '^' rules will be active on the next match, otherwise
478 int yy_bs_lineno; /**< The line count. */
479 int yy_bs_column; /**< The column count. */
481 /* Whether to try to fill the input buffer when we reach the
486 int yy_buffer_status;
488 #define YY_BUFFER_NEW 0
489 #define YY_BUFFER_NORMAL 1
490 /* When an EOF's been seen but there's still some text to process
491 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
492 * shouldn't try reading from the input source any more. We might
493 * still have a bunch of tokens to match, though, because of
494 * possible backing-up.
496 * When we actually see the EOF, we change the status to "new"
497 * (via yyrestart()), so that the user can continue scanning by
498 * just pointing yyin at a new input file.
500 #define YY_BUFFER_EOF_PENDING 2
503 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
505 /* Stack of input buffers. */
506 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
507 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
508 static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
510 /* We provide macros for accessing buffer states in case in the
511 * future we want to put the buffer states in a more general
514 * Returns the top of the stack, or NULL.
516 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
517 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
519 /* Same as previous macro, but useful when we know that the buffer stack is not
520 * NULL or when we need an lvalue. For internal use only.
522 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
524 /* yy_hold_char holds the character lost when yytext is formed. */
525 static char yy_hold_char;
526 static int yy_n_chars; /* number of characters read into yy_ch_buf */
529 /* Points to current character in buffer. */
530 static char *yy_c_buf_p = NULL;
531 static int yy_init = 0; /* whether we need to initialize */
532 static int yy_start = 0; /* start state number */
534 /* Flag which is used to allow yywrap()'s to do buffer switches
535 * instead of setting up a fresh yyin. A bit of a hack ...
537 static int yy_did_buffer_switch_on_eof;
539 void yyrestart ( FILE *input_file );
540 void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
541 YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
542 void yy_delete_buffer ( YY_BUFFER_STATE b );
543 void yy_flush_buffer ( YY_BUFFER_STATE b );
544 void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
545 void yypop_buffer_state ( void );
547 static void yyensure_buffer_stack ( void );
548 static void yy_load_buffer_state ( void );
549 static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
550 #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
552 YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
553 YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
554 YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
556 void *yyalloc ( yy_size_t );
557 void *yyrealloc ( void *, yy_size_t );
558 void yyfree ( void * );
560 #define yy_new_buffer yy_create_buffer
561 #define yy_set_interactive(is_interactive) \
563 if ( ! YY_CURRENT_BUFFER ){ \
564 yyensure_buffer_stack (); \
565 YY_CURRENT_BUFFER_LVALUE = \
566 yy_create_buffer( yyin, YY_BUF_SIZE ); \
568 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
570 #define yy_set_bol(at_bol) \
572 if ( ! YY_CURRENT_BUFFER ){\
573 yyensure_buffer_stack (); \
574 YY_CURRENT_BUFFER_LVALUE = \
575 yy_create_buffer( yyin, YY_BUF_SIZE ); \
577 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
579 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
581 typedef flex_uint8_t YY_CHAR;
583 FILE *yyin = NULL, *yyout = NULL;
585 typedef int yy_state_type;
594 #define yytext_ptr yytext
596 static yy_state_type yy_get_previous_state ( void );
597 static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
598 static int yy_get_next_buffer ( void );
599 static void yynoreturn yy_fatal_error ( const char* msg );
601 /* Done after the current pattern has been matched and before the
602 * corresponding action - sets up yytext.
604 #define YY_DO_BEFORE_ACTION \
605 (yytext_ptr) = yy_bp; \
606 yyleng = (int) (yy_cp - yy_bp); \
607 (yy_hold_char) = *yy_cp; \
609 (yy_c_buf_p) = yy_cp;
610 #define YY_NUM_RULES 26
611 #define YY_END_OF_BUFFER 27
612 /* This struct is not used in this scanner,
613 but its presence is necessary. */
616 flex_int32_t yy_verify;
619 static const flex_int16_t yy_accept[55] =
621 0, 0, 27, 26, 1, 25, 8, 10, 7, 2,
622 12, 3, 22, 4, 24, 26, 15, 13, 23, 23,
623 23, 23, 23, 9, 11, 5, 25, 6, 22, 0,
624 14, 23, 23, 23, 23, 23, 0, 21, 23, 23,
625 23, 23, 19, 23, 23, 23, 20, 18, 23, 17,
629 static const YY_CHAR yy_ec[256] =
631 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
632 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
633 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
634 1, 2, 1, 1, 1, 1, 1, 1, 3, 4,
635 5, 6, 7, 8, 9, 10, 11, 12, 12, 12,
636 12, 12, 12, 12, 12, 12, 12, 1, 13, 14,
637 15, 1, 1, 16, 17, 17, 18, 19, 17, 17,
638 17, 17, 17, 17, 17, 17, 17, 17, 17, 20,
639 17, 17, 21, 17, 17, 17, 17, 17, 17, 17,
640 22, 1, 23, 24, 25, 1, 26, 17, 17, 27,
642 28, 17, 29, 17, 30, 17, 17, 17, 31, 32,
643 33, 17, 17, 34, 35, 36, 37, 38, 17, 17,
644 17, 17, 1, 39, 1, 1, 1, 1, 1, 1,
645 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
646 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
647 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
648 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
649 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
650 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
651 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
653 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
654 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
655 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
656 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
657 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
661 static const YY_CHAR yy_meta[40] =
663 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
664 1, 2, 1, 1, 1, 1, 2, 2, 2, 2,
665 2, 1, 1, 1, 2, 2, 2, 2, 2, 2,
666 2, 2, 2, 2, 2, 2, 2, 2, 1
669 static const flex_int16_t yy_base[56] =
671 0, 0, 75, 77, 77, 71, 77, 77, 67, 77,
672 77, 77, 30, 77, 77, 63, 77, 77, 0, 38,
673 42, 35, 31, 77, 77, 77, 64, 77, 31, 37,
674 77, 0, 34, 19, 32, 33, 51, 50, 26, 25,
675 27, 29, 0, 19, 19, 14, 0, 0, 21, 0,
679 static const flex_int16_t yy_def[56] =
681 54, 1, 54, 54, 54, 54, 54, 54, 54, 54,
682 54, 54, 54, 54, 54, 54, 54, 54, 55, 55,
683 55, 55, 55, 54, 54, 54, 54, 54, 54, 54,
684 54, 55, 55, 55, 55, 55, 54, 54, 55, 55,
685 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
689 static const flex_int16_t yy_nxt[117] =
691 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
692 14, 13, 15, 16, 17, 18, 19, 20, 21, 22,
693 23, 24, 25, 26, 4, 19, 19, 19, 19, 19,
694 19, 19, 19, 19, 19, 19, 19, 19, 4, 29,
695 29, 29, 29, 37, 40, 37, 32, 53, 38, 52,
696 51, 50, 41, 49, 48, 47, 46, 30, 30, 45,
697 44, 38, 38, 43, 42, 39, 27, 36, 35, 34,
698 33, 31, 28, 27, 54, 37, 3, 54, 54, 54,
699 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
700 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
702 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
703 54, 54, 54, 54, 54, 54
706 static const flex_int16_t yy_chk[117] =
708 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
709 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
710 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
711 1, 1, 1, 1, 1, 1, 1, 1, 1, 13,
712 29, 13, 29, 30, 34, 30, 55, 52, 30, 51,
713 49, 46, 34, 45, 44, 42, 41, 13, 29, 40,
714 39, 38, 37, 36, 35, 33, 27, 23, 22, 21,
715 20, 16, 9, 6, 3, 30, 54, 54, 54, 54,
716 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
717 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
719 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
720 54, 54, 54, 54, 54, 54
723 static yy_state_type yy_last_accepting_state;
724 static char *yy_last_accepting_cpos;
726 extern int yy_flex_debug;
727 int yy_flex_debug = 0;
729 /* The intent behind this definition is that it'll catch
730 * any uses of REJECT which flex missed.
732 #define REJECT reject_used_but_not_detected
733 #define yymore() yymore_used_but_not_detected
734 #define YY_MORE_ADJ 0
735 #define YY_RESTORE_YY_MORE_OFFSET
739 Copyright (c) 1997-1999 Matra Datavision
740 Copyright (c) 1999-2014 OPEN CASCADE SAS
742 This file is part of Open CASCADE Technology software library.
744 This library is free software; you can redistribute it and/or modify it under
745 the terms of the GNU Lesser General Public License version 2.1 as published
746 by the Free Software Foundation, with special exception defined in the file
747 OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
748 distribution for complete text of the license and disclaimer of any warranty.
750 Alternatively, this file may be used under the terms of Open CASCADE
751 commercial license or contractual agreement.
753 #include <ExprIntrp.tab.h>
755 #include <ExprIntrp_yaccintrf.hxx>
757 #define YY_SKIP_YYWRAP
759 static YY_BUFFER_STATE ExprIntrp_bufstring;
761 void ExprIntrp_start_string(const char* str)
763 // depending on configuration and generator, yyconst may be defined as const or empty
764 ExprIntrp_bufstring = ExprIntrp_scan_string((yyconst char*)str);
767 void ExprIntrp_stop_string()
769 ExprIntrp_delete_buffer(ExprIntrp_bufstring);
770 ExprIntrp_bufstring = (YY_BUFFER_STATE) 0;
778 // provide safe error handler (exception instead of exit())
779 #define YY_FATAL_ERROR(msg) ExprIntrperror(msg)
784 // add includes for flex 2.91 (Linux version)
788 // Avoid includion of unistd.h if parser is generated on Linux (flex 2.5.35)
789 #define YY_NO_UNISTD_H
791 // disable MSVC warnings in flex 2.89 and 2.5.35 code
792 // Note that Intel compiler also defines _MSC_VER but has different warning ids
793 #if defined(__INTEL_COMPILER)
794 #pragma warning(disable:177 1786 1736)
795 #elif defined(__clang__)
796 #pragma GCC diagnostic ignored "-Wunused-function"
797 #pragma GCC diagnostic ignored "-Winconsistent-dllimport"
798 #pragma GCC diagnostic ignored "-Wunneeded-internal-declaration"
800 #pragma warning(disable:4131 4244 4273 4127 4267)
806 // add includes for flex 2.91 (Linux version)
809 // disable GCC warnings in flex 2.91 code
810 #pragma GCC diagnostic ignored "-Wunused-function"
815 #ifndef YY_NO_UNISTD_H
816 /* Special case for "unistd.h", since it is non-ANSI. We include it way
817 * down here because we want the user's section 1 to have been scanned first.
818 * The user has a chance to override it with an option.
823 #ifndef YY_EXTRA_TYPE
824 #define YY_EXTRA_TYPE void *
827 static int yy_init_globals ( void );
829 /* Accessor methods to globals.
830 These are made visible to non-reentrant scanners for convenience. */
832 int yylex_destroy ( void );
834 int yyget_debug ( void );
836 void yyset_debug ( int debug_flag );
838 YY_EXTRA_TYPE yyget_extra ( void );
840 void yyset_extra ( YY_EXTRA_TYPE user_defined );
842 FILE *yyget_in ( void );
844 void yyset_in ( FILE * _in_str );
846 FILE *yyget_out ( void );
848 void yyset_out ( FILE * _out_str );
850 int yyget_leng ( void );
852 char *yyget_text ( void );
854 int yyget_lineno ( void );
856 void yyset_lineno ( int _line_number );
858 /* Macros after this point can all be overridden by user definitions in
862 #ifndef YY_SKIP_YYWRAP
864 extern "C" int yywrap ( void );
866 extern int yywrap ( void );
872 static void yyunput ( int c, char *buf_ptr );
877 static void yy_flex_strncpy ( char *, const char *, int );
880 #ifdef YY_NEED_STRLEN
881 static int yy_flex_strlen ( const char * );
886 static int yyinput ( void );
888 static int input ( void );
893 /* Amount of stuff to slurp up with each read. */
894 #ifndef YY_READ_BUF_SIZE
896 /* On IA-64, the buffer size is 16k, not 8k */
897 #define YY_READ_BUF_SIZE 16384
899 #define YY_READ_BUF_SIZE 8192
900 #endif /* __ia64__ */
903 /* Copy whatever the last rule matched to the standard output. */
905 /* This used to be an fputs(), but since the string might contain NUL's,
906 * we now use fwrite().
908 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
911 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
912 * is returned in "result".
915 #define YY_INPUT(buf,result,max_size) \
916 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
920 for ( n = 0; n < max_size && \
921 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
924 buf[n++] = (char) c; \
925 if ( c == EOF && ferror( yyin ) ) \
926 YY_FATAL_ERROR( "input in flex scanner failed" ); \
932 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
934 if( errno != EINTR) \
936 YY_FATAL_ERROR( "input in flex scanner failed" ); \
947 /* No semi-colon after return; correct usage is to write "yyterminate();" -
948 * we don't want an extra ';' after the "return" because that will cause
949 * some compilers to complain about unreachable statements.
952 #define yyterminate() return YY_NULL
955 /* Number of entries by which start-condition stack grows. */
956 #ifndef YY_START_STACK_INCR
957 #define YY_START_STACK_INCR 25
960 /* Report a fatal error. */
961 #ifndef YY_FATAL_ERROR
962 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
965 /* end tables serialization structures and prototypes */
967 /* Default declaration of generated scanner - a define so the user can
968 * easily add parameters.
971 #define YY_DECL_IS_OURS 1
973 extern int yylex (void);
975 #define YY_DECL int yylex (void)
976 #endif /* !YY_DECL */
978 /* Code executed at the beginning of each rule, after yytext and yyleng
981 #ifndef YY_USER_ACTION
982 #define YY_USER_ACTION
985 /* Code executed at the end of each rule. */
987 #define YY_BREAK /*LINTED*/break;
990 #define YY_RULE_SETUP \
993 /** The main scanner function which does all the work.
997 yy_state_type yy_current_state;
1010 (yy_start) = 1; /* first start state */
1018 if ( ! YY_CURRENT_BUFFER ) {
1019 yyensure_buffer_stack ();
1020 YY_CURRENT_BUFFER_LVALUE =
1021 yy_create_buffer( yyin, YY_BUF_SIZE );
1024 yy_load_buffer_state( );
1029 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
1031 yy_cp = (yy_c_buf_p);
1033 /* Support of yytext. */
1034 *yy_cp = (yy_hold_char);
1036 /* yy_bp points to the position in yy_ch_buf of the start of
1041 yy_current_state = (yy_start);
1045 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1046 if ( yy_accept[yy_current_state] )
1048 (yy_last_accepting_state) = yy_current_state;
1049 (yy_last_accepting_cpos) = yy_cp;
1051 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1053 yy_current_state = (int) yy_def[yy_current_state];
1054 if ( yy_current_state >= 55 )
1055 yy_c = yy_meta[yy_c];
1057 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1060 while ( yy_base[yy_current_state] != 77 );
1063 yy_act = yy_accept[yy_current_state];
1065 { /* have to back up */
1066 yy_cp = (yy_last_accepting_cpos);
1067 yy_current_state = (yy_last_accepting_state);
1068 yy_act = yy_accept[yy_current_state];
1071 YY_DO_BEFORE_ACTION;
1073 do_action: /* This label is used only to access EOF actions. */
1076 { /* beginning of action switch */
1077 case 0: /* must back up */
1078 /* undo the effects of YY_DO_BEFORE_ACTION */
1079 *yy_cp = (yy_hold_char);
1080 yy_cp = (yy_last_accepting_cpos);
1081 yy_current_state = (yy_last_accepting_state);
1082 goto yy_find_action;
1098 {return(DIVIDEOP) ;}
1114 {return(PARENTHESIS);}
1122 {return(ENDPARENTHESIS);}
1126 {return(ENDBRACKET);}
1134 {return(DIFFERENTIAL);}
1146 {return(DEASSIGNKEY);}
1166 {ExprIntrp_SetResult(); return(VALUE);}
1170 {ExprIntrp_SetResult(); return(VALUE);}
1174 {ExprIntrp_SetResult(); return(IDENTIFIER);}
1178 {return(RELSEPARATOR);}
1182 {ExprIntrp_SetDegree();return(DERIVATE);}
1188 case YY_STATE_EOF(INITIAL):
1191 case YY_END_OF_BUFFER:
1193 /* Amount of text matched not including the EOB char. */
1194 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1196 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1197 *yy_cp = (yy_hold_char);
1198 YY_RESTORE_YY_MORE_OFFSET
1200 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1202 /* We're scanning a new file or input source. It's
1203 * possible that this happened because the user
1204 * just pointed yyin at a new source and called
1205 * yylex(). If so, then we have to assure
1206 * consistency between YY_CURRENT_BUFFER and our
1207 * globals. Here is the right place to do so, because
1208 * this is the first action (other than possibly a
1209 * back-up) that will match for the new input source.
1211 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1212 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1213 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1216 /* Note that here we test for yy_c_buf_p "<=" to the position
1217 * of the first EOB in the buffer, since yy_c_buf_p will
1218 * already have been incremented past the NUL character
1219 * (since all states make transitions on EOB to the
1220 * end-of-buffer state). Contrast this with the test
1223 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1224 { /* This was really a NUL. */
1225 yy_state_type yy_next_state;
1227 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1229 yy_current_state = yy_get_previous_state( );
1231 /* Okay, we're now positioned to make the NUL
1232 * transition. We couldn't have
1233 * yy_get_previous_state() go ahead and do it
1234 * for us because it doesn't know how to deal
1235 * with the possibility of jamming (and we don't
1236 * want to build jamming into it because then it
1237 * will run more slowly).
1240 yy_next_state = yy_try_NUL_trans( yy_current_state );
1242 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1244 if ( yy_next_state )
1246 /* Consume the NUL. */
1247 yy_cp = ++(yy_c_buf_p);
1248 yy_current_state = yy_next_state;
1254 yy_cp = (yy_c_buf_p);
1255 goto yy_find_action;
1259 else switch ( yy_get_next_buffer( ) )
1261 case EOB_ACT_END_OF_FILE:
1263 (yy_did_buffer_switch_on_eof) = 0;
1267 /* Note: because we've taken care in
1268 * yy_get_next_buffer() to have set up
1269 * yytext, we can now set up
1270 * yy_c_buf_p so that if some total
1271 * hoser (like flex itself) wants to
1272 * call the scanner after we return the
1273 * YY_NULL, it'll still work - another
1274 * YY_NULL will get returned.
1276 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1278 yy_act = YY_STATE_EOF(YY_START);
1284 if ( ! (yy_did_buffer_switch_on_eof) )
1290 case EOB_ACT_CONTINUE_SCAN:
1292 (yytext_ptr) + yy_amount_of_matched_text;
1294 yy_current_state = yy_get_previous_state( );
1296 yy_cp = (yy_c_buf_p);
1297 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1300 case EOB_ACT_LAST_MATCH:
1302 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1304 yy_current_state = yy_get_previous_state( );
1306 yy_cp = (yy_c_buf_p);
1307 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1308 goto yy_find_action;
1315 "fatal flex scanner internal error--no action found" );
1316 } /* end of action switch */
1317 } /* end of scanning one token */
1318 } /* end of user's declarations */
1319 } /* end of yylex */
1321 /* yy_get_next_buffer - try to read in a new buffer
1323 * Returns a code representing an action:
1324 * EOB_ACT_LAST_MATCH -
1325 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1326 * EOB_ACT_END_OF_FILE - end of file
1328 static int yy_get_next_buffer (void)
1330 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1331 char *source = (yytext_ptr);
1332 int number_to_move, i;
1335 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1337 "fatal flex scanner internal error--end of buffer missed" );
1339 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1340 { /* Don't try to fill the buffer, so this is an EOF. */
1341 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1343 /* We matched a single character, the EOB, so
1344 * treat this as a final EOF.
1346 return EOB_ACT_END_OF_FILE;
1351 /* We matched some text prior to the EOB, first
1354 return EOB_ACT_LAST_MATCH;
1358 /* Try to read more data. */
1360 /* First move last chars to start of buffer. */
1361 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1363 for ( i = 0; i < number_to_move; ++i )
1364 *(dest++) = *(source++);
1366 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1367 /* don't do the read, it's not guaranteed to return an EOF,
1370 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1375 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1377 while ( num_to_read <= 0 )
1378 { /* Not enough room in the buffer - grow it. */
1380 /* just a shorter name for the current buffer */
1381 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1383 int yy_c_buf_p_offset =
1384 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1386 if ( b->yy_is_our_buffer )
1388 int new_size = b->yy_buf_size * 2;
1390 if ( new_size <= 0 )
1391 b->yy_buf_size += b->yy_buf_size / 8;
1393 b->yy_buf_size *= 2;
1395 b->yy_ch_buf = (char *)
1396 /* Include room in for 2 EOB chars. */
1397 yyrealloc( (void *) b->yy_ch_buf,
1398 (yy_size_t) (b->yy_buf_size + 2) );
1401 /* Can't grow it, we don't own it. */
1402 b->yy_ch_buf = NULL;
1404 if ( ! b->yy_ch_buf )
1406 "fatal error - scanner input buffer overflow" );
1408 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1410 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1415 if ( num_to_read > YY_READ_BUF_SIZE )
1416 num_to_read = YY_READ_BUF_SIZE;
1418 /* Read in more data. */
1419 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1420 (yy_n_chars), num_to_read );
1422 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1425 if ( (yy_n_chars) == 0 )
1427 if ( number_to_move == YY_MORE_ADJ )
1429 ret_val = EOB_ACT_END_OF_FILE;
1435 ret_val = EOB_ACT_LAST_MATCH;
1436 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1437 YY_BUFFER_EOF_PENDING;
1442 ret_val = EOB_ACT_CONTINUE_SCAN;
1444 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1445 /* Extend the array by 50%, plus the number we really need. */
1446 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1447 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1448 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
1449 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1450 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1451 /* "- 2" to take care of EOB's */
1452 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1455 (yy_n_chars) += number_to_move;
1456 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1457 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1459 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1464 /* yy_get_previous_state - get the state just before the EOB char was reached */
1466 static yy_state_type yy_get_previous_state (void)
1468 yy_state_type yy_current_state;
1471 yy_current_state = (yy_start);
1473 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1475 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1476 if ( yy_accept[yy_current_state] )
1478 (yy_last_accepting_state) = yy_current_state;
1479 (yy_last_accepting_cpos) = yy_cp;
1481 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1483 yy_current_state = (int) yy_def[yy_current_state];
1484 if ( yy_current_state >= 55 )
1485 yy_c = yy_meta[yy_c];
1487 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1490 return yy_current_state;
1493 /* yy_try_NUL_trans - try to make a transition on the NUL character
1496 * next_state = yy_try_NUL_trans( current_state );
1498 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1501 char *yy_cp = (yy_c_buf_p);
1504 if ( yy_accept[yy_current_state] )
1506 (yy_last_accepting_state) = yy_current_state;
1507 (yy_last_accepting_cpos) = yy_cp;
1509 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1511 yy_current_state = (int) yy_def[yy_current_state];
1512 if ( yy_current_state >= 55 )
1513 yy_c = yy_meta[yy_c];
1515 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1516 yy_is_jam = (yy_current_state == 54);
1518 return yy_is_jam ? 0 : yy_current_state;
1523 static void yyunput (int c, char * yy_bp )
1527 yy_cp = (yy_c_buf_p);
1529 /* undo effects of setting up yytext */
1530 *yy_cp = (yy_hold_char);
1532 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1533 { /* need to shift things up to make room */
1534 /* +2 for EOB chars. */
1535 int number_to_move = (yy_n_chars) + 2;
1536 char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1537 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1539 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1541 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1542 *--dest = *--source;
1544 yy_cp += (int) (dest - source);
1545 yy_bp += (int) (dest - source);
1546 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1547 (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1549 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1550 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1553 *--yy_cp = (char) c;
1555 (yytext_ptr) = yy_bp;
1556 (yy_hold_char) = *yy_cp;
1557 (yy_c_buf_p) = yy_cp;
1564 static int yyinput (void)
1566 static int input (void)
1572 *(yy_c_buf_p) = (yy_hold_char);
1574 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1576 /* yy_c_buf_p now points to the character we want to return.
1577 * If this occurs *before* the EOB characters, then it's a
1578 * valid NUL; if not, then we've hit the end of the buffer.
1580 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1581 /* This was really a NUL. */
1582 *(yy_c_buf_p) = '\0';
1585 { /* need more input */
1586 int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
1589 switch ( yy_get_next_buffer( ) )
1591 case EOB_ACT_LAST_MATCH:
1592 /* This happens because yy_g_n_b()
1593 * sees that we've accumulated a
1594 * token and flags that we need to
1595 * try matching the token before
1596 * proceeding. But for input(),
1597 * there's no matching to consider.
1598 * So convert the EOB_ACT_LAST_MATCH
1599 * to EOB_ACT_END_OF_FILE.
1602 /* Reset buffer status. */
1607 case EOB_ACT_END_OF_FILE:
1612 if ( ! (yy_did_buffer_switch_on_eof) )
1621 case EOB_ACT_CONTINUE_SCAN:
1622 (yy_c_buf_p) = (yytext_ptr) + offset;
1628 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1629 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1630 (yy_hold_char) = *++(yy_c_buf_p);
1634 #endif /* ifndef YY_NO_INPUT */
1636 /** Immediately switch to a different input stream.
1637 * @param input_file A readable stream.
1639 * @note This function does not reset the start condition to @c INITIAL .
1641 void yyrestart (FILE * input_file )
1644 if ( ! YY_CURRENT_BUFFER ){
1645 yyensure_buffer_stack ();
1646 YY_CURRENT_BUFFER_LVALUE =
1647 yy_create_buffer( yyin, YY_BUF_SIZE );
1650 yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1651 yy_load_buffer_state( );
1654 /** Switch to a different input buffer.
1655 * @param new_buffer The new input buffer.
1658 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1661 /* TODO. We should be able to replace this entire function body
1663 * yypop_buffer_state();
1664 * yypush_buffer_state(new_buffer);
1666 yyensure_buffer_stack ();
1667 if ( YY_CURRENT_BUFFER == new_buffer )
1670 if ( YY_CURRENT_BUFFER )
1672 /* Flush out information for old buffer. */
1673 *(yy_c_buf_p) = (yy_hold_char);
1674 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1675 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1678 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1679 yy_load_buffer_state( );
1681 /* We don't actually know whether we did this switch during
1682 * EOF (yywrap()) processing, but the only time this flag
1683 * is looked at is after yywrap() is called, so it's safe
1684 * to go ahead and always set it.
1686 (yy_did_buffer_switch_on_eof) = 1;
1689 static void yy_load_buffer_state (void)
1691 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1692 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1693 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1694 (yy_hold_char) = *(yy_c_buf_p);
1697 /** Allocate and initialize an input buffer state.
1698 * @param file A readable stream.
1699 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1701 * @return the allocated buffer state.
1703 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1707 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1709 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1711 b->yy_buf_size = size;
1713 /* yy_ch_buf has to be 2 characters longer than the size given because
1714 * we need to put in 2 end-of-buffer characters.
1716 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
1717 if ( ! b->yy_ch_buf )
1718 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1720 b->yy_is_our_buffer = 1;
1722 yy_init_buffer( b, file );
1727 /** Destroy the buffer.
1728 * @param b a buffer created with yy_create_buffer()
1731 void yy_delete_buffer (YY_BUFFER_STATE b )
1737 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1738 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1740 if ( b->yy_is_our_buffer )
1741 yyfree( (void *) b->yy_ch_buf );
1743 yyfree( (void *) b );
1746 /* Initializes or reinitializes a buffer.
1747 * This function is sometimes called more than once on the same buffer,
1748 * such as during a yyrestart() or at EOF.
1750 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1755 yy_flush_buffer( b );
1757 b->yy_input_file = file;
1758 b->yy_fill_buffer = 1;
1760 /* If b is the current buffer, then yy_init_buffer was _probably_
1761 * called from yyrestart() or through yy_get_next_buffer.
1762 * In that case, we don't want to reset the lineno or column.
1764 if (b != YY_CURRENT_BUFFER){
1765 b->yy_bs_lineno = 1;
1766 b->yy_bs_column = 0;
1769 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1774 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1775 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1778 void yy_flush_buffer (YY_BUFFER_STATE b )
1785 /* We always need two end-of-buffer characters. The first causes
1786 * a transition to the end-of-buffer state. The second causes
1787 * a jam in that state.
1789 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1790 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1792 b->yy_buf_pos = &b->yy_ch_buf[0];
1795 b->yy_buffer_status = YY_BUFFER_NEW;
1797 if ( b == YY_CURRENT_BUFFER )
1798 yy_load_buffer_state( );
1801 /** Pushes the new state onto the stack. The new state becomes
1802 * the current state. This function will allocate the stack
1804 * @param new_buffer The new state.
1807 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1809 if (new_buffer == NULL)
1812 yyensure_buffer_stack();
1814 /* This block is copied from yy_switch_to_buffer. */
1815 if ( YY_CURRENT_BUFFER )
1817 /* Flush out information for old buffer. */
1818 *(yy_c_buf_p) = (yy_hold_char);
1819 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1820 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1823 /* Only push if top exists. Otherwise, replace top. */
1824 if (YY_CURRENT_BUFFER)
1825 (yy_buffer_stack_top)++;
1826 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1828 /* copied from yy_switch_to_buffer. */
1829 yy_load_buffer_state( );
1830 (yy_did_buffer_switch_on_eof) = 1;
1833 /** Removes and deletes the top of the stack, if present.
1834 * The next element becomes the new top.
1837 void yypop_buffer_state (void)
1839 if (!YY_CURRENT_BUFFER)
1842 yy_delete_buffer(YY_CURRENT_BUFFER );
1843 YY_CURRENT_BUFFER_LVALUE = NULL;
1844 if ((yy_buffer_stack_top) > 0)
1845 --(yy_buffer_stack_top);
1847 if (YY_CURRENT_BUFFER) {
1848 yy_load_buffer_state( );
1849 (yy_did_buffer_switch_on_eof) = 1;
1853 /* Allocates the stack if it does not exist.
1854 * Guarantees space for at least one push.
1856 static void yyensure_buffer_stack (void)
1858 yy_size_t num_to_alloc;
1860 if (!(yy_buffer_stack)) {
1862 /* First allocation is just for 2 elements, since we don't know if this
1863 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1864 * immediate realloc on the next call.
1866 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1867 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1868 (num_to_alloc * sizeof(struct yy_buffer_state*)
1870 if ( ! (yy_buffer_stack) )
1871 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1873 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1875 (yy_buffer_stack_max) = num_to_alloc;
1876 (yy_buffer_stack_top) = 0;
1880 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1882 /* Increase the buffer to prepare for a possible push. */
1883 yy_size_t grow_size = 8 /* arbitrary grow size */;
1885 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1886 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1888 num_to_alloc * sizeof(struct yy_buffer_state*)
1890 if ( ! (yy_buffer_stack) )
1891 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1893 /* zero only the new slots.*/
1894 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1895 (yy_buffer_stack_max) = num_to_alloc;
1899 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1900 * @param base the character buffer
1901 * @param size the size in bytes of the character buffer
1903 * @return the newly allocated buffer state object.
1905 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1910 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1911 base[size-1] != YY_END_OF_BUFFER_CHAR )
1912 /* They forgot to leave room for the EOB's. */
1915 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1917 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1919 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
1920 b->yy_buf_pos = b->yy_ch_buf = base;
1921 b->yy_is_our_buffer = 0;
1922 b->yy_input_file = NULL;
1923 b->yy_n_chars = b->yy_buf_size;
1924 b->yy_is_interactive = 0;
1926 b->yy_fill_buffer = 0;
1927 b->yy_buffer_status = YY_BUFFER_NEW;
1929 yy_switch_to_buffer( b );
1934 /** Setup the input buffer state to scan a string. The next call to yylex() will
1935 * scan from a @e copy of @a str.
1936 * @param yystr a NUL-terminated string to scan
1938 * @return the newly allocated buffer state object.
1939 * @note If you want to scan bytes that may contain NUL values, then use
1940 * yy_scan_bytes() instead.
1942 YY_BUFFER_STATE yy_scan_string (const char * yystr )
1945 return yy_scan_bytes( yystr, (int) strlen(yystr) );
1948 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1949 * scan from a @e copy of @a bytes.
1950 * @param yybytes the byte buffer to scan
1951 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1953 * @return the newly allocated buffer state object.
1955 YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
1962 /* Get memory for full buffer, including space for trailing EOB's. */
1963 n = (yy_size_t) (_yybytes_len + 2);
1964 buf = (char *) yyalloc( n );
1966 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1968 for ( i = 0; i < _yybytes_len; ++i )
1969 buf[i] = yybytes[i];
1971 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1973 b = yy_scan_buffer( buf, n );
1975 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1977 /* It's okay to grow etc. this buffer, and we should throw it
1978 * away when we're done.
1980 b->yy_is_our_buffer = 1;
1985 #ifndef YY_EXIT_FAILURE
1986 #define YY_EXIT_FAILURE 2
1989 static void yynoreturn yy_fatal_error (const char* msg )
1991 fprintf( stderr, "%s\n", msg );
1992 exit( YY_EXIT_FAILURE );
1995 /* Redefine yyless() so it works in section 3 code. */
2001 /* Undo effects of setting up yytext. */ \
2002 int yyless_macro_arg = (n); \
2003 YY_LESS_LINENO(yyless_macro_arg);\
2004 yytext[yyleng] = (yy_hold_char); \
2005 (yy_c_buf_p) = yytext + yyless_macro_arg; \
2006 (yy_hold_char) = *(yy_c_buf_p); \
2007 *(yy_c_buf_p) = '\0'; \
2008 yyleng = yyless_macro_arg; \
2012 /* Accessor methods (get/set functions) to struct members. */
2014 /** Get the current line number.
2017 int yyget_lineno (void)
2023 /** Get the input stream.
2026 FILE *yyget_in (void)
2031 /** Get the output stream.
2034 FILE *yyget_out (void)
2039 /** Get the length of the current token.
2042 int yyget_leng (void)
2047 /** Get the current token.
2051 char *yyget_text (void)
2056 /** Set the current line number.
2057 * @param _line_number line number
2060 void yyset_lineno (int _line_number )
2063 yylineno = _line_number;
2066 /** Set the input stream. This does not discard the current
2068 * @param _in_str A readable stream.
2070 * @see yy_switch_to_buffer
2072 void yyset_in (FILE * _in_str )
2077 void yyset_out (FILE * _out_str )
2082 int yyget_debug (void)
2084 return yy_flex_debug;
2087 void yyset_debug (int _bdebug )
2089 yy_flex_debug = _bdebug ;
2092 static int yy_init_globals (void)
2094 /* Initialization is the same as for the non-reentrant scanner.
2095 * This function is called from yylex_destroy(), so don't allocate here.
2098 (yy_buffer_stack) = NULL;
2099 (yy_buffer_stack_top) = 0;
2100 (yy_buffer_stack_max) = 0;
2101 (yy_c_buf_p) = NULL;
2105 /* Defined in main.c */
2114 /* For future reference: Set errno on error, since we are called by
2120 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2121 int yylex_destroy (void)
2124 /* Pop the buffer stack, destroying each element. */
2125 while(YY_CURRENT_BUFFER){
2126 yy_delete_buffer( YY_CURRENT_BUFFER );
2127 YY_CURRENT_BUFFER_LVALUE = NULL;
2128 yypop_buffer_state();
2131 /* Destroy the stack itself. */
2132 yyfree((yy_buffer_stack) );
2133 (yy_buffer_stack) = NULL;
2135 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2136 * yylex() is called, initialization will occur. */
2143 * Internal utility routines.
2147 static void yy_flex_strncpy (char* s1, const char * s2, int n )
2151 for ( i = 0; i < n; ++i )
2156 #ifdef YY_NEED_STRLEN
2157 static int yy_flex_strlen (const char * s )
2160 for ( n = 0; s[n]; ++n )
2167 void *yyalloc (yy_size_t size )
2169 return malloc(size);
2172 void *yyrealloc (void * ptr, yy_size_t size )
2175 /* The cast to (char *) in the following accommodates both
2176 * implementations that use char* generic pointers, and those
2177 * that use void* generic pointers. It works with the latter
2178 * because both ANSI C and C++ allow castless assignment from
2179 * any pointer type to void*, and deal with argument conversions
2180 * as though doing an assignment.
2182 return realloc(ptr, size);
2185 void yyfree (void * ptr )
2187 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2190 #define YYTABLES_NAME "yytables"