Asterisk - The Open Source Telephony Project  GIT-master-44aef04
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
ast_expr2f.c File Reference

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
 

Macros

#define ast_yywrap(n)   1
 
#define ASTMM_LIBC   ASTMM_REDIRECT
 
#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 FLEXINT_H
 
#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 YY_STRUCT_YY_BUFFER_STATE
 
#define YY_TYPEDEF_YY_BUFFER_STATE
 
#define YY_TYPEDEF_YY_SCANNER_T
 
#define YY_TYPEDEF_YY_SIZE_T
 
#define YY_USER_ACTION
 
#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_stateYY_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. More...
 
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. More...
 
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 *, YYLTYPE *, struct parse_io *)
 
int ast_yyerror (const char *s, yyltype *loc, struct parse_io *parseio)
 
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)
 
YYLTYPEast_yyget_lloc (yyscan_t yyscanner)
 
YYSTYPEast_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)
 
 if (!yyg->yy_init)
 
static int input (yyscan_t yyscanner)
 
int isatty (int)
 
 while (1)
 
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)
 
static void yyunput (int c, register char *yy_bp, 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]
 
register int yy_act
 
static yyconst flex_int16_t yy_base [70]
 
register char * yy_bp
 
static yyconst flex_int16_t yy_chk [159]
 
register char * yy_cp
 
 YY_DECL
 
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]
 
struct yyguts_tyyg = (struct yyguts_t*)yyscanner
 
 yylloc = yylloc_param
 
 yylval = yylval_param
 

Detailed Description

Dialplan Expression Lexical Scanner.

Definition in file ast_expr2f.c.

Macro Definition Documentation

◆ ast_yywrap

#define ast_yywrap (   n)    1

Definition at line 340 of file ast_expr2f.c.

Referenced by input(), and while().

◆ ASTMM_LIBC

#define ASTMM_LIBC   ASTMM_REDIRECT

Definition at line 1 of file ast_expr2f.c.

◆ BEGIN

#define BEGIN   yyg->yy_start = 1 + 2 *

Definition at line 146 of file ast_expr2f.c.

Referenced by while().

◆ ECHO

#define ECHO   do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)

Definition at line 563 of file ast_expr2f.c.

Referenced by ast_hide_password(), ast_restore_tty(), and while().

◆ EOB_ACT_CONTINUE_SCAN

#define EOB_ACT_CONTINUE_SCAN   0

Definition at line 185 of file ast_expr2f.c.

Referenced by input(), while(), and yy_get_next_buffer().

◆ EOB_ACT_END_OF_FILE

#define EOB_ACT_END_OF_FILE   1

Definition at line 186 of file ast_expr2f.c.

Referenced by input(), while(), and yy_get_next_buffer().

◆ EOB_ACT_LAST_MATCH

#define EOB_ACT_LAST_MATCH   2

Definition at line 187 of file ast_expr2f.c.

Referenced by input(), while(), and yy_get_next_buffer().

◆ FLEX_BETA

#define FLEX_BETA

Definition at line 17 of file ast_expr2f.c.

◆ FLEX_SCANNER

#define FLEX_SCANNER

Definition at line 12 of file ast_expr2f.c.

◆ FLEXINT_H

#define FLEXINT_H

Definition at line 33 of file ast_expr2f.c.

◆ FP___FMOD

#define FP___FMOD   fmod

Definition at line 536 of file ast_expr2f.c.

◆ FP___PRINTF

#define FP___PRINTF   "%.16g"

Definition at line 535 of file ast_expr2f.c.

Referenced by ast_expr(), and ast_str_expr().

◆ FP___STRTOD

#define FP___STRTOD   strtod

Definition at line 537 of file ast_expr2f.c.

◆ FP___TYPE

#define FP___TYPE   double

Definition at line 538 of file ast_expr2f.c.

◆ INITIAL

#define INITIAL   0

Definition at line 613 of file ast_expr2f.c.

Referenced by while().

◆ INT16_MAX

#define INT16_MAX   (32767)

Definition at line 75 of file ast_expr2f.c.

◆ INT16_MIN

#define INT16_MIN   (-32767-1)

Definition at line 66 of file ast_expr2f.c.

◆ INT32_MAX

#define INT32_MAX   (2147483647)

Definition at line 78 of file ast_expr2f.c.

Referenced by ast_parse_arg().

◆ INT32_MIN

#define INT32_MIN   (-2147483647-1)

Definition at line 69 of file ast_expr2f.c.

Referenced by ast_parse_arg().

◆ INT8_MAX

#define INT8_MAX   (127)

Definition at line 72 of file ast_expr2f.c.

◆ INT8_MIN

#define INT8_MIN   (-128)

Definition at line 63 of file ast_expr2f.c.

◆ REJECT

#define REJECT   reject_used_but_not_detected

Definition at line 491 of file ast_expr2f.c.

◆ SET_COLUMNS

#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)
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
#define yyleng
Definition: ast_expr2f.c:136
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:290
char * yytext_r
Definition: ast_expr2f.c:657

Definition at line 580 of file ast_expr2f.c.

Referenced by while().

◆ SET_NUMERIC_STRING

#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)
#define yytext
Definition: ast_expr2f.c:137
Definition: ast_expr2.c:325
#define calloc(a, b)
Definition: astmm.h:157
#define strdup(a)
Definition: astmm.h:165

Definition at line 592 of file ast_expr2f.c.

Referenced by while().

◆ SET_STRING

#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)
#define yytext
Definition: ast_expr2f.c:137
Definition: ast_expr2.c:325
#define calloc(a, b)
Definition: astmm.h:157
#define strdup(a)
Definition: astmm.h:165

Definition at line 586 of file ast_expr2f.c.

Referenced by while().

◆ trail

#define trail   2

Definition at line 615 of file ast_expr2f.c.

Referenced by while().

◆ UINT16_MAX

#define UINT16_MAX   (65535U)

Definition at line 84 of file ast_expr2f.c.

◆ UINT32_MAX

#define UINT32_MAX   (4294967295U)

Definition at line 87 of file ast_expr2f.c.

Referenced by ast_parse_arg().

◆ UINT8_MAX

#define UINT8_MAX   (255U)

Definition at line 81 of file ast_expr2f.c.

◆ unput

#define unput (   c)    yyunput( c, yyg->yytext_ptr , yyscanner )

Definition at line 205 of file ast_expr2f.c.

Referenced by while().

◆ var

#define var   1

Definition at line 614 of file ast_expr2f.c.

Referenced by __init_manager(), _ast_var_assign(), acf_iaxvar_read(), acf_iaxvar_write(), acf_sprintf(), aco_process_category_options(), add_cfg_entry(), add_message_id(), add_rt_cfg_entry(), add_rt_multi_cfg_entry(), agent_login_channel_config(), aMYSQL_set(), app_control_set_channel_var(), append_channel_vars(), append_row_to_cfg(), append_variable(), apply_options(), apply_options_full(), array(), assign_and_insert(), ast_ari_callback(), ast_bridge_timelimit(), ast_category_inherit(), ast_cdr_serialize_variables(), ast_channel_get_vars(), ast_channeltype_list(), ast_config_text_file_save2(), ast_http_get_post_vars(), ast_iax2_new(), ast_json_channel_vars(), ast_manager_build_channel_state_string_prefix(), ast_phoneprov_provider_register(), AST_TEST_DEFINE(), ast_var_assign(), ast_var_find(), ast_var_list_clone(), ast_var_list_destroy(), ast_variables_reverse(), ast_xmldoc_load_documentation(), authenticate_reply(), build_calendar(), build_cfg(), chan_pjsip_new(), channel_get_external_vars(), channel_set_external_vars(), check_expiration_thread(), clearvar_prefix(), cli_realtime_load(), conf_exec(), conf_run(), config_function_read(), config_option_destroy(), console_cmd(), contact_to_var_list(), copy_plain_file(), copy_variables(), create_mwi_subscriptions(), crement_function_read(), fields_handler(), find_conf(), find_conf_realtime(), find_realtime(), find_user_realtime(), free_chanvar(), free_external_channelvars(), function_realtime_read(), function_realtime_readdestroy(), get_chan_by_ast_name(), get_defaults(), get_insecure_variable_from_config(), get_insecure_variable_from_sippeers(), global_read(), handle_aor(), handle_show_chanvar(), handle_showchan(), handle_updates(), handle_uri(), http_post_callback(), iax2_call(), iax_parse_ies(), inherit_category(), init_logger_chain(), ldap_loadentry(), ldap_table_config_add_attribute(), leave_queue(), load_aliases(), load_config(), load_moh_classes(), load_realtime_musiconhold(), load_users(), load_zonemessages(), local_ast_moh_start(), localized_config_text_file_save(), man_do_variable_value(), manager_sipnotify(), meetme_menu_admin_extended(), minivm_account_func_read(), misdn_hangup(), moh_parse_options(), move_variables(), my_connect_db(), my_load_module(), new_realtime_sqlite3_db(), odbc_load_module(), osp_create_provider(), oss_request(), parse_config(), parse_cookies(), parse_variable_name(), pbx_builtin_serialize_variables(), pbx_substitute_variables_helper_full(), prep_email_sub_vars(), process_my_load_module(), process_text_line(), profile_destructor(), queue_function_queuegetchannel(), queue_function_queuewaitingcount(), realtime_curl(), realtime_directory(), realtime_ldap(), realtime_ldap_entry_to_var(), realtime_ldap_result_to_vars(), realtime_multi_curl(), realtime_multi_ldap(), realtime_multi_mysql(), realtime_multi_odbc(), realtime_multi_pgsql(), realtime_mysql(), realtime_odbc(), realtime_peer(), realtime_peer_get_sippeer_helper(), realtime_pgsql(), realtime_user(), realtimefield_read(), register_realtime_peers_with_callbackextens(), reload_followme(), reload_module(), reload_single_queue(), rt_extend_conf(), rtp_reload(), set_var_to_str(), shared_read(), shared_variable_free(), shared_write(), shift_pop(), show_users_realtime(), sip_cli_notify(), sip_msg_send(), sipinfo_send(), sla_build_station(), sla_build_trunk(), socket_process_helper(), stasis_app_control_set_channel_var(), static_realtime_cb(), test_chan_variable(), test_config_validity(), tls_method_to_str(), transmit_invite(), unshift_push(), variable_named(), variables_count(), varshead_dtor(), vm_allocate_dh(), vm_change_password(), while(), write_password_to_file(), and xml_translate().

◆ YY_AT_BOL

#define YY_AT_BOL ( )    (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)

Definition at line 336 of file ast_expr2f.c.

◆ YY_BREAK

#define YY_BREAK   break;

Definition at line 844 of file ast_expr2f.c.

Referenced by while().

◆ YY_BUF_SIZE

#define YY_BUF_SIZE   16384

Definition at line 172 of file ast_expr2f.c.

Referenced by ast_yyrestart(), and if().

◆ YY_BUFFER_EOF_PENDING

#define YY_BUFFER_EOF_PENDING   2

Definition at line 272 of file ast_expr2f.c.

Referenced by yy_get_next_buffer().

◆ YY_BUFFER_NEW

#define YY_BUFFER_NEW   0

Definition at line 260 of file ast_expr2f.c.

Referenced by ast_yy_flush_buffer(), ast_yy_scan_buffer(), and while().

◆ YY_BUFFER_NORMAL

#define YY_BUFFER_NORMAL   1

Definition at line 261 of file ast_expr2f.c.

Referenced by while().

◆ YY_CURRENT_BUFFER

#define YY_CURRENT_BUFFER

◆ YY_CURRENT_BUFFER_LVALUE

#define YY_CURRENT_BUFFER_LVALUE   yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]

◆ YY_DECL

#define YY_DECL
Value:
int ast_yylex \
(YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
int ast_yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner)
void * yyscan_t
Definition: ael_structs.h:71

Definition at line 831 of file ast_expr2f.c.

◆ YY_DECL_IS_OURS

#define YY_DECL_IS_OURS   1

Definition at line 826 of file ast_expr2f.c.

◆ YY_DO_BEFORE_ACTION

#define YY_DO_BEFORE_ACTION

Definition at line 357 of file ast_expr2f.c.

Referenced by while().

◆ YY_END_OF_BUFFER

#define YY_END_OF_BUFFER   39

Definition at line 366 of file ast_expr2f.c.

Referenced by while().

◆ YY_END_OF_BUFFER_CHAR

#define YY_END_OF_BUFFER_CHAR   0

◆ YY_EXIT_FAILURE

#define YY_EXIT_FAILURE   2

Definition at line 2018 of file ast_expr2f.c.

Referenced by yy_fatal_error().

◆ YY_EXTRA_TYPE

#define YY_EXTRA_TYPE   void *

Definition at line 626 of file ast_expr2f.c.

◆ YY_FATAL_ERROR

#define YY_FATAL_ERROR (   msg)    yy_fatal_error( msg , yyscanner)

◆ yy_flex_debug

#define yy_flex_debug   yyg->yy_flex_debug_r

Definition at line 140 of file ast_expr2f.c.

Referenced by ast_yyget_debug(), and ast_yyset_debug().

◆ YY_FLEX_MAJOR_VERSION

#define YY_FLEX_MAJOR_VERSION   2

Definition at line 13 of file ast_expr2f.c.

◆ YY_FLEX_MINOR_VERSION

#define YY_FLEX_MINOR_VERSION   5

Definition at line 14 of file ast_expr2f.c.

◆ YY_FLEX_SUBMINOR_VERSION

#define YY_FLEX_SUBMINOR_VERSION   35

Definition at line 15 of file ast_expr2f.c.

◆ YY_FLUSH_BUFFER

#define YY_FLUSH_BUFFER   ast_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)

Definition at line 304 of file ast_expr2f.c.

◆ YY_INPUT

#define YY_INPUT (   buf,
  result,
  max_size 
)

Definition at line 770 of file ast_expr2f.c.

