#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 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 } |
Functions | |
int | ast_expr (char *expr, char *buf, int length, struct ast_channel *chan) |
void | ast_expr_clear_extra_error_info (void) |
void | ast_expr_register_extra_error_info (char *message) |
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 char * | expr2_token_equivs1 [] |
static char * | 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] |
Definition in file ast_expr2f.c.
#define ast_yywrap | ( | n | ) | 1 |
Definition at line 331 of file ast_expr2f.c.
#define BEGIN yyg->yy_start = 1 + 2 * |
Definition at line 145 of file ast_expr2f.c.
#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) |
Definition at line 746 of file ast_expr2f.c.
Referenced by ast_hide_password(), ast_restore_tty(), and openserial().
#define EOB_ACT_CONTINUE_SCAN 0 |
Definition at line 176 of file ast_expr2f.c.
#define EOB_ACT_END_OF_FILE 1 |
Definition at line 177 of file ast_expr2f.c.
#define EOB_ACT_LAST_MATCH 2 |
Definition at line 178 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 529 of file ast_expr2f.c.
#define FP___PRINTF "%.16g" |
Definition at line 528 of file ast_expr2f.c.
#define FP___STRTOD strtod |
Definition at line 530 of file ast_expr2f.c.
#define FP___TYPE double |
Definition at line 531 of file ast_expr2f.c.
#define INITIAL 0 |
Definition at line 601 of file ast_expr2f.c.
#define INT16_MAX (32767) |
#define INT16_MIN (-32767-1) |
#define INT32_MAX (2147483647) |
Definition at line 77 of file ast_expr2f.c.
#define INT32_MIN (-2147483647-1) |
Definition at line 68 of file ast_expr2f.c.
#define INT8_MAX (127) |
Definition at line 71 of file ast_expr2f.c.
#define INT8_MIN (-128) |
Definition at line 62 of file ast_expr2f.c.
#define REJECT reject_used_but_not_detected |
Definition at line 482 of file ast_expr2f.c.
#define SET_COLUMNS |
Value:
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 568 of file ast_expr2f.c.
#define SET_NUMERIC_STRING |
Value:
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 580 of file ast_expr2f.c.
#define SET_STRING |
Value:
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 574 of file ast_expr2f.c.
#define trail 2 |
Definition at line 603 of file ast_expr2f.c.
#define UINT16_MAX (65535U) |
Definition at line 83 of file ast_expr2f.c.
#define UINT32_MAX (4294967295U) |
Definition at line 86 of file ast_expr2f.c.
#define UINT8_MAX (255U) |
Definition at line 80 of file ast_expr2f.c.
#define unput | ( | c | ) | yyunput( c, yyg->yytext_ptr , yyscanner ) |
Definition at line 196 of file ast_expr2f.c.
#define var 1 |
Definition at line 602 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_create_client(), aji_load_config(), append_mailbox_mapping(), apply_general_options(), apply_options(), apply_options_full(), apply_outgoing(), ast_cdr_copy_vars(), ast_cdr_serialize_variables(), ast_channeltype_list(), ast_iax2_new(), ast_var_assign(), ast_var_delete(), ast_var_full_name(), ast_var_name(), ast_var_value(), astman_get_variables(), authenticate_reply(), build_extension(), build_parkinglot(), build_profile(), clearvar_prefix(), cli_realtime_load(), conf_exec(), conf_run(), config_module(), config_text_file_save(), console_cmd(), copy_plain_file(), create_vmaccount(), delete_extension(), do_timelimit(), find_conf(), find_conf_realtime(), find_user_realtime(), function_realtime_read(), function_realtime_readdestroy(), get_insecure_variable_from_config(), get_name_from_variable(), global_read(), gtalk_create_member(), gtalk_load_config(), handle_updates(), handle_uri(), http_post_callback(), iax2_call(), iax_parse_ies(), inherit_category(), init_logger_chain(), jingle_create_member(), jingle_load_config(), ldap_loadentry(), ldap_table_config_add_attribute(), leave_queue(), load_config(), load_moh_classes(), local_ast_moh_start(), message_template_build(), minivm_account_func_read(), move_variables(), odbc_load_module(), parse_config(), parse_cookies(), pbx_builtin_serialize_variables(), pbx_substitute_variables_helper_full(), phoneprov_callback(), prep_email_sub_vars(), process_text_line(), profile_destructor(), queue_function_queuewaitingcount(), realtime_alias(), realtime_canmatch(), realtime_common(), realtime_curl(), realtime_directory(), realtime_exec(), realtime_exists(), realtime_ldap(), realtime_ldap_entry_to_var(), realtime_ldap_result_to_vars(), realtime_matchmore(), realtime_multi_curl(), realtime_multi_ldap(), realtime_multi_odbc(), realtime_multi_pgsql(), realtime_odbc(), realtime_peer(), realtime_pgsql(), realtime_switch_common(), realtime_user(), reload(), reload_followme(), reload_queues(), retrieve_astcfgint(), semicolon_count_var(), set_config(), set_timezone_variables(), shared_read(), shared_variable_free(), shared_write(), show_users_realtime(), sla_add_trunk_to_station(), sla_build_station(), sla_build_trunk(), socket_process(), transmit_invite(), transmit_notify_custom(), unload_module(), variable_named(), vm_change_password(), and xml_translate().
#define YY_AT_BOL | ( | ) | (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) |
Definition at line 327 of file ast_expr2f.c.
#define YY_BREAK break; |
Definition at line 827 of file ast_expr2f.c.
#define YY_BUF_SIZE 16384 |
Definition at line 164 of file ast_expr2f.c.
#define YY_BUFFER_EOF_PENDING 2 |
Definition at line 263 of file ast_expr2f.c.
#define YY_BUFFER_NEW 0 |
Definition at line 251 of file ast_expr2f.c.
Referenced by ast_yy_flush_buffer(), and ast_yy_scan_buffer().
#define YY_BUFFER_NORMAL 1 |
Definition at line 252 of file ast_expr2f.c.
#define YY_CURRENT_BUFFER |
Value:
( yyg->yy_buffer_stack \ ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ : NULL)
Definition at line 274 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 281 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 809 of file ast_expr2f.c.
#define YY_DO_BEFORE_ACTION |
Definition at line 348 of file ast_expr2f.c.
#define YY_END_OF_BUFFER 39 |
Definition at line 357 of file ast_expr2f.c.
#define YY_END_OF_BUFFER_CHAR 0 |
Definition at line 160 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 |
#define YY_EXTRA_TYPE void * |
Definition at line 614 of file ast_expr2f.c.
Definition at line 800 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 139 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 295 of file ast_expr2f.c.
#define YY_INPUT | ( | buf, | |||
result, | |||||
max_size | ) |
Definition at line 753 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 180 of file ast_expr2f.c.
#define YY_MORE_ADJ yyg->yy_more_len |
Definition at line 484 of file ast_expr2f.c.
#define yy_new_buffer ast_yy_create_buffer |
Definition at line 305 of file ast_expr2f.c.
#define YY_NEW_FILE ast_yyrestart(yyin ,yyscanner ) |
Definition at line 158 of file ast_expr2f.c.
#define YY_NULL 0 |
Definition at line 115 of file ast_expr2f.c.
#define YY_NUM_RULES 38 |
Definition at line 356 of file ast_expr2f.c.
#define YY_READ_BUF_SIZE 8192 |
Definition at line 738 of file ast_expr2f.c.
#define YY_RESTORE_YY_MORE_OFFSET |
Definition at line 485 of file ast_expr2f.c.
#define YY_RULE_SETUP YY_USER_ACTION |
Definition at line 830 of file ast_expr2f.c.
#define YY_SC_TO_UI | ( | c | ) | ((unsigned int) (unsigned char) c) |
Definition at line 122 of file ast_expr2f.c.
#define yy_set_bol | ( | at_bol | ) |
Definition at line 317 of file ast_expr2f.c.
#define yy_set_interactive | ( | is_interactive | ) |
Definition at line 307 of file ast_expr2f.c.
#define YY_SKIP_YYWRAP |
Definition at line 332 of file ast_expr2f.c.
#define YY_START ((yyg->yy_start - 1) / 2) |
Definition at line 151 of file ast_expr2f.c.
#define YY_START_STACK_INCR 25 |
Definition at line 795 of file ast_expr2f.c.
#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) |
Definition at line 169 of file ast_expr2f.c.
Definition at line 155 of file ast_expr2f.c.
#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) |
Definition at line 138 of file ast_expr2f.c.
Referenced by ast_yyget_column(), and ast_yyset_column().
#define yyconst |
Definition at line 111 of file ast_expr2f.c.
#define yyextra yyg->yyextra_r |
Definition at line 134 of file ast_expr2f.c.
Referenced by ast_yyget_extra(), and ast_yyset_extra().
#define yyin yyg->yyin_r |
Definition at line 132 of file ast_expr2f.c.
Referenced by ast_yyget_in(), ast_yyset_in(), and yy_init_globals().
#define yyleng yyg->yyleng_r |
#define yyless | ( | n | ) |
Definition at line 2013 of file ast_expr2f.c.
#define yyless | ( | n | ) |
Definition at line 2013 of file ast_expr2f.c.
#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) |
Definition at line 137 of file ast_expr2f.c.
Referenced by ast_yyget_lineno(), and ast_yyset_lineno().
#define yylloc yyg->yylloc_r |
Definition at line 661 of file ast_expr2f.c.
#define yylval yyg->yylval_r |
Definition at line 659 of file ast_expr2f.c.
#define yymore | ( | ) | (yyg->yy_more_flag = 1) |
Definition at line 483 of file ast_expr2f.c.
#define yyout yyg->yyout_r |
Definition at line 133 of file ast_expr2f.c.
Referenced by ast_yyget_out(), ast_yyset_out(), and yy_init_globals().
#define YYSTATE YY_START |
Definition at line 152 of file ast_expr2f.c.
#define YYTABLES_NAME "yytables" |
Definition at line 2365 of file ast_expr2f.c.
#define yyterminate | ( | ) | return YY_NULL |
Definition at line 790 of file ast_expr2f.c.
#define yytext yyg->yytext_r |
#define yytext_ptr yytext_r |
Definition at line 338 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 173 of file ast_expr2f.c.
typedef unsigned char YY_CHAR |
Definition at line 334 of file ast_expr2f.c.
typedef size_t yy_size_t |
Definition at line 200 of file ast_expr2f.c.
typedef int yy_state_type |
Definition at line 336 of file ast_expr2f.c.
typedef void* yyscan_t |
Definition at line 127 of file ast_expr2f.c.
enum valtype |
Definition at line 554 of file ast_expr2f.c.
00554 { 00555 AST_EXPR_number, AST_EXPR_numeric_string, AST_EXPR_string 00556 } ;
int ast_expr | ( | char * | expr, | |
char * | buf, | |||
int | length, | |||
struct ast_channel * | chan | |||
) |
Definition at line 2388 of file ast_expr2f.c.
References ast_copy_string(), AST_EXPR_number, ast_yy_scan_string(), ast_yylex_destroy(), ast_yylex_init(), ast_yyparse(), chan, FP___PRINTF, free, and io.
Referenced by pbx_substitute_variables_helper_full().
02389 { 02390 struct parse_io io; 02391 int return_value = 0; 02392 02393 memset(&io, 0, sizeof(io)); 02394 io.string = expr; /* to pass to the error routine */ 02395 io.chan = chan; 02396 02397 ast_yylex_init(&io.scanner); 02398 02399 ast_yy_scan_string(expr, io.scanner); 02400 02401 ast_yyparse ((void *) &io); 02402 02403 ast_yylex_destroy(io.scanner); 02404 02405 if (!io.val) { 02406 if (length > 1) { 02407 strcpy(buf, "0"); 02408 return_value = 1; 02409 } 02410 } else { 02411 if (io.val->type == AST_EXPR_number) { 02412 int res_length; 02413 02414 res_length = snprintf(buf, length, FP___PRINTF, io.val->u.i); 02415 return_value = (res_length <= length) ? res_length : length; 02416 } else { 02417 if (io.val->u.s) 02418 #if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE) 02419 strncpy(buf, io.val->u.s, length - 1); 02420 #else /* !STANDALONE && !LOW_MEMORY */ 02421 ast_copy_string(buf, io.val->u.s, length); 02422 #endif /* STANDALONE || LOW_MEMORY */ 02423 else 02424 buf[0] = 0; 02425 return_value = strlen(buf); 02426 if (io.val->u.s) 02427 free(io.val->u.s); 02428 } 02429 free(io.val); 02430 } 02431 return return_value; 02432 }
void ast_expr_clear_extra_error_info | ( | void | ) |
Definition at line 2446 of file ast_expr2f.c.
02447 { 02448 extra_error_message_supplied=0; 02449 extra_error_message[0] = 0; 02450 }
void ast_expr_register_extra_error_info | ( | char * | message | ) |
Definition at line 2440 of file ast_expr2f.c.
02441 { 02442 extra_error_message_supplied=1; 02443 strcpy(extra_error_message, message); 02444 }
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 1789 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().
01790 { 01791 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01792 if ( ! b ) 01793 return; 01794 01795 b->yy_n_chars = 0; 01796 01797 /* We always need two end-of-buffer characters. The first causes 01798 * a transition to the end-of-buffer state. The second causes 01799 * a jam in that state. 01800 */ 01801 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; 01802 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; 01803 01804 b->yy_buf_pos = &b->yy_ch_buf[0]; 01805 01806 b->yy_at_bol = 1; 01807 b->yy_buffer_status = YY_BUFFER_NEW; 01808 01809 if ( b == YY_CURRENT_BUFFER ) 01810 ast_yy_load_buffer_state(yyscanner ); 01811 }
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 1760 of file ast_expr2f.c.
References ast_yy_flush_buffer(), errno, and YY_CURRENT_BUFFER.
01762 { 01763 int oerrno = errno; 01764 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01765 01766 ast_yy_flush_buffer(b ,yyscanner); 01767 01768 b->yy_input_file = file; 01769 b->yy_fill_buffer = 1; 01770 01771 /* If b is the current buffer, then ast_yy_init_buffer was _probably_ 01772 * called from ast_yyrestart() or through yy_get_next_buffer. 01773 * In that case, we don't want to reset the lineno or column. 01774 */ 01775 if (b != YY_CURRENT_BUFFER){ 01776 b->yy_bs_lineno = 1; 01777 b->yy_bs_column = 0; 01778 } 01779 01780 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; 01781 01782 errno = oerrno; 01783 }
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 1920 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().
01921 { 01922 YY_BUFFER_STATE b; 01923 01924 if ( size < 2 || 01925 base[size-2] != YY_END_OF_BUFFER_CHAR || 01926 base[size-1] != YY_END_OF_BUFFER_CHAR ) 01927 /* They forgot to leave room for the EOB's. */ 01928 return 0; 01929 01930 b = (YY_BUFFER_STATE) ast_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); 01931 if ( ! b ) 01932 YY_FATAL_ERROR( "out of dynamic memory in ast_yy_scan_buffer()" ); 01933 01934 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ 01935 b->yy_buf_pos = b->yy_ch_buf = base; 01936 b->yy_is_our_buffer = 0; 01937 b->yy_input_file = 0; 01938 b->yy_n_chars = b->yy_buf_size; 01939 b->yy_is_interactive = 0; 01940 b->yy_at_bol = 1; 01941 b->yy_fill_buffer = 0; 01942 b->yy_buffer_status = YY_BUFFER_NEW; 01943 01944 ast_yy_switch_to_buffer(b ,yyscanner ); 01945 01946 return b; 01947 }
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 1970 of file ast_expr2f.c.
References ast_yy_scan_buffer(), ast_yyalloc(), buf, YY_END_OF_BUFFER_CHAR, YY_FATAL_ERROR, and yy_buffer_state::yy_is_our_buffer.
Referenced by ast_yy_scan_string().
01971 { 01972 YY_BUFFER_STATE b; 01973 char *buf; 01974 yy_size_t n; 01975 int i; 01976 01977 /* Get memory for full buffer, including space for trailing EOB's. */ 01978 n = _yybytes_len + 2; 01979 buf = (char *) ast_yyalloc(n ,yyscanner ); 01980 if ( ! buf ) 01981 YY_FATAL_ERROR( "out of dynamic memory in ast_yy_scan_bytes()" ); 01982 01983 for ( i = 0; i < _yybytes_len; ++i ) 01984 buf[i] = yybytes[i]; 01985 01986 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; 01987 01988 b = ast_yy_scan_buffer(buf,n ,yyscanner); 01989 if ( ! b ) 01990 YY_FATAL_ERROR( "bad buffer in ast_yy_scan_bytes()" ); 01991 01992 /* It's okay to grow etc. this buffer, and we should throw it 01993 * away when we're done. 01994 */ 01995 b->yy_is_our_buffer = 1; 01996 01997 return b; 01998 }
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 1957 of file ast_expr2f.c.
References ast_yy_scan_bytes().
Referenced by ast_expr().
01958 { 01959 01960 return ast_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner); 01961 }
void ast_yy_switch_to_buffer | ( | YY_BUFFER_STATE | new_buffer, | |
yyscan_t | yyscanner | |||
) |
Referenced by ast_yy_scan_buffer().
Definition at line 2348 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().
02349 { 02350 return (void *) malloc( size ); 02351 }
static void ast_yyensure_buffer_stack | ( | yyscan_t | yyscanner | ) | [static] |
Definition at line 1870 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().
01871 { 01872 int num_to_alloc; 01873 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01874 01875 if (!yyg->yy_buffer_stack) { 01876 01877 /* First allocation is just for 2 elements, since we don't know if this 01878 * scanner will even need a stack. We use 2 instead of 1 to avoid an 01879 * immediate realloc on the next call. 01880 */ 01881 num_to_alloc = 1; 01882 yyg->yy_buffer_stack = (struct yy_buffer_state**)ast_yyalloc 01883 (num_to_alloc * sizeof(struct yy_buffer_state*) 01884 , yyscanner); 01885 if ( ! yyg->yy_buffer_stack ) 01886 YY_FATAL_ERROR( "out of dynamic memory in ast_yyensure_buffer_stack()" ); 01887 01888 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); 01889 01890 yyg->yy_buffer_stack_max = num_to_alloc; 01891 yyg->yy_buffer_stack_top = 0; 01892 return; 01893 } 01894 01895 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ 01896 01897 /* Increase the buffer to prepare for a possible push. */ 01898 int grow_size = 8 /* arbitrary grow size */; 01899 01900 num_to_alloc = yyg->yy_buffer_stack_max + grow_size; 01901 yyg->yy_buffer_stack = (struct yy_buffer_state**)ast_yyrealloc 01902 (yyg->yy_buffer_stack, 01903 num_to_alloc * sizeof(struct yy_buffer_state*) 01904 , yyscanner); 01905 if ( ! yyg->yy_buffer_stack ) 01906 YY_FATAL_ERROR( "out of dynamic memory in ast_yyensure_buffer_stack()" ); 01907 01908 /* zero only the new slots.*/ 01909 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); 01910 yyg->yy_buffer_stack_max = num_to_alloc; 01911 } 01912 }
Definition at line 2548 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.
02549 { 02550 struct yyguts_t * yyg = (struct yyguts_t*)(parseio->scanner); 02551 char spacebuf[8000]; /* best safe than sorry */ 02552 char spacebuf2[8000]; /* best safe than sorry */ 02553 int i=0; 02554 char *s2 = expr2_token_subst(s); 02555 spacebuf[0] = 0; 02556 02557 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, 02558 which is the same thing as... get this: 02559 yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]->yy_bs_column 02560 I was tempted to just use yy_buf_pos in the STATE, but..., well: 02561 a. the yy_buf_pos is the current position in the buffer, which 02562 may not relate to the entire string/buffer because of the 02563 buffering. 02564 b. but, analysis of the situation is that when you use the 02565 ast_yy_scan_string func, it creates a single buffer the size of 02566 string, so the two would be the same... 02567 so, in the end, the yycolumn macro is available, shorter, therefore easier. */ 02568 spacebuf2[i++]='^'; 02569 spacebuf2[i]= 0; 02570 02571 #ifdef STANDALONE3 02572 /* easier to read in the standalone version */ 02573 printf("ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n", 02574 (extra_error_message_supplied?extra_error_message:""), s2, parseio->string,spacebuf2); 02575 #else 02576 ast_log(LOG_WARNING,"ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n", 02577 (extra_error_message_supplied?extra_error_message:""), s2, parseio->string,spacebuf2); 02578 #endif 02579 #ifndef STANDALONE 02580 ast_log(LOG_WARNING,"If you have questions, please refer to doc/tex/channelvariables.tex in the asterisk source.\n"); 02581 #endif 02582 free(s2); 02583 return(0); 02584 }
void ast_yyfree | ( | void * | , | |
yyscan_t | yyscanner | |||
) |
Definition at line 2380 of file ast_expr2f.c.
References free.
Referenced by ast_yylex_destroy().
02381 { 02382 if (ptr) /* the normal generated ast_yyfree func just frees its first arg; 02383 this get complaints on some systems, as sometimes this 02384 arg is a nil ptr! It's usually not fatal, but is irritating! */ 02385 free( (char *) ptr ); 02386 }
int ast_yyget_column | ( | yyscan_t | yyscanner | ) |
Get the current column number.
yyscanner | The scanner object. |
Definition at line 2054 of file ast_expr2f.c.
References YY_CURRENT_BUFFER, and yycolumn.
02055 { 02056 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02057 02058 if (! YY_CURRENT_BUFFER) 02059 return 0; 02060 02061 return yycolumn; 02062 }
int ast_yyget_debug | ( | yyscan_t | yyscanner | ) |
Definition at line 2159 of file ast_expr2f.c.
References yy_flex_debug.
02160 { 02161 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02162 return yy_flex_debug; 02163 }
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 2041 of file ast_expr2f.c.
References YY_CURRENT_BUFFER, and yylineno.
02042 { 02043 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02044 02045 if (! YY_CURRENT_BUFFER) 02046 return 0; 02047 02048 return yylineno; 02049 }
FILE * ast_yyget_out | ( | yyscan_t | yyscanner | ) |
char * ast_yyget_text | ( | yyscan_t | yyscanner | ) |
int ast_yylex_destroy | ( | yyscan_t | yyscanner | ) |
Definition at line 2295 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().
02296 { 02297 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02298 02299 /* Pop the buffer stack, destroying each element. */ 02300 while(YY_CURRENT_BUFFER){ 02301 ast_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); 02302 YY_CURRENT_BUFFER_LVALUE = NULL; 02303 ast_yypop_buffer_state(yyscanner); 02304 } 02305 02306 /* Destroy the stack itself. */ 02307 ast_yyfree(yyg->yy_buffer_stack ,yyscanner); 02308 yyg->yy_buffer_stack = NULL; 02309 02310 /* Destroy the start condition stack. */ 02311 ast_yyfree(yyg->yy_start_stack ,yyscanner ); 02312 yyg->yy_start_stack = NULL; 02313 02314 /* Reset the globals. This is important in a non-reentrant scanner so the next time 02315 * ast_yylex() is called, initialization will occur. */ 02316 yy_init_globals( yyscanner); 02317 02318 /* Destroy the main struct (reentrant only). */ 02319 ast_yyfree ( yyscanner , yyscanner ); 02320 yyscanner = NULL; 02321 return 0; 02322 }
int ast_yylex_init | ( | yyscan_t * | scanner | ) |
Definition at line 2204 of file ast_expr2f.c.
References ast_yyalloc(), errno, and yy_init_globals().
Referenced by ast_expr().
02206 { 02207 if (ptr_yy_globals == NULL){ 02208 errno = EINVAL; 02209 return 1; 02210 } 02211 02212 *ptr_yy_globals = (yyscan_t) ast_yyalloc ( sizeof( struct yyguts_t ), NULL ); 02213 02214 if (*ptr_yy_globals == NULL){ 02215 errno = ENOMEM; 02216 return 1; 02217 } 02218 02219 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ 02220 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); 02221 02222 return yy_init_globals ( *ptr_yy_globals ); 02223 }
int ast_yylex_init_extra | ( | YY_EXTRA_TYPE | user_defined, | |
yyscan_t * | scanner | |||
) |
Definition at line 2233 of file ast_expr2f.c.
References ast_yyalloc(), ast_yyset_extra(), errno, and yy_init_globals().
02235 { 02236 struct yyguts_t dummy_yyguts; 02237 02238 ast_yyset_extra (yy_user_defined, &dummy_yyguts); 02239 02240 if (ptr_yy_globals == NULL){ 02241 errno = EINVAL; 02242 return 1; 02243 } 02244 02245 *ptr_yy_globals = (yyscan_t) ast_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); 02246 02247 if (*ptr_yy_globals == NULL){ 02248 errno = ENOMEM; 02249 return 1; 02250 } 02251 02252 /* By setting to 0xAA, we expose bugs in 02253 yy_init_globals. Leave at 0x00 for releases. */ 02254 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); 02255 02256 ast_yyset_extra (yy_user_defined, *ptr_yy_globals); 02257 02258 return yy_init_globals ( *ptr_yy_globals ); 02259 }
int ast_yyparse | ( | void * | ) |
Referenced by ast_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 1850 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().
01851 { 01852 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01853 if (!YY_CURRENT_BUFFER) 01854 return; 01855 01856 ast_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner); 01857 YY_CURRENT_BUFFER_LVALUE = NULL; 01858 if (yyg->yy_buffer_stack_top > 0) 01859 --yyg->yy_buffer_stack_top; 01860 01861 if (YY_CURRENT_BUFFER) { 01862 ast_yy_load_buffer_state(yyscanner ); 01863 yyg->yy_did_buffer_switch_on_eof = 1; 01864 } 01865 }
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 1819 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.
01820 { 01821 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01822 if (new_buffer == NULL) 01823 return; 01824 01825 ast_yyensure_buffer_stack(yyscanner); 01826 01827 /* This block is copied from ast_yy_switch_to_buffer. */ 01828 if ( YY_CURRENT_BUFFER ) 01829 { 01830 /* Flush out information for old buffer. */ 01831 *yyg->yy_c_buf_p = yyg->yy_hold_char; 01832 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; 01833 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; 01834 } 01835 01836 /* Only push if top exists. Otherwise, replace top. */ 01837 if (YY_CURRENT_BUFFER) 01838 yyg->yy_buffer_stack_top++; 01839 YY_CURRENT_BUFFER_LVALUE = new_buffer; 01840 01841 /* copied from ast_yy_switch_to_buffer. */ 01842 ast_yy_load_buffer_state(yyscanner ); 01843 yyg->yy_did_buffer_switch_on_eof = 1; 01844 }
Definition at line 2353 of file ast_expr2f.c.
References realloc.
Referenced by ast_yyensure_buffer_stack().
02354 { 02355 /* The cast to (char *) in the following accommodates both 02356 * implementations that use char* generic pointers, and those 02357 * that use void* generic pointers. It works with the latter 02358 * because both ANSI C and C++ allow castless assignment from 02359 * any pointer type to void*, and deal with argument conversions 02360 * as though doing an assignment. 02361 */ 02362 return (void *) realloc( (char *) ptr, size ); 02363 }
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 2130 of file ast_expr2f.c.
References YY_CURRENT_BUFFER, yy_fatal_error(), and yycolumn.
02131 { 02132 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02133 02134 /* column is only valid if an input buffer exists. */ 02135 if (! YY_CURRENT_BUFFER ) 02136 yy_fatal_error( "ast_yyset_column called with no buffer" , yyscanner); 02137 02138 yycolumn = column_no; 02139 }
void ast_yyset_debug | ( | int | debug_flag, | |
yyscan_t | yyscanner | |||
) |
Definition at line 2165 of file ast_expr2f.c.
References yy_flex_debug.
02166 { 02167 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02168 yy_flex_debug = bdebug ; 02169 }
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 2105 of file ast_expr2f.c.
References yyextra.
Referenced by ast_yylex_init_extra().
02106 { 02107 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02108 yyextra = user_defined ; 02109 }
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 2147 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 2115 of file ast_expr2f.c.
References YY_CURRENT_BUFFER, yy_fatal_error(), and yylineno.
02116 { 02117 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02118 02119 /* lineno is only valid if an input buffer exists. */ 02120 if (! YY_CURRENT_BUFFER ) 02121 yy_fatal_error( "ast_yyset_lineno called with no buffer" , yyscanner); 02122 02123 yylineno = line_number; 02124 }
void ast_yyset_out | ( | FILE * | out_str, | |
yyscan_t | yyscanner | |||
) |
static char * expr2_token_subst | ( | const char * | mess | ) | [static] |
Definition at line 2505 of file ast_expr2f.c.
Referenced by ast_yyerror().
02506 { 02507 /* calc a length, malloc, fill, and return; yyerror had better free it! */ 02508 int len=0,i; 02509 const char *p; 02510 char *res, *s,*t; 02511 int expr2_token_equivs_entries = sizeof(expr2_token_equivs1)/sizeof(char*); 02512 02513 for (p=mess; *p; p++) { 02514 for (i=0; i<expr2_token_equivs_entries; i++) { 02515 if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 ) 02516 { 02517 len+=strlen(expr2_token_equivs2[i])+2; 02518 p += strlen(expr2_token_equivs1[i])-1; 02519 break; 02520 } 02521 } 02522 len++; 02523 } 02524 res = (char*)malloc(len+1); 02525 res[0] = 0; 02526 s = res; 02527 for (p=mess; *p;) { 02528 int found = 0; 02529 for (i=0; i<expr2_token_equivs_entries; i++) { 02530 if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 ) { 02531 *s++ = '\''; 02532 for (t=expr2_token_equivs2[i]; *t;) { 02533 *s++ = *t++; 02534 } 02535 *s++ = '\''; 02536 p += strlen(expr2_token_equivs1[i]); 02537 found = 1; 02538 break; 02539 } 02540 } 02541 if( !found ) 02542 *s++ = *p++; 02543 } 02544 *s++ = 0; 02545 return res; 02546 }
static int input | ( | yyscan_t | yyscanner | ) | [static] |
Referenced by conf_exec(), conf_run(), and eivr_comm().
static void yy_fatal_error | ( | yyconst char * | msg, | |
yyscan_t | yyscanner | |||
) | [static] |
Definition at line 2004 of file ast_expr2f.c.
References YY_EXIT_FAILURE.
02005 { 02006 (void) fprintf( stderr, "%s\n", msg ); 02007 exit( YY_EXIT_FAILURE ); 02008 }
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 2261 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().
02262 { 02263 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02264 /* Initialization is the same as for the non-reentrant scanner. 02265 * This function is called from ast_yylex_destroy(), so don't allocate here. 02266 */ 02267 02268 yyg->yy_buffer_stack = 0; 02269 yyg->yy_buffer_stack_top = 0; 02270 yyg->yy_buffer_stack_max = 0; 02271 yyg->yy_c_buf_p = (char *) 0; 02272 yyg->yy_init = 0; 02273 yyg->yy_start = 0; 02274 02275 yyg->yy_start_stack_ptr = 0; 02276 yyg->yy_start_stack_depth = 0; 02277 yyg->yy_start_stack = NULL; 02278 02279 /* Defined in main.c */ 02280 #ifdef YY_STDINIT 02281 yyin = stdin; 02282 yyout = stdout; 02283 #else 02284 yyin = (FILE *) 0; 02285 yyout = (FILE *) 0; 02286 #endif 02287 02288 /* For future reference: Set errno on error, since we are called by 02289 * ast_yylex_init() 02290 */ 02291 return 0; 02292 }
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 596 of file ast_expr2f.c.
char* expr2_token_equivs1[] [static] |
Definition at line 2452 of file ast_expr2f.c.
char* expr2_token_equivs2[] [static] |
Definition at line 2478 of file ast_expr2f.c.
char extra_error_message[4095] |
Definition at line 2435 of file ast_expr2f.c.
int extra_error_message_supplied = 0 |
Definition at line 2436 of file ast_expr2f.c.
yyconst flex_int16_t yy_accept[63] [static] |
Definition at line 365 of file ast_expr2f.c.
yyconst flex_int16_t yy_base[70] [static] |
Definition at line 415 of file ast_expr2f.c.
yyconst flex_int16_t yy_chk[159] [static] |
Definition at line 458 of file ast_expr2f.c.
yyconst flex_int16_t yy_def[70] [static] |
Definition at line 426 of file ast_expr2f.c.
yyconst flex_int32_t yy_ec[256] [static] |
Definition at line 376 of file ast_expr2f.c.
yyconst flex_int32_t yy_meta[29] [static] |
Definition at line 408 of file ast_expr2f.c.
yyconst flex_int16_t yy_nxt[159] [static] |
Definition at line 437 of file ast_expr2f.c.