Dialplan Expression Lexical Scanner. More...
#include "asterisk.h"
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/types.h>
#include <locale.h>
#include <ctype.h>
#include <regex.h>
#include <limits.h>
#include "asterisk/ast_expr.h"
#include "asterisk/logger.h"
#include "asterisk/strings.h"
#include "asterisk/channel.h"
#include "ast_expr2.h"
#include <unistd.h>
Go to the source code of this file.
Data Structures | |
struct | parse_io |
struct | val |
struct | yy_buffer_state |
struct | yy_trans_info |
struct | yyguts_t |
Defines | |
#define | ast_yywrap(n) 1 |
#define | BEGIN yyg->yy_start = 1 + 2 * |
#define | ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) |
#define | EOB_ACT_CONTINUE_SCAN 0 |
#define | EOB_ACT_END_OF_FILE 1 |
#define | EOB_ACT_LAST_MATCH 2 |
#define | FLEX_BETA |
#define | FLEX_SCANNER |
#define | FP___FMOD fmod |
#define | FP___PRINTF "%.16g" |
#define | FP___STRTOD strtod |
#define | FP___TYPE double |
#define | INITIAL 0 |
#define | INT16_MAX (32767) |
#define | INT16_MIN (-32767-1) |
#define | INT32_MAX (2147483647) |
#define | INT32_MIN (-2147483647-1) |
#define | INT8_MAX (127) |
#define | INT8_MIN (-128) |
#define | REJECT reject_used_but_not_detected |
#define | SET_COLUMNS |
#define | SET_NUMERIC_STRING |
#define | SET_STRING |
#define | trail 2 |
#define | UINT16_MAX (65535U) |
#define | UINT32_MAX (4294967295U) |
#define | UINT8_MAX (255U) |
#define | unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) |
#define | var 1 |
#define | YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) |
#define | YY_BREAK break; |
#define | YY_BUF_SIZE 16384 |
#define | YY_BUFFER_EOF_PENDING 2 |
#define | YY_BUFFER_NEW 0 |
#define | YY_BUFFER_NORMAL 1 |
#define | YY_CURRENT_BUFFER |
#define | YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] |
#define | YY_DECL |
#define | YY_DECL_IS_OURS 1 |
#define | YY_DO_BEFORE_ACTION |
#define | YY_END_OF_BUFFER 39 |
#define | YY_END_OF_BUFFER_CHAR 0 |
#define | YY_EXIT_FAILURE 2 |
#define | YY_EXTRA_TYPE void * |
#define | YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) |
#define | yy_flex_debug yyg->yy_flex_debug_r |
#define | YY_FLEX_MAJOR_VERSION 2 |
#define | YY_FLEX_MINOR_VERSION 5 |
#define | YY_FLEX_SUBMINOR_VERSION 35 |
#define | YY_FLUSH_BUFFER ast_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner) |
#define | YY_INPUT(buf, result, max_size) |
#define | YY_INT_ALIGNED short int |
#define | YY_LESS_LINENO(n) |
#define | YY_MORE_ADJ yyg->yy_more_len |
#define | yy_new_buffer ast_yy_create_buffer |
#define | YY_NEW_FILE ast_yyrestart(yyin ,yyscanner ) |
#define | YY_NULL 0 |
#define | YY_NUM_RULES 38 |
#define | YY_READ_BUF_SIZE 8192 |
#define | YY_RESTORE_YY_MORE_OFFSET |
#define | YY_RULE_SETUP YY_USER_ACTION |
#define | YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) |
#define | yy_set_bol(at_bol) |
#define | yy_set_interactive(is_interactive) |
#define | YY_SKIP_YYWRAP |
#define | YY_START ((yyg->yy_start - 1) / 2) |
#define | YY_START_STACK_INCR 25 |
#define | YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) |
#define | YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) |
#define | yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) |
#define | yyconst |
#define | yyextra yyg->yyextra_r |
#define | yyin yyg->yyin_r |
#define | yyleng yyg->yyleng_r |
#define | yyless(n) |
#define | yyless(n) |
#define | yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) |
#define | yylloc yyg->yylloc_r |
#define | yylval yyg->yylval_r |
#define | yymore() (yyg->yy_more_flag = 1) |
#define | yyout yyg->yyout_r |
#define | YYSTATE YY_START |
#define | YYTABLES_NAME "yytables" |
#define | yyterminate() return YY_NULL |
#define | yytext yyg->yytext_r |
#define | yytext_ptr yytext_r |
Typedefs | |
typedef short int | flex_int16_t |
typedef int | flex_int32_t |
typedef signed char | flex_int8_t |
typedef unsigned short int | flex_uint16_t |
typedef unsigned int | flex_uint32_t |
typedef unsigned char | flex_uint8_t |
typedef struct yy_buffer_state * | YY_BUFFER_STATE |
typedef unsigned char | YY_CHAR |
typedef size_t | yy_size_t |
typedef int | yy_state_type |
typedef void * | yyscan_t |
Enumerations | |
enum | valtype { AST_EXPR_number, AST_EXPR_numeric_string, AST_EXPR_string, AST_EXPR_number, AST_EXPR_numeric_string, AST_EXPR_string } |
Functions | |
int | ast_expr (char *expr, char *buf, int length, struct ast_channel *chan) |
Evaluate the given expression. | |
void | ast_expr_clear_extra_error_info (void) |
void | ast_expr_register_extra_error_info (char *message) |
int | ast_str_expr (struct ast_str **str, ssize_t maxlen, struct ast_channel *chan, char *expr) |
Evaluate the given expression. | |
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) |
void | ast_yy_flush_buffer (YY_BUFFER_STATE b, yyscan_t yyscanner) |
static void | ast_yy_init_buffer (YY_BUFFER_STATE b, FILE *file, yyscan_t yyscanner) |
static void | ast_yy_load_buffer_state (yyscan_t yyscanner) |
YY_BUFFER_STATE | ast_yy_scan_buffer (char *base, yy_size_t size, yyscan_t yyscanner) |
YY_BUFFER_STATE | ast_yy_scan_bytes (yyconst char *bytes, int len, yyscan_t yyscanner) |
YY_BUFFER_STATE | ast_yy_scan_string (yyconst char *yy_str, yyscan_t yyscanner) |
void | ast_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer, yyscan_t yyscanner) |
void * | ast_yyalloc (yy_size_t, yyscan_t yyscanner) |
static void | ast_yyensure_buffer_stack (yyscan_t yyscanner) |
int | ast_yyerror (const char *s, yyltype *loc, struct parse_io *parseio) |
int | ast_yyerror (const char *, YYLTYPE *, struct parse_io *) |
void | ast_yyfree (void *, yyscan_t yyscanner) |
int | ast_yyget_column (yyscan_t yyscanner) |
int | ast_yyget_debug (yyscan_t yyscanner) |
YY_EXTRA_TYPE | ast_yyget_extra (yyscan_t yyscanner) |
FILE * | ast_yyget_in (yyscan_t yyscanner) |
int | ast_yyget_leng (yyscan_t yyscanner) |
int | ast_yyget_lineno (yyscan_t yyscanner) |
YYLTYPE * | ast_yyget_lloc (yyscan_t yyscanner) |
YYSTYPE * | ast_yyget_lval (yyscan_t yyscanner) |
FILE * | ast_yyget_out (yyscan_t yyscanner) |
char * | ast_yyget_text (yyscan_t yyscanner) |
int | ast_yylex (YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner) |
int | ast_yylex_destroy (yyscan_t yyscanner) |
int | ast_yylex_init (yyscan_t *scanner) |
int | ast_yylex_init_extra (YY_EXTRA_TYPE user_defined, yyscan_t *scanner) |
int | ast_yyparse (void *) |
void | ast_yypop_buffer_state (yyscan_t yyscanner) |
void | ast_yypush_buffer_state (YY_BUFFER_STATE new_buffer, yyscan_t yyscanner) |
void * | ast_yyrealloc (void *, yy_size_t, yyscan_t yyscanner) |
void | ast_yyrestart (FILE *input_file, yyscan_t yyscanner) |
void | ast_yyset_column (int column_no, yyscan_t yyscanner) |
void | ast_yyset_debug (int debug_flag, yyscan_t yyscanner) |
void | ast_yyset_extra (YY_EXTRA_TYPE user_defined, yyscan_t yyscanner) |
void | ast_yyset_in (FILE *in_str, yyscan_t yyscanner) |
void | ast_yyset_lineno (int line_number, yyscan_t yyscanner) |
void | ast_yyset_lloc (YYLTYPE *yylloc_param, yyscan_t yyscanner) |
void | ast_yyset_lval (YYSTYPE *yylval_param, yyscan_t yyscanner) |
void | ast_yyset_out (FILE *out_str, yyscan_t yyscanner) |
static char * | expr2_token_subst (const char *mess) |
static int | input (yyscan_t yyscanner) |
static void | yy_fatal_error (yyconst char *msg, yyscan_t yyscanner) |
static void | yy_fatal_error (yyconst char msg[], yyscan_t yyscanner) |
static int | yy_get_next_buffer (yyscan_t yyscanner) |
static yy_state_type | yy_get_previous_state (yyscan_t yyscanner) |
static int | yy_init_globals (yyscan_t yyscanner) |
static yy_state_type | yy_try_NUL_trans (yy_state_type current_state, yyscan_t yyscanner) |
static void | yyunput (int c, char *buf_ptr, yyscan_t yyscanner) |
Variables | |
static int | curlycount = 0 |
static const char *const | expr2_token_equivs1 [] |
static const char *const | expr2_token_equivs2 [] |
char | extra_error_message [4095] |
int | extra_error_message_supplied = 0 |
static yyconst flex_int16_t | yy_accept [63] |
static yyconst flex_int16_t | yy_base [70] |
static yyconst flex_int16_t | yy_chk [159] |
static yyconst flex_int16_t | yy_def [70] |
static yyconst flex_int32_t | yy_ec [256] |
static yyconst flex_int32_t | yy_meta [29] |
static yyconst flex_int16_t | yy_nxt [159] |
Dialplan Expression Lexical Scanner.
Definition in file ast_expr2f.c.
#define ast_yywrap | ( | n | ) | 1 |
Definition at line 330 of file ast_expr2f.c.
#define BEGIN yyg->yy_start = 1 + 2 * |
Definition at line 144 of file ast_expr2f.c.
#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) |
Definition at line 555 of file ast_expr2f.c.
Referenced by ast_hide_password(), and ast_restore_tty().
#define EOB_ACT_CONTINUE_SCAN 0 |
Definition at line 175 of file ast_expr2f.c.
#define EOB_ACT_END_OF_FILE 1 |
Definition at line 176 of file ast_expr2f.c.
#define EOB_ACT_LAST_MATCH 2 |
Definition at line 177 of file ast_expr2f.c.
#define FLEX_BETA |
Definition at line 16 of file ast_expr2f.c.
#define FLEX_SCANNER |
Definition at line 11 of file ast_expr2f.c.
#define FP___FMOD fmod |
Definition at line 528 of file ast_expr2f.c.
#define FP___PRINTF "%.16g" |
Definition at line 527 of file ast_expr2f.c.
#define FP___STRTOD strtod |
Definition at line 529 of file ast_expr2f.c.
#define FP___TYPE double |
Definition at line 530 of file ast_expr2f.c.
#define INITIAL 0 |
Definition at line 605 of file ast_expr2f.c.
#define INT16_MAX (32767) |
Definition at line 75 of file ast_expr2f.c.
Referenced by fsaturate().
#define INT16_MIN (-32767-1) |
Definition at line 66 of file ast_expr2f.c.
Referenced by fsaturate().
#define INT32_MAX (2147483647) |
Definition at line 78 of file ast_expr2f.c.
Referenced by ast_parse_arg().
#define INT32_MIN (-2147483647-1) |
Definition at line 69 of file ast_expr2f.c.
Referenced by ast_parse_arg().
#define INT8_MAX (127) |
Definition at line 72 of file ast_expr2f.c.
#define INT8_MIN (-128) |
Definition at line 63 of file ast_expr2f.c.
#define REJECT reject_used_but_not_detected |
Definition at line 481 of file ast_expr2f.c.
#define SET_COLUMNS |
do { \ yylloc_param->first_column = (int)(yyg->yytext_r - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf); \ yylloc_param->last_column += yyleng - 1; \ yylloc_param->first_line = yylloc_param->last_line = 1; \ } while (0)
Definition at line 572 of file ast_expr2f.c.
#define SET_NUMERIC_STRING |
do { \ yylval_param->val = calloc(1, sizeof(struct val)); \ yylval_param->val->type = AST_EXPR_numeric_string; \ yylval_param->val->u.s = strdup(yytext); \ } while (0)
Definition at line 584 of file ast_expr2f.c.
#define SET_STRING |
do { \ yylval_param->val = calloc(1, sizeof(struct val)); \ yylval_param->val->type = AST_EXPR_string; \ yylval_param->val->u.s = strdup(yytext); \ } while (0)
Definition at line 578 of file ast_expr2f.c.
#define trail 2 |
Definition at line 607 of file ast_expr2f.c.
#define UINT16_MAX (65535U) |
Definition at line 84 of file ast_expr2f.c.
#define UINT32_MAX (4294967295U) |
Definition at line 87 of file ast_expr2f.c.
Referenced by ast_parse_arg().
#define UINT8_MAX (255U) |
Definition at line 81 of file ast_expr2f.c.
#define unput | ( | c | ) | yyunput( c, yyg->yytext_ptr , yyscanner ) |
Definition at line 195 of file ast_expr2f.c.
#define var 1 |
Definition at line 606 of file ast_expr2f.c.
Referenced by __init_manager(), acf_iaxvar_read(), acf_iaxvar_write(), acf_sprintf(), add_cfg_entry(), add_rt_cfg_entry(), add_rt_multi_cfg_entry(), add_user_extension(), aji_load_config(), append_channel_vars(), apply_options(), apply_outgoing(), ast_bridge_timelimit(), ast_cdr_copy_vars(), ast_cdr_data_add_structure(), ast_cdr_serialize_variables(), ast_channeltype_list(), ast_config_text_file_save(), ast_http_get_post_vars(), ast_iax2_new(), ast_plc_reload(), ast_var_assign(), authenticate_reply(), build_event_channel(), build_extension(), build_profile(), clearvar_prefix(), cli_realtime_load(), conf_exec(), conf_run(), config_module(), console_cmd(), crement_function_read(), delete_extension(), find_conf(), find_conf_realtime(), find_realtime(), find_user_realtime(), free_channelvars(), function_realtime_read(), function_realtime_readdestroy(), get_insecure_variable_from_config(), get_insecure_variable_from_sippeers(), global_read(), gtalk_load_config(), handle_updates(), handle_uri(), handle_verbose(), http_post_callback(), iax2_call(), iax_parse_ies(), inherit_category(), init_logger_chain(), jingle_load_config(), ldap_loadentry(), ldap_table_config_add_attribute(), leave_queue(), load_config(), load_moh_classes(), local_ast_moh_start(), man_do_variable_value(), manager_sipnotify(), meetme_menu_admin_extended(), minivm_account_func_read(), move_variables(), odbc_load_module(), osp_create_provider(), parse_config(), parse_cookies(), pbx_builtin_serialize_variables(), pbx_extension_helper(), pbx_substitute_variables_helper_full(), phoneprov_callback(), prep_email_sub_vars(), process_config(), process_text_line(), profile_destructor(), queue_function_queuewaitingcount(), realtime_alias(), realtime_common(), realtime_curl(), realtime_directory(), realtime_ldap(), realtime_ldap_entry_to_var(), realtime_ldap_result_to_vars(), realtime_multi_curl(), realtime_multi_ldap(), realtime_multi_odbc(), realtime_multi_pgsql(), realtime_odbc(), realtime_peer(), realtime_peer_get_sippeer_helper(), realtime_pgsql(), realtime_switch_common(), realtime_user(), realtimefield_read(), reload(), reload_followme(), reload_module(), reload_single_queue(), rt_extend_conf(), run_agi(), set_config(), set_timezone_variables(), shared_read(), shared_variable_free(), shared_write(), shift_pop(), sip_cli_notify(), sla_build_station(), sla_build_trunk(), socket_process(), transmit_invite(), unload_module(), unshift_push(), vm_change_password(), and xml_translate().
#define YY_AT_BOL | ( | ) | (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) |
Definition at line 326 of file ast_expr2f.c.
#define YY_BREAK break; |
Definition at line 835 of file ast_expr2f.c.
#define YY_BUF_SIZE 16384 |
Definition at line 163 of file ast_expr2f.c.
#define YY_BUFFER_EOF_PENDING 2 |
Definition at line 262 of file ast_expr2f.c.
#define YY_BUFFER_NEW 0 |
Definition at line 250 of file ast_expr2f.c.
Referenced by ast_yy_flush_buffer(), and ast_yy_scan_buffer().
#define YY_BUFFER_NORMAL 1 |
Definition at line 251 of file ast_expr2f.c.
#define YY_CURRENT_BUFFER |
( yyg->yy_buffer_stack \ ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ : NULL)
Definition at line 273 of file ast_expr2f.c.
Referenced by ast_yy_flush_buffer(), ast_yy_init_buffer(), ast_yyget_column(), ast_yyget_lineno(), ast_yylex_destroy(), ast_yypop_buffer_state(), ast_yypush_buffer_state(), ast_yyset_column(), and ast_yyset_lineno().
#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] |
Definition at line 280 of file ast_expr2f.c.
Referenced by ast_yyerror(), ast_yylex_destroy(), ast_yypop_buffer_state(), and ast_yypush_buffer_state().
#define YY_DECL |
#define YY_DECL_IS_OURS 1 |
Definition at line 817 of file ast_expr2f.c.
#define YY_DO_BEFORE_ACTION |
Definition at line 347 of file ast_expr2f.c.
#define YY_END_OF_BUFFER 39 |
Definition at line 356 of file ast_expr2f.c.
#define YY_END_OF_BUFFER_CHAR 0 |
Definition at line 159 of file ast_expr2f.c.
Referenced by ast_yy_flush_buffer(), ast_yy_scan_buffer(), and ast_yy_scan_bytes().
#define YY_EXIT_FAILURE 2 |
Definition at line 2009 of file ast_expr2f.c.
Referenced by yy_fatal_error().
#define YY_EXTRA_TYPE void * |
Definition at line 618 of file ast_expr2f.c.
#define YY_FATAL_ERROR | ( | msg | ) | yy_fatal_error( msg , yyscanner) |
Definition at line 808 of file ast_expr2f.c.
Referenced by ast_yy_scan_buffer(), ast_yy_scan_bytes(), and ast_yyensure_buffer_stack().
#define yy_flex_debug yyg->yy_flex_debug_r |
Definition at line 138 of file ast_expr2f.c.
Referenced by ast_yyget_debug(), and ast_yyset_debug().
#define YY_FLEX_MAJOR_VERSION 2 |
Definition at line 12 of file ast_expr2f.c.
#define YY_FLEX_MINOR_VERSION 5 |
Definition at line 13 of file ast_expr2f.c.
#define YY_FLEX_SUBMINOR_VERSION 35 |
Definition at line 14 of file ast_expr2f.c.
#define YY_FLUSH_BUFFER ast_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner) |
Definition at line 294 of file ast_expr2f.c.
#define YY_INPUT | ( | buf, | |||
result, | |||||
max_size | ) |
Definition at line 761 of file ast_expr2f.c.
#define YY_INT_ALIGNED short int |
Definition at line 7 of file ast_expr2f.c.
#define YY_LESS_LINENO | ( | n | ) |
Definition at line 179 of file ast_expr2f.c.
#define YY_MORE_ADJ yyg->yy_more_len |
Definition at line 483 of file ast_expr2f.c.
#define yy_new_buffer ast_yy_create_buffer |
Definition at line 304 of file ast_expr2f.c.
#define YY_NEW_FILE ast_yyrestart(yyin ,yyscanner ) |
Definition at line 157 of file ast_expr2f.c.
#define YY_NULL 0 |
Definition at line 114 of file ast_expr2f.c.
#define YY_NUM_RULES 38 |
Definition at line 355 of file ast_expr2f.c.
#define YY_READ_BUF_SIZE 8192 |
Definition at line 746 of file ast_expr2f.c.
#define YY_RESTORE_YY_MORE_OFFSET |
Definition at line 484 of file ast_expr2f.c.
#define YY_RULE_SETUP YY_USER_ACTION |
Definition at line 838 of file ast_expr2f.c.
#define YY_SC_TO_UI | ( | c | ) | ((unsigned int) (unsigned char) c) |
Definition at line 121 of file ast_expr2f.c.
#define yy_set_bol | ( | at_bol | ) |
Definition at line 316 of file ast_expr2f.c.
#define yy_set_interactive | ( | is_interactive | ) |
Definition at line 306 of file ast_expr2f.c.
#define YY_SKIP_YYWRAP |
Definition at line 331 of file ast_expr2f.c.
#define YY_START ((yyg->yy_start - 1) / 2) |
Definition at line 150 of file ast_expr2f.c.
#define YY_START_STACK_INCR 25 |
Definition at line 803 of file ast_expr2f.c.
#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) |
Definition at line 168 of file ast_expr2f.c.
Definition at line 154 of file ast_expr2f.c.
#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) |
Definition at line 137 of file ast_expr2f.c.
Referenced by ast_yyget_column(), and ast_yyset_column().
#define yyconst |
Definition at line 110 of file ast_expr2f.c.
#define yyextra yyg->yyextra_r |
Definition at line 133 of file ast_expr2f.c.
Referenced by ast_yyget_extra(), and ast_yyset_extra().
#define yyin yyg->yyin_r |
Definition at line 131 of file ast_expr2f.c.
Referenced by ast_yyget_in(), ast_yyset_in(), and yy_init_globals().
#define yyleng yyg->yyleng_r |
Definition at line 134 of file ast_expr2f.c.
Referenced by ast_yyget_leng().
#define yyless | ( | n | ) |
Definition at line 2021 of file ast_expr2f.c.
#define yyless | ( | n | ) |
Definition at line 2021 of file ast_expr2f.c.
#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) |
Definition at line 136 of file ast_expr2f.c.
Referenced by ast_yyget_lineno(), and ast_yyset_lineno().
#define yylloc yyg->yylloc_r |
Definition at line 665 of file ast_expr2f.c.
#define yylval yyg->yylval_r |
Definition at line 663 of file ast_expr2f.c.
#define yymore | ( | ) | (yyg->yy_more_flag = 1) |
Definition at line 482 of file ast_expr2f.c.
#define yyout yyg->yyout_r |
Definition at line 132 of file ast_expr2f.c.
Referenced by ast_yyget_out(), ast_yyset_out(), and yy_init_globals().
#define YYSTATE YY_START |
Definition at line 151 of file ast_expr2f.c.
#define YYTABLES_NAME "yytables" |
Definition at line 2373 of file ast_expr2f.c.
#define yyterminate | ( | ) | return YY_NULL |
Definition at line 798 of file ast_expr2f.c.
#define yytext yyg->yytext_r |
Definition at line 135 of file ast_expr2f.c.
Referenced by ast_yyerror(), and ast_yyget_text().
#define yytext_ptr yytext_r |
Definition at line 337 of file ast_expr2f.c.
typedef short int flex_int16_t |
Definition at line 54 of file ast_expr2f.c.
typedef int flex_int32_t |
Definition at line 55 of file ast_expr2f.c.
typedef signed char flex_int8_t |
Definition at line 53 of file ast_expr2f.c.
typedef unsigned short int flex_uint16_t |
Definition at line 57 of file ast_expr2f.c.
typedef unsigned int flex_uint32_t |
Definition at line 58 of file ast_expr2f.c.
typedef unsigned char flex_uint8_t |
Definition at line 56 of file ast_expr2f.c.
typedef struct yy_buffer_state* YY_BUFFER_STATE |
Definition at line 172 of file ast_expr2f.c.
typedef unsigned char YY_CHAR |
Definition at line 333 of file ast_expr2f.c.
typedef size_t yy_size_t |
Definition at line 199 of file ast_expr2f.c.
typedef int yy_state_type |
Definition at line 335 of file ast_expr2f.c.
typedef void* yyscan_t |
Definition at line 126 of file ast_expr2f.c.
enum valtype |
AST_EXPR_number | |
AST_EXPR_numeric_string | |
AST_EXPR_string | |
AST_EXPR_number | |
AST_EXPR_numeric_string | |
AST_EXPR_string |
Definition at line 558 of file ast_expr2f.c.
00558 { 00559 AST_EXPR_number, AST_EXPR_numeric_string, AST_EXPR_string 00560 } ;
int ast_expr | ( | char * | expr, | |
char * | buf, | |||
int | length, | |||
struct ast_channel * | chan | |||
) |
Evaluate the given expression.
expr | An expression | |
buf | Result buffer | |
length | Size of the result buffer, in bytes | |
chan | Channel to use for evaluating included dialplan functions, if any |
Definition at line 2396 of file ast_expr2f.c.
References ast_copy_string(), AST_EXPR_number, ast_yy_scan_string(), ast_yylex_destroy(), ast_yylex_init(), ast_yyparse(), FP___PRINTF, free, parse_io::scanner, and parse_io::string.
Referenced by check_pval_item(), and pbx_substitute_variables_helper_full().
02397 { 02398 struct parse_io io = { .string = expr, .chan = chan }; 02399 int return_value = 0; 02400 02401 ast_yylex_init(&io.scanner); 02402 02403 ast_yy_scan_string(expr, io.scanner); 02404 02405 ast_yyparse ((void *) &io); 02406 02407 ast_yylex_destroy(io.scanner); 02408 02409 if (!io.val) { 02410 if (length > 1) { 02411 strcpy(buf, "0"); 02412 return_value = 1; 02413 } 02414 } else { 02415 if (io.val->type == AST_EXPR_number) { 02416 int res_length; 02417 02418 res_length = snprintf(buf, length, FP___PRINTF, io.val->u.i); 02419 return_value = (res_length <= length) ? res_length : length; 02420 } else { 02421 if (io.val->u.s) 02422 #if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE) 02423 strncpy(buf, io.val->u.s, length - 1); 02424 #else /* !STANDALONE && !LOW_MEMORY */ 02425 ast_copy_string(buf, io.val->u.s, length); 02426 #endif /* STANDALONE || LOW_MEMORY */ 02427 else 02428 buf[0] = 0; 02429 return_value = strlen(buf); 02430 free(io.val->u.s); 02431 } 02432 free(io.val); 02433 } 02434 return return_value; 02435 }
void ast_expr_clear_extra_error_info | ( | void | ) |
Definition at line 2475 of file ast_expr2f.c.
Referenced by check_pval_item().
02476 { 02477 extra_error_message_supplied=0; 02478 extra_error_message[0] = 0; 02479 }
void ast_expr_register_extra_error_info | ( | char * | message | ) |
Definition at line 2469 of file ast_expr2f.c.
Referenced by check_pval_item().
02470 { 02471 extra_error_message_supplied=1; 02472 strcpy(extra_error_message, message); 02473 }
int ast_str_expr | ( | struct ast_str ** | str, | |
ssize_t | maxlen, | |||
struct ast_channel * | chan, | |||
char * | expr | |||
) |
Evaluate the given expression.
str | Dynamic result buffer | |
maxlen | <0 if the size of the buffer should remain constant, >0 if the size of the buffer should expand to that many bytes, maximum, or 0 for unlimited expansion of the result buffer | |
chan | Channel to use for evaluating included dialplan functions, if any | |
expr | An expression |
Definition at line 2438 of file ast_expr2f.c.
References AST_EXPR_number, ast_str_set(), ast_str_strlen(), ast_yy_scan_string(), ast_yylex_destroy(), ast_yylex_init(), ast_yyparse(), FP___PRINTF, free, parse_io::scanner, and parse_io::string.
Referenced by ast_str_substitute_variables_full().
02439 { 02440 struct parse_io io = { .string = expr, .chan = chan }; 02441 02442 ast_yylex_init(&io.scanner); 02443 ast_yy_scan_string(expr, io.scanner); 02444 ast_yyparse ((void *) &io); 02445 ast_yylex_destroy(io.scanner); 02446 02447 if (!io.val) { 02448 ast_str_set(str, maxlen, "0"); 02449 } else { 02450 if (io.val->type == AST_EXPR_number) { 02451 int res_length; 02452 ast_str_set(str, maxlen, FP___PRINTF, io.val->u.i); 02453 } else if (io.val->u.s) { 02454 ast_str_set(str, maxlen, "%s", io.val->u.s); 02455 free(io.val->u.s); 02456 } 02457 free(io.val); 02458 } 02459 return ast_str_strlen(*str); 02460 }
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 | |||
) |
Referenced by ast_yylex_destroy(), and ast_yypop_buffer_state().
void ast_yy_flush_buffer | ( | YY_BUFFER_STATE | b, | |
yyscan_t | yyscanner | |||
) |
Discard all buffered characters. On the next scan, YY_INPUT will be called.
b | the buffer state to be flushed, usually YY_CURRENT_BUFFER . | |
yyscanner | The scanner object. |
Definition at line 1797 of file ast_expr2f.c.
References ast_yy_load_buffer_state(), yy_buffer_state::yy_at_bol, yy_buffer_state::yy_buf_pos, YY_BUFFER_NEW, yy_buffer_state::yy_buffer_status, yy_buffer_state::yy_ch_buf, YY_CURRENT_BUFFER, YY_END_OF_BUFFER_CHAR, and yy_buffer_state::yy_n_chars.
Referenced by ast_yy_init_buffer().
01798 { 01799 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01800 if ( ! b ) 01801 return; 01802 01803 b->yy_n_chars = 0; 01804 01805 /* We always need two end-of-buffer characters. The first causes 01806 * a transition to the end-of-buffer state. The second causes 01807 * a jam in that state. 01808 */ 01809 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; 01810 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; 01811 01812 b->yy_buf_pos = &b->yy_ch_buf[0]; 01813 01814 b->yy_at_bol = 1; 01815 b->yy_buffer_status = YY_BUFFER_NEW; 01816 01817 if ( b == YY_CURRENT_BUFFER ) 01818 ast_yy_load_buffer_state(yyscanner ); 01819 }
static void ast_yy_init_buffer | ( | YY_BUFFER_STATE | b, | |
FILE * | file, | |||
yyscan_t | yyscanner | |||
) | [static] |
The main scanner function which does all the work.
Definition at line 1768 of file ast_expr2f.c.
References ast_yy_flush_buffer(), errno, yy_buffer_state::yy_bs_column, yy_buffer_state::yy_bs_lineno, YY_CURRENT_BUFFER, yy_buffer_state::yy_fill_buffer, yy_buffer_state::yy_input_file, and yy_buffer_state::yy_is_interactive.
01770 { 01771 int oerrno = errno; 01772 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01773 01774 ast_yy_flush_buffer(b ,yyscanner); 01775 01776 b->yy_input_file = file; 01777 b->yy_fill_buffer = 1; 01778 01779 /* If b is the current buffer, then ast_yy_init_buffer was _probably_ 01780 * called from ast_yyrestart() or through yy_get_next_buffer. 01781 * In that case, we don't want to reset the lineno or column. 01782 */ 01783 if (b != YY_CURRENT_BUFFER){ 01784 b->yy_bs_lineno = 1; 01785 b->yy_bs_column = 0; 01786 } 01787 01788 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; 01789 01790 errno = oerrno; 01791 }
static void ast_yy_load_buffer_state | ( | yyscan_t | yyscanner | ) | [static] |
Referenced by ast_yy_flush_buffer(), ast_yypop_buffer_state(), and ast_yypush_buffer_state().
YY_BUFFER_STATE ast_yy_scan_buffer | ( | char * | base, | |
yy_size_t | size, | |||
yyscan_t | yyscanner | |||
) |
Setup the input buffer state to scan directly from a user-specified character buffer.
base | the character buffer | |
size | the size in bytes of the character buffer | |
yyscanner | The scanner object. |
Definition at line 1928 of file ast_expr2f.c.
References ast_yy_switch_to_buffer(), ast_yyalloc(), yy_buffer_state::yy_at_bol, yy_buffer_state::yy_buf_pos, yy_buffer_state::yy_buf_size, YY_BUFFER_NEW, yy_buffer_state::yy_buffer_status, yy_buffer_state::yy_ch_buf, YY_END_OF_BUFFER_CHAR, YY_FATAL_ERROR, yy_buffer_state::yy_fill_buffer, yy_buffer_state::yy_input_file, yy_buffer_state::yy_is_interactive, yy_buffer_state::yy_is_our_buffer, and yy_buffer_state::yy_n_chars.
Referenced by ast_yy_scan_bytes().
01929 { 01930 YY_BUFFER_STATE b; 01931 01932 if ( size < 2 || 01933 base[size-2] != YY_END_OF_BUFFER_CHAR || 01934 base[size-1] != YY_END_OF_BUFFER_CHAR ) 01935 /* They forgot to leave room for the EOB's. */ 01936 return 0; 01937 01938 b = (YY_BUFFER_STATE) ast_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); 01939 if ( ! b ) 01940 YY_FATAL_ERROR( "out of dynamic memory in ast_yy_scan_buffer()" ); 01941 01942 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ 01943 b->yy_buf_pos = b->yy_ch_buf = base; 01944 b->yy_is_our_buffer = 0; 01945 b->yy_input_file = 0; 01946 b->yy_n_chars = b->yy_buf_size; 01947 b->yy_is_interactive = 0; 01948 b->yy_at_bol = 1; 01949 b->yy_fill_buffer = 0; 01950 b->yy_buffer_status = YY_BUFFER_NEW; 01951 01952 ast_yy_switch_to_buffer(b ,yyscanner ); 01953 01954 return b; 01955 }
YY_BUFFER_STATE ast_yy_scan_bytes | ( | yyconst char * | yybytes, | |
int | _yybytes_len, | |||
yyscan_t | yyscanner | |||
) |
Setup the input buffer state to scan the given bytes. The next call to ast_yylex() will scan from a copy of bytes.
bytes | the byte buffer to scan | |
len | the number of bytes in the buffer pointed to by bytes. | |
yyscanner | The scanner object. |
Definition at line 1978 of file ast_expr2f.c.
References ast_yy_scan_buffer(), ast_yyalloc(), YY_END_OF_BUFFER_CHAR, YY_FATAL_ERROR, and yy_buffer_state::yy_is_our_buffer.
Referenced by ast_yy_scan_string().
01979 { 01980 YY_BUFFER_STATE b; 01981 char *buf; 01982 yy_size_t n; 01983 int i; 01984 01985 /* Get memory for full buffer, including space for trailing EOB's. */ 01986 n = _yybytes_len + 2; 01987 buf = (char *) ast_yyalloc(n ,yyscanner ); 01988 if ( ! buf ) 01989 YY_FATAL_ERROR( "out of dynamic memory in ast_yy_scan_bytes()" ); 01990 01991 for ( i = 0; i < _yybytes_len; ++i ) 01992 buf[i] = yybytes[i]; 01993 01994 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; 01995 01996 b = ast_yy_scan_buffer(buf,n ,yyscanner); 01997 if ( ! b ) 01998 YY_FATAL_ERROR( "bad buffer in ast_yy_scan_bytes()" ); 01999 02000 /* It's okay to grow etc. this buffer, and we should throw it 02001 * away when we're done. 02002 */ 02003 b->yy_is_our_buffer = 1; 02004 02005 return b; 02006 }
YY_BUFFER_STATE ast_yy_scan_string | ( | yyconst char * | yystr, | |
yyscan_t | yyscanner | |||
) |
Setup the input buffer state to scan a string. The next call to ast_yylex() will scan from a copy of str.
yystr | a NUL-terminated string to scan | |
yyscanner | The scanner object. |
Definition at line 1965 of file ast_expr2f.c.
References ast_yy_scan_bytes().
Referenced by ast_expr(), and ast_str_expr().
01966 { 01967 01968 return ast_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner); 01969 }
void ast_yy_switch_to_buffer | ( | YY_BUFFER_STATE | new_buffer, | |
yyscan_t | yyscanner | |||
) |
Referenced by ast_yy_scan_buffer().
Definition at line 2356 of file ast_expr2f.c.
References malloc.
Referenced by ast_yy_scan_buffer(), ast_yy_scan_bytes(), ast_yyensure_buffer_stack(), ast_yylex_init(), and ast_yylex_init_extra().
02357 { 02358 return (void *) malloc( size ); 02359 }
static void ast_yyensure_buffer_stack | ( | yyscan_t | yyscanner | ) | [static] |
Definition at line 1878 of file ast_expr2f.c.
References ast_yyalloc(), ast_yyrealloc(), yyguts_t::yy_buffer_stack, yyguts_t::yy_buffer_stack_max, yyguts_t::yy_buffer_stack_top, and YY_FATAL_ERROR.
Referenced by ast_yypush_buffer_state().
01879 { 01880 int num_to_alloc; 01881 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01882 01883 if (!yyg->yy_buffer_stack) { 01884 01885 /* First allocation is just for 2 elements, since we don't know if this 01886 * scanner will even need a stack. We use 2 instead of 1 to avoid an 01887 * immediate realloc on the next call. 01888 */ 01889 num_to_alloc = 1; 01890 yyg->yy_buffer_stack = (struct yy_buffer_state**)ast_yyalloc 01891 (num_to_alloc * sizeof(struct yy_buffer_state*) 01892 , yyscanner); 01893 if ( ! yyg->yy_buffer_stack ) 01894 YY_FATAL_ERROR( "out of dynamic memory in ast_yyensure_buffer_stack()" ); 01895 01896 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); 01897 01898 yyg->yy_buffer_stack_max = num_to_alloc; 01899 yyg->yy_buffer_stack_top = 0; 01900 return; 01901 } 01902 01903 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ 01904 01905 /* Increase the buffer to prepare for a possible push. */ 01906 int grow_size = 8 /* arbitrary grow size */; 01907 01908 num_to_alloc = yyg->yy_buffer_stack_max + grow_size; 01909 yyg->yy_buffer_stack = (struct yy_buffer_state**)ast_yyrealloc 01910 (yyg->yy_buffer_stack, 01911 num_to_alloc * sizeof(struct yy_buffer_state*) 01912 , yyscanner); 01913 if ( ! yyg->yy_buffer_stack ) 01914 YY_FATAL_ERROR( "out of dynamic memory in ast_yyensure_buffer_stack()" ); 01915 01916 /* zero only the new slots.*/ 01917 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); 01918 yyg->yy_buffer_stack_max = num_to_alloc; 01919 } 01920 }
Definition at line 2578 of file ast_expr2f.c.
References ast_log(), expr2_token_subst(), free, LOG_WARNING, parse_io::scanner, parse_io::string, YY_CURRENT_BUFFER_LVALUE, and yytext.
02579 { 02580 struct yyguts_t * yyg = (struct yyguts_t*)(parseio->scanner); 02581 char spacebuf[8000]; /* best safe than sorry */ 02582 char spacebuf2[8000]; /* best safe than sorry */ 02583 int i=0; 02584 char *s2 = expr2_token_subst(s); 02585 spacebuf[0] = 0; 02586 02587 for(i=0;i< (int)(yytext - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);i++) spacebuf2[i] = ' '; /* uh... assuming yyg is defined, then I can use the yycolumn macro, 02588 which is the same thing as... get this: 02589 yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]->yy_bs_column 02590 I was tempted to just use yy_buf_pos in the STATE, but..., well: 02591 a. the yy_buf_pos is the current position in the buffer, which 02592 may not relate to the entire string/buffer because of the 02593 buffering. 02594 b. but, analysis of the situation is that when you use the 02595 ast_yy_scan_string func, it creates a single buffer the size of 02596 string, so the two would be the same... 02597 so, in the end, the yycolumn macro is available, shorter, therefore easier. */ 02598 spacebuf2[i++]='^'; 02599 spacebuf2[i]= 0; 02600 02601 #ifdef STANDALONE3 02602 /* easier to read in the standalone version */ 02603 printf("ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n", 02604 (extra_error_message_supplied?extra_error_message:""), s2, parseio->string,spacebuf2); 02605 #else 02606 ast_log(LOG_WARNING,"ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n", 02607 (extra_error_message_supplied?extra_error_message:""), s2, parseio->string,spacebuf2); 02608 #endif 02609 #ifndef STANDALONE 02610 ast_log(LOG_WARNING,"If you have questions, please refer to https://wiki.asterisk.org/wiki/display/AST/Channel+Variables\n"); 02611 #endif 02612 free(s2); 02613 return(0); 02614 }
int ast_yyerror | ( | const char * | , | |
YYLTYPE * | , | |||
struct parse_io * | ||||
) |
void ast_yyfree | ( | void * | ptr, | |
yyscan_t | yyscanner | |||
) |
Definition at line 2388 of file ast_expr2f.c.
References free.
Referenced by ast_yylex_destroy().
02389 { 02390 /* the normal generated ast_yyfree func just frees its first arg; 02391 this get complaints on some systems, as sometimes this 02392 arg is a nil ptr! It's usually not fatal, but is irritating! */ 02393 free( (char *) ptr ); 02394 }
int ast_yyget_column | ( | yyscan_t | yyscanner | ) |
Get the current column number.
yyscanner | The scanner object. |
Definition at line 2062 of file ast_expr2f.c.
References YY_CURRENT_BUFFER, and yycolumn.
02063 { 02064 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02065 02066 if (! YY_CURRENT_BUFFER) 02067 return 0; 02068 02069 return yycolumn; 02070 }
int ast_yyget_debug | ( | yyscan_t | yyscanner | ) |
Definition at line 2167 of file ast_expr2f.c.
References yy_flex_debug.
02168 { 02169 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02170 return yy_flex_debug; 02171 }
YY_EXTRA_TYPE ast_yyget_extra | ( | yyscan_t | yyscanner | ) |
FILE * ast_yyget_in | ( | yyscan_t | yyscanner | ) |
int ast_yyget_leng | ( | yyscan_t | yyscanner | ) |
int ast_yyget_lineno | ( | yyscan_t | yyscanner | ) |
Get the current line number.
yyscanner | The scanner object. |
Definition at line 2049 of file ast_expr2f.c.
References YY_CURRENT_BUFFER, and yylineno.
02050 { 02051 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02052 02053 if (! YY_CURRENT_BUFFER) 02054 return 0; 02055 02056 return yylineno; 02057 }
YYLTYPE * ast_yyget_lloc | ( | yyscan_t | yyscanner | ) |
FILE * ast_yyget_out | ( | yyscan_t | yyscanner | ) |
char * ast_yyget_text | ( | yyscan_t | yyscanner | ) |
int ast_yylex_destroy | ( | yyscan_t | yyscanner | ) |
Definition at line 2303 of file ast_expr2f.c.
References ast_yy_delete_buffer(), ast_yyfree(), ast_yypop_buffer_state(), yyguts_t::yy_buffer_stack, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yy_init_globals(), and yyguts_t::yy_start_stack.
Referenced by ast_expr(), and ast_str_expr().
02304 { 02305 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02306 02307 /* Pop the buffer stack, destroying each element. */ 02308 while(YY_CURRENT_BUFFER){ 02309 ast_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); 02310 YY_CURRENT_BUFFER_LVALUE = NULL; 02311 ast_yypop_buffer_state(yyscanner); 02312 } 02313 02314 /* Destroy the stack itself. */ 02315 ast_yyfree(yyg->yy_buffer_stack ,yyscanner); 02316 yyg->yy_buffer_stack = NULL; 02317 02318 /* Destroy the start condition stack. */ 02319 ast_yyfree(yyg->yy_start_stack ,yyscanner ); 02320 yyg->yy_start_stack = NULL; 02321 02322 /* Reset the globals. This is important in a non-reentrant scanner so the next time 02323 * ast_yylex() is called, initialization will occur. */ 02324 yy_init_globals( yyscanner); 02325 02326 /* Destroy the main struct (reentrant only). */ 02327 ast_yyfree ( yyscanner , yyscanner ); 02328 yyscanner = NULL; 02329 return 0; 02330 }
int ast_yylex_init | ( | yyscan_t * | scanner | ) |
Definition at line 2212 of file ast_expr2f.c.
References ast_yyalloc(), errno, and yy_init_globals().
Referenced by ast_expr(), and ast_str_expr().
02214 { 02215 if (ptr_yy_globals == NULL){ 02216 errno = EINVAL; 02217 return 1; 02218 } 02219 02220 *ptr_yy_globals = (yyscan_t) ast_yyalloc ( sizeof( struct yyguts_t ), NULL ); 02221 02222 if (*ptr_yy_globals == NULL){ 02223 errno = ENOMEM; 02224 return 1; 02225 } 02226 02227 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ 02228 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); 02229 02230 return yy_init_globals ( *ptr_yy_globals ); 02231 }
int ast_yylex_init_extra | ( | YY_EXTRA_TYPE | user_defined, | |
yyscan_t * | scanner | |||
) |
Definition at line 2241 of file ast_expr2f.c.
References ast_yyalloc(), ast_yyset_extra(), errno, and yy_init_globals().
02243 { 02244 struct yyguts_t dummy_yyguts; 02245 02246 ast_yyset_extra (yy_user_defined, &dummy_yyguts); 02247 02248 if (ptr_yy_globals == NULL){ 02249 errno = EINVAL; 02250 return 1; 02251 } 02252 02253 *ptr_yy_globals = (yyscan_t) ast_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); 02254 02255 if (*ptr_yy_globals == NULL){ 02256 errno = ENOMEM; 02257 return 1; 02258 } 02259 02260 /* By setting to 0xAA, we expose bugs in 02261 yy_init_globals. Leave at 0x00 for releases. */ 02262 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); 02263 02264 ast_yyset_extra (yy_user_defined, *ptr_yy_globals); 02265 02266 return yy_init_globals ( *ptr_yy_globals ); 02267 }
int ast_yyparse | ( | void * | ) |
Referenced by ast_expr(), and ast_str_expr().
void ast_yypop_buffer_state | ( | yyscan_t | yyscanner | ) |
Removes and deletes the top of the stack, if present. The next element becomes the new top.
yyscanner | The scanner object. |
Definition at line 1858 of file ast_expr2f.c.
References ast_yy_delete_buffer(), ast_yy_load_buffer_state(), yyguts_t::yy_buffer_stack_top, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, and yyguts_t::yy_did_buffer_switch_on_eof.
Referenced by ast_yylex_destroy().
01859 { 01860 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01861 if (!YY_CURRENT_BUFFER) 01862 return; 01863 01864 ast_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner); 01865 YY_CURRENT_BUFFER_LVALUE = NULL; 01866 if (yyg->yy_buffer_stack_top > 0) 01867 --yyg->yy_buffer_stack_top; 01868 01869 if (YY_CURRENT_BUFFER) { 01870 ast_yy_load_buffer_state(yyscanner ); 01871 yyg->yy_did_buffer_switch_on_eof = 1; 01872 } 01873 }
void ast_yypush_buffer_state | ( | YY_BUFFER_STATE | new_buffer, | |
yyscan_t | yyscanner | |||
) |
Pushes the new state onto the stack. The new state becomes the current state. This function will allocate the stack if necessary.
new_buffer | The new state. | |
yyscanner | The scanner object. |
Definition at line 1827 of file ast_expr2f.c.
References ast_yy_load_buffer_state(), ast_yyensure_buffer_stack(), yyguts_t::yy_buffer_stack_top, yyguts_t::yy_c_buf_p, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yyguts_t::yy_did_buffer_switch_on_eof, yyguts_t::yy_hold_char, and yyguts_t::yy_n_chars.
01828 { 01829 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01830 if (new_buffer == NULL) 01831 return; 01832 01833 ast_yyensure_buffer_stack(yyscanner); 01834 01835 /* This block is copied from ast_yy_switch_to_buffer. */ 01836 if ( YY_CURRENT_BUFFER ) 01837 { 01838 /* Flush out information for old buffer. */ 01839 *yyg->yy_c_buf_p = yyg->yy_hold_char; 01840 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; 01841 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; 01842 } 01843 01844 /* Only push if top exists. Otherwise, replace top. */ 01845 if (YY_CURRENT_BUFFER) 01846 yyg->yy_buffer_stack_top++; 01847 YY_CURRENT_BUFFER_LVALUE = new_buffer; 01848 01849 /* copied from ast_yy_switch_to_buffer. */ 01850 ast_yy_load_buffer_state(yyscanner ); 01851 yyg->yy_did_buffer_switch_on_eof = 1; 01852 }
Definition at line 2361 of file ast_expr2f.c.
References realloc.
Referenced by ast_yyensure_buffer_stack().
02362 { 02363 /* The cast to (char *) in the following accommodates both 02364 * implementations that use char* generic pointers, and those 02365 * that use void* generic pointers. It works with the latter 02366 * because both ANSI C and C++ allow castless assignment from 02367 * any pointer type to void*, and deal with argument conversions 02368 * as though doing an assignment. 02369 */ 02370 return (void *) realloc( (char *) ptr, size ); 02371 }
void ast_yyrestart | ( | FILE * | input_file, | |
yyscan_t | yyscanner | |||
) |
void ast_yyset_column | ( | int | column_no, | |
yyscan_t | yyscanner | |||
) |
Set the current column.
line_number | ||
yyscanner | The scanner object. |
Definition at line 2138 of file ast_expr2f.c.
References YY_CURRENT_BUFFER, yy_fatal_error(), and yycolumn.
02139 { 02140 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02141 02142 /* column is only valid if an input buffer exists. */ 02143 if (! YY_CURRENT_BUFFER ) 02144 yy_fatal_error( "ast_yyset_column called with no buffer" , yyscanner); 02145 02146 yycolumn = column_no; 02147 }
void ast_yyset_debug | ( | int | debug_flag, | |
yyscan_t | yyscanner | |||
) |
Definition at line 2173 of file ast_expr2f.c.
References yy_flex_debug.
02174 { 02175 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02176 yy_flex_debug = bdebug ; 02177 }
void ast_yyset_extra | ( | YY_EXTRA_TYPE | user_defined, | |
yyscan_t | yyscanner | |||
) |
Set the user-defined data. This data is never touched by the scanner.
user_defined | The data to be associated with this scanner. | |
yyscanner | The scanner object. |
Definition at line 2113 of file ast_expr2f.c.
References yyextra.
Referenced by ast_yylex_init_extra().
void ast_yyset_in | ( | FILE * | in_str, | |
yyscan_t | yyscanner | |||
) |
Set the input stream. This does not discard the current input buffer.
in_str | A readable stream. | |
yyscanner | The scanner object. |
Definition at line 2155 of file ast_expr2f.c.
References yyin.
void ast_yyset_lineno | ( | int | line_number, | |
yyscan_t | yyscanner | |||
) |
Set the current line number.
line_number | ||
yyscanner | The scanner object. |
Definition at line 2123 of file ast_expr2f.c.
References YY_CURRENT_BUFFER, yy_fatal_error(), and yylineno.
02124 { 02125 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02126 02127 /* lineno is only valid if an input buffer exists. */ 02128 if (! YY_CURRENT_BUFFER ) 02129 yy_fatal_error( "ast_yyset_lineno called with no buffer" , yyscanner); 02130 02131 yylineno = line_number; 02132 }
void ast_yyset_lloc | ( | YYLTYPE * | yylloc_param, | |
yyscan_t | yyscanner | |||
) |
void ast_yyset_out | ( | FILE * | out_str, | |
yyscan_t | yyscanner | |||
) |
static char * expr2_token_subst | ( | const char * | mess | ) | [static] |
Definition at line 2534 of file ast_expr2f.c.
Referenced by ast_yyerror().
02535 { 02536 /* calc a length, malloc, fill, and return; yyerror had better free it! */ 02537 int len=0,i; 02538 const char *p; 02539 char *res, *s; 02540 const char *t; 02541 int expr2_token_equivs_entries = sizeof(expr2_token_equivs1)/sizeof(char*); 02542 02543 for (p=mess; *p; p++) { 02544 for (i=0; i<expr2_token_equivs_entries; i++) { 02545 if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 ) 02546 { 02547 len+=strlen(expr2_token_equivs2[i])+2; 02548 p += strlen(expr2_token_equivs1[i])-1; 02549 break; 02550 } 02551 } 02552 len++; 02553 } 02554 res = (char*)malloc(len+1); 02555 res[0] = 0; 02556 s = res; 02557 for (p=mess; *p;) { 02558 int found = 0; 02559 for (i=0; i<expr2_token_equivs_entries; i++) { 02560 if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 ) { 02561 *s++ = '\''; 02562 for (t=expr2_token_equivs2[i]; *t;) { 02563 *s++ = *t++; 02564 } 02565 *s++ = '\''; 02566 p += strlen(expr2_token_equivs1[i]); 02567 found = 1; 02568 break; 02569 } 02570 } 02571 if( !found ) 02572 *s++ = *p++; 02573 } 02574 *s++ = 0; 02575 return res; 02576 }
static int input | ( | yyscan_t | yyscanner | ) | [static] |
Referenced by eivr_comm().
static void yy_fatal_error | ( | yyconst char * | msg, | |
yyscan_t | yyscanner | |||
) | [static] |
Definition at line 2012 of file ast_expr2f.c.
References YY_EXIT_FAILURE.
02013 { 02014 (void) fprintf( stderr, "%s\n", msg ); 02015 exit( YY_EXIT_FAILURE ); 02016 }
static void yy_fatal_error | ( | yyconst char | msg[], | |
yyscan_t | yyscanner | |||
) | [static] |
Referenced by ast_yyset_column(), and ast_yyset_lineno().
static int yy_get_next_buffer | ( | yyscan_t | yyscanner | ) | [static] |
static yy_state_type yy_get_previous_state | ( | yyscan_t | yyscanner | ) | [static] |
static int yy_init_globals | ( | yyscan_t | yyscanner | ) | [static] |
Definition at line 2269 of file ast_expr2f.c.
References yyguts_t::yy_buffer_stack, yyguts_t::yy_buffer_stack_max, yyguts_t::yy_buffer_stack_top, yyguts_t::yy_c_buf_p, yyguts_t::yy_init, yyguts_t::yy_start, yyguts_t::yy_start_stack, yyguts_t::yy_start_stack_depth, yyguts_t::yy_start_stack_ptr, yyin, and yyout.
Referenced by ast_yylex_destroy(), ast_yylex_init(), and ast_yylex_init_extra().
02270 { 02271 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02272 /* Initialization is the same as for the non-reentrant scanner. 02273 * This function is called from ast_yylex_destroy(), so don't allocate here. 02274 */ 02275 02276 yyg->yy_buffer_stack = 0; 02277 yyg->yy_buffer_stack_top = 0; 02278 yyg->yy_buffer_stack_max = 0; 02279 yyg->yy_c_buf_p = (char *) 0; 02280 yyg->yy_init = 0; 02281 yyg->yy_start = 0; 02282 02283 yyg->yy_start_stack_ptr = 0; 02284 yyg->yy_start_stack_depth = 0; 02285 yyg->yy_start_stack = NULL; 02286 02287 /* Defined in main.c */ 02288 #ifdef YY_STDINIT 02289 yyin = stdin; 02290 yyout = stdout; 02291 #else 02292 yyin = (FILE *) 0; 02293 yyout = (FILE *) 0; 02294 #endif 02295 02296 /* For future reference: Set errno on error, since we are called by 02297 * ast_yylex_init() 02298 */ 02299 return 0; 02300 }
static yy_state_type yy_try_NUL_trans | ( | yy_state_type | current_state, | |
yyscan_t | yyscanner | |||
) | [static] |
static void yyunput | ( | int | c, | |
char * | buf_ptr, | |||
yyscan_t | yyscanner | |||
) | [static] |
int curlycount = 0 [static] |
Definition at line 600 of file ast_expr2f.c.
const char* const expr2_token_equivs1[] [static] |
Definition at line 2481 of file ast_expr2f.c.
const char* const expr2_token_equivs2[] [static] |
Definition at line 2507 of file ast_expr2f.c.
char extra_error_message[4095] |
Definition at line 2464 of file ast_expr2f.c.
int extra_error_message_supplied = 0 |
Definition at line 2465 of file ast_expr2f.c.
yyconst flex_int16_t yy_accept[63] [static] |
Definition at line 364 of file ast_expr2f.c.
yyconst flex_int16_t yy_base[70] [static] |
Definition at line 414 of file ast_expr2f.c.
yyconst flex_int16_t yy_chk[159] [static] |
Definition at line 457 of file ast_expr2f.c.
yyconst flex_int16_t yy_def[70] [static] |
Definition at line 425 of file ast_expr2f.c.
yyconst flex_int32_t yy_ec[256] [static] |
Definition at line 375 of file ast_expr2f.c.
yyconst flex_int32_t yy_meta[29] [static] |
Definition at line 407 of file ast_expr2f.c.
yyconst flex_int16_t yy_nxt[159] [static] |
Definition at line 436 of file ast_expr2f.c.