Referenced by yy_get_next_buffer().

◆ YY_INT_ALIGNED

#define YY_INT_ALIGNED   short int

Definition at line 8 of file ast_expr2f.c.

◆ YY_LESS_LINENO

#define YY_LESS_LINENO (   n)

Definition at line 189 of file ast_expr2f.c.

◆ YY_MORE_ADJ

#define YY_MORE_ADJ   yyg->yy_more_len

Definition at line 493 of file ast_expr2f.c.

Referenced by while(), yy_get_next_buffer(), and yy_get_previous_state().

◆ yy_new_buffer

#define yy_new_buffer   ast_yy_create_buffer

Definition at line 314 of file ast_expr2f.c.

◆ YY_NEW_FILE

#define YY_NEW_FILE   ast_yyrestart(yyin ,yyscanner )

Definition at line 159 of file ast_expr2f.c.

Referenced by input(), and while().

◆ YY_NULL

#define YY_NULL   0

Definition at line 116 of file ast_expr2f.c.

◆ YY_NUM_RULES

#define YY_NUM_RULES   38

Definition at line 365 of file ast_expr2f.c.

◆ YY_READ_BUF_SIZE

#define YY_READ_BUF_SIZE   8192

Definition at line 754 of file ast_expr2f.c.

Referenced by yy_get_next_buffer().

◆ YY_RESTORE_YY_MORE_OFFSET

#define YY_RESTORE_YY_MORE_OFFSET

Definition at line 494 of file ast_expr2f.c.

Referenced by while().

◆ YY_RULE_SETUP

#define YY_RULE_SETUP   YY_USER_ACTION

Definition at line 847 of file ast_expr2f.c.

Referenced by while().

◆ YY_SC_TO_UI

#define YY_SC_TO_UI (   c)    ((unsigned int) (unsigned char) c)

Definition at line 123 of file ast_expr2f.c.

Referenced by while(), and yy_get_previous_state().

◆ yy_set_bol

#define yy_set_bol (   at_bol)

Definition at line 326 of file ast_expr2f.c.

◆ yy_set_interactive

#define yy_set_interactive (   is_interactive)

Definition at line 316 of file ast_expr2f.c.

◆ YY_SKIP_YYWRAP

#define YY_SKIP_YYWRAP

Definition at line 341 of file ast_expr2f.c.

◆ YY_START

#define YY_START   ((yyg->yy_start - 1) / 2)

Definition at line 152 of file ast_expr2f.c.

Referenced by while().

◆ YY_START_STACK_INCR

#define YY_START_STACK_INCR   25

Definition at line 812 of file ast_expr2f.c.

◆ YY_STATE_BUF_SIZE

#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))

Definition at line 178 of file ast_expr2f.c.

◆ YY_STATE_EOF

#define YY_STATE_EOF (   state)    (YY_END_OF_BUFFER + state + 1)

Definition at line 156 of file ast_expr2f.c.

Referenced by while().

◆ YY_STRUCT_YY_BUFFER_STATE

#define YY_STRUCT_YY_BUFFER_STATE

Definition at line 213 of file ast_expr2f.c.

◆ YY_TYPEDEF_YY_BUFFER_STATE

#define YY_TYPEDEF_YY_BUFFER_STATE

Definition at line 181 of file ast_expr2f.c.

◆ YY_TYPEDEF_YY_SCANNER_T

#define YY_TYPEDEF_YY_SCANNER_T

Definition at line 127 of file ast_expr2f.c.

◆ YY_TYPEDEF_YY_SIZE_T

#define YY_TYPEDEF_YY_SIZE_T

Definition at line 208 of file ast_expr2f.c.

◆ YY_USER_ACTION

#define YY_USER_ACTION

Definition at line 839 of file ast_expr2f.c.

◆ yycolumn

#define yycolumn   (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)

Definition at line 139 of file ast_expr2f.c.

Referenced by ast_yyget_column(), and ast_yyset_column().

◆ yyconst

#define yyconst

Definition at line 112 of file ast_expr2f.c.

Referenced by ast_yylex_destroy().

◆ yyextra

#define yyextra   yyg->yyextra_r

Definition at line 135 of file ast_expr2f.c.

Referenced by ast_yyget_extra(), and ast_yyset_extra().

◆ yyin

#define yyin   yyg->yyin_r

◆ yyleng

#define yyleng   yyg->yyleng_r

Definition at line 136 of file ast_expr2f.c.

Referenced by ast_yyget_leng(), and while().

◆ yyless [1/2]

#define yyless (   n)

Definition at line 2030 of file ast_expr2f.c.

◆ yyless [2/2]

#define yyless (   n)

Definition at line 2030 of file ast_expr2f.c.

◆ yylineno

#define yylineno   (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)

Definition at line 138 of file ast_expr2f.c.

Referenced by ast_yyget_lineno(), and ast_yyset_lineno().

◆ yylloc

#define yylloc   yyg->yylloc_r

Definition at line 673 of file ast_expr2f.c.

Referenced by ast_yyget_lloc(), and ast_yyset_lloc().

◆ yylval

#define yylval   yyg->yylval_r

Definition at line 671 of file ast_expr2f.c.

Referenced by ast_yyget_lval(), and ast_yyset_lval().

◆ yymore

#define yymore ( )    (yyg->yy_more_flag = 1)

Definition at line 492 of file ast_expr2f.c.

Referenced by while().

◆ yyout

#define yyout   yyg->yyout_r

Definition at line 134 of file ast_expr2f.c.

Referenced by ast_yyget_out(), ast_yyset_out(), if(), and yy_init_globals().

◆ YYSTATE

#define YYSTATE   YY_START

Definition at line 153 of file ast_expr2f.c.

◆ YYTABLES_NAME

#define YYTABLES_NAME   "yytables"

Definition at line 2382 of file ast_expr2f.c.

◆ yyterminate

#define yyterminate ( )    return YY_NULL

Definition at line 807 of file ast_expr2f.c.

Referenced by while().

◆ yytext

#define yytext   yyg->yytext_r

Definition at line 137 of file ast_expr2f.c.

Referenced by ast_yyerror(), ast_yyget_text(), and while().

◆ yytext_ptr

#define yytext_ptr   yytext_r

Definition at line 347 of file ast_expr2f.c.

Typedef Documentation

◆ flex_int16_t

typedef short int flex_int16_t

Definition at line 55 of file ast_expr2f.c.

◆ flex_int32_t

typedef int flex_int32_t

Definition at line 56 of file ast_expr2f.c.

◆ flex_int8_t

typedef signed char flex_int8_t

Definition at line 54 of file ast_expr2f.c.

◆ flex_uint16_t

typedef unsigned short int flex_uint16_t

Definition at line 58 of file ast_expr2f.c.

◆ flex_uint32_t

typedef unsigned int flex_uint32_t

Definition at line 59 of file ast_expr2f.c.

◆ flex_uint8_t

typedef unsigned char flex_uint8_t

Definition at line 57 of file ast_expr2f.c.

◆ YY_BUFFER_STATE

Definition at line 182 of file ast_expr2f.c.

◆ YY_CHAR

typedef unsigned char YY_CHAR

Definition at line 343 of file ast_expr2f.c.

◆ yy_size_t

typedef size_t yy_size_t

Definition at line 209 of file ast_expr2f.c.

◆ yy_state_type

typedef int yy_state_type

Definition at line 345 of file ast_expr2f.c.

◆ yyscan_t

typedef void* yyscan_t

Definition at line 128 of file ast_expr2f.c.

Enumeration Type Documentation

◆ valtype

enum valtype
Enumerator
AST_EXPR_number 
AST_EXPR_numeric_string 
AST_EXPR_string 
AST_EXPR_number 
AST_EXPR_numeric_string 
AST_EXPR_string 

Definition at line 566 of file ast_expr2f.c.

Function Documentation

◆ ast_expr()

int ast_expr ( char *  expr,
char *  buf,
int  length,
struct ast_channel chan 
)

Evaluate the given expression.

Parameters
exprAn expression
bufResult buffer
lengthSize of the result buffer, in bytes
chanChannel to use for evaluating included dialplan functions, if any
Returns
Length of the result string, in bytes

Definition at line 2405 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 AST_TEST_DEFINE(), check_eval(), check_pval_item(), is_zero_or_null(), and pbx_substitute_variables_helper_full().

2406 {
2407  struct parse_io io = { .string = expr, .chan = chan };
2408  int return_value = 0;
2409 
2410  ast_yylex_init(&io.scanner);
2411 
2412  ast_yy_scan_string(expr, io.scanner);
2413 
2414  ast_yyparse ((void *) &io);
2415 
2417 
2418  if (!io.val) {
2419  if (length > 1) {
2420  strcpy(buf, "0");
2421  return_value = 1;
2422  }
2423  } else {
2424  if (io.val->type == AST_EXPR_number) {
2425  int res_length;
2426 
2427  res_length = snprintf(buf, length, FP___PRINTF, io.val->u.i);
2428  return_value = (res_length <= length) ? res_length : length;
2429  } else {
2430  if (io.val->u.s)
2431 #if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE)
2432  strncpy(buf, io.val->u.s, length - 1);
2433 #else /* !STANDALONE && !LOW_MEMORY */
2434  ast_copy_string(buf, io.val->u.s, length);
2435 #endif /* STANDALONE || LOW_MEMORY */
2436  else
2437  buf[0] = 0;
2438  return_value = strlen(buf);
2439  free(io.val->u.s);
2440  }
2441  free(io.val);
2442  }
2443  return return_value;
2444 }
int ast_yyparse(void *)
#define FP___PRINTF
Definition: ast_expr2f.c:535
FP___TYPE i
Definition: ast_expr2.c:329
char buf[BUFSIZE]
Definition: eagi_proxy.c:66
YY_BUFFER_STATE ast_yy_scan_string(yyconst char *yy_str, yyscan_t yyscanner)
Definition: ast_expr2f.c:1974
struct val * val
Definition: ast_expr2.c:351
yyscan_t scanner
Definition: ael_structs.h:78
enum valtype type
Definition: ast_expr2.c:326
char * s
Definition: ast_expr2.c:328
void free()
static struct io_context * io
Definition: chan_ooh323.c:401
int ast_yylex_init(yyscan_t *scanner)
Definition: ast_expr2f.c:2221
int ast_yylex_destroy(yyscan_t yyscanner)
Definition: ast_expr2f.c:2312
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Definition: strings.h:401
union val::@329 u

◆ ast_expr_clear_extra_error_info()

void ast_expr_clear_extra_error_info ( void  )

Definition at line 2483 of file ast_expr2f.c.

Referenced by check_pval_item().

2484 {
2486  extra_error_message[0] = 0;
2487 }
char extra_error_message[4095]
Definition: ast_expr2f.c:2472
int extra_error_message_supplied
Definition: ast_expr2f.c:2473

◆ ast_expr_register_extra_error_info()

void ast_expr_register_extra_error_info ( char *  message)

Definition at line 2477 of file ast_expr2f.c.

Referenced by check_pval_item().

2478 {
2480  strcpy(extra_error_message, message);
2481 }
char extra_error_message[4095]
Definition: ast_expr2f.c:2472
int extra_error_message_supplied
Definition: ast_expr2f.c:2473

◆ ast_str_expr()

int ast_str_expr ( struct ast_str **  str,
ssize_t  maxlen,
struct ast_channel chan,
char *  expr 
)

Evaluate the given expression.

Parameters
strDynamic 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
chanChannel to use for evaluating included dialplan functions, if any
exprAn expression
Returns
Length of the result string, in bytes

Definition at line 2447 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().

2448 {
2449  struct parse_io io = { .string = expr, .chan = chan };
2450 
2451  ast_yylex_init(&io.scanner);
2452  ast_yy_scan_string(expr, io.scanner);
2453  ast_yyparse ((void *) &io);
2455 
2456  if (!io.val) {
2457  ast_str_set(str, maxlen, "0");
2458  } else {
2459  if (io.val->type == AST_EXPR_number) {
2460  ast_str_set(str, maxlen, FP___PRINTF, io.val->u.i);
2461  } else if (io.val->u.s) {
2462  ast_str_set(str, maxlen, "%s", io.val->u.s);
2463  free(io.val->u.s);
2464  }
2465  free(io.val);
2466  }
2467  return ast_str_strlen(*str);
2468 }
int ast_yyparse(void *)
#define FP___PRINTF
Definition: ast_expr2f.c:535
FP___TYPE i
Definition: ast_expr2.c:329
YY_BUFFER_STATE ast_yy_scan_string(yyconst char *yy_str, yyscan_t yyscanner)
Definition: ast_expr2f.c:1974
struct val * val
Definition: ast_expr2.c:351
yyscan_t scanner
Definition: ael_structs.h:78
enum valtype type
Definition: ast_expr2.c:326
char * s
Definition: ast_expr2.c:328
int ast_str_set(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Set a dynamic string using variable arguments.
Definition: strings.h:1065
void free()
static struct io_context * io
Definition: chan_ooh323.c:401
int ast_yylex_init(yyscan_t *scanner)
Definition: ast_expr2f.c:2221
int ast_yylex_destroy(yyscan_t yyscanner)
Definition: ast_expr2f.c:2312
size_t ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
Definition: strings.h:688
union val::@329 u

◆ ast_yy_create_buffer()

YY_BUFFER_STATE ast_yy_create_buffer ( FILE *  file,
int  size,
yyscan_t  yyscanner 
)

Allocate and initialize an input buffer state.

Parameters
fileA readable stream.
sizeThe character buffer size in bytes. When in doubt, use YY_BUF_SIZE.
yyscannerThe scanner object.
Returns
the allocated buffer state.

Definition at line 1725 of file ast_expr2f.c.

References ast_yy_init_buffer(), ast_yyalloc(), b, yy_buffer_state::yy_buf_size, yy_buffer_state::yy_ch_buf, YY_FATAL_ERROR, and yy_buffer_state::yy_is_our_buffer.

Referenced by ast_yyrestart(), and if().

1726 {
1728 
1729  b = (YY_BUFFER_STATE) ast_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1730  if ( ! b )
1731  YY_FATAL_ERROR( "out of dynamic memory in ast_yy_create_buffer()" );
1732 
1733  b->yy_buf_size = size;
1734 
1735  /* yy_ch_buf has to be 2 characters longer than the size given because
1736  * we need to put in 2 end-of-buffer characters.
1737  */
1738  b->yy_ch_buf = (char *) ast_yyalloc(b->yy_buf_size + 2 ,yyscanner );
1739  if ( ! b->yy_ch_buf )
1740  YY_FATAL_ERROR( "out of dynamic memory in ast_yy_create_buffer()" );
1741 
1742  b->yy_is_our_buffer = 1;
1743 
1744  ast_yy_init_buffer(b,file ,yyscanner);
1745 
1746  return b;
1747 }
#define YY_FATAL_ERROR(msg)
Definition: ast_expr2f.c:817
void * ast_yyalloc(yy_size_t, yyscan_t yyscanner)
Definition: ast_expr2f.c:2365
char * yy_ch_buf
Definition: ast_expr2f.c:218
yy_size_t yy_buf_size
Definition: ast_expr2f.c:224
struct yy_buffer_state * YY_BUFFER_STATE
Definition: ast_expr2f.c:182
static struct test_val b
static void ast_yy_init_buffer(YY_BUFFER_STATE b, FILE *file, yyscan_t yyscanner)
Definition: ast_expr2f.c:1777

◆ ast_yy_delete_buffer()

void ast_yy_delete_buffer ( YY_BUFFER_STATE  b,
yyscan_t  yyscanner 
)

Destroy the buffer.

Parameters
ba buffer created with ast_yy_create_buffer()
yyscannerThe scanner object.

Definition at line 1753 of file ast_expr2f.c.

References ast_yyfree(), isatty(), yy_buffer_state::yy_ch_buf, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, and yy_buffer_state::yy_is_our_buffer.

Referenced by ast_yylex_destroy(), and ast_yypop_buffer_state().

1754 {
1755  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1756 
1757  if ( ! b )
1758  return;
1759 
1760  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1762 
1763  if ( b->yy_is_our_buffer )
1764  ast_yyfree((void *) b->yy_ch_buf ,yyscanner );
1765 
1766  ast_yyfree((void *) b ,yyscanner );
1767 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
char * yy_ch_buf
Definition: ast_expr2f.c:218
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:283
struct yy_buffer_state * YY_BUFFER_STATE
Definition: ast_expr2f.c:182
void ast_yyfree(void *, yyscan_t yyscanner)
Definition: ast_expr2f.c:2397
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:290

◆ ast_yy_flush_buffer()

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.

Parameters
bthe buffer state to be flushed, usually YY_CURRENT_BUFFER.
yyscannerThe scanner object.

Definition at line 1806 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().

1807 {
1808  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1809  if ( ! b )
1810  return;
1811 
1812  b->yy_n_chars = 0;
1813 
1814  /* We always need two end-of-buffer characters. The first causes
1815  * a transition to the end-of-buffer state. The second causes
1816  * a jam in that state.
1817  */
1820 
1821  b->yy_buf_pos = &b->yy_ch_buf[0];
1822 
1823  b->yy_at_bol = 1;
1825 
1826  if ( b == YY_CURRENT_BUFFER )
1827  ast_yy_load_buffer_state(yyscanner );
1828 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
char * yy_ch_buf
Definition: ast_expr2f.c:218
#define YY_END_OF_BUFFER_CHAR
Definition: ast_expr2f.c:161
#define YY_BUFFER_NEW
Definition: ast_expr2f.c:260
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:283
static void ast_yy_load_buffer_state(yyscan_t yyscanner)
Definition: ast_expr2f.c:1710
char * yy_buf_pos
Definition: ast_expr2f.c:219

◆ ast_yy_init_buffer()

static void ast_yy_init_buffer ( YY_BUFFER_STATE  b,
FILE *  file,
yyscan_t  yyscanner 
)
static

Definition at line 1777 of file ast_expr2f.c.

References ast_yy_flush_buffer(), errno, make_ari_stubs::file, isatty(), 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.

Referenced by ast_yy_create_buffer(), and ast_yyrestart().

1779 {
1780  int oerrno = errno;
1781  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1782 
1783  ast_yy_flush_buffer(b ,yyscanner);
1784 
1785  b->yy_input_file = file;
1786  b->yy_fill_buffer = 1;
1787 
1788  /* If b is the current buffer, then ast_yy_init_buffer was _probably_
1789  * called from ast_yyrestart() or through yy_get_next_buffer.
1790  * In that case, we don't want to reset the lineno or column.
1791  */
1792  if (b != YY_CURRENT_BUFFER){
1793  b->yy_bs_lineno = 1;
1794  b->yy_bs_column = 0;
1795  }
1796 
1797  b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1798 
1799  errno = oerrno;
1800 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
void ast_yy_flush_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner)
Definition: ast_expr2f.c:1806
int errno
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:283
int isatty(int)
FILE * yy_input_file
Definition: ast_expr2f.c:216

◆ ast_yy_load_buffer_state()

static void ast_yy_load_buffer_state ( yyscan_t  yyscanner)
static

Definition at line 1710 of file ast_expr2f.c.

References yyguts_t::yy_c_buf_p, YY_CURRENT_BUFFER_LVALUE, yyguts_t::yy_hold_char, yyguts_t::yy_n_chars, and yyin.

Referenced by ast_yy_flush_buffer(), ast_yy_switch_to_buffer(), ast_yypop_buffer_state(), ast_yypush_buffer_state(), ast_yyrestart(), and if().

1711 {
1712  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1713  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1714  yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1715  yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1716  yyg->yy_hold_char = *yyg->yy_c_buf_p;
1717 }
char yy_hold_char
Definition: ast_expr2f.c:641
#define yyin
Definition: ast_expr2f.c:133
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
char * yy_c_buf_p
Definition: ast_expr2f.c:644
int yy_n_chars
Definition: ast_expr2f.c:642
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:290

◆ ast_yy_scan_buffer()

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.

Parameters
basethe character buffer
sizethe size in bytes of the character buffer
yyscannerThe scanner object.
Returns
the newly allocated buffer state object.

Definition at line 1937 of file ast_expr2f.c.

References ast_yy_switch_to_buffer(), ast_yyalloc(), b, 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().

1938 {
1940 
1941  if ( size < 2 ||
1942  base[size-2] != YY_END_OF_BUFFER_CHAR ||
1943  base[size-1] != YY_END_OF_BUFFER_CHAR )
1944  /* They forgot to leave room for the EOB's. */
1945  return 0;
1946 
1947  b = (YY_BUFFER_STATE) ast_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
1948  if ( ! b )
1949  YY_FATAL_ERROR( "out of dynamic memory in ast_yy_scan_buffer()" );
1950 
1951  b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1952  b->yy_buf_pos = b->yy_ch_buf = base;
1953  b->yy_is_our_buffer = 0;
1954  b->yy_input_file = 0;
1955  b->yy_n_chars = b->yy_buf_size;
1956  b->yy_is_interactive = 0;
1957  b->yy_at_bol = 1;
1958  b->yy_fill_buffer = 0;
1960 
1961  ast_yy_switch_to_buffer(b ,yyscanner );
1962 
1963  return b;
1964 }
#define YY_FATAL_ERROR(msg)
Definition: ast_expr2f.c:817
void ast_yy_switch_to_buffer(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner)
Definition: ast_expr2f.c:1678
void * ast_yyalloc(yy_size_t, yyscan_t yyscanner)
Definition: ast_expr2f.c:2365
char * yy_ch_buf
Definition: ast_expr2f.c:218
yy_size_t yy_buf_size
Definition: ast_expr2f.c:224
#define YY_END_OF_BUFFER_CHAR
Definition: ast_expr2f.c:161
#define YY_BUFFER_NEW
Definition: ast_expr2f.c:260
struct yy_buffer_state * YY_BUFFER_STATE
Definition: ast_expr2f.c:182
static struct test_val b
char * yy_buf_pos
Definition: ast_expr2f.c:219
FILE * yy_input_file
Definition: ast_expr2f.c:216

◆ ast_yy_scan_bytes()

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.

Parameters
yybytesthe byte buffer to scan
_yybytes_lenthe number of bytes in the buffer pointed to by bytes.
yyscannerThe scanner object.
Returns
the newly allocated buffer state object.

Definition at line 1987 of file ast_expr2f.c.

References ast_yy_scan_buffer(), ast_yyalloc(), b, buf, YY_END_OF_BUFFER_CHAR, YY_FATAL_ERROR, and yy_buffer_state::yy_is_our_buffer.

Referenced by ast_yy_scan_string().

1988 {
1990  char *buf;
1991  yy_size_t n;
1992  int i;
1993 
1994  /* Get memory for full buffer, including space for trailing EOB's. */
1995  n = _yybytes_len + 2;
1996  buf = (char *) ast_yyalloc(n ,yyscanner );
1997  if ( ! buf )
1998  YY_FATAL_ERROR( "out of dynamic memory in ast_yy_scan_bytes()" );
1999 
2000  for ( i = 0; i < _yybytes_len; ++i )
2001  buf[i] = yybytes[i];
2002 
2003  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2004 
2005  b = ast_yy_scan_buffer(buf,n ,yyscanner);
2006  if ( ! b )
2007  YY_FATAL_ERROR( "bad buffer in ast_yy_scan_bytes()" );
2008 
2009  /* It's okay to grow etc. this buffer, and we should throw it
2010  * away when we're done.
2011  */
2012  b->yy_is_our_buffer = 1;
2013 
2014  return b;
2015 }
#define YY_FATAL_ERROR(msg)
Definition: ast_expr2f.c:817
void * ast_yyalloc(yy_size_t, yyscan_t yyscanner)
Definition: ast_expr2f.c:2365
char buf[BUFSIZE]
Definition: eagi_proxy.c:66
#define YY_END_OF_BUFFER_CHAR
Definition: ast_expr2f.c:161
static struct test_val b
YY_BUFFER_STATE ast_yy_scan_buffer(char *base, yy_size_t size, yyscan_t yyscanner)
Definition: ast_expr2f.c:1937
size_t yy_size_t
Definition: ast_expr2f.c:209

◆ ast_yy_scan_string()

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.

Parameters
yystra NUL-terminated string to scan
yyscannerThe scanner object.
Returns
the newly allocated buffer state object.
Note
If you want to scan bytes that may contain NUL values, then use ast_yy_scan_bytes() instead.

Definition at line 1974 of file ast_expr2f.c.

References ast_yy_scan_bytes().

Referenced by ast_expr(), and ast_str_expr().

1975 {
1976 
1977  return ast_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
1978 }
YY_BUFFER_STATE ast_yy_scan_bytes(yyconst char *bytes, int len, yyscan_t yyscanner)
Definition: ast_expr2f.c:1987

◆ ast_yy_switch_to_buffer()

void ast_yy_switch_to_buffer ( YY_BUFFER_STATE  new_buffer,
yyscan_t  yyscanner 
)

Switch to a different input buffer.

Parameters
new_bufferThe new input buffer.
yyscannerThe scanner object.

Definition at line 1678 of file ast_expr2f.c.

References ast_yy_load_buffer_state(), ast_yyensure_buffer_stack(), 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.

Referenced by ast_yy_scan_buffer().

1679 {
1680  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1681 
1682  /* TODO. We should be able to replace this entire function body
1683  * with
1684  * ast_yypop_buffer_state();
1685  * ast_yypush_buffer_state(new_buffer);
1686  */
1687  ast_yyensure_buffer_stack (yyscanner);
1688  if ( YY_CURRENT_BUFFER == new_buffer )
1689  return;
1690 
1691  if ( YY_CURRENT_BUFFER )
1692  {
1693  /* Flush out information for old buffer. */
1694  *yyg->yy_c_buf_p = yyg->yy_hold_char;
1695  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1696  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1697  }
1698 
1699  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1700  ast_yy_load_buffer_state(yyscanner );
1701 
1702  /* We don't actually know whether we did this switch during
1703  * EOF (ast_yywrap()) processing, but the only time this flag
1704  * is looked at is after ast_yywrap() is called, so it's safe
1705  * to go ahead and always set it.
1706  */
1707  yyg->yy_did_buffer_switch_on_eof = 1;
1708 }
char yy_hold_char
Definition: ast_expr2f.c:641
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
char * yy_c_buf_p
Definition: ast_expr2f.c:644
int yy_did_buffer_switch_on_eof
Definition: ast_expr2f.c:647
int yy_n_chars
Definition: ast_expr2f.c:642
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:283
static void ast_yy_load_buffer_state(yyscan_t yyscanner)
Definition: ast_expr2f.c:1710
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:290
static void ast_yyensure_buffer_stack(yyscan_t yyscanner)
Definition: ast_expr2f.c:1887

◆ ast_yyalloc()

void * ast_yyalloc ( yy_size_t  size,
yyscan_t  yyscanner 
)

Definition at line 2365 of file ast_expr2f.c.

References malloc().

Referenced by ast_yy_create_buffer(), ast_yy_scan_buffer(), ast_yy_scan_bytes(), ast_yyensure_buffer_stack(), ast_yylex_init(), and ast_yylex_init_extra().

2366 {
2367  return (void *) malloc( size );
2368 }
char * malloc()

◆ ast_yyensure_buffer_stack()

static void ast_yyensure_buffer_stack ( yyscan_t  yyscanner)
static

Definition at line 1887 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_yy_switch_to_buffer(), ast_yypush_buffer_state(), ast_yyrestart(), and if().

1888 {
1889  int num_to_alloc;
1890  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1891 
1892  if (!yyg->yy_buffer_stack) {
1893 
1894  /* First allocation is just for 2 elements, since we don't know if this
1895  * scanner will even need a stack. We use 2 instead of 1 to avoid an
1896  * immediate realloc on the next call.
1897  */
1898  num_to_alloc = 1;
1900  (num_to_alloc * sizeof(struct yy_buffer_state*)
1901  , yyscanner);
1902  if ( ! yyg->yy_buffer_stack )
1903  YY_FATAL_ERROR( "out of dynamic memory in ast_yyensure_buffer_stack()" );
1904 
1905  memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1906 
1907  yyg->yy_buffer_stack_max = num_to_alloc;
1908  yyg->yy_buffer_stack_top = 0;
1909  return;
1910  }
1911 
1912  if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
1913 
1914  /* Increase the buffer to prepare for a possible push. */
1915  int grow_size = 8 /* arbitrary grow size */;
1916 
1917  num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
1919  (yyg->yy_buffer_stack,
1920  num_to_alloc * sizeof(struct yy_buffer_state*)
1921  , yyscanner);
1922  if ( ! yyg->yy_buffer_stack )
1923  YY_FATAL_ERROR( "out of dynamic memory in ast_yyensure_buffer_stack()" );
1924 
1925  /* zero only the new slots.*/
1926  memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
1927  yyg->yy_buffer_stack_max = num_to_alloc;
1928  }
1929 }
#define YY_FATAL_ERROR(msg)
Definition: ast_expr2f.c:817
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
void * ast_yyalloc(yy_size_t, yyscan_t yyscanner)
Definition: ast_expr2f.c:2365
YY_BUFFER_STATE * yy_buffer_stack
Definition: ast_expr2f.c:640
void * ast_yyrealloc(void *, yy_size_t, yyscan_t yyscanner)
Definition: ast_expr2f.c:2370
size_t yy_buffer_stack_max
Definition: ast_expr2f.c:639
size_t yy_buffer_stack_top
Definition: ast_expr2f.c:638

◆ ast_yyerror() [1/2]

int ast_yyerror ( const char *  ,
YYLTYPE ,
struct parse_io  
)

◆ ast_yyerror() [2/2]

int ast_yyerror ( const char *  s,
yyltype loc,
struct parse_io parseio 
)

Definition at line 2586 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.

2587 {
2588  struct yyguts_t * yyg = (struct yyguts_t*)(parseio->scanner);
2589  char spacebuf[8000]; /* best safe than sorry */
2590  int i=0;
2591  char *s2 = expr2_token_subst(s);
2592  spacebuf[0] = 0;
2593 
2594  for (i = 0; i < (int)(yytext - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf); i++) {
2595  spacebuf[i] = ' ';
2596  }
2597  /* uh... assuming yyg is defined, then I can use the yycolumn macro,
2598  which is the same thing as... get this:
2599  yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]->yy_bs_column
2600  I was tempted to just use yy_buf_pos in the STATE, but..., well:
2601  a. the yy_buf_pos is the current position in the buffer, which
2602  may not relate to the entire string/buffer because of the
2603  buffering.
2604  b. but, analysis of the situation is that when you use the
2605  ast_yy_scan_string func, it creates a single buffer the size of
2606  string, so the two would be the same...
2607  so, in the end, the yycolumn macro is available, shorter, therefore easier. */
2608 
2609  spacebuf[i++] = '^';
2610  spacebuf[i] = 0;
2611 
2612 #ifdef STANDALONE3
2613  /* easier to read in the standalone version */
2614  printf("ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n",
2615  (extra_error_message_supplied ? extra_error_message : ""), s2, parseio->string, spacebuf);
2616 #else
2617  ast_log(LOG_WARNING,"ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n",
2618  (extra_error_message_supplied ? extra_error_message : ""), s2, parseio->string, spacebuf);
2619 #endif
2620 #ifndef STANDALONE
2621  ast_log(LOG_WARNING,"If you have questions, please refer to https://wiki.asterisk.org/wiki/display/AST/Channel+Variables\n");
2622 #endif
2623  free(s2);
2624  return(0);
2625 }
#define yytext
Definition: ast_expr2f.c:137
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
#define LOG_WARNING
Definition: logger.h:274
char extra_error_message[4095]
Definition: ast_expr2f.c:2472
yyscan_t scanner
Definition: ael_structs.h:78
#define ast_log
Definition: astobj2.c:42
void free()
static char * expr2_token_subst(const char *mess)
Definition: ast_expr2f.c:2542
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:290
char * string
Definition: ast_expr2.c:350
int extra_error_message_supplied
Definition: ast_expr2f.c:2473

◆ ast_yyfree()

void ast_yyfree ( void *  ptr,
yyscan_t  yyscanner 
)

Definition at line 2397 of file ast_expr2f.c.

References free().

Referenced by ast_yy_delete_buffer(), and ast_yylex_destroy().

2398 {
2399  /* the normal generated ast_yyfree func just frees its first arg;
2400  this get complaints on some systems, as sometimes this
2401  arg is a nil ptr! It's usually not fatal, but is irritating! */
2402  free( (char *) ptr );
2403 }
void free()

◆ ast_yyget_column()

int ast_yyget_column ( yyscan_t  yyscanner)

Get the current column number.

Parameters
yyscannerThe scanner object.

Definition at line 2071 of file ast_expr2f.c.

References YY_CURRENT_BUFFER, and yycolumn.

2072 {
2073  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2074 
2075  if (! YY_CURRENT_BUFFER)
2076  return 0;
2077 
2078  return yycolumn;
2079 }
#define yycolumn
Definition: ast_expr2f.c:139
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:283

◆ ast_yyget_debug()

int ast_yyget_debug ( yyscan_t  yyscanner)

Definition at line 2176 of file ast_expr2f.c.

References yy_flex_debug.

2177 {
2178  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2179  return yy_flex_debug;
2180 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
#define yy_flex_debug
Definition: ast_expr2f.c:140

◆ ast_yyget_extra()

YY_EXTRA_TYPE ast_yyget_extra ( yyscan_t  yyscanner)

Get the user-defined data for this scanner.

Parameters
yyscannerThe scanner object.

Definition at line 2049 of file ast_expr2f.c.

References yyextra.

2050 {
2051  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2052  return yyextra;
2053 }
#define yyextra
Definition: ast_expr2f.c:135
struct yyguts_t * yyg
Definition: ast_expr2f.c:857

◆ ast_yyget_in()

FILE * ast_yyget_in ( yyscan_t  yyscanner)

Get the input stream.

Parameters
yyscannerThe scanner object.

Definition at line 2084 of file ast_expr2f.c.

References yyin.

2085 {
2086  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2087  return yyin;
2088 }
#define yyin
Definition: ast_expr2f.c:133
struct yyguts_t * yyg
Definition: ast_expr2f.c:857

◆ ast_yyget_leng()

int ast_yyget_leng ( yyscan_t  yyscanner)

Get the length of the current token.

Parameters
yyscannerThe scanner object.

Definition at line 2102 of file ast_expr2f.c.

References yyleng.

2103 {
2104  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2105  return yyleng;
2106 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
#define yyleng
Definition: ast_expr2f.c:136

◆ ast_yyget_lineno()

int ast_yyget_lineno ( yyscan_t  yyscanner)

Get the current line number.

Parameters
yyscannerThe scanner object.

Definition at line 2058 of file ast_expr2f.c.

References YY_CURRENT_BUFFER, and yylineno.

2059 {
2060  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2061 
2062  if (! YY_CURRENT_BUFFER)
2063  return 0;
2064 
2065  return yylineno;
2066 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:283
#define yylineno
Definition: ast_expr2f.c:138

◆ ast_yyget_lloc()

YYLTYPE * ast_yyget_lloc ( yyscan_t  yyscanner)

Definition at line 2202 of file ast_expr2f.c.

References yylloc.

2203 {
2204  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2205  return yylloc;
2206 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
#define yylloc
Definition: ast_expr2f.c:673

◆ ast_yyget_lval()

YYSTYPE * ast_yyget_lval ( yyscan_t  yyscanner)

Definition at line 2190 of file ast_expr2f.c.

References yylval.

2191 {
2192  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2193  return yylval;
2194 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
#define yylval
Definition: ast_expr2f.c:671

◆ ast_yyget_out()

FILE * ast_yyget_out ( yyscan_t  yyscanner)

Get the output stream.

Parameters
yyscannerThe scanner object.

Definition at line 2093 of file ast_expr2f.c.

References yyout.

2094 {
2095  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2096  return yyout;
2097 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
#define yyout
Definition: ast_expr2f.c:134

◆ ast_yyget_text()

char * ast_yyget_text ( yyscan_t  yyscanner)

Get the current token.

Parameters
yyscannerThe scanner object.

Definition at line 2112 of file ast_expr2f.c.

References yytext.

2113 {
2114  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2115  return yytext;
2116 }
#define yytext
Definition: ast_expr2f.c:137
struct yyguts_t * yyg
Definition: ast_expr2f.c:857

◆ ast_yylex()

int ast_yylex ( YYSTYPE yylval_param,
YYLTYPE yylloc_param,
yyscan_t  yyscanner 
)

◆ ast_yylex_destroy()

int ast_yylex_destroy ( yyscan_t  yyscanner)

Definition at line 2312 of file ast_expr2f.c.

References ast_yy_delete_buffer(), ast_yyfree(), ast_yypop_buffer_state(), NULL, yyguts_t::yy_buffer_stack, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yy_init_globals(), yyguts_t::yy_start_stack, and yyconst.

Referenced by ast_expr(), and ast_str_expr().

2313 {
2314  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2315 
2316  /* Pop the buffer stack, destroying each element. */
2317  while(YY_CURRENT_BUFFER){
2320  ast_yypop_buffer_state(yyscanner);
2321  }
2322 
2323  /* Destroy the stack itself. */
2324  ast_yyfree(yyg->yy_buffer_stack ,yyscanner);
2325  yyg->yy_buffer_stack = NULL;
2326 
2327  /* Destroy the start condition stack. */
2328  ast_yyfree(yyg->yy_start_stack ,yyscanner );
2329  yyg->yy_start_stack = NULL;
2330 
2331  /* Reset the globals. This is important in a non-reentrant scanner so the next time
2332  * ast_yylex() is called, initialization will occur. */
2333  yy_init_globals( yyscanner);
2334 
2335  /* Destroy the main struct (reentrant only). */
2336  ast_yyfree ( yyscanner , yyscanner );
2337  yyscanner = NULL;
2338  return 0;
2339 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
static int yy_init_globals(yyscan_t yyscanner)
Definition: ast_expr2f.c:2278
#define NULL
Definition: resample.c:96
YY_BUFFER_STATE * yy_buffer_stack
Definition: ast_expr2f.c:640
int * yy_start_stack
Definition: ast_expr2f.c:650
void ast_yypop_buffer_state(yyscan_t yyscanner)
Definition: ast_expr2f.c:1867
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:283
void ast_yyfree(void *, yyscan_t yyscanner)
Definition: ast_expr2f.c:2397
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:290
void ast_yy_delete_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner)
Definition: ast_expr2f.c:1753

◆ ast_yylex_init()

int ast_yylex_init ( yyscan_t scanner)

Definition at line 2221 of file ast_expr2f.c.

References ast_yyalloc(), errno, NULL, and yy_init_globals().

Referenced by ast_expr(), and ast_str_expr().

2223 {
2224  if (ptr_yy_globals == NULL){
2225  errno = EINVAL;
2226  return 1;
2227  }
2228 
2229  *ptr_yy_globals = (yyscan_t) ast_yyalloc ( sizeof( struct yyguts_t ), NULL );
2230 
2231  if (*ptr_yy_globals == NULL){
2232  errno = ENOMEM;
2233  return 1;
2234  }
2235 
2236  /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
2237  memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2238 
2239  return yy_init_globals ( *ptr_yy_globals );
2240 }
void * ast_yyalloc(yy_size_t, yyscan_t yyscanner)
Definition: ast_expr2f.c:2365
static int yy_init_globals(yyscan_t yyscanner)
Definition: ast_expr2f.c:2278
#define NULL
Definition: resample.c:96
void * yyscan_t
Definition: ast_expr2f.c:128
int errno

◆ ast_yylex_init_extra()

int ast_yylex_init_extra ( YY_EXTRA_TYPE  user_defined,
yyscan_t scanner 
)

Definition at line 2250 of file ast_expr2f.c.

References ast_yyalloc(), ast_yyset_extra(), errno, NULL, and yy_init_globals().

2252 {
2253  struct yyguts_t dummy_yyguts;
2254 
2255  ast_yyset_extra (yy_user_defined, &dummy_yyguts);
2256 
2257  if (ptr_yy_globals == NULL){
2258  errno = EINVAL;
2259  return 1;
2260  }
2261 
2262  *ptr_yy_globals = (yyscan_t) ast_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
2263 
2264  if (*ptr_yy_globals == NULL){
2265  errno = ENOMEM;
2266  return 1;
2267  }
2268 
2269  /* By setting to 0xAA, we expose bugs in
2270  yy_init_globals. Leave at 0x00 for releases. */
2271  memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
2272 
2273  ast_yyset_extra (yy_user_defined, *ptr_yy_globals);
2274 
2275  return yy_init_globals ( *ptr_yy_globals );
2276 }
void * ast_yyalloc(yy_size_t, yyscan_t yyscanner)
Definition: ast_expr2f.c:2365
static int yy_init_globals(yyscan_t yyscanner)
Definition: ast_expr2f.c:2278
#define NULL
Definition: resample.c:96
void ast_yyset_extra(YY_EXTRA_TYPE user_defined, yyscan_t yyscanner)
Definition: ast_expr2f.c:2122
void * yyscan_t
Definition: ast_expr2f.c:128
int errno

◆ ast_yyparse()

int ast_yyparse ( void *  )

Referenced by ast_expr(), and ast_str_expr().

◆ ast_yypop_buffer_state()

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.

Parameters
yyscannerThe scanner object.

Definition at line 1867 of file ast_expr2f.c.

References ast_yy_delete_buffer(), ast_yy_load_buffer_state(), NULL, 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().

1868 {
1869  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1870  if (!YY_CURRENT_BUFFER)
1871  return;
1872 
1875  if (yyg->yy_buffer_stack_top > 0)
1876  --yyg->yy_buffer_stack_top;
1877 
1878  if (YY_CURRENT_BUFFER) {
1879  ast_yy_load_buffer_state(yyscanner );
1880  yyg->yy_did_buffer_switch_on_eof = 1;
1881  }
1882 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
#define NULL
Definition: resample.c:96
int yy_did_buffer_switch_on_eof
Definition: ast_expr2f.c:647
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:283
static void ast_yy_load_buffer_state(yyscan_t yyscanner)
Definition: ast_expr2f.c:1710
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:290
void ast_yy_delete_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner)
Definition: ast_expr2f.c:1753
size_t yy_buffer_stack_top
Definition: ast_expr2f.c:638

◆ ast_yypush_buffer_state()

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.

Parameters
new_bufferThe new state.
yyscannerThe scanner object.

Definition at line 1836 of file ast_expr2f.c.

References ast_yy_load_buffer_state(), ast_yyensure_buffer_stack(), NULL, 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.

1837 {
1838  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1839  if (new_buffer == NULL)
1840  return;
1841 
1842  ast_yyensure_buffer_stack(yyscanner);
1843 
1844  /* This block is copied from ast_yy_switch_to_buffer. */
1845  if ( YY_CURRENT_BUFFER )
1846  {
1847  /* Flush out information for old buffer. */
1848  *yyg->yy_c_buf_p = yyg->yy_hold_char;
1849  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
1850  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1851  }
1852 
1853  /* Only push if top exists. Otherwise, replace top. */
1854  if (YY_CURRENT_BUFFER)
1855  yyg->yy_buffer_stack_top++;
1856  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1857 
1858  /* copied from ast_yy_switch_to_buffer. */
1859  ast_yy_load_buffer_state(yyscanner );
1860  yyg->yy_did_buffer_switch_on_eof = 1;
1861 }
char yy_hold_char
Definition: ast_expr2f.c:641
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
char * yy_c_buf_p
Definition: ast_expr2f.c:644
#define NULL
Definition: resample.c:96
int yy_did_buffer_switch_on_eof
Definition: ast_expr2f.c:647
int yy_n_chars
Definition: ast_expr2f.c:642
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:283
static void ast_yy_load_buffer_state(yyscan_t yyscanner)
Definition: ast_expr2f.c:1710
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:290
static void ast_yyensure_buffer_stack(yyscan_t yyscanner)
Definition: ast_expr2f.c:1887
size_t yy_buffer_stack_top
Definition: ast_expr2f.c:638

◆ ast_yyrealloc()

void * ast_yyrealloc ( void *  ptr,
yy_size_t  size,
yyscan_t  yyscanner 
)

Definition at line 2370 of file ast_expr2f.c.

References realloc.

Referenced by ast_yyensure_buffer_stack(), and yy_get_next_buffer().

2371 {
2372  /* The cast to (char *) in the following accommodates both
2373  * implementations that use char* generic pointers, and those
2374  * that use void* generic pointers. It works with the latter
2375  * because both ANSI C and C++ allow castless assignment from
2376  * any pointer type to void*, and deal with argument conversions
2377  * as though doing an assignment.
2378  */
2379  return (void *) realloc( (char *) ptr, size );
2380 }
#define realloc(a, b)
Definition: astmm.h:163

◆ ast_yyrestart()

void ast_yyrestart ( FILE *  input_file,
yyscan_t  yyscanner 
)

Immediately switch to a different input stream.

Parameters
input_fileA readable stream.
yyscannerThe scanner object.
Note
This function does not reset the start condition to INITIAL .

Definition at line 1660 of file ast_expr2f.c.

References ast_yy_create_buffer(), ast_yy_init_buffer(), ast_yy_load_buffer_state(), ast_yyensure_buffer_stack(), YY_BUF_SIZE, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, and yyin.

Referenced by input(), and yy_get_next_buffer().

1661 {
1662  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1663 
1664  if ( ! YY_CURRENT_BUFFER ){
1665  ast_yyensure_buffer_stack (yyscanner);
1668  }
1669 
1670  ast_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
1671  ast_yy_load_buffer_state(yyscanner );
1672 }
#define yyin
Definition: ast_expr2f.c:133
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
YY_BUFFER_STATE ast_yy_create_buffer(FILE *file, int size, yyscan_t yyscanner)
Definition: ast_expr2f.c:1725
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:283
static void ast_yy_load_buffer_state(yyscan_t yyscanner)
Definition: ast_expr2f.c:1710
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:290
static void ast_yyensure_buffer_stack(yyscan_t yyscanner)
Definition: ast_expr2f.c:1887
#define YY_BUF_SIZE
Definition: ast_expr2f.c:172
static void ast_yy_init_buffer(YY_BUFFER_STATE b, FILE *file, yyscan_t yyscanner)
Definition: ast_expr2f.c:1777

◆ ast_yyset_column()

void ast_yyset_column ( int  column_no,
yyscan_t  yyscanner 
)

Set the current column.

Parameters
column_noline_number
yyscannerThe scanner object.

Definition at line 2147 of file ast_expr2f.c.

References YY_CURRENT_BUFFER, yy_fatal_error(), and yycolumn.

2148 {
2149  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2150 
2151  /* column is only valid if an input buffer exists. */
2152  if (! YY_CURRENT_BUFFER )
2153  yy_fatal_error( "ast_yyset_column called with no buffer" , yyscanner);
2154 
2155  yycolumn = column_no;
2156 }
#define yycolumn
Definition: ast_expr2f.c:139
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
static void yy_fatal_error(yyconst char msg[], yyscan_t yyscanner)
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:283

◆ ast_yyset_debug()

void ast_yyset_debug ( int  debug_flag,
yyscan_t  yyscanner 
)

Definition at line 2182 of file ast_expr2f.c.

References yy_flex_debug.

2183 {
2184  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2185  yy_flex_debug = bdebug ;
2186 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
#define yy_flex_debug
Definition: ast_expr2f.c:140

◆ ast_yyset_extra()

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.

Parameters
user_definedThe data to be associated with this scanner.
yyscannerThe scanner object.

Definition at line 2122 of file ast_expr2f.c.

References yyextra.

Referenced by ast_yylex_init_extra().

2123 {
2124  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2125  yyextra = user_defined ;
2126 }
#define yyextra
Definition: ast_expr2f.c:135
struct yyguts_t * yyg
Definition: ast_expr2f.c:857

◆ ast_yyset_in()

void ast_yyset_in ( FILE *  in_str,
yyscan_t  yyscanner 
)

Set the input stream. This does not discard the current input buffer.

Parameters
in_strA readable stream.
yyscannerThe scanner object.
See also
ast_yy_switch_to_buffer

Definition at line 2164 of file ast_expr2f.c.

References yyin.

2165 {
2166  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2167  yyin = in_str ;
2168 }
#define yyin
Definition: ast_expr2f.c:133
struct yyguts_t * yyg
Definition: ast_expr2f.c:857

◆ ast_yyset_lineno()

void ast_yyset_lineno ( int  line_number,
yyscan_t  yyscanner 
)

Set the current line number.

Parameters
line_number
yyscannerThe scanner object.

Definition at line 2132 of file ast_expr2f.c.

References YY_CURRENT_BUFFER, yy_fatal_error(), and yylineno.

2133 {
2134  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2135 
2136  /* lineno is only valid if an input buffer exists. */
2137  if (! YY_CURRENT_BUFFER )
2138  yy_fatal_error( "ast_yyset_lineno called with no buffer" , yyscanner);
2139 
2140  yylineno = line_number;
2141 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
static void yy_fatal_error(yyconst char msg[], yyscan_t yyscanner)
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:283
#define yylineno
Definition: ast_expr2f.c:138

◆ ast_yyset_lloc()

void ast_yyset_lloc ( YYLTYPE yylloc_param,
yyscan_t  yyscanner 
)

Definition at line 2208 of file ast_expr2f.c.

References yylloc.

2209 {
2210  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2211  yylloc = yylloc_param;
2212 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
#define yylloc
Definition: ast_expr2f.c:673

◆ ast_yyset_lval()

void ast_yyset_lval ( YYSTYPE yylval_param,
yyscan_t  yyscanner 
)

Definition at line 2196 of file ast_expr2f.c.

References yylval.

2197 {
2198  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2199  yylval = yylval_param;
2200 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
#define yylval
Definition: ast_expr2f.c:671

◆ ast_yyset_out()

void ast_yyset_out ( FILE *  out_str,
yyscan_t  yyscanner 
)

Definition at line 2170 of file ast_expr2f.c.

References yyout.

2171 {
2172  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2173  yyout = out_str ;
2174 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
#define yyout
Definition: ast_expr2f.c:134

◆ expr2_token_subst()

static char * expr2_token_subst ( const char *  mess)
static

Definition at line 2542 of file ast_expr2f.c.

References expr2_token_equivs1, len(), and malloc().

Referenced by ast_yyerror().

2543 {
2544  /* calc a length, malloc, fill, and return; yyerror had better free it! */
2545  int len=0,i;
2546  const char *p;
2547  char *res, *s;
2548  const char *t;
2549  int expr2_token_equivs_entries = sizeof(expr2_token_equivs1)/sizeof(char*);
2550 
2551  for (p=mess; *p; p++) {
2552  for (i=0; i<expr2_token_equivs_entries; i++) {
2553  if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 )
2554  {
2555  len+=strlen(expr2_token_equivs2[i])+2;
2556  p += strlen(expr2_token_equivs1[i])-1;
2557  break;
2558  }
2559  }
2560  len++;
2561  }
2562  res = (char*)malloc(len+1);
2563  res[0] = 0;
2564  s = res;
2565  for (p=mess; *p;) {
2566  int found = 0;
2567  for (i=0; i<expr2_token_equivs_entries; i++) {
2568  if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 ) {
2569  *s++ = '\'';
2570  for (t=expr2_token_equivs2[i]; *t;) {
2571  *s++ = *t++;
2572  }
2573  *s++ = '\'';
2574  p += strlen(expr2_token_equivs1[i]);
2575  found = 1;
2576  break;
2577  }
2578  }
2579  if( !found )
2580  *s++ = *p++;
2581  }
2582  *s++ = 0;
2583  return res;
2584 }
char * malloc()
static const char *const expr2_token_equivs1[]
Definition: ast_expr2f.c:2489
static const char *const expr2_token_equivs2[]
Definition: ast_expr2f.c:2515
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)

◆ if()

if ( !yyg->  yy_init)
Examples:
/tmp/asterisk-shallow/include/asterisk/strings.h.

Definition at line 868 of file ast_expr2f.c.

References ast_yy_create_buffer(), ast_yy_load_buffer_state(), ast_yyensure_buffer_stack(), YY_BUF_SIZE, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yyguts_t::yy_init, yyguts_t::yy_start, yyin, and yyout.

Referenced by __add_ovflpage(), __addel(), __ast_str_helper(), __ast_str_helper2(), __big_delete(), __big_split(), __bt_put(), __bt_split(), __delpair(), __hash_open(), __rec_vmap(), __rec_vpipe(), apply_contact_acl(), apply_endpoint_contact_acl(), ast_cel_fabricate_channel_from_event(), ast_format_cmp(), ast_set_default_eid(), ast_sorcery_wizard_unregister(), ast_stun_request(), ast_unreal_setoption(), ast_variable_lists_match(), cli_complete(), cli_show_subscription_common(), defer_full_frame(), dundi_send(), fax_gateway_detect_v21(), g726_write(), generate_parked_user(), get_filestream(), h263_read(), h264_read(), handle_bchan(), handle_err(), handle_mgmt(), handle_request_subscribe(), hash_access(), hash_delete(), hash_fd(), hash_get(), hash_put(), hash_seq(), hash_sync(), history_get(), keypad_cfg_read(), lintospeex_feedback(), MD5Update(), misdn_lib_get_free_bc(), misdn_lib_get_port_info(), misdn_lib_isdn_event_catcher(), newbuf(), ogg_speex_read(), ogg_vorbis_close(), ogg_vorbis_read(), ogg_vorbis_seek(), ogg_vorbis_tell(), ogg_vorbis_write(), oss_write(), parse_release_complete(), phone_write_buf(), pitch_shift(), read_dirs_cb(), rtp_learning_start(), sdp_search(), send_trunk(), socket_read(), speex_callback(), tzload(), ugly_split(), update(), update_filter(), update_jitter_stats(), update_lost_stats(), wav_close(), wav_open(), wav_seek(), wav_write(), and xmpp_connect_hook().

869  {
870  yyg->yy_init = 1;
871 
872 #ifdef YY_USER_INIT
873  YY_USER_INIT;
874 #endif
875 
876  if ( ! yyg->yy_start )
877  yyg->yy_start = 1; /* first start state */
878 
879  if ( ! yyin )
880  yyin = stdin;
881 
882  if ( ! yyout )
883  yyout = stdout;
884 
885  if ( ! YY_CURRENT_BUFFER ) {
886  ast_yyensure_buffer_stack (yyscanner);
889  }
890 
891  ast_yy_load_buffer_state(yyscanner );
892  }
#define yyin
Definition: ast_expr2f.c:133
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
YY_BUFFER_STATE ast_yy_create_buffer(FILE *file, int size, yyscan_t yyscanner)
Definition: ast_expr2f.c:1725
int yy_init
Definition: ast_expr2f.c:645
int yy_start
Definition: ast_expr2f.c:646
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:283
static void ast_yy_load_buffer_state(yyscan_t yyscanner)
Definition: ast_expr2f.c:1710
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:290
static void ast_yyensure_buffer_stack(yyscan_t yyscanner)
Definition: ast_expr2f.c:1887
#define YY_BUF_SIZE
Definition: ast_expr2f.c:172
#define yyout
Definition: ast_expr2f.c:134

◆ input()

static int input ( yyscan_t  yyscanner)
static

Definition at line 1584 of file ast_expr2f.c.

References ast_yyrestart(), ast_yywrap, c, EOB_ACT_CONTINUE_SCAN, EOB_ACT_END_OF_FILE, EOB_ACT_LAST_MATCH, yyguts_t::yy_c_buf_p, YY_CURRENT_BUFFER_LVALUE, yyguts_t::yy_did_buffer_switch_on_eof, YY_END_OF_BUFFER_CHAR, yy_get_next_buffer(), yyguts_t::yy_hold_char, yyguts_t::yy_n_chars, YY_NEW_FILE, and yyin.

Referenced by AST_TEST_DEFINE(), eivr_comm(), escape_and_substitute(), get_calleridname(), get_user_input(), sip_unregister_tests(), and strip_control_and_high().

1587 {
1588  int c;
1589  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1590 
1591  *yyg->yy_c_buf_p = yyg->yy_hold_char;
1592 
1593  if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1594  {
1595  /* yy_c_buf_p now points to the character we want to return.
1596  * If this occurs *before* the EOB characters, then it's a
1597  * valid NUL; if not, then we've hit the end of the buffer.
1598  */
1599  if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1600  /* This was really a NUL. */
1601  *yyg->yy_c_buf_p = '\0';
1602 
1603  else
1604  { /* need more input */
1605  int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1606  ++yyg->yy_c_buf_p;
1607 
1608  switch ( yy_get_next_buffer( yyscanner ) )
1609  {
1610  case EOB_ACT_LAST_MATCH:
1611  /* This happens because yy_g_n_b()
1612  * sees that we've accumulated a
1613  * token and flags that we need to
1614  * try matching the token before
1615  * proceeding. But for input(),
1616  * there's no matching to consider.
1617  * So convert the EOB_ACT_LAST_MATCH
1618  * to EOB_ACT_END_OF_FILE.
1619  */
1620 
1621  /* Reset buffer status. */
1622  ast_yyrestart(yyin ,yyscanner);
1623 
1624  /*FALLTHROUGH*/
1625 
1626  case EOB_ACT_END_OF_FILE:
1627  {
1628  if ( ast_yywrap(yyscanner ) )
1629  return EOF;
1630 
1631  if ( ! yyg->yy_did_buffer_switch_on_eof )
1632  YY_NEW_FILE;
1633 #ifdef __cplusplus
1634  return yyinput(yyscanner);
1635 #else
1636  return input(yyscanner);
1637 #endif
1638  }
1639 
1640  case EOB_ACT_CONTINUE_SCAN:
1641  yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
1642  break;
1643  }
1644  }
1645  }
1646 
1647  c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
1648  *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
1649  yyg->yy_hold_char = *++yyg->yy_c_buf_p;
1650 
1651  return c;
1652 }
char yy_hold_char
Definition: ast_expr2f.c:641
#define yyin
Definition: ast_expr2f.c:133
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
char * yy_c_buf_p
Definition: ast_expr2f.c:644
#define YY_NEW_FILE
Definition: ast_expr2f.c:159
static struct test_val c
#define EOB_ACT_END_OF_FILE
Definition: ast_expr2f.c:186
static int input(yyscan_t yyscanner)
Definition: ast_expr2f.c:1584
#define EOB_ACT_CONTINUE_SCAN
Definition: ast_expr2f.c:185
#define YY_END_OF_BUFFER_CHAR
Definition: ast_expr2f.c:161
int yy_did_buffer_switch_on_eof
Definition: ast_expr2f.c:647
void ast_yyrestart(FILE *input_file, yyscan_t yyscanner)
Definition: ast_expr2f.c:1660
int yy_n_chars
Definition: ast_expr2f.c:642
static int yy_get_next_buffer(yyscan_t yyscanner)
Definition: ast_expr2f.c:1350
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:290
#define ast_yywrap(n)
Definition: ast_expr2f.c:340
#define EOB_ACT_LAST_MATCH
Definition: ast_expr2f.c:187

◆ isatty()

int isatty ( int  )

◆ while()

while ( )

Definition at line 894 of file ast_expr2f.c.

References ast_yywrap, BEGIN, c, curlycount, ECHO, EOB_ACT_CONTINUE_SCAN, EOB_ACT_END_OF_FILE, EOB_ACT_LAST_MATCH, INITIAL, SET_COLUMNS, SET_NUMERIC_STRING, SET_STRING, TOK_AND, TOK_COLON, TOK_COLONCOLON, TOK_COMMA, TOK_COMPL, TOK_COND, TOK_DIV, TOK_EQ, TOK_EQTILDE, TOK_GE, TOK_GT, TOK_LE, TOK_LP, TOK_LT, TOK_MINUS, TOK_MOD, TOK_MULT, TOK_NE, TOK_OR, TOK_PLUS, TOK_RP, TOK_TILDETILDE, TOKEN, trail, unput, var, yy_accept, yy_base, YY_BREAK, YY_BUFFER_NEW, YY_BUFFER_NORMAL, yyguts_t::yy_c_buf_p, yy_chk, yy_cp, YY_CURRENT_BUFFER_LVALUE, yy_def, yyguts_t::yy_did_buffer_switch_on_eof, YY_DO_BEFORE_ACTION, yy_ec, YY_END_OF_BUFFER, YY_FATAL_ERROR, yy_get_next_buffer(), yy_get_previous_state(), yyguts_t::yy_hold_char, yyguts_t::yy_last_accepting_cpos, yyguts_t::yy_last_accepting_state, yy_meta, YY_MORE_ADJ, yyguts_t::yy_more_flag, yyguts_t::yy_more_len, yyguts_t::yy_n_chars, YY_NEW_FILE, yy_nxt, YY_RESTORE_YY_MORE_OFFSET, YY_RULE_SETUP, YY_SC_TO_UI, YY_START, yyguts_t::yy_start, YY_STATE_EOF, yy_try_NUL_trans(), yyin, yyleng, yymore, yyterminate, and yytext.

Referenced by __addel(), __big_delete(), __big_return(), ast_sip_pubsub_has_eventlist_support(), fetch_bitmap(), find_challenge(), read_packet(), sms_exec(), subscription_get_generator_from_rdata(), timesub(), and tzload().

895  {
896  yyg->yy_more_len = 0;
897  if ( yyg->yy_more_flag )
898  {
899  yyg->yy_more_len = yyg->yy_c_buf_p - yyg->yytext_ptr;
900  yyg->yy_more_flag = 0;
901  }
902  yy_cp = yyg->yy_c_buf_p;
903 
904  /* Support of yytext. */
905  *yy_cp = yyg->yy_hold_char;
906 
907  /* yy_bp points to the position in yy_ch_buf of the start of
908  * the current run.
909  */
910  yy_bp = yy_cp;
911 
912  yy_current_state = yyg->yy_start;
913 yy_match:
914  do
915  {
916  register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
917  if ( yy_accept[yy_current_state] )
918  {
919  yyg->yy_last_accepting_state = yy_current_state;
921  }
922  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
923  {
924  yy_current_state = (int) yy_def[yy_current_state];
925  if ( yy_current_state >= 63 )
926  yy_c = yy_meta[(unsigned int) yy_c];
927  }
928  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
929  ++yy_cp;
930  }
931  while ( yy_current_state != 62 );
933  yy_current_state = yyg->yy_last_accepting_state;
934 
935 yy_find_action:
936  yy_act = yy_accept[yy_current_state];
937 
939 
940 do_action: /* This label is used only to access EOF actions. */
941 
942  switch ( yy_act )
943  { /* beginning of action switch */
944  case 0: /* must back up */
945  /* undo the effects of YY_DO_BEFORE_ACTION */
946  *yy_cp = yyg->yy_hold_char;
948  yy_current_state = yyg->yy_last_accepting_state;
949  goto yy_find_action;
950 
951 case 1:
953 #line 132 "ast_expr2.fl"
954 { SET_COLUMNS; SET_STRING; return TOK_OR;}
955  YY_BREAK
956 case 2:
958 #line 133 "ast_expr2.fl"
959 { SET_COLUMNS; SET_STRING; return TOK_AND;}
960  YY_BREAK
961 case 3:
963 #line 134 "ast_expr2.fl"
964 { SET_COLUMNS; SET_STRING; return TOK_EQ;}
965  YY_BREAK
966 case 4:
968 #line 135 "ast_expr2.fl"
969 { SET_COLUMNS; SET_STRING; return TOK_OR;}
970  YY_BREAK
971 case 5:
973 #line 136 "ast_expr2.fl"
974 { SET_COLUMNS; SET_STRING; return TOK_AND;}
975  YY_BREAK
976 case 6:
978 #line 137 "ast_expr2.fl"
979 { SET_COLUMNS; SET_STRING; return TOK_EQ;}
980  YY_BREAK
981 case 7:
983 #line 138 "ast_expr2.fl"
985  YY_BREAK
986 case 8:
988 #line 139 "ast_expr2.fl"
990  YY_BREAK
991 case 9:
993 #line 140 "ast_expr2.fl"
994 { SET_COLUMNS; SET_STRING; return TOK_GT;}
995  YY_BREAK
996 case 10:
998 #line 141 "ast_expr2.fl"
999 { SET_COLUMNS; SET_STRING; return TOK_LT;}
1000  YY_BREAK
1001 case 11:
1003 #line 142 "ast_expr2.fl"
1004 { SET_COLUMNS; SET_STRING; return TOK_GE;}
1005  YY_BREAK
1006 case 12:
1008 #line 143 "ast_expr2.fl"
1009 { SET_COLUMNS; SET_STRING; return TOK_LE;}
1010  YY_BREAK
1011 case 13:
1013 #line 144 "ast_expr2.fl"
1014 { SET_COLUMNS; SET_STRING; return TOK_NE;}
1015  YY_BREAK
1016 case 14:
1018 #line 145 "ast_expr2.fl"
1019 { SET_COLUMNS; SET_STRING; return TOK_PLUS;}
1020  YY_BREAK
1021 case 15:
1023 #line 146 "ast_expr2.fl"
1024 { SET_COLUMNS; SET_STRING; return TOK_COMMA;}
1025  YY_BREAK
1026 case 16:
1028 #line 147 "ast_expr2.fl"
1029 { SET_COLUMNS; SET_STRING; return TOK_MINUS;}
1030  YY_BREAK
1031 case 17:
1033 #line 148 "ast_expr2.fl"
1034 { SET_COLUMNS; SET_STRING; return TOK_MULT;}
1035  YY_BREAK
1036 case 18:
1038 #line 149 "ast_expr2.fl"
1039 { SET_COLUMNS; SET_STRING; return TOK_DIV;}
1040  YY_BREAK
1041 case 19:
1043 #line 150 "ast_expr2.fl"
1044 { SET_COLUMNS; SET_STRING; return TOK_MOD;}
1045  YY_BREAK
1046 case 20:
1048 #line 151 "ast_expr2.fl"
1049 { SET_COLUMNS; SET_STRING; return TOK_COND;}
1050  YY_BREAK
1051 case 21:
1053 #line 152 "ast_expr2.fl"
1054 { SET_COLUMNS; SET_STRING; return TOK_COMPL;}
1055  YY_BREAK
1056 case 22:
1058 #line 153 "ast_expr2.fl"
1059 { SET_COLUMNS; SET_STRING; return TOK_COLON;}
1060  YY_BREAK
1061 case 23:
1063 #line 154 "ast_expr2.fl"
1065  YY_BREAK
1066 case 24:
1068 #line 155 "ast_expr2.fl"
1069 { SET_COLUMNS; SET_STRING; return TOK_LP;}
1070  YY_BREAK
1071 case 25:
1073 #line 156 "ast_expr2.fl"
1074 { SET_COLUMNS; SET_STRING; return TOK_RP;}
1075  YY_BREAK
1076 case 26:
1078 #line 157 "ast_expr2.fl"
1079 {
1080  /* gather the contents of ${} expressions, with trailing stuff,
1081  * into a single TOKEN.
1082  * They are much more complex now than they used to be
1083  */
1084  curlycount = 0;
1085  BEGIN(var);
1086  yymore();
1087  }
1088  YY_BREAK
1089 case 27:
1091 #line 167 "ast_expr2.fl"
1092 {}
1093  YY_BREAK
1094 case 28:
1095 /* rule 28 can match eol */
1097 #line 168 "ast_expr2.fl"
1098 {SET_COLUMNS; SET_STRING; return TOKEN;}
1099  YY_BREAK
1100 case 29:
1101 /* rule 29 can match eol */
1103 #line 170 "ast_expr2.fl"
1104 {/* what to do with eol */}
1105  YY_BREAK
1106 case 30:
1108 #line 171 "ast_expr2.fl"
1109 {
1110  SET_COLUMNS;
1111  /* the original behavior of the expression parser was
1112  * to bring in numbers as a numeric string
1113  */
1115  return TOKEN;
1116  }
1117  YY_BREAK
1118 case 31:
1119 /* rule 31 can match eol */
1121 #line 180 "ast_expr2.fl"
1122 {
1123  SET_COLUMNS;
1124  SET_STRING;
1125  return TOKEN;
1126  }
1127  YY_BREAK
1128 case 32:
1129 /* rule 32 can match eol */
1131 #line 186 "ast_expr2.fl"
1132 {
1133  curlycount = 0;
1134  BEGIN(var);
1135  yymore();
1136  }
1137  YY_BREAK
1138 case 33:
1139 /* rule 33 can match eol */
1141 #line 192 "ast_expr2.fl"
1142 {
1143  curlycount--;
1144  if (curlycount < 0) {
1145  BEGIN(trail);
1146  yymore();
1147  } else {
1148  yymore();
1149  }
1150  }
1151  YY_BREAK
1152 case 34:
1153 /* rule 34 can match eol */
1155 #line 202 "ast_expr2.fl"
1156 {
1157  curlycount++;
1158  yymore();
1159  }
1160  YY_BREAK
1161 case 35:
1163 #line 208 "ast_expr2.fl"
1164 {
1165  BEGIN(0);
1166  SET_COLUMNS;
1167  SET_STRING;
1168  return TOKEN;
1169  }
1170  YY_BREAK
1171 case 36:
1173 #line 215 "ast_expr2.fl"
1174 {
1175  curlycount = 0;
1176  BEGIN(var);
1177  yymore();
1178  }
1179  YY_BREAK
1180 case 37:
1181 /* rule 37 can match eol */
1183 #line 221 "ast_expr2.fl"
1184 {
1185  char c = yytext[yyleng-1];
1186  BEGIN(0);
1187  unput(c);
1188  SET_COLUMNS;
1189  SET_STRING;
1190  return TOKEN;
1191  }
1192  YY_BREAK
1193 case YY_STATE_EOF(trail):
1194 #line 230 "ast_expr2.fl"
1195 {
1196  BEGIN(0);
1197  SET_COLUMNS;
1198  SET_STRING;
1199  return TOKEN;
1200  /*actually, if an expr is only a variable ref, this could happen a LOT */
1201  }
1202  YY_BREAK
1203 case 38:
1205 #line 238 "ast_expr2.fl"
1206 ECHO;
1207  YY_BREAK
1208 #line 1208 "ast_expr2f.c"
1209 case YY_STATE_EOF(INITIAL):
1210 case YY_STATE_EOF(var):
1211  yyterminate();
1212 
1213  case YY_END_OF_BUFFER:
1214  {
1215  /* Amount of text matched not including the EOB char. */
1216  int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
1217 
1218  /* Undo the effects of YY_DO_BEFORE_ACTION. */
1219  *yy_cp = yyg->yy_hold_char;
1221 
1222  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1223  {
1224  /* We're scanning a new file or input source. It's
1225  * possible that this happened because the user
1226  * just pointed yyin at a new source and called
1227  * ast_yylex(). If so, then we have to assure
1228  * consistency between YY_CURRENT_BUFFER and our
1229  * globals. Here is the right place to do so, because
1230  * this is the first action (other than possibly a
1231  * back-up) that will match for the new input source.
1232  */
1233  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1234  YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1235  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1236  }
1237 
1238  /* Note that here we test for yy_c_buf_p "<=" to the position
1239  * of the first EOB in the buffer, since yy_c_buf_p will
1240  * already have been incremented past the NUL character
1241  * (since all states make transitions on EOB to the
1242  * end-of-buffer state). Contrast this with the test
1243  * in input().
1244  */
1245  if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1246  { /* This was really a NUL. */
1247  yy_state_type yy_next_state;
1248 
1249  yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
1250 
1251  yy_current_state = yy_get_previous_state( yyscanner );
1252 
1253  /* Okay, we're now positioned to make the NUL
1254  * transition. We couldn't have
1255  * yy_get_previous_state() go ahead and do it
1256  * for us because it doesn't know how to deal
1257  * with the possibility of jamming (and we don't
1258  * want to build jamming into it because then it
1259  * will run more slowly).
1260  */
1261 
1262  yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
1263 
1264  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1265 
1266  if ( yy_next_state )
1267  {
1268  /* Consume the NUL. */
1269  yy_cp = ++yyg->yy_c_buf_p;
1270  yy_current_state = yy_next_state;
1271  goto yy_match;
1272  }
1273 
1274  else
1275  {
1277  yy_current_state = yyg->yy_last_accepting_state;
1278  goto yy_find_action;
1279  }
1280  }
1281 
1282  else switch ( yy_get_next_buffer( yyscanner ) )
1283  {
1284  case EOB_ACT_END_OF_FILE:
1285  {
1287 
1288  if ( ast_yywrap(yyscanner ) )
1289  {
1290  /* Note: because we've taken care in
1291  * yy_get_next_buffer() to have set up
1292  * yytext, we can now set up
1293  * yy_c_buf_p so that if some total
1294  * hoser (like flex itself) wants to
1295  * call the scanner after we return the
1296  * YY_NULL, it'll still work - another
1297  * YY_NULL will get returned.
1298  */
1299  yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
1300 
1302  goto do_action;
1303  }
1304 
1305  else
1306  {
1308  YY_NEW_FILE;
1309  }
1310  break;
1311  }
1312 
1313  case EOB_ACT_CONTINUE_SCAN:
1314  yyg->yy_c_buf_p =
1315  yyg->yytext_ptr + yy_amount_of_matched_text;
1316 
1317  yy_current_state = yy_get_previous_state( yyscanner );
1318 
1319  yy_cp = yyg->yy_c_buf_p;
1320  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1321  goto yy_match;
1322 
1323  case EOB_ACT_LAST_MATCH:
1324  yyg->yy_c_buf_p =
1325  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
1326 
1327  yy_current_state = yy_get_previous_state( yyscanner );
1328 
1329  yy_cp = yyg->yy_c_buf_p;
1330  yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
1331  goto yy_find_action;
1332  }
1333  break;
1334  }
1335 
1336  default:
1338  "fatal flex scanner internal error--no action found" );
1339  } /* end of action switch */
1340  } /* end of scanning one token */
#define YY_FATAL_ERROR(msg)
Definition: ast_expr2f.c:817
#define YY_START
Definition: ast_expr2f.c:152
char yy_hold_char
Definition: ast_expr2f.c:641
#define yyin
Definition: ast_expr2f.c:133
#define yytext
Definition: ast_expr2f.c:137
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
#define YY_END_OF_BUFFER
Definition: ast_expr2f.c:366
char * yy_c_buf_p
Definition: ast_expr2f.c:644
#define YY_DO_BEFORE_ACTION
Definition: ast_expr2f.c:357
static int curlycount
Definition: ast_expr2f.c:608
#define YY_NEW_FILE
Definition: ast_expr2f.c:159
#define var
Definition: ast_expr2f.c:614
static yy_state_type yy_try_NUL_trans(yy_state_type current_state, yyscan_t yyscanner)
Definition: ast_expr2f.c:1518
#define BEGIN
Definition: ast_expr2f.c:146
#define YY_STATE_EOF(state)
Definition: ast_expr2f.c:156
static struct test_val c
#define EOB_ACT_END_OF_FILE
Definition: ast_expr2f.c:186
#define EOB_ACT_CONTINUE_SCAN
Definition: ast_expr2f.c:185
#define YY_BREAK
Definition: ast_expr2f.c:844
#define YY_RESTORE_YY_MORE_OFFSET
Definition: ast_expr2f.c:494
#define yyleng
Definition: ast_expr2f.c:136
int yy_start
Definition: ast_expr2f.c:646
#define SET_STRING
Definition: ast_expr2f.c:586
#define INITIAL
Definition: ast_expr2f.c:613
int yy_did_buffer_switch_on_eof
Definition: ast_expr2f.c:647
#define unput(c)
Definition: ast_expr2f.c:205
int yy_state_type
Definition: ast_expr2f.c:345
#define yymore()
Definition: ast_expr2f.c:492
int yy_more_flag
Definition: ast_expr2f.c:658
register char * yy_cp
Definition: ast_expr2f.c:855
#define YY_SC_TO_UI(c)
Definition: ast_expr2f.c:123
register char * yy_bp
Definition: ast_expr2f.c:855
static yyconst flex_int16_t yy_chk[159]
Definition: ast_expr2f.c:467
static yyconst flex_int16_t yy_base[70]
Definition: ast_expr2f.c:424
int yy_n_chars
Definition: ast_expr2f.c:642
char * yy_last_accepting_cpos
Definition: ast_expr2f.c:652
#define YY_BUFFER_NORMAL
Definition: ast_expr2f.c:261
#define YY_BUFFER_NEW
Definition: ast_expr2f.c:260
static yy_state_type yy_get_previous_state(yyscan_t yyscanner)
Definition: ast_expr2f.c:1485
#define trail
Definition: ast_expr2f.c:615
unsigned char YY_CHAR
Definition: ast_expr2f.c:343
static int yy_get_next_buffer(yyscan_t yyscanner)
Definition: ast_expr2f.c:1350
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:290
#define ast_yywrap(n)
Definition: ast_expr2f.c:340
#define SET_NUMERIC_STRING
Definition: ast_expr2f.c:592
static yyconst flex_int32_t yy_meta[29]
Definition: ast_expr2f.c:417
#define YY_RULE_SETUP
Definition: ast_expr2f.c:847
static yyconst flex_int16_t yy_nxt[159]
Definition: ast_expr2f.c:446
int yy_more_len
Definition: ast_expr2f.c:659
#define yyterminate()
Definition: ast_expr2f.c:807
#define SET_COLUMNS
Definition: ast_expr2f.c:580
register int yy_act
Definition: ast_expr2f.c:856
yy_state_type yy_last_accepting_state
Definition: ast_expr2f.c:651
#define ECHO
Definition: ast_expr2f.c:563
#define YY_MORE_ADJ
Definition: ast_expr2f.c:493
static yyconst flex_int32_t yy_ec[256]
Definition: ast_expr2f.c:385
static yyconst flex_int16_t yy_accept[63]
Definition: ast_expr2f.c:374
static yyconst flex_int16_t yy_def[70]
Definition: ast_expr2f.c:435
#define EOB_ACT_LAST_MATCH
Definition: ast_expr2f.c:187

◆ yy_fatal_error() [1/2]

static void yy_fatal_error ( yyconst char  msg[],
yyscan_t  yyscanner 
)
static

◆ yy_fatal_error() [2/2]

static void yy_fatal_error ( yyconst char *  msg,
yyscan_t  yyscanner 
)
static

Definition at line 2021 of file ast_expr2f.c.

References YY_EXIT_FAILURE.

2022 {
2023  (void) fprintf( stderr, "%s\n", msg );
2024  exit( YY_EXIT_FAILURE );
2025 }
#define YY_EXIT_FAILURE
Definition: ast_expr2f.c:2018

◆ yy_get_next_buffer()

static int yy_get_next_buffer ( yyscan_t  yyscanner)
static

Definition at line 1350 of file ast_expr2f.c.

References ast_yyrealloc(), ast_yyrestart(), b, EOB_ACT_CONTINUE_SCAN, EOB_ACT_END_OF_FILE, EOB_ACT_LAST_MATCH, yy_buffer_state::yy_buf_size, YY_BUFFER_EOF_PENDING, yyguts_t::yy_c_buf_p, yy_buffer_state::yy_ch_buf, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, YY_END_OF_BUFFER_CHAR, YY_FATAL_ERROR, YY_INPUT, yy_buffer_state::yy_is_our_buffer, YY_MORE_ADJ, yyguts_t::yy_n_chars, YY_READ_BUF_SIZE, and yyin.

Referenced by input(), and while().

1351 {
1352  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1353  register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1354  register char *source = yyg->yytext_ptr;
1355  register int number_to_move, i;
1356  int ret_val;
1357 
1358  if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
1360  "fatal flex scanner internal error--end of buffer missed" );
1361 
1362  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1363  { /* Don't try to fill the buffer, so this is an EOF. */
1364  if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
1365  {
1366  /* We matched a single character, the EOB, so
1367  * treat this as a final EOF.
1368  */
1369  return EOB_ACT_END_OF_FILE;
1370  }
1371 
1372  else
1373  {
1374  /* We matched some text prior to the EOB, first
1375  * process it.
1376  */
1377  return EOB_ACT_LAST_MATCH;
1378  }
1379  }
1380 
1381  /* Try to read more data. */
1382 
1383  /* First move last chars to start of buffer. */
1384  number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
1385 
1386  for ( i = 0; i < number_to_move; ++i )
1387  *(dest++) = *(source++);
1388 
1389  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1390  /* don't do the read, it's not guaranteed to return an EOF,
1391  * just force an EOF
1392  */
1393  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
1394 
1395  else
1396  {
1397  int num_to_read =
1398  YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1399 
1400  while ( num_to_read <= 0 )
1401  { /* Not enough room in the buffer - grow it. */
1402 
1403  /* just a shorter name for the current buffer */
1405 
1406  int yy_c_buf_p_offset =
1407  (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
1408 
1409  if ( b->yy_is_our_buffer )
1410  {
1411  int new_size = b->yy_buf_size * 2;
1412 
1413  if ( new_size <= 0 )
1414  b->yy_buf_size += b->yy_buf_size / 8;
1415  else
1416  b->yy_buf_size *= 2;
1417 
1418  b->yy_ch_buf = (char *)
1419  /* Include room in for 2 EOB chars. */
1420  ast_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
1421  }
1422  else
1423  /* Can't grow it, we don't own it. */
1424  b->yy_ch_buf = 0;
1425 
1426  if ( ! b->yy_ch_buf )
1428  "fatal error - scanner input buffer overflow" );
1429 
1430  yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1431 
1432  num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1433  number_to_move - 1;
1434 
1435  }
1436 
1437  if ( num_to_read > YY_READ_BUF_SIZE )
1438  num_to_read = YY_READ_BUF_SIZE;
1439 
1440  /* Read in more data. */
1441  YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1442  yyg->yy_n_chars, (size_t) num_to_read );
1443 
1444  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
1445  }
1446 
1447  if ( yyg->yy_n_chars == 0 )
1448  {
1449  if ( number_to_move == YY_MORE_ADJ )
1450  {
1451  ret_val = EOB_ACT_END_OF_FILE;
1452  ast_yyrestart(yyin ,yyscanner);
1453  }
1454 
1455  else
1456  {
1457  ret_val = EOB_ACT_LAST_MATCH;
1458  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1460  }
1461  }
1462 
1463  else
1464  ret_val = EOB_ACT_CONTINUE_SCAN;
1465 
1466  if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1467  /* Extend the array by 50%, plus the number we really need. */
1468  yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
1469  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) ast_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
1470  if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1471  YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1472  }
1473 
1474  yyg->yy_n_chars += number_to_move;
1477 
1478  yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1479 
1480  return ret_val;
1481 }
#define YY_FATAL_ERROR(msg)
Definition: ast_expr2f.c:817
#define yyin
Definition: ast_expr2f.c:133
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
#define YY_READ_BUF_SIZE
Definition: ast_expr2f.c:754
char * yy_c_buf_p
Definition: ast_expr2f.c:644
char * yy_ch_buf
Definition: ast_expr2f.c:218
#define EOB_ACT_END_OF_FILE
Definition: ast_expr2f.c:186
yy_size_t yy_buf_size
Definition: ast_expr2f.c:224
#define EOB_ACT_CONTINUE_SCAN
Definition: ast_expr2f.c:185
void * ast_yyrealloc(void *, yy_size_t, yyscan_t yyscanner)
Definition: ast_expr2f.c:2370
#define YY_END_OF_BUFFER_CHAR
Definition: ast_expr2f.c:161
#define YY_BUFFER_EOF_PENDING
Definition: ast_expr2f.c:272
void ast_yyrestart(FILE *input_file, yyscan_t yyscanner)
Definition: ast_expr2f.c:1660
int yy_n_chars
Definition: ast_expr2f.c:642
#define YY_CURRENT_BUFFER
Definition: ast_expr2f.c:283
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:290
#define YY_INPUT(buf, result, max_size)
Definition: ast_expr2f.c:770
static struct test_val b
size_t yy_size_t
Definition: ast_expr2f.c:209
#define YY_MORE_ADJ
Definition: ast_expr2f.c:493
#define EOB_ACT_LAST_MATCH
Definition: ast_expr2f.c:187

◆ yy_get_previous_state()

static yy_state_type yy_get_previous_state ( yyscan_t  yyscanner)
static

Definition at line 1485 of file ast_expr2f.c.

References yy_accept, yy_base, yyguts_t::yy_c_buf_p, yy_chk, yy_cp, yy_def, yy_ec, yyguts_t::yy_last_accepting_cpos, yyguts_t::yy_last_accepting_state, yy_meta, YY_MORE_ADJ, yy_nxt, YY_SC_TO_UI, and yyguts_t::yy_start.

Referenced by while().

1486 {
1487  register yy_state_type yy_current_state;
1488  register char *yy_cp;
1489  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1490 
1491  yy_current_state = yyg->yy_start;
1492 
1493  for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
1494  {
1495  register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1496  if ( yy_accept[yy_current_state] )
1497  {
1498  yyg->yy_last_accepting_state = yy_current_state;
1500  }
1501  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1502  {
1503  yy_current_state = (int) yy_def[yy_current_state];
1504  if ( yy_current_state >= 63 )
1505  yy_c = yy_meta[(unsigned int) yy_c];
1506  }
1507  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1508  }
1509 
1510  return yy_current_state;
1511 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
char * yy_c_buf_p
Definition: ast_expr2f.c:644
int yy_start
Definition: ast_expr2f.c:646
int yy_state_type
Definition: ast_expr2f.c:345
register char * yy_cp
Definition: ast_expr2f.c:855
#define YY_SC_TO_UI(c)
Definition: ast_expr2f.c:123
static yyconst flex_int16_t yy_chk[159]
Definition: ast_expr2f.c:467
static yyconst flex_int16_t yy_base[70]
Definition: ast_expr2f.c:424
char * yy_last_accepting_cpos
Definition: ast_expr2f.c:652
unsigned char YY_CHAR
Definition: ast_expr2f.c:343
static yyconst flex_int32_t yy_meta[29]
Definition: ast_expr2f.c:417
static yyconst flex_int16_t yy_nxt[159]
Definition: ast_expr2f.c:446
yy_state_type yy_last_accepting_state
Definition: ast_expr2f.c:651
#define YY_MORE_ADJ
Definition: ast_expr2f.c:493
static yyconst flex_int32_t yy_ec[256]
Definition: ast_expr2f.c:385
static yyconst flex_int16_t yy_accept[63]
Definition: ast_expr2f.c:374
static yyconst flex_int16_t yy_def[70]
Definition: ast_expr2f.c:435

◆ yy_init_globals()

static int yy_init_globals ( yyscan_t  yyscanner)
static

Definition at line 2278 of file ast_expr2f.c.

References NULL, 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().

2279 {
2280  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2281  /* Initialization is the same as for the non-reentrant scanner.
2282  * This function is called from ast_yylex_destroy(), so don't allocate here.
2283  */
2284 
2285  yyg->yy_buffer_stack = 0;
2286  yyg->yy_buffer_stack_top = 0;
2287  yyg->yy_buffer_stack_max = 0;
2288  yyg->yy_c_buf_p = (char *) 0;
2289  yyg->yy_init = 0;
2290  yyg->yy_start = 0;
2291 
2292  yyg->yy_start_stack_ptr = 0;
2293  yyg->yy_start_stack_depth = 0;
2294  yyg->yy_start_stack = NULL;
2295 
2296 /* Defined in main.c */
2297 #ifdef YY_STDINIT
2298  yyin = stdin;
2299  yyout = stdout;
2300 #else
2301  yyin = (FILE *) 0;
2302  yyout = (FILE *) 0;
2303 #endif
2304 
2305  /* For future reference: Set errno on error, since we are called by
2306  * ast_yylex_init()
2307  */
2308  return 0;
2309 }
#define yyin
Definition: ast_expr2f.c:133
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
char * yy_c_buf_p
Definition: ast_expr2f.c:644
#define NULL
Definition: resample.c:96
YY_BUFFER_STATE * yy_buffer_stack
Definition: ast_expr2f.c:640
int yy_start_stack_depth
Definition: ast_expr2f.c:649
int yy_init
Definition: ast_expr2f.c:645
int * yy_start_stack
Definition: ast_expr2f.c:650
int yy_start
Definition: ast_expr2f.c:646
int yy_start_stack_ptr
Definition: ast_expr2f.c:648
size_t yy_buffer_stack_max
Definition: ast_expr2f.c:639
#define yyout
Definition: ast_expr2f.c:134
size_t yy_buffer_stack_top
Definition: ast_expr2f.c:638

◆ yy_try_NUL_trans()

static yy_state_type yy_try_NUL_trans ( yy_state_type  current_state,
yyscan_t  yyscanner 
)
static

Definition at line 1518 of file ast_expr2f.c.

References yy_accept, yy_base, yyguts_t::yy_c_buf_p, yy_chk, yy_cp, yy_def, yyguts_t::yy_last_accepting_cpos, yyguts_t::yy_last_accepting_state, yy_meta, and yy_nxt.

Referenced by while().

1519 {
1520  register int yy_is_jam;
1521  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
1522  register char *yy_cp = yyg->yy_c_buf_p;
1523 
1524  register YY_CHAR yy_c = 1;
1525  if ( yy_accept[yy_current_state] )
1526  {
1527  yyg->yy_last_accepting_state = yy_current_state;
1529  }
1530  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1531  {
1532  yy_current_state = (int) yy_def[yy_current_state];
1533  if ( yy_current_state >= 63 )
1534  yy_c = yy_meta[(unsigned int) yy_c];
1535  }
1536  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1537  yy_is_jam = (yy_current_state == 62);
1538 
1539  return yy_is_jam ? 0 : yy_current_state;
1540 }
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
char * yy_c_buf_p
Definition: ast_expr2f.c:644
register char * yy_cp
Definition: ast_expr2f.c:855
static yyconst flex_int16_t yy_chk[159]
Definition: ast_expr2f.c:467
static yyconst flex_int16_t yy_base[70]
Definition: ast_expr2f.c:424
char * yy_last_accepting_cpos
Definition: ast_expr2f.c:652
unsigned char YY_CHAR
Definition: ast_expr2f.c:343
static yyconst flex_int32_t yy_meta[29]
Definition: ast_expr2f.c:417
static yyconst flex_int16_t yy_nxt[159]
Definition: ast_expr2f.c:446
yy_state_type yy_last_accepting_state
Definition: ast_expr2f.c:651
static yyconst flex_int16_t yy_accept[63]
Definition: ast_expr2f.c:374
static yyconst flex_int16_t yy_def[70]
Definition: ast_expr2f.c:435

◆ yyunput() [1/2]

static void yyunput ( int  c,
char *  buf_ptr,
yyscan_t  yyscanner 
)
static

◆ yyunput() [2/2]

static void yyunput ( int  c,
register char *  yy_bp,
yyscan_t  yyscanner 
)
static

Definition at line 1542 of file ast_expr2f.c.

References yy_bp, yyguts_t::yy_c_buf_p, yy_buffer_state::yy_ch_buf, yy_cp, YY_CURRENT_BUFFER_LVALUE, YY_FATAL_ERROR, yyguts_t::yy_hold_char, and yyguts_t::yy_n_chars.

1543 {
1544  register char *yy_cp;
1545  struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1546 
1547  yy_cp = yyg->yy_c_buf_p;
1548 
1549  /* undo effects of setting up yytext */
1550  *yy_cp = yyg->yy_hold_char;
1551 
1552  if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1553  { /* need to shift things up to make room */
1554  /* +2 for EOB chars. */
1555  register int number_to_move = yyg->yy_n_chars + 2;
1556  register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1557  YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1558  register char *source =
1559  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1560 
1561  while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1562  *--dest = *--source;
1563 
1564  yy_cp += (int) (dest - source);
1565  yy_bp += (int) (dest - source);
1566  YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1567  yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1568 
1569  if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1570  YY_FATAL_ERROR( "flex scanner push-back overflow" );
1571  }
1572 
1573  *--yy_cp = (char) c;
1574 
1575  yyg->yytext_ptr = yy_bp;
1576  yyg->yy_hold_char = *yy_cp;
1577  yyg->yy_c_buf_p = yy_cp;
1578 }
#define YY_FATAL_ERROR(msg)
Definition: ast_expr2f.c:817
char yy_hold_char
Definition: ast_expr2f.c:641
struct yyguts_t * yyg
Definition: ast_expr2f.c:857
char * yy_c_buf_p
Definition: ast_expr2f.c:644
static struct test_val c
register char * yy_cp
Definition: ast_expr2f.c:855
register char * yy_bp
Definition: ast_expr2f.c:855
int yy_n_chars
Definition: ast_expr2f.c:642
#define YY_CURRENT_BUFFER_LVALUE
Definition: ast_expr2f.c:290

Variable Documentation

◆ curlycount

int curlycount = 0
static

Definition at line 608 of file ast_expr2f.c.

Referenced by while().

◆ expr2_token_equivs1

const char* const expr2_token_equivs1[]
static

Definition at line 2489 of file ast_expr2f.c.

Referenced by expr2_token_subst().

◆ expr2_token_equivs2

const char* const expr2_token_equivs2[]
static

Definition at line 2515 of file ast_expr2f.c.

◆ extra_error_message

char extra_error_message[4095]

Definition at line 2472 of file ast_expr2f.c.

◆ extra_error_message_supplied

int extra_error_message_supplied = 0

Definition at line 2473 of file ast_expr2f.c.

Referenced by op_div(), op_minus(), op_negate(), op_plus(), op_rem(), and op_times().

◆ yy_accept

yyconst flex_int16_t yy_accept[63]
static

Definition at line 374 of file ast_expr2f.c.

Referenced by while(), yy_get_previous_state(), and yy_try_NUL_trans().

◆ yy_act

register int yy_act

Definition at line 856 of file ast_expr2f.c.

◆ yy_base

yyconst flex_int16_t yy_base[70]
static

Definition at line 424 of file ast_expr2f.c.

Referenced by while(), yy_get_previous_state(), and yy_try_NUL_trans().

◆ yy_bp

register char * yy_bp

Definition at line 855 of file ast_expr2f.c.

Referenced by yyunput().

◆ yy_chk

yyconst flex_int16_t yy_chk[159]
static

Definition at line 467 of file ast_expr2f.c.

Referenced by while(), yy_get_previous_state(), and yy_try_NUL_trans().

◆ yy_cp

register char* yy_cp

Definition at line 855 of file ast_expr2f.c.

Referenced by while(), yy_get_previous_state(), yy_try_NUL_trans(), and yyunput().

◆ YY_DECL

YY_DECL
Initial value:
{
register yy_state_type yy_current_state
int yy_state_type
Definition: ast_expr2f.c:345

The main scanner function which does all the work.

Definition at line 853 of file ast_expr2f.c.

◆ yy_def

yyconst flex_int16_t yy_def[70]
static

Definition at line 435 of file ast_expr2f.c.

Referenced by while(), yy_get_previous_state(), and yy_try_NUL_trans().

◆ yy_ec

yyconst flex_int32_t yy_ec[256]
static

Definition at line 385 of file ast_expr2f.c.

Referenced by while(), and yy_get_previous_state().

◆ yy_meta

yyconst flex_int32_t yy_meta[29]
static

Definition at line 417 of file ast_expr2f.c.

Referenced by while(), yy_get_previous_state(), and yy_try_NUL_trans().

◆ yy_nxt

yyconst flex_int16_t yy_nxt[159]
static

Definition at line 446 of file ast_expr2f.c.

Referenced by while(), yy_get_previous_state(), and yy_try_NUL_trans().

◆ yyg

struct yyguts_t* yyg = (struct yyguts_t*)yyscanner

Definition at line 857 of file ast_expr2f.c.

◆ yylloc

yylloc = yylloc_param

Definition at line 866 of file ast_expr2f.c.

◆ yylval

yylval = yylval_param

Definition at line 864 of file ast_expr2f.c.