1 #define ASTMM_LIBC ASTMM_REDIRECT
8 #define YY_INT_ALIGNED short int
13 #define YY_FLEX_MAJOR_VERSION 2
14 #define YY_FLEX_MINOR_VERSION 5
15 #define YY_FLEX_SUBMINOR_VERSION 35
16 #if YY_FLEX_SUBMINOR_VERSION > 0
37 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
42 #ifndef __STDC_LIMIT_MACROS
43 #define __STDC_LIMIT_MACROS 1
47 typedef int8_t flex_int8_t;
48 typedef uint8_t flex_uint8_t;
49 typedef int16_t flex_int16_t;
50 typedef uint16_t flex_uint16_t;
51 typedef int32_t flex_int32_t;
52 typedef uint32_t flex_uint32_t;
54 typedef signed char flex_int8_t;
55 typedef short int flex_int16_t;
56 typedef int flex_int32_t;
57 typedef unsigned char flex_uint8_t;
58 typedef unsigned short int flex_uint16_t;
59 typedef unsigned int flex_uint32_t;
64 #define INT8_MIN (-128)
67 #define INT16_MIN (-32767-1)
70 #define INT32_MIN (-2147483647-1)
73 #define INT8_MAX (127)
76 #define INT16_MAX (32767)
79 #define INT32_MAX (2147483647)
82 #define UINT8_MAX (255U)
85 #define UINT16_MAX (65535U)
88 #define UINT32_MAX (4294967295U)
101 #if defined (__STDC__)
109 #define yyconst const
122 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
125 #ifndef YY_TYPEDEF_YY_SCANNER_T
126 #define YY_TYPEDEF_YY_SCANNER_T
127 typedef void* yyscan_t;
132 #define yyin yyg->yyin_r
133 #define yyout yyg->yyout_r
134 #define yyextra yyg->yyextra_r
135 #define yyleng yyg->yyleng_r
136 #define yytext yyg->yytext_r
137 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
138 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
139 #define yy_flex_debug yyg->yy_flex_debug_r
145 #define BEGIN yyg->yy_start = 1 + 2 *
151 #define YY_START ((yyg->yy_start - 1) / 2)
152 #define YYSTATE YY_START
155 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
158 #define YY_NEW_FILE ast_yyrestart(yyin ,yyscanner )
160 #define YY_END_OF_BUFFER_CHAR 0
164 #define YY_BUF_SIZE 16384
169 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
171 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
172 #define YY_TYPEDEF_YY_BUFFER_STATE
176 #define EOB_ACT_CONTINUE_SCAN 0
177 #define EOB_ACT_END_OF_FILE 1
178 #define EOB_ACT_LAST_MATCH 2
180 #define YY_LESS_LINENO(n)
187 int yyless_macro_arg = (n); \
188 YY_LESS_LINENO(yyless_macro_arg);\
189 *yy_cp = yyg->yy_hold_char; \
190 YY_RESTORE_YY_MORE_OFFSET \
191 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
192 YY_DO_BEFORE_ACTION; \
196 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
198 #ifndef YY_TYPEDEF_YY_SIZE_T
199 #define YY_TYPEDEF_YY_SIZE_T
200 typedef size_t yy_size_t;
203 #ifndef YY_STRUCT_YY_BUFFER_STATE
204 #define YY_STRUCT_YY_BUFFER_STATE
215 yy_size_t yy_buf_size;
226 int yy_is_our_buffer;
233 int yy_is_interactive;
249 int yy_buffer_status;
251 #define YY_BUFFER_NEW 0
252 #define YY_BUFFER_NORMAL 1
263 #define YY_BUFFER_EOF_PENDING 2
274 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
275 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
281 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
291 static void ast_yyensure_buffer_stack (yyscan_t yyscanner );
292 static void ast_yy_load_buffer_state (yyscan_t yyscanner );
293 static void ast_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
295 #define YY_FLUSH_BUFFER ast_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
299 YY_BUFFER_STATE
ast_yy_scan_bytes (yyconst
char *bytes,
int len ,yyscan_t yyscanner );
301 void *ast_yyalloc (yy_size_t ,yyscan_t yyscanner );
302 void *ast_yyrealloc (
void *,yy_size_t ,yyscan_t yyscanner );
303 void ast_yyfree (
void * ,yyscan_t yyscanner );
305 #define yy_new_buffer ast_yy_create_buffer
307 #define yy_set_interactive(is_interactive) \
309 if ( ! YY_CURRENT_BUFFER ){ \
310 ast_yyensure_buffer_stack (yyscanner); \
311 YY_CURRENT_BUFFER_LVALUE = \
312 ast_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
314 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
317 #define yy_set_bol(at_bol) \
319 if ( ! YY_CURRENT_BUFFER ){\
320 ast_yyensure_buffer_stack (yyscanner); \
321 YY_CURRENT_BUFFER_LVALUE = \
322 ast_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
324 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
327 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
331 #define ast_yywrap(n) 1
332 #define YY_SKIP_YYWRAP
334 typedef unsigned char YY_CHAR;
336 typedef int yy_state_type;
338 #define yytext_ptr yytext_r
340 static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
341 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
342 static int yy_get_next_buffer (yyscan_t yyscanner );
343 static void yy_fatal_error (yyconst
char msg[] ,yyscan_t yyscanner );
348 #define YY_DO_BEFORE_ACTION \
349 yyg->yytext_ptr = yy_bp; \
350 yyg->yytext_ptr -= yyg->yy_more_len; \
351 yyleng = (size_t) (yy_cp - yyg->yytext_ptr); \
352 yyg->yy_hold_char = *yy_cp; \
354 yyg->yy_c_buf_p = yy_cp;
356 #define YY_NUM_RULES 38
357 #define YY_END_OF_BUFFER 39
362 flex_int32_t yy_verify;
365 static yyconst flex_int16_t yy_accept[63] =
367 0, 0, 0, 0, 35, 35, 39, 38, 27, 29,
368 21, 38, 31, 38, 19, 2, 24, 25, 17, 14,
369 15, 16, 18, 30, 22, 10, 3, 9, 20, 1,
370 38, 38, 34, 33, 35, 37, 37, 13, 0, 28,
371 31, 0, 26, 5, 31, 30, 23, 12, 6, 7,
372 11, 4, 8, 0, 34, 33, 35, 0, 36, 32,
376 static yyconst flex_int32_t yy_ec[256] =
378 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
379 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
380 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
381 1, 2, 4, 5, 6, 7, 8, 9, 6, 10,
382 11, 12, 13, 14, 15, 16, 17, 18, 18, 18,
383 18, 18, 18, 18, 18, 18, 18, 19, 6, 20,
384 21, 22, 23, 6, 6, 6, 6, 6, 6, 6,
385 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
386 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
387 1, 6, 1, 6, 6, 1, 6, 6, 6, 6,
389 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
390 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
391 6, 6, 24, 25, 26, 27, 1, 28, 28, 28,
392 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
393 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
394 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
395 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
396 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
397 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
398 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
400 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
401 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
402 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
403 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
404 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
408 static yyconst flex_int32_t yy_meta[29] =
410 1, 2, 2, 2, 1, 3, 3, 2, 2, 2,
411 2, 2, 2, 1, 2, 3, 2, 3, 2, 2,
412 2, 2, 2, 1, 2, 1, 1, 3
415 static yyconst flex_int16_t yy_base[70] =
417 0, 0, 5, 6, 32, 60, 73, 130, 130, 130,
418 51, 66, 63, 45, 130, 59, 130, 130, 130, 130,
419 130, 130, 130, 83, 45, 42, 13, 41, 130, 32,
420 28, 17, 130, 130, 47, 130, 29, 130, 47, 130,
421 44, 25, 130, 130, 29, 0, 130, 130, 130, 130,
422 130, 130, 130, 18, 130, 130, 38, 12, 130, 130,
423 0, 130, 111, 114, 117, 32, 120, 123, 126
426 static yyconst flex_int16_t yy_def[70] =
428 62, 1, 63, 63, 64, 64, 62, 62, 62, 62,
429 62, 65, 66, 67, 62, 62, 62, 62, 62, 62,
430 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
431 62, 68, 62, 62, 69, 62, 62, 62, 65, 62,
432 66, 67, 62, 62, 41, 24, 62, 62, 62, 62,
433 62, 62, 62, 68, 62, 62, 69, 62, 62, 62,
434 45, 0, 62, 62, 62, 62, 62, 62, 62
437 static yyconst flex_int16_t yy_nxt[159] =
439 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
440 18, 19, 20, 21, 22, 13, 23, 24, 25, 26,
441 27, 28, 29, 8, 30, 8, 31, 13, 33, 33,
442 34, 34, 35, 49, 41, 59, 35, 35, 37, 50,
443 55, 55, 56, 56, 58, 35, 61, 35, 60, 35,
444 42, 40, 59, 58, 53, 35, 52, 35, 35, 35,
445 35, 51, 48, 47, 35, 35, 37, 44, 43, 42,
446 40, 38, 62, 35, 62, 35, 62, 35, 62, 62,
447 62, 62, 62, 35, 62, 35, 35, 35, 41, 42,
448 62, 62, 62, 62, 62, 62, 62, 62, 45, 62,
450 46, 62, 62, 62, 62, 62, 62, 62, 62, 62,
451 41, 32, 32, 32, 36, 36, 36, 39, 39, 39,
452 41, 41, 41, 54, 54, 54, 57, 62, 57, 7,
453 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
454 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
455 62, 62, 62, 62, 62, 62, 62, 62
458 static yyconst flex_int16_t yy_chk[159] =
460 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
461 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
462 1, 1, 1, 1, 1, 1, 1, 1, 3, 4,
463 3, 4, 5, 27, 66, 58, 5, 5, 5, 27,
464 32, 54, 32, 54, 57, 5, 45, 5, 42, 5,
465 41, 39, 37, 35, 31, 5, 30, 5, 5, 5,
466 6, 28, 26, 25, 6, 6, 6, 16, 14, 13,
467 12, 11, 7, 6, 0, 6, 0, 6, 0, 0,
468 0, 0, 0, 6, 0, 6, 6, 6, 24, 24,
469 0, 0, 0, 0, 0, 0, 0, 0, 24, 0,
471 24, 0, 0, 0, 0, 0, 0, 0, 0, 0,
472 24, 63, 63, 63, 64, 64, 64, 65, 65, 65,
473 67, 67, 67, 68, 68, 68, 69, 0, 69, 62,
474 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
475 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
476 62, 62, 62, 62, 62, 62, 62, 62
482 #define REJECT reject_used_but_not_detected
483 #define yymore() (yyg->yy_more_flag = 1)
484 #define YY_MORE_ADJ yyg->yy_more_len
485 #define YY_RESTORE_YY_MORE_OFFSET
486 #line 1 "ast_expr2.fl"
487 #line 2 "ast_expr2.fl"
511 #include <sys/types.h>
514 #if defined(STANDALONE)
516 #define __USE_ISOC99 1
521 #define FP___PRINTF "%.18Lg"
522 #define FP___FMOD fmodl
523 #define FP___STRTOD strtold
524 #define FP___TYPE long double
526 #define FP___PRINTF "%.16g"
527 #define FP___FMOD fmod
528 #define FP___STRTOD strtod
529 #define FP___TYPE double
536 #if !defined(SOLARIS) && !defined(__CYGWIN__)
539 #define quad_t int64_t
554 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
558 AST_EXPR_number, AST_EXPR_numeric_string, AST_EXPR_string
569 #include "ast_expr2.h"
571 #define SET_COLUMNS do { \
572 yylloc_param->first_column = (int)(yyg->yytext_r - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf); \
573 yylloc_param->last_column += yyleng - 1; \
574 yylloc_param->first_line = yylloc_param->last_line = 1; \
577 #define SET_STRING do { \
578 yylval_param->val = calloc(1, sizeof(struct val)); \
579 yylval_param->val->type = AST_EXPR_string; \
580 yylval_param->val->u.s = strdup(yytext); \
583 #define SET_NUMERIC_STRING do { \
584 yylval_param->val = calloc(1, sizeof(struct val)); \
585 yylval_param->val->type = AST_EXPR_numeric_string; \
586 yylval_param->val->u.s = strdup(yytext); \
599 static int curlycount = 0;
600 static char *expr2_token_subst(
const char *mess);
602 #line 600 "ast_expr2f.c"
608 #ifndef YY_NO_UNISTD_H
616 #ifndef YY_EXTRA_TYPE
617 #define YY_EXTRA_TYPE void *
625 YY_EXTRA_TYPE yyextra_r;
628 FILE *yyin_r, *yyout_r;
638 int yy_did_buffer_switch_on_eof;
639 int yy_start_stack_ptr;
640 int yy_start_stack_depth;
642 yy_state_type yy_last_accepting_state;
643 char* yy_last_accepting_cpos;
658 static int yy_init_globals (yyscan_t yyscanner );
662 # define yylval yyg->yylval_r
664 # define yylloc yyg->yylloc_r
666 int ast_yylex_init (yyscan_t* scanner);
668 int ast_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
673 int ast_yylex_destroy (yyscan_t yyscanner );
675 int ast_yyget_debug (yyscan_t yyscanner );
677 void ast_yyset_debug (
int debug_flag ,yyscan_t yyscanner );
681 void ast_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
689 void ast_yyset_out (FILE * out_str ,yyscan_t yyscanner );
699 YYSTYPE * ast_yyget_lval (yyscan_t yyscanner );
701 void ast_yyset_lval (
YYSTYPE * yylval_param ,yyscan_t yyscanner );
703 YYLTYPE *ast_yyget_lloc (yyscan_t yyscanner );
705 void ast_yyset_lloc (
YYLTYPE * yylloc_param ,yyscan_t yyscanner );
711 #ifndef YY_SKIP_YYWRAP
713 extern "C" int ast_yywrap (yyscan_t yyscanner );
715 extern int ast_yywrap (yyscan_t yyscanner );
719 static void yyunput (
int c,
char *buf_ptr ,yyscan_t yyscanner);
722 static void yy_flex_strncpy (
char *,yyconst
char *,
int ,yyscan_t yyscanner);
725 #ifdef YY_NEED_STRLEN
726 static int yy_flex_strlen (yyconst
char * ,yyscan_t yyscanner);
732 static int yyinput (yyscan_t yyscanner );
734 static int input (yyscan_t yyscanner );
740 #ifndef YY_READ_BUF_SIZE
741 #define YY_READ_BUF_SIZE 8192
749 #define ECHO fwrite( yytext, yyleng, 1, yyout )
756 #define YY_INPUT(buf,result,max_size) \
757 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
761 for ( n = 0; n < max_size && \
762 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
765 buf[n++] = (char) c; \
766 if ( c == EOF && ferror( yyin ) ) \
767 YY_FATAL_ERROR( "input in flex scanner failed" ); \
773 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
775 if( errno != EINTR) \
777 YY_FATAL_ERROR( "input in flex scanner failed" ); \
793 #define yyterminate() return YY_NULL
797 #ifndef YY_START_STACK_INCR
798 #define YY_START_STACK_INCR 25
802 #ifndef YY_FATAL_ERROR
803 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
812 #define YY_DECL_IS_OURS 1
814 extern int ast_yylex \
815 (
YYSTYPE * yylval_param,
YYLTYPE * yylloc_param ,yyscan_t yyscanner);
817 #define YY_DECL int ast_yylex \
818 (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
824 #ifndef YY_USER_ACTION
825 #define YY_USER_ACTION
830 #define YY_BREAK break;
833 #define YY_RULE_SETUP \
840 register yy_state_type yy_current_state;
841 register char *yy_cp, *yy_bp;
845 #line 128 "ast_expr2.fl"
848 #line 846 "ast_expr2f.c"
850 yylval = yylval_param;
852 yylloc = yylloc_param;
862 if ( ! yyg->yy_start )
871 if ( ! YY_CURRENT_BUFFER ) {
872 ast_yyensure_buffer_stack (yyscanner);
873 YY_CURRENT_BUFFER_LVALUE =
877 ast_yy_load_buffer_state(yyscanner );
882 yyg->yy_more_len = 0;
883 if ( yyg->yy_more_flag )
885 yyg->yy_more_len = yyg->yy_c_buf_p - yyg->yytext_ptr;
886 yyg->yy_more_flag = 0;
888 yy_cp = yyg->yy_c_buf_p;
891 *yy_cp = yyg->yy_hold_char;
898 yy_current_state = yyg->yy_start;
902 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
903 if ( yy_accept[yy_current_state] )
905 yyg->yy_last_accepting_state = yy_current_state;
906 yyg->yy_last_accepting_cpos = yy_cp;
908 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
910 yy_current_state = (int) yy_def[yy_current_state];
911 if ( yy_current_state >= 63 )
912 yy_c = yy_meta[(
unsigned int) yy_c];
914 yy_current_state = yy_nxt[yy_base[yy_current_state] + (
unsigned int) yy_c];
917 while ( yy_current_state != 62 );
918 yy_cp = yyg->yy_last_accepting_cpos;
919 yy_current_state = yyg->yy_last_accepting_state;
922 yy_act = yy_accept[yy_current_state];
932 *yy_cp = yyg->yy_hold_char;
933 yy_cp = yyg->yy_last_accepting_cpos;
934 yy_current_state = yyg->yy_last_accepting_state;
939 #line 130 "ast_expr2.fl"
940 { SET_COLUMNS; SET_STRING;
return TOK_OR;}
944 #line 131 "ast_expr2.fl"
945 { SET_COLUMNS; SET_STRING;
return TOK_AND;}
949 #line 132 "ast_expr2.fl"
950 { SET_COLUMNS; SET_STRING;
return TOK_EQ;}
954 #line 133 "ast_expr2.fl"
955 { SET_COLUMNS; SET_STRING;
return TOK_OR;}
959 #line 134 "ast_expr2.fl"
960 { SET_COLUMNS; SET_STRING;
return TOK_AND;}
964 #line 135 "ast_expr2.fl"
965 { SET_COLUMNS; SET_STRING;
return TOK_EQ;}
969 #line 136 "ast_expr2.fl"
970 { SET_COLUMNS; SET_STRING;
return TOK_EQTILDE;}
974 #line 137 "ast_expr2.fl"
975 { SET_COLUMNS; SET_STRING;
return TOK_TILDETILDE;}
979 #line 138 "ast_expr2.fl"
980 { SET_COLUMNS; SET_STRING;
return TOK_GT;}
984 #line 139 "ast_expr2.fl"
985 { SET_COLUMNS; SET_STRING;
return TOK_LT;}
989 #line 140 "ast_expr2.fl"
990 { SET_COLUMNS; SET_STRING;
return TOK_GE;}
994 #line 141 "ast_expr2.fl"
995 { SET_COLUMNS; SET_STRING;
return TOK_LE;}
999 #line 142 "ast_expr2.fl"
1000 { SET_COLUMNS; SET_STRING;
return TOK_NE;}
1004 #line 143 "ast_expr2.fl"
1005 { SET_COLUMNS; SET_STRING;
return TOK_PLUS;}
1009 #line 144 "ast_expr2.fl"
1010 { SET_COLUMNS; SET_STRING;
return TOK_COMMA;}
1014 #line 145 "ast_expr2.fl"
1015 { SET_COLUMNS; SET_STRING;
return TOK_MINUS;}
1019 #line 146 "ast_expr2.fl"
1020 { SET_COLUMNS; SET_STRING;
return TOK_MULT;}
1024 #line 147 "ast_expr2.fl"
1025 { SET_COLUMNS; SET_STRING;
return TOK_DIV;}
1029 #line 148 "ast_expr2.fl"
1030 { SET_COLUMNS; SET_STRING;
return TOK_MOD;}
1034 #line 149 "ast_expr2.fl"
1035 { SET_COLUMNS; SET_STRING;
return TOK_COND;}
1039 #line 150 "ast_expr2.fl"
1040 { SET_COLUMNS; SET_STRING;
return TOK_COMPL;}
1044 #line 151 "ast_expr2.fl"
1045 { SET_COLUMNS; SET_STRING;
return TOK_COLON;}
1049 #line 152 "ast_expr2.fl"
1050 { SET_COLUMNS; SET_STRING;
return TOK_COLONCOLON;}
1054 #line 153 "ast_expr2.fl"
1055 { SET_COLUMNS; SET_STRING;
return TOK_LP;}
1059 #line 154 "ast_expr2.fl"
1060 { SET_COLUMNS; SET_STRING;
return TOK_RP;}
1064 #line 155 "ast_expr2.fl"
1077 #line 165 "ast_expr2.fl"
1083 #line 166 "ast_expr2.fl"
1084 {SET_COLUMNS; SET_STRING;
return TOKEN;}
1089 #line 168 "ast_expr2.fl"
1094 #line 169 "ast_expr2.fl"
1107 #line 178 "ast_expr2.fl"
1117 #line 184 "ast_expr2.fl"
1127 #line 190 "ast_expr2.fl"
1130 if (curlycount < 0) {
1141 #line 200 "ast_expr2.fl"
1149 #line 206 "ast_expr2.fl"
1159 #line 213 "ast_expr2.fl"
1169 #line 219 "ast_expr2.fl"
1171 char c = yytext[yyleng-1];
1179 case YY_STATE_EOF(trail):
1180 #line 228 "ast_expr2.fl"
1191 #line 236 "ast_expr2.fl"
1194 #line 1192 "ast_expr2f.c"
1195 case YY_STATE_EOF(INITIAL):
1196 case YY_STATE_EOF(var):
1199 case YY_END_OF_BUFFER:
1202 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1205 *yy_cp = yyg->yy_hold_char;
1206 YY_RESTORE_YY_MORE_OFFSET
1208 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1219 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1220 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1221 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1231 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1233 yy_state_type yy_next_state;
1235 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1237 yy_current_state = yy_get_previous_state( yyscanner );
1248 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1250 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1252 if ( yy_next_state )
1255 yy_cp = ++yyg->yy_c_buf_p;
1256 yy_current_state = yy_next_state;
1262 yy_cp = yyg->yy_last_accepting_cpos;
1263 yy_current_state = yyg->yy_last_accepting_state;
1264 goto yy_find_action;
1268 else switch ( yy_get_next_buffer( yyscanner ) )
1270 case EOB_ACT_END_OF_FILE:
1272 yyg->yy_did_buffer_switch_on_eof = 0;
1274 if ( ast_yywrap(yyscanner ) )
1285 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1287 yy_act = YY_STATE_EOF(YY_START);
1293 if ( ! yyg->yy_did_buffer_switch_on_eof )
1299 case EOB_ACT_CONTINUE_SCAN:
1301 yyg->yytext_ptr + yy_amount_of_matched_text;
1303 yy_current_state = yy_get_previous_state( yyscanner );
1305 yy_cp = yyg->yy_c_buf_p;
1306 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1309 case EOB_ACT_LAST_MATCH:
1311 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1313 yy_current_state = yy_get_previous_state( yyscanner );
1315 yy_cp = yyg->yy_c_buf_p;
1316 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1317 goto yy_find_action;
1324 "fatal flex scanner internal error--no action found" );
1336 static int yy_get_next_buffer (yyscan_t yyscanner)
1339 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1340 register char *source = yyg->yytext_ptr;
1341 register int number_to_move, i;
1344 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1346 "fatal flex scanner internal error--end of buffer missed" );
1348 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1350 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1355 return EOB_ACT_END_OF_FILE;
1363 return EOB_ACT_LAST_MATCH;
1370 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1372 for ( i = 0; i < number_to_move; ++i )
1373 *(dest++) = *(source++);
1375 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1379 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1384 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1386 while ( num_to_read <= 0 )
1390 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1392 int yy_c_buf_p_offset =
1393 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1395 if ( b->yy_is_our_buffer )
1397 int new_size = b->yy_buf_size * 2;
1399 if ( new_size <= 0 )
1400 b->yy_buf_size += b->yy_buf_size / 8;
1402 b->yy_buf_size *= 2;
1404 b->yy_ch_buf = (
char *)
1406 ast_yyrealloc((
void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
1412 if ( ! b->yy_ch_buf )
1414 "fatal error - scanner input buffer overflow" );
1416 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1418 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1423 if ( num_to_read > YY_READ_BUF_SIZE )
1424 num_to_read = YY_READ_BUF_SIZE;
1427 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1428 yyg->yy_n_chars, (
size_t) num_to_read );
1430 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1433 if ( yyg->yy_n_chars == 0 )
1435 if ( number_to_move == YY_MORE_ADJ )
1437 ret_val = EOB_ACT_END_OF_FILE;
1443 ret_val = EOB_ACT_LAST_MATCH;
1444 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1445 YY_BUFFER_EOF_PENDING;
1450 ret_val = EOB_ACT_CONTINUE_SCAN;
1452 if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1454 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1455 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (
char *) ast_yyrealloc((
void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
1456 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1457 YY_FATAL_ERROR(
"out of dynamic memory in yy_get_next_buffer()" );
1460 yyg->yy_n_chars += number_to_move;
1461 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1462 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1464 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1471 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
1473 register yy_state_type yy_current_state;
1474 register char *yy_cp;
1477 yy_current_state = yyg->yy_start;
1479 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1481 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1482 if ( yy_accept[yy_current_state] )
1484 yyg->yy_last_accepting_state = yy_current_state;
1485 yyg->yy_last_accepting_cpos = yy_cp;
1487 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1489 yy_current_state = (int) yy_def[yy_current_state];
1490 if ( yy_current_state >= 63 )
1491 yy_c = yy_meta[(
unsigned int) yy_c];
1493 yy_current_state = yy_nxt[yy_base[yy_current_state] + (
unsigned int) yy_c];
1496 return yy_current_state;
1504 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
1506 register int yy_is_jam;
1508 register char *yy_cp = yyg->yy_c_buf_p;
1510 register YY_CHAR yy_c = 1;
1511 if ( yy_accept[yy_current_state] )
1513 yyg->yy_last_accepting_state = yy_current_state;
1514 yyg->yy_last_accepting_cpos = yy_cp;
1516 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1518 yy_current_state = (int) yy_def[yy_current_state];
1519 if ( yy_current_state >= 63 )
1520 yy_c = yy_meta[(
unsigned int) yy_c];
1522 yy_current_state = yy_nxt[yy_base[yy_current_state] + (
unsigned int) yy_c];
1523 yy_is_jam = (yy_current_state == 62);
1525 return yy_is_jam ? 0 : yy_current_state;
1528 static void yyunput (
int c,
register char * yy_bp , yyscan_t yyscanner)
1530 register char *yy_cp;
1533 yy_cp = yyg->yy_c_buf_p;
1536 *yy_cp = yyg->yy_hold_char;
1538 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1541 register int number_to_move = yyg->yy_n_chars + 2;
1542 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1543 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1544 register char *source =
1545 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1547 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1548 *--dest = *--source;
1550 yy_cp += (int) (dest - source);
1551 yy_bp += (int) (dest - source);
1552 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1553 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1555 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1556 YY_FATAL_ERROR(
"flex scanner push-back overflow" );
1559 *--yy_cp = (char) c;
1561 yyg->yytext_ptr = yy_bp;
1562 yyg->yy_hold_char = *yy_cp;
1563 yyg->yy_c_buf_p = yy_cp;
1568 static int yyinput (yyscan_t yyscanner)
1570 static int input (yyscan_t yyscanner)
1577 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1579 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1585 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1587 *yyg->yy_c_buf_p =
'\0';
1591 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1594 switch ( yy_get_next_buffer( yyscanner ) )
1596 case EOB_ACT_LAST_MATCH:
1612 case EOB_ACT_END_OF_FILE:
1614 if ( ast_yywrap(yyscanner ) )
1617 if ( ! yyg->yy_did_buffer_switch_on_eof )
1620 return yyinput(yyscanner);
1622 return input(yyscanner);
1626 case EOB_ACT_CONTINUE_SCAN:
1627 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1633 c = *(
unsigned char *) yyg->yy_c_buf_p;
1634 *yyg->yy_c_buf_p =
'\0';
1635 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1650 if ( ! YY_CURRENT_BUFFER ){
1651 ast_yyensure_buffer_stack (yyscanner);
1652 YY_CURRENT_BUFFER_LVALUE =
1656 ast_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
1657 ast_yy_load_buffer_state(yyscanner );
1673 ast_yyensure_buffer_stack (yyscanner);
1674 if ( YY_CURRENT_BUFFER == new_buffer )
1677 if ( YY_CURRENT_BUFFER )
1680 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1681 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1682 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1685 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1686 ast_yy_load_buffer_state(yyscanner );
1693 yyg->yy_did_buffer_switch_on_eof = 1;
1696 static void ast_yy_load_buffer_state (yyscan_t yyscanner)
1699 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1700 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1701 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1702 yyg->yy_hold_char = *yyg->yy_c_buf_p;
1715 b = (YY_BUFFER_STATE) ast_yyalloc(
sizeof(
struct yy_buffer_state ) ,yyscanner );
1717 YY_FATAL_ERROR(
"out of dynamic memory in ast_yy_create_buffer()" );
1719 b->yy_buf_size = size;
1724 b->yy_ch_buf = (
char *) ast_yyalloc(b->yy_buf_size + 2 ,yyscanner );
1725 if ( ! b->yy_ch_buf )
1726 YY_FATAL_ERROR(
"out of dynamic memory in ast_yy_create_buffer()" );
1728 b->yy_is_our_buffer = 1;
1730 ast_yy_init_buffer(b,file ,yyscanner);
1746 if ( b == YY_CURRENT_BUFFER )
1747 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1749 if ( b->yy_is_our_buffer )
1750 ast_yyfree((
void *) b->yy_ch_buf ,yyscanner );
1752 ast_yyfree((
void *) b ,yyscanner );
1756 extern int isatty (
int );
1763 static void ast_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
1771 b->yy_input_file = file;
1772 b->yy_fill_buffer = 1;
1778 if (b != YY_CURRENT_BUFFER){
1783 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1804 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1805 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1807 b->yy_buf_pos = &b->yy_ch_buf[0];
1810 b->yy_buffer_status = YY_BUFFER_NEW;
1812 if ( b == YY_CURRENT_BUFFER )
1813 ast_yy_load_buffer_state(yyscanner );
1825 if (new_buffer == NULL)
1828 ast_yyensure_buffer_stack(yyscanner);
1831 if ( YY_CURRENT_BUFFER )
1834 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1835 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1836 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1840 if (YY_CURRENT_BUFFER)
1842 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1845 ast_yy_load_buffer_state(yyscanner );
1846 yyg->yy_did_buffer_switch_on_eof = 1;
1856 if (!YY_CURRENT_BUFFER)
1860 YY_CURRENT_BUFFER_LVALUE = NULL;
1864 if (YY_CURRENT_BUFFER) {
1865 ast_yy_load_buffer_state(yyscanner );
1866 yyg->yy_did_buffer_switch_on_eof = 1;
1873 static void ast_yyensure_buffer_stack (yyscan_t yyscanner)
1889 YY_FATAL_ERROR(
"out of dynamic memory in ast_yyensure_buffer_stack()" );
1909 YY_FATAL_ERROR(
"out of dynamic memory in ast_yyensure_buffer_stack()" );
1928 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1929 base[size-1] != YY_END_OF_BUFFER_CHAR )
1933 b = (YY_BUFFER_STATE) ast_yyalloc(
sizeof(
struct yy_buffer_state ) ,yyscanner );
1935 YY_FATAL_ERROR(
"out of dynamic memory in ast_yy_scan_buffer()" );
1937 b->yy_buf_size = size - 2;
1938 b->yy_buf_pos = b->yy_ch_buf = base;
1939 b->yy_is_our_buffer = 0;
1940 b->yy_input_file = 0;
1941 b->yy_n_chars = b->yy_buf_size;
1942 b->yy_is_interactive = 0;
1944 b->yy_fill_buffer = 0;
1945 b->yy_buffer_status = YY_BUFFER_NEW;
1981 n = _yybytes_len + 2;
1982 buf = (
char *) ast_yyalloc(n ,yyscanner );
1984 YY_FATAL_ERROR(
"out of dynamic memory in ast_yy_scan_bytes()" );
1986 for ( i = 0; i < _yybytes_len; ++i )
1987 buf[i] = yybytes[i];
1989 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1993 YY_FATAL_ERROR(
"bad buffer in ast_yy_scan_bytes()" );
1998 b->yy_is_our_buffer = 1;
2003 #ifndef YY_EXIT_FAILURE
2004 #define YY_EXIT_FAILURE 2
2007 static void yy_fatal_error (yyconst
char* msg , yyscan_t yyscanner)
2009 (void) fprintf( stderr,
"%s\n", msg );
2010 exit( YY_EXIT_FAILURE );
2020 int yyless_macro_arg = (n); \
2021 YY_LESS_LINENO(yyless_macro_arg);\
2022 yytext[yyleng] = yyg->yy_hold_char; \
2023 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2024 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2025 *yyg->yy_c_buf_p = '\0'; \
2026 yyleng = yyless_macro_arg; \
2048 if (! YY_CURRENT_BUFFER)
2061 if (! YY_CURRENT_BUFFER)
2111 yyextra = user_defined ;
2123 if (! YY_CURRENT_BUFFER )
2124 yy_fatal_error(
"ast_yyset_lineno called with no buffer" , yyscanner);
2126 yylineno = line_number;
2138 if (! YY_CURRENT_BUFFER )
2139 yy_fatal_error(
"ast_yyset_column called with no buffer" , yyscanner);
2141 yycolumn = column_no;
2156 void ast_yyset_out (FILE * out_str , yyscan_t yyscanner)
2162 int ast_yyget_debug (yyscan_t yyscanner)
2165 return yy_flex_debug;
2168 void ast_yyset_debug (
int bdebug , yyscan_t yyscanner)
2171 yy_flex_debug = bdebug ;
2176 YYSTYPE * ast_yyget_lval (yyscan_t yyscanner)
2182 void ast_yyset_lval (
YYSTYPE * yylval_param , yyscan_t yyscanner)
2185 yylval = yylval_param;
2188 YYLTYPE *ast_yyget_lloc (yyscan_t yyscanner)
2194 void ast_yyset_lloc (
YYLTYPE * yylloc_param , yyscan_t yyscanner)
2197 yylloc = yylloc_param;
2207 int ast_yylex_init(yyscan_t* ptr_yy_globals)
2210 if (ptr_yy_globals == NULL){
2215 *ptr_yy_globals = (yyscan_t) ast_yyalloc (
sizeof(
struct yyguts_t ), NULL );
2217 if (*ptr_yy_globals == NULL){
2223 memset(*ptr_yy_globals,0x00,
sizeof(
struct yyguts_t));
2225 return yy_init_globals ( *ptr_yy_globals );
2236 int ast_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
2243 if (ptr_yy_globals == NULL){
2248 *ptr_yy_globals = (yyscan_t) ast_yyalloc (
sizeof(
struct yyguts_t ), &dummy_yyguts );
2250 if (*ptr_yy_globals == NULL){
2257 memset(*ptr_yy_globals,0x00,
sizeof(
struct yyguts_t));
2261 return yy_init_globals ( *ptr_yy_globals );
2264 static int yy_init_globals (yyscan_t yyscanner)
2274 yyg->yy_c_buf_p = (
char *) 0;
2278 yyg->yy_start_stack_ptr = 0;
2279 yyg->yy_start_stack_depth = 0;
2280 yyg->yy_start_stack = NULL;
2298 int ast_yylex_destroy (yyscan_t yyscanner)
2303 while(YY_CURRENT_BUFFER){
2305 YY_CURRENT_BUFFER_LVALUE = NULL;
2314 ast_yyfree(yyg->yy_start_stack ,yyscanner );
2315 yyg->yy_start_stack = NULL;
2319 yy_init_globals( yyscanner);
2322 ast_yyfree ( yyscanner , yyscanner );
2332 static void yy_flex_strncpy (
char* s1, yyconst
char * s2,
int n , yyscan_t yyscanner)
2335 for ( i = 0; i < n; ++i )
2340 #ifdef YY_NEED_STRLEN
2341 static int yy_flex_strlen (yyconst
char * s , yyscan_t yyscanner)
2344 for ( n = 0; s[n]; ++n )
2351 void *ast_yyalloc (yy_size_t size , yyscan_t yyscanner)
2353 return (
void *) malloc( size );
2356 void *ast_yyrealloc (
void * ptr, yy_size_t size , yyscan_t yyscanner)
2365 return (
void *) realloc( (
char *) ptr, size );
2368 #define YYTABLES_NAME "yytables"
2370 #line 236 "ast_expr2.fl"
2380 int ast_yyparse(
void *);
2383 void ast_yyfree(
void *ptr, yyscan_t yyscanner)
2388 free( (
char *) ptr );
2393 struct parse_io io = { .string = expr, .chan = chan };
2394 int return_value = 0;
2396 ast_yylex_init(&io.scanner);
2400 ast_yyparse ((
void *) &io);
2402 ast_yylex_destroy(io.scanner);
2410 if (io.val->type == AST_EXPR_number) {
2413 res_length = snprintf(buf, length, FP___PRINTF, io.val->u.i);
2414 return_value = (res_length <= length) ? res_length : length;
2417 #if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE)
2418 strncpy(buf, io.val->u.s, length - 1);
2424 return_value = strlen(buf);
2429 return return_value;
2435 struct parse_io io = { .string = expr, .chan = chan };
2437 ast_yylex_init(&io.scanner);
2439 ast_yyparse ((
void *) &io);
2440 ast_yylex_destroy(io.scanner);
2445 if (io.val->type == AST_EXPR_number) {
2446 ast_str_set(str, maxlen, FP___PRINTF, io.val->u.i);
2447 }
else if (io.val->u.s) {
2458 char extra_error_message[4095];
2459 int extra_error_message_supplied = 0;
2460 void ast_expr_register_extra_error_info(
char *
message);
2461 void ast_expr_clear_extra_error_info(
void);
2463 void ast_expr_register_extra_error_info(
char *
message)
2465 extra_error_message_supplied=1;
2466 strcpy(extra_error_message, message);
2469 void ast_expr_clear_extra_error_info(
void)
2471 extra_error_message_supplied=0;
2472 extra_error_message[0] = 0;
2475 static const char *
const expr2_token_equivs1[] =
2501 static const char *
const expr2_token_equivs2[] =
2528 static char *expr2_token_subst(
const char *mess)
2535 int expr2_token_equivs_entries =
sizeof(expr2_token_equivs1)/
sizeof(
char*);
2537 for (p=mess; *p; p++) {
2538 for (i=0; i<expr2_token_equivs_entries; i++) {
2539 if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 )
2541 len+=strlen(expr2_token_equivs2[i])+2;
2542 p += strlen(expr2_token_equivs1[i])-1;
2548 res = (
char*)malloc(len+1);
2553 for (i=0; i<expr2_token_equivs_entries; i++) {
2554 if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 ) {
2556 for (t=expr2_token_equivs2[i]; *t;) {
2560 p += strlen(expr2_token_equivs1[i]);
2572 int ast_yyerror (
const char *s,
yyltype *loc,
struct parse_io *parseio )
2575 char spacebuf[8000];
2577 char *s2 = expr2_token_subst(s);
2580 for (i = 0; i < (int)(yytext - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf); i++) {
2595 spacebuf[i++] =
'^';
2600 printf(
"ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n",
2601 (extra_error_message_supplied ? extra_error_message :
""), s2, parseio->string, spacebuf);
2603 ast_log(LOG_WARNING,
"ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n",
2604 (extra_error_message_supplied ? extra_error_message :
""), s2, parseio->string, spacebuf);
2607 ast_log(LOG_WARNING,
"If you have questions, please refer to https://docs.asterisk.org/Configuration/Dialplan/Variables/Channel-Variables/\n");
YY_BUFFER_STATE ast_yy_scan_bytes(yyconst char *bytes, int len, yyscan_t yyscanner)
Main Channel structure associated with a channel.
Asterisk main include file. File version handling, generic pbx functions.
int ast_str_expr(struct ast_str **str, ssize_t maxlen, struct ast_channel *chan, char *expr)
Evaluate the given expression.
String manipulation functions.
int ast_expr(char *expr, char *buf, int length, struct ast_channel *chan)
Evaluate the given expression.
char * ast_yyget_text(yyscan_t yyscanner)
YY_BUFFER_STATE ast_yy_scan_buffer(char *base, yy_size_t size, yyscan_t yyscanner)
void ast_yy_switch_to_buffer(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner)
YY_BUFFER_STATE ast_yy_create_buffer(FILE *file, int size, yyscan_t yyscanner)
void ast_yy_delete_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner)
YY_BUFFER_STATE * yy_buffer_stack
FILE * ast_yyget_out(yyscan_t yyscanner)
int ast_str_set(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Set a dynamic string using variable arguments.
void ast_yypop_buffer_state(yyscan_t yyscanner)
YY_EXTRA_TYPE ast_yyget_extra(yyscan_t yyscanner)
FILE * ast_yyget_in(yyscan_t yyscanner)
General Asterisk PBX channel definitions.
int ast_yyget_lineno(yyscan_t yyscanner)
void ast_yy_flush_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner)
void ast_yyset_column(int column_no, yyscan_t yyscanner)
void ast_yyrestart(FILE *input_file, yyscan_t yyscanner)
void ast_yyset_extra(YY_EXTRA_TYPE user_defined, yyscan_t yyscanner)
Support for dynamic strings.
int ast_yyget_column(yyscan_t yyscanner)
Support for logging to various files, console and syslog Configuration in file logger.conf.
void ast_yyset_lineno(int line_number, yyscan_t yyscanner)
size_t ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
void ast_yypush_buffer_state(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner)
void ast_yyset_in(FILE *in_str, yyscan_t yyscanner)
YY_BUFFER_STATE ast_yy_scan_string(yyconst char *yy_str, yyscan_t yyscanner)
int ast_yyget_leng(yyscan_t yyscanner)
size_t yy_buffer_stack_max
size_t yy_buffer_stack_top