Thu Apr 28 2011 17:15:35

Asterisk developer's documentation


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>
Include dependency graph for ast_expr2f.c:

Go to the source code of this file.

Data Structures

struct  parse_io
struct  val
struct  yy_buffer_state
struct  yy_trans_info
struct  yyguts_t

Defines

#define ast_yywrap(n)   1
#define BEGIN   yyg->yy_start = 1 + 2 *
#define ECHO   fwrite( yytext, yyleng, 1, yyout )
#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 fwrite(a, b, c, d)   do { int __res = fwrite(a,b,c,d); (__res); } while (0)
#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   34
#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)
void ast_expr_clear_extra_error_info (void)
void ast_expr_register_extra_error_info (char *message)
YY_BUFFER_STATE ast_yy_create_buffer (FILE *file, int size, yyscan_t yyscanner)
void ast_yy_delete_buffer (YY_BUFFER_STATE b, yyscan_t yyscanner)
void ast_yy_flush_buffer (YY_BUFFER_STATE b, yyscan_t yyscanner)
static void ast_yy_init_buffer (YY_BUFFER_STATE b, FILE *file, yyscan_t yyscanner)
static void ast_yy_load_buffer_state (yyscan_t yyscanner)
YY_BUFFER_STATE ast_yy_scan_buffer (char *base, yy_size_t size, yyscan_t yyscanner)
YY_BUFFER_STATE ast_yy_scan_bytes (yyconst char *bytes, int len, yyscan_t yyscanner)
YY_BUFFER_STATE ast_yy_scan_string (yyconst char *yy_str, yyscan_t yyscanner)
void ast_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer, yyscan_t yyscanner)
void * ast_yyalloc (yy_size_t, yyscan_t yyscanner)
static void ast_yyensure_buffer_stack (yyscan_t yyscanner)
int ast_yyerror (const char *, 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)
static int input (yyscan_t yyscanner)
static void yy_fatal_error (yyconst char *msg, yyscan_t yyscanner)
static void yy_fatal_error (yyconst char msg[], yyscan_t yyscanner)
static int yy_get_next_buffer (yyscan_t yyscanner)
static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
static int yy_init_globals (yyscan_t yyscanner)
static yy_state_type yy_try_NUL_trans (yy_state_type current_state, yyscan_t yyscanner)
static void yyunput (int c, char *buf_ptr, yyscan_t yyscanner)

Variables

static int curlycount = 0
static char * expr2_token_equivs1 []
static char * expr2_token_equivs2 []
char extra_error_message [4095]
int extra_error_message_supplied = 0
static yyconst flex_int16_t yy_accept [63]
static yyconst flex_int16_t yy_base [70]
static yyconst flex_int16_t yy_chk [159]
static yyconst flex_int16_t yy_def [70]
static yyconst flex_int32_t yy_ec [256]
static yyconst flex_int32_t yy_meta [29]
static yyconst flex_int16_t yy_nxt [159]

Detailed Description

Dialplan Expression Lexical Scanner.

Definition in file ast_expr2f.c.


Define Documentation

#define ast_yywrap (   n)    1

Definition at line 337 of file ast_expr2f.c.

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

Definition at line 144 of file ast_expr2f.c.

#define ECHO   fwrite( yytext, yyleng, 1, yyout )

Definition at line 757 of file ast_expr2f.c.

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

#define EOB_ACT_CONTINUE_SCAN   0

Definition at line 175 of file ast_expr2f.c.

#define EOB_ACT_END_OF_FILE   1

Definition at line 176 of file ast_expr2f.c.

#define EOB_ACT_LAST_MATCH   2

Definition at line 177 of file ast_expr2f.c.

#define FLEX_BETA

Definition at line 16 of file ast_expr2f.c.

#define FLEX_SCANNER

Definition at line 11 of file ast_expr2f.c.

#define FLEXINT_H

Definition at line 32 of file ast_expr2f.c.

#define FP___FMOD   fmod

Definition at line 535 of file ast_expr2f.c.

#define FP___PRINTF   "%.16g"

Definition at line 534 of file ast_expr2f.c.

Referenced by ast_expr().

#define FP___STRTOD   strtod

Definition at line 536 of file ast_expr2f.c.

#define FP___TYPE   double

Definition at line 537 of file ast_expr2f.c.

#define fwrite (   a,
  b,
  c,
 
)    do { int __res = fwrite(a,b,c,d); (__res); } while (0)
Note:
The latest Flex uses fwrite without checking its return value, which is a warning on some compilers. Therefore, we use this workaround, to trick the compiler into suppressing this warning.

Definition at line 563 of file ast_expr2f.c.

Referenced by ast_careful_fwrite(), g723_write(), g726_write(), g729_write(), gsm_seek(), gsm_write(), h263_write(), h264_write(), httpd_helper_thread(), ilbc_write(), ogg_vorbis_rewrite(), pcm_seek(), pcm_write(), phoneprov_callback(), readmimefile(), siren14write(), siren7write(), slinear_write(), static_callback(), update_header(), usbradio_read(), usbradio_write(), vox_write(), wav_close(), wav_seek(), wav_write(), write_entry_history(), write_header(), write_history(), and write_stream().

#define INITIAL   0

Definition at line 612 of file ast_expr2f.c.

#define INT16_MAX   (32767)

Definition at line 75 of file ast_expr2f.c.

#define INT16_MIN   (-32767-1)

Definition at line 66 of file ast_expr2f.c.

#define INT32_MAX   (2147483647)

Definition at line 78 of file ast_expr2f.c.

#define INT32_MIN   (-2147483647-1)

Definition at line 69 of file ast_expr2f.c.

#define INT8_MAX   (127)

Definition at line 72 of file ast_expr2f.c.

#define INT8_MIN   (-128)

Definition at line 63 of file ast_expr2f.c.

#define REJECT   reject_used_but_not_detected

Definition at line 488 of file ast_expr2f.c.

#define SET_COLUMNS
Value:
do {     \
   yylloc_param->first_column = (int)(yyg->yytext_r - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf); \
   yylloc_param->last_column += yyleng - 1; \
   yylloc_param->first_line = yylloc_param->last_line = 1; \
   } while (0)

Definition at line 579 of file ast_expr2f.c.

#define SET_NUMERIC_STRING
Value:
do {  \
   yylval_param->val = calloc(1, sizeof(struct val)); \
   yylval_param->val->type = AST_EXPR_numeric_string; \
   yylval_param->val->u.s = strdup(yytext);  \
   } while (0)

Definition at line 591 of file ast_expr2f.c.

#define SET_STRING
Value:
do {     \
   yylval_param->val = calloc(1, sizeof(struct val)); \
   yylval_param->val->type = AST_EXPR_string;      \
   yylval_param->val->u.s = strdup(yytext);     \
   } while (0)

Definition at line 585 of file ast_expr2f.c.

#define trail   2

Definition at line 614 of file ast_expr2f.c.

#define UINT16_MAX   (65535U)

Definition at line 84 of file ast_expr2f.c.

#define UINT32_MAX   (4294967295U)

Definition at line 87 of file ast_expr2f.c.

#define UINT8_MAX   (255U)

Definition at line 81 of file ast_expr2f.c.

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

Definition at line 195 of file ast_expr2f.c.

#define var   1

Definition at line 613 of file ast_expr2f.c.

Referenced by __init_manager(), acf_iaxvar_read(), acf_iaxvar_write(), acf_sprintf(), add_cfg_entry(), add_rt_cfg_entry(), add_rt_multi_cfg_entry(), add_user_extension(), aji_load_config(), apply_options(), apply_options_full(), apply_outgoing(), array(), ast_cdr_copy_vars(), ast_cdr_serialize_variables(), ast_channeltype_list(), ast_config_text_file_save(), ast_iax2_new(), ast_plc_reload(), ast_var_assign(), astman_get_variables(), authenticate_reply(), build_event_channel(), build_extension(), build_parkinglot(), build_profile(), clearvar_prefix(), cli_realtime_load(), conf_exec(), conf_run(), config_module(), console_cmd(), delete_extension(), do_timelimit(), find_conf(), find_conf_realtime(), find_realtime(), find_user_realtime(), function_realtime_read(), function_realtime_readdestroy(), get_insecure_variable_from_config(), global_read(), gtalk_load_config(), handle_updates(), handle_uri(), http_post_callback(), iax2_call(), iax_parse_ies(), inherit_category(), init_logger_chain(), jingle_load_config(), ldap_loadentry(), ldap_table_config_add_attribute(), leave_queue(), load_config(), load_moh_classes(), local_ast_moh_start(), minivm_account_func_read(), misdn_hangup(), move_variables(), odbc_load_module(), parse_config(), parse_cookies(), parse_variable_name(), pbx_builtin_serialize_variables(), pbx_substitute_variables_helper_full(), phoneprov_callback(), prep_email_sub_vars(), process_text_line(), profile_destructor(), queue_function_queuewaitingcount(), realtime_alias(), realtime_canmatch(), realtime_common(), realtime_curl(), realtime_directory(), realtime_exec(), realtime_exists(), realtime_ldap(), realtime_ldap_entry_to_var(), realtime_ldap_result_to_vars(), realtime_matchmore(), realtime_multi_curl(), realtime_multi_ldap(), realtime_multi_odbc(), realtime_multi_pgsql(), realtime_odbc(), realtime_peer(), realtime_pgsql(), realtime_switch_common(), realtime_user(), realtimefield_read(), reload(), reload_followme(), reload_single_queue(), retrieve_astcfgint(), rt_extend_conf(), set_config(), set_timezone_variables(), shared_read(), shared_variable_free(), shared_write(), show_users_realtime(), sla_build_station(), sla_build_trunk(), socket_process(), transmit_invite(), transmit_notify_custom(), unload_module(), variable_named(), vm_change_password(), and xml_translate().

#define YY_AT_BOL ( )    (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)

Definition at line 333 of file ast_expr2f.c.

#define YY_BREAK   break;

Definition at line 838 of file ast_expr2f.c.

#define YY_BUF_SIZE   16384

Definition at line 163 of file ast_expr2f.c.

#define YY_BUFFER_EOF_PENDING   2

Definition at line 269 of file ast_expr2f.c.

#define YY_BUFFER_NEW   0

Definition at line 257 of file ast_expr2f.c.

Referenced by ast_yy_flush_buffer(), and ast_yy_scan_buffer().

#define YY_BUFFER_NORMAL   1

Definition at line 258 of file ast_expr2f.c.

#define YY_CURRENT_BUFFER
Value:
( yyg->yy_buffer_stack \
                          ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
                          : NULL)

Definition at line 280 of file ast_expr2f.c.

Referenced by ast_yy_flush_buffer(), ast_yy_init_buffer(), ast_yyget_column(), ast_yyget_lineno(), ast_yylex_destroy(), ast_yypop_buffer_state(), ast_yypush_buffer_state(), ast_yyset_column(), and ast_yyset_lineno().

#define YY_CURRENT_BUFFER_LVALUE   yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
#define YY_DECL
Value:
int ast_yylex \
               (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)

Definition at line 825 of file ast_expr2f.c.

#define YY_DECL_IS_OURS   1

Definition at line 820 of file ast_expr2f.c.

#define YY_DO_BEFORE_ACTION

Definition at line 354 of file ast_expr2f.c.

#define YY_END_OF_BUFFER   39

Definition at line 363 of file ast_expr2f.c.

#define YY_END_OF_BUFFER_CHAR   0

Definition at line 159 of file ast_expr2f.c.

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

#define YY_EXIT_FAILURE   2

Definition at line 2012 of file ast_expr2f.c.

Referenced by yy_fatal_error().

#define YY_EXTRA_TYPE   void *

Definition at line 625 of file ast_expr2f.c.

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

Definition at line 811 of file ast_expr2f.c.

Referenced by ast_yy_scan_buffer(), ast_yy_scan_bytes(), and ast_yyensure_buffer_stack().

#define yy_flex_debug   yyg->yy_flex_debug_r

Definition at line 138 of file ast_expr2f.c.

Referenced by ast_yyget_debug(), and ast_yyset_debug().

#define YY_FLEX_MAJOR_VERSION   2

Definition at line 12 of file ast_expr2f.c.

#define YY_FLEX_MINOR_VERSION   5

Definition at line 13 of file ast_expr2f.c.

#define YY_FLEX_SUBMINOR_VERSION   34

Definition at line 14 of file ast_expr2f.c.

#define YY_FLUSH_BUFFER   ast_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)

Definition at line 301 of file ast_expr2f.c.

#define YY_INPUT (   buf,
  result,
  max_size 
)

Definition at line 764 of file ast_expr2f.c.

#define YY_INT_ALIGNED   short int

Definition at line 7 of file ast_expr2f.c.

#define YY_LESS_LINENO (   n)

Definition at line 179 of file ast_expr2f.c.

#define YY_MORE_ADJ   yyg->yy_more_len

Definition at line 490 of file ast_expr2f.c.

#define yy_new_buffer   ast_yy_create_buffer

Definition at line 311 of file ast_expr2f.c.

#define YY_NEW_FILE   ast_yyrestart(yyin ,yyscanner )

Definition at line 157 of file ast_expr2f.c.

#define YY_NULL   0

Definition at line 114 of file ast_expr2f.c.

#define YY_NUM_RULES   38

Definition at line 362 of file ast_expr2f.c.

#define YY_READ_BUF_SIZE   8192

Definition at line 749 of file ast_expr2f.c.

#define YY_RESTORE_YY_MORE_OFFSET

Definition at line 491 of file ast_expr2f.c.

#define YY_RULE_SETUP   YY_USER_ACTION

Definition at line 841 of file ast_expr2f.c.

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

Definition at line 121 of file ast_expr2f.c.

#define yy_set_bol (   at_bol)

Definition at line 323 of file ast_expr2f.c.

#define yy_set_interactive (   is_interactive)

Definition at line 313 of file ast_expr2f.c.

#define YY_SKIP_YYWRAP

Definition at line 338 of file ast_expr2f.c.

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

Definition at line 150 of file ast_expr2f.c.

#define YY_START_STACK_INCR   25

Definition at line 806 of file ast_expr2f.c.

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

Definition at line 168 of file ast_expr2f.c.

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

Definition at line 154 of file ast_expr2f.c.

#define YY_STRUCT_YY_BUFFER_STATE

Definition at line 210 of file ast_expr2f.c.

#define YY_TYPEDEF_YY_BUFFER_STATE

Definition at line 171 of file ast_expr2f.c.

#define YY_TYPEDEF_YY_SCANNER_T

Definition at line 125 of file ast_expr2f.c.

#define YY_TYPEDEF_YY_SIZE_T

Definition at line 205 of file ast_expr2f.c.

#define YY_USER_ACTION

Definition at line 833 of file ast_expr2f.c.

#define yycolumn   (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)

Definition at line 137 of file ast_expr2f.c.

Referenced by ast_yyget_column(), and ast_yyset_column().

#define yyconst

Definition at line 110 of file ast_expr2f.c.

#define yyextra   yyg->yyextra_r

Definition at line 133 of file ast_expr2f.c.

Referenced by ast_yyget_extra(), and ast_yyset_extra().

#define yyin   yyg->yyin_r

Definition at line 131 of file ast_expr2f.c.

Referenced by ast_yyget_in(), ast_yyset_in(), and yy_init_globals().

#define yyleng   yyg->yyleng_r

Definition at line 134 of file ast_expr2f.c.

Referenced by ast_yyget_leng().

#define yyless (   n)

Definition at line 2024 of file ast_expr2f.c.

#define yyless (   n)

Definition at line 2024 of file ast_expr2f.c.

#define yylineno   (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)

Definition at line 136 of file ast_expr2f.c.

Referenced by ast_yyget_lineno(), and ast_yyset_lineno().

#define yylloc   yyg->yylloc_r

Definition at line 672 of file ast_expr2f.c.

Referenced by ast_yyget_lloc(), and ast_yyset_lloc().

#define yylval   yyg->yylval_r

Definition at line 670 of file ast_expr2f.c.

Referenced by ast_yyget_lval(), and ast_yyset_lval().

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

Definition at line 489 of file ast_expr2f.c.

#define yyout   yyg->yyout_r

Definition at line 132 of file ast_expr2f.c.

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

#define YYSTATE   YY_START

Definition at line 151 of file ast_expr2f.c.

#define YYTABLES_NAME   "yytables"

Definition at line 2376 of file ast_expr2f.c.

#define yyterminate ( )    return YY_NULL

Definition at line 801 of file ast_expr2f.c.

#define yytext   yyg->yytext_r

Definition at line 135 of file ast_expr2f.c.

Referenced by ast_yyerror(), and ast_yyget_text().

#define yytext_ptr   yytext_r

Definition at line 344 of file ast_expr2f.c.


Typedef Documentation

typedef short int flex_int16_t

Definition at line 54 of file ast_expr2f.c.

typedef int flex_int32_t

Definition at line 55 of file ast_expr2f.c.

typedef signed char flex_int8_t

Definition at line 53 of file ast_expr2f.c.

typedef unsigned short int flex_uint16_t

Definition at line 57 of file ast_expr2f.c.

typedef unsigned int flex_uint32_t

Definition at line 58 of file ast_expr2f.c.

typedef unsigned char flex_uint8_t

Definition at line 56 of file ast_expr2f.c.

Definition at line 172 of file ast_expr2f.c.

typedef unsigned char YY_CHAR

Definition at line 340 of file ast_expr2f.c.

typedef size_t yy_size_t

Definition at line 206 of file ast_expr2f.c.

typedef int yy_state_type

Definition at line 342 of file ast_expr2f.c.

typedef void* yyscan_t

Definition at line 126 of file ast_expr2f.c.


Enumeration Type Documentation

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 565 of file ast_expr2f.c.


Function Documentation

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

Definition at line 2399 of file ast_expr2f.c.

References ast_copy_string(), AST_EXPR_number, ast_yy_scan_string(), ast_yylex_destroy(), ast_yylex_init(), ast_yyparse(), chan, parse_io::chan, FP___PRINTF, free, parse_io::scanner, and parse_io::string.

Referenced by check_pval_item(), and pbx_substitute_variables_helper_full().

{
   struct parse_io io;
   int return_value = 0;
   
   memset(&io, 0, sizeof(io));
   io.string = expr;  /* to pass to the error routine */
   io.chan = chan;
   
   ast_yylex_init(&io.scanner);
   
   ast_yy_scan_string(expr, io.scanner);
   
   ast_yyparse ((void *) &io);

   ast_yylex_destroy(io.scanner);

   if (!io.val) {
      if (length > 1) {
         strcpy(buf, "0");
         return_value = 1;
      }
   } else {
      if (io.val->type == AST_EXPR_number) {
         int res_length;

         res_length = snprintf(buf, length, FP___PRINTF, io.val->u.i);
         return_value = (res_length <= length) ? res_length : length;
      } else {
         if (io.val->u.s)
#if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE)
            strncpy(buf, io.val->u.s, length - 1);
#else /* !STANDALONE && !LOW_MEMORY */
            ast_copy_string(buf, io.val->u.s, length);
#endif /* STANDALONE || LOW_MEMORY */
         else
            buf[0] = 0;
         return_value = strlen(buf);
         free(io.val->u.s);
      }
      free(io.val);
   }
   return return_value;
}
void ast_expr_clear_extra_error_info ( void  )

Definition at line 2456 of file ast_expr2f.c.

Referenced by check_pval_item().

void ast_expr_register_extra_error_info ( char *  message)

Definition at line 2450 of file ast_expr2f.c.

Referenced by check_pval_item().

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 
)

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 1800 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().

{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
   if ( ! b )
      return;

   b->yy_n_chars = 0;

   /* We always need two end-of-buffer characters.  The first causes
    * a transition to the end-of-buffer state.  The second causes
    * a jam in that state.
    */
   b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
   b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;

   b->yy_buf_pos = &b->yy_ch_buf[0];

   b->yy_at_bol = 1;
   b->yy_buffer_status = YY_BUFFER_NEW;

   if ( b == YY_CURRENT_BUFFER )
      ast_yy_load_buffer_state(yyscanner );
}
static void ast_yy_init_buffer ( YY_BUFFER_STATE  b,
FILE *  file,
yyscan_t  yyscanner 
) [static]

The main scanner function which does all the work.

Definition at line 1771 of file ast_expr2f.c.

References ast_yy_flush_buffer(), errno, yy_buffer_state::yy_bs_column, yy_buffer_state::yy_bs_lineno, YY_CURRENT_BUFFER, yy_buffer_state::yy_fill_buffer, yy_buffer_state::yy_input_file, and yy_buffer_state::yy_is_interactive.

{
   int oerrno = errno;
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;

   ast_yy_flush_buffer(b ,yyscanner);

   b->yy_input_file = file;
   b->yy_fill_buffer = 1;

    /* If b is the current buffer, then ast_yy_init_buffer was _probably_
     * called from ast_yyrestart() or through yy_get_next_buffer.
     * In that case, we don't want to reset the lineno or column.
     */
    if (b != YY_CURRENT_BUFFER){
        b->yy_bs_lineno = 1;
        b->yy_bs_column = 0;
    }

        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
    
   errno = oerrno;
}
static void ast_yy_load_buffer_state ( yyscan_t  yyscanner) [static]
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 1931 of file ast_expr2f.c.

References ast_yy_switch_to_buffer(), ast_yyalloc(), yy_buffer_state::yy_at_bol, yy_buffer_state::yy_buf_pos, yy_buffer_state::yy_buf_size, YY_BUFFER_NEW, yy_buffer_state::yy_buffer_status, yy_buffer_state::yy_ch_buf, YY_END_OF_BUFFER_CHAR, YY_FATAL_ERROR, yy_buffer_state::yy_fill_buffer, yy_buffer_state::yy_input_file, yy_buffer_state::yy_is_interactive, yy_buffer_state::yy_is_our_buffer, and yy_buffer_state::yy_n_chars.

Referenced by ast_yy_scan_bytes().

{
   YY_BUFFER_STATE b;
    
   if ( size < 2 ||
        base[size-2] != YY_END_OF_BUFFER_CHAR ||
        base[size-1] != YY_END_OF_BUFFER_CHAR )
      /* They forgot to leave room for the EOB's. */
      return 0;

   b = (YY_BUFFER_STATE) ast_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
   if ( ! b )
      YY_FATAL_ERROR( "out of dynamic memory in ast_yy_scan_buffer()" );

   b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
   b->yy_buf_pos = b->yy_ch_buf = base;
   b->yy_is_our_buffer = 0;
   b->yy_input_file = 0;
   b->yy_n_chars = b->yy_buf_size;
   b->yy_is_interactive = 0;
   b->yy_at_bol = 1;
   b->yy_fill_buffer = 0;
   b->yy_buffer_status = YY_BUFFER_NEW;

   ast_yy_switch_to_buffer(b ,yyscanner );

   return b;
}
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:
bytesthe byte buffer to scan
lenthe number of bytes in the buffer pointed to by bytes.
yyscannerThe scanner object.
Returns:
the newly allocated buffer state object.

Definition at line 1981 of file ast_expr2f.c.

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

Referenced by ast_yy_scan_string().

{
   YY_BUFFER_STATE b;
   char *buf;
   yy_size_t n;
   int i;
    
   /* Get memory for full buffer, including space for trailing EOB's. */
   n = _yybytes_len + 2;
   buf = (char *) ast_yyalloc(n ,yyscanner );
   if ( ! buf )
      YY_FATAL_ERROR( "out of dynamic memory in ast_yy_scan_bytes()" );

   for ( i = 0; i < _yybytes_len; ++i )
      buf[i] = yybytes[i];

   buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;

   b = ast_yy_scan_buffer(buf,n ,yyscanner);
   if ( ! b )
      YY_FATAL_ERROR( "bad buffer in ast_yy_scan_bytes()" );

   /* It's okay to grow etc. this buffer, and we should throw it
    * away when we're done.
    */
   b->yy_is_our_buffer = 1;

   return b;
}
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 1968 of file ast_expr2f.c.

References ast_yy_scan_bytes().

Referenced by ast_expr().

{
    
   return ast_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
}
void ast_yy_switch_to_buffer ( YY_BUFFER_STATE  new_buffer,
yyscan_t  yyscanner 
)

Referenced by ast_yy_scan_buffer().

void * ast_yyalloc ( yy_size_t  size,
yyscan_t  yyscanner 
)

Definition at line 2359 of file ast_expr2f.c.

References malloc.

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

{
   return (void *) malloc( size );
}
static void ast_yyensure_buffer_stack ( yyscan_t  yyscanner) [static]

Definition at line 1881 of file ast_expr2f.c.

References ast_yyalloc(), ast_yyrealloc(), yyguts_t::yy_buffer_stack, yyguts_t::yy_buffer_stack_max, yyguts_t::yy_buffer_stack_top, and YY_FATAL_ERROR.

Referenced by ast_yypush_buffer_state().

{
   int num_to_alloc;
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;

   if (!yyg->yy_buffer_stack) {

      /* First allocation is just for 2 elements, since we don't know if this
       * scanner will even need a stack. We use 2 instead of 1 to avoid an
       * immediate realloc on the next call.
         */
      num_to_alloc = 1;
      yyg->yy_buffer_stack = (struct yy_buffer_state**)ast_yyalloc
                        (num_to_alloc * sizeof(struct yy_buffer_state*)
                        , yyscanner);
      if ( ! yyg->yy_buffer_stack )
         YY_FATAL_ERROR( "out of dynamic memory in ast_yyensure_buffer_stack()" );
                          
      memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
            
      yyg->yy_buffer_stack_max = num_to_alloc;
      yyg->yy_buffer_stack_top = 0;
      return;
   }

   if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){

      /* Increase the buffer to prepare for a possible push. */
      int grow_size = 8 /* arbitrary grow size */;

      num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
      yyg->yy_buffer_stack = (struct yy_buffer_state**)ast_yyrealloc
                        (yyg->yy_buffer_stack,
                        num_to_alloc * sizeof(struct yy_buffer_state*)
                        , yyscanner);
      if ( ! yyg->yy_buffer_stack )
         YY_FATAL_ERROR( "out of dynamic memory in ast_yyensure_buffer_stack()" );

      /* zero only the new slots.*/
      memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
      yyg->yy_buffer_stack_max = num_to_alloc;
   }
}
int ast_yyerror ( const char *  ,
YYLTYPE ,
struct parse_io  
)
int ast_yyerror ( const char *  s,
yyltype loc,
struct parse_io parseio 
)

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

{  
   struct yyguts_t * yyg = (struct yyguts_t*)(parseio->scanner);
   char spacebuf[8000]; /* best safe than sorry */
   char spacebuf2[8000]; /* best safe than sorry */
   int i=0;
   char *s2 = expr2_token_subst(s);
   spacebuf[0] = 0;
   
   for(i=0;i< (int)(yytext - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);i++) spacebuf2[i] = ' ';  /* uh... assuming yyg is defined, then I can use the yycolumn macro,
                                                                        which is the same thing as... get this:
                                       yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]->yy_bs_column
                                       I was tempted to just use yy_buf_pos in the STATE, but..., well:
                                          a. the yy_buf_pos is the current position in the buffer, which
                                             may not relate to the entire string/buffer because of the
                                             buffering.
                                          b. but, analysis of the situation is that when you use the
                                             ast_yy_scan_string func, it creates a single buffer the size of
                                             string, so the two would be the same... 
                                       so, in the end, the yycolumn macro is available, shorter, therefore easier. */
   spacebuf2[i++]='^';
   spacebuf2[i]= 0;

#ifdef STANDALONE3
   /* easier to read in the standalone version */
   printf("ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n",  
         (extra_error_message_supplied?extra_error_message:""), s2, parseio->string,spacebuf2);
#else
   ast_log(LOG_WARNING,"ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n",  
         (extra_error_message_supplied?extra_error_message:""), s2, parseio->string,spacebuf2);
#endif
#ifndef STANDALONE
   ast_log(LOG_WARNING,"If you have questions, please refer to doc/tex/channelvariables.tex.\n");
#endif
   free(s2);
   return(0);
}
void ast_yyfree ( void *  ptr,
yyscan_t  yyscanner 
)

Definition at line 2391 of file ast_expr2f.c.

References free.

Referenced by ast_yylex_destroy().

{
    /* the normal generated ast_yyfree func just frees its first arg;
     this get complaints on some systems, as sometimes this
     arg is a nil ptr! It's usually not fatal, but is irritating! */
   free( (char *) ptr );
}
int ast_yyget_column ( yyscan_t  yyscanner)

Get the current column number.

Parameters:
yyscannerThe scanner object.

Definition at line 2065 of file ast_expr2f.c.

References YY_CURRENT_BUFFER, and yycolumn.

{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    
        if (! YY_CURRENT_BUFFER)
            return 0;
    
    return yycolumn;
}
int ast_yyget_debug ( yyscan_t  yyscanner)

Definition at line 2170 of file ast_expr2f.c.

References yy_flex_debug.

{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    return yy_flex_debug;
}
YY_EXTRA_TYPE ast_yyget_extra ( yyscan_t  yyscanner)

Get the user-defined data for this scanner.

Parameters:
yyscannerThe scanner object.

Definition at line 2043 of file ast_expr2f.c.

References yyextra.

{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    return yyextra;
}
FILE * ast_yyget_in ( yyscan_t  yyscanner)

Get the input stream.

Parameters:
yyscannerThe scanner object.

Definition at line 2078 of file ast_expr2f.c.

References yyin.

{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    return yyin;
}
int ast_yyget_leng ( yyscan_t  yyscanner)

Get the length of the current token.

Parameters:
yyscannerThe scanner object.

Definition at line 2096 of file ast_expr2f.c.

References yyleng.

{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    return yyleng;
}
int ast_yyget_lineno ( yyscan_t  yyscanner)

Get the current line number.

Parameters:
yyscannerThe scanner object.

Definition at line 2052 of file ast_expr2f.c.

References YY_CURRENT_BUFFER, and yylineno.

{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    
        if (! YY_CURRENT_BUFFER)
            return 0;
    
    return yylineno;
}
YYLTYPE * ast_yyget_lloc ( yyscan_t  yyscanner)

Definition at line 2196 of file ast_expr2f.c.

References yylloc.

{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    return yylloc;
}
YYSTYPE * ast_yyget_lval ( yyscan_t  yyscanner)

Definition at line 2184 of file ast_expr2f.c.

References yylval.

{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    return yylval;
}
FILE * ast_yyget_out ( yyscan_t  yyscanner)

Get the output stream.

Parameters:
yyscannerThe scanner object.

Definition at line 2087 of file ast_expr2f.c.

References yyout.

{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    return yyout;
}
char * ast_yyget_text ( yyscan_t  yyscanner)

Get the current token.

Parameters:
yyscannerThe scanner object.

Definition at line 2106 of file ast_expr2f.c.

References yytext.

{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    return yytext;
}
int ast_yylex ( YYSTYPE yylval_param,
YYLTYPE yylloc_param,
yyscan_t  yyscanner 
)
int ast_yylex_destroy ( yyscan_t  yyscanner)

Definition at line 2306 of file ast_expr2f.c.

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

Referenced by ast_expr().

{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;

    /* Pop the buffer stack, destroying each element. */
   while(YY_CURRENT_BUFFER){
      ast_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
      YY_CURRENT_BUFFER_LVALUE = NULL;
      ast_yypop_buffer_state(yyscanner);
   }

   /* Destroy the stack itself. */
   ast_yyfree(yyg->yy_buffer_stack ,yyscanner);
   yyg->yy_buffer_stack = NULL;

    /* Destroy the start condition stack. */
        ast_yyfree(yyg->yy_start_stack ,yyscanner );
        yyg->yy_start_stack = NULL;

    /* Reset the globals. This is important in a non-reentrant scanner so the next time
     * ast_yylex() is called, initialization will occur. */
    yy_init_globals( yyscanner);

    /* Destroy the main struct (reentrant only). */
    ast_yyfree ( yyscanner , yyscanner );
    yyscanner = NULL;
    return 0;
}
int ast_yylex_init ( yyscan_t scanner)

Definition at line 2215 of file ast_expr2f.c.

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

Referenced by ast_expr().

{
    if (ptr_yy_globals == NULL){
        errno = EINVAL;
        return 1;
    }

    *ptr_yy_globals = (yyscan_t) ast_yyalloc ( sizeof( struct yyguts_t ), NULL );

    if (*ptr_yy_globals == NULL){
        errno = ENOMEM;
        return 1;
    }

    /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));

    return yy_init_globals ( *ptr_yy_globals );
}
int ast_yylex_init_extra ( YY_EXTRA_TYPE  user_defined,
yyscan_t scanner 
)

Definition at line 2244 of file ast_expr2f.c.

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

{
    struct yyguts_t dummy_yyguts;

    ast_yyset_extra (yy_user_defined, &dummy_yyguts);

    if (ptr_yy_globals == NULL){
        errno = EINVAL;
        return 1;
    }
   
    *ptr_yy_globals = (yyscan_t) ast_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
   
    if (*ptr_yy_globals == NULL){
        errno = ENOMEM;
        return 1;
    }
    
    /* By setting to 0xAA, we expose bugs in
    yy_init_globals. Leave at 0x00 for releases. */
    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
    
    ast_yyset_extra (yy_user_defined, *ptr_yy_globals);
    
    return yy_init_globals ( *ptr_yy_globals );
}
int ast_yyparse ( void *  )

Referenced by ast_expr().

void ast_yypop_buffer_state ( yyscan_t  yyscanner)

Removes and deletes the top of the stack, if present. The next element becomes the new top.

Parameters:
yyscannerThe scanner object.

Definition at line 1861 of file ast_expr2f.c.

References ast_yy_delete_buffer(), ast_yy_load_buffer_state(), yyguts_t::yy_buffer_stack_top, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, and yyguts_t::yy_did_buffer_switch_on_eof.

Referenced by ast_yylex_destroy().

{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
   if (!YY_CURRENT_BUFFER)
      return;

   ast_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
   YY_CURRENT_BUFFER_LVALUE = NULL;
   if (yyg->yy_buffer_stack_top > 0)
      --yyg->yy_buffer_stack_top;

   if (YY_CURRENT_BUFFER) {
      ast_yy_load_buffer_state(yyscanner );
      yyg->yy_did_buffer_switch_on_eof = 1;
   }
}
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 1830 of file ast_expr2f.c.

References ast_yy_load_buffer_state(), ast_yyensure_buffer_stack(), yyguts_t::yy_buffer_stack_top, yyguts_t::yy_c_buf_p, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yyguts_t::yy_did_buffer_switch_on_eof, yyguts_t::yy_hold_char, and yyguts_t::yy_n_chars.

{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
   if (new_buffer == NULL)
      return;

   ast_yyensure_buffer_stack(yyscanner);

   /* This block is copied from ast_yy_switch_to_buffer. */
   if ( YY_CURRENT_BUFFER )
      {
      /* Flush out information for old buffer. */
      *yyg->yy_c_buf_p = yyg->yy_hold_char;
      YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
      YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
      }

   /* Only push if top exists. Otherwise, replace top. */
   if (YY_CURRENT_BUFFER)
      yyg->yy_buffer_stack_top++;
   YY_CURRENT_BUFFER_LVALUE = new_buffer;

   /* copied from ast_yy_switch_to_buffer. */
   ast_yy_load_buffer_state(yyscanner );
   yyg->yy_did_buffer_switch_on_eof = 1;
}
void * ast_yyrealloc ( void *  ptr,
yy_size_t  size,
yyscan_t  yyscanner 
)

Definition at line 2364 of file ast_expr2f.c.

References realloc.

Referenced by ast_yyensure_buffer_stack().

{
   /* The cast to (char *) in the following accommodates both
    * implementations that use char* generic pointers, and those
    * that use void* generic pointers.  It works with the latter
    * because both ANSI C and C++ allow castless assignment from
    * any pointer type to void*, and deal with argument conversions
    * as though doing an assignment.
    */
   return (void *) realloc( (char *) ptr, size );
}
void ast_yyrestart ( FILE *  input_file,
yyscan_t  yyscanner 
)
void ast_yyset_column ( int  column_no,
yyscan_t  yyscanner 
)

Set the current column.

Parameters:
line_number
yyscannerThe scanner object.

Definition at line 2141 of file ast_expr2f.c.

References YY_CURRENT_BUFFER, yy_fatal_error(), and yycolumn.

{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;

        /* column is only valid if an input buffer exists. */
        if (! YY_CURRENT_BUFFER )
           yy_fatal_error( "ast_yyset_column called with no buffer" , yyscanner); 
    
    yycolumn = column_no;
}
void ast_yyset_debug ( int  debug_flag,
yyscan_t  yyscanner 
)

Definition at line 2176 of file ast_expr2f.c.

References yy_flex_debug.

{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    yy_flex_debug = bdebug ;
}
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 2116 of file ast_expr2f.c.

References yyextra.

Referenced by ast_yylex_init_extra().

{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    yyextra = user_defined ;
}
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 2158 of file ast_expr2f.c.

References yyin.

{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    yyin = in_str ;
}
void ast_yyset_lineno ( int  line_number,
yyscan_t  yyscanner 
)

Set the current line number.

Parameters:
line_number
yyscannerThe scanner object.

Definition at line 2126 of file ast_expr2f.c.

References YY_CURRENT_BUFFER, yy_fatal_error(), and yylineno.

{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;

        /* lineno is only valid if an input buffer exists. */
        if (! YY_CURRENT_BUFFER )
           yy_fatal_error( "ast_yyset_lineno called with no buffer" , yyscanner); 
    
    yylineno = line_number;
}
void ast_yyset_lloc ( YYLTYPE yylloc_param,
yyscan_t  yyscanner 
)

Definition at line 2202 of file ast_expr2f.c.

References yylloc.

{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    yylloc = yylloc_param;
}
void ast_yyset_lval ( YYSTYPE yylval_param,
yyscan_t  yyscanner 
)

Definition at line 2190 of file ast_expr2f.c.

References yylval.

{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    yylval = yylval_param;
}
void ast_yyset_out ( FILE *  out_str,
yyscan_t  yyscanner 
)

Definition at line 2164 of file ast_expr2f.c.

References yyout.

{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    yyout = out_str ;
}
static char * expr2_token_subst ( const char *  mess) [static]

Definition at line 2515 of file ast_expr2f.c.

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

Referenced by ast_yyerror().

{
   /* calc a length, malloc, fill, and return; yyerror had better free it! */
   int len=0,i;
   const char *p;
   char *res, *s,*t;
   int expr2_token_equivs_entries = sizeof(expr2_token_equivs1)/sizeof(char*);

   for (p=mess; *p; p++) {
      for (i=0; i<expr2_token_equivs_entries; i++) {
         if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 )
         {
            len+=strlen(expr2_token_equivs2[i])+2;
            p += strlen(expr2_token_equivs1[i])-1;
            break;
         }
      }
      len++;
   }
   res = (char*)malloc(len+1);
   res[0] = 0;
   s = res;
   for (p=mess; *p;) {
      int found = 0;
      for (i=0; i<expr2_token_equivs_entries; i++) {
         if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 ) {
            *s++ = '\'';
            for (t=expr2_token_equivs2[i]; *t;) {
               *s++ = *t++;
            }
            *s++ = '\'';
            p += strlen(expr2_token_equivs1[i]);
            found = 1;
            break;
         }
      }
      if( !found )
         *s++ = *p++;
   }
   *s++ = 0;
   return res;
}
static int input ( yyscan_t  yyscanner) [static]
static void yy_fatal_error ( yyconst char *  msg,
yyscan_t  yyscanner 
) [static]

Definition at line 2015 of file ast_expr2f.c.

References YY_EXIT_FAILURE.

{
      (void) fprintf( stderr, "%s\n", msg );
   exit( YY_EXIT_FAILURE );
}
static void yy_fatal_error ( yyconst char  msg[],
yyscan_t  yyscanner 
) [static]
static int yy_get_next_buffer ( yyscan_t  yyscanner) [static]
static yy_state_type yy_get_previous_state ( yyscan_t  yyscanner) [static]
static int yy_init_globals ( yyscan_t  yyscanner) [static]

Definition at line 2272 of file ast_expr2f.c.

References yyguts_t::yy_buffer_stack, yyguts_t::yy_buffer_stack_max, yyguts_t::yy_buffer_stack_top, yyguts_t::yy_c_buf_p, yyguts_t::yy_init, yyguts_t::yy_start, yyguts_t::yy_start_stack, yyguts_t::yy_start_stack_depth, yyguts_t::yy_start_stack_ptr, yyin, and yyout.

Referenced by ast_yylex_destroy(), ast_yylex_init(), and ast_yylex_init_extra().

{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    /* Initialization is the same as for the non-reentrant scanner.
     * This function is called from ast_yylex_destroy(), so don't allocate here.
     */

    yyg->yy_buffer_stack = 0;
    yyg->yy_buffer_stack_top = 0;
    yyg->yy_buffer_stack_max = 0;
    yyg->yy_c_buf_p = (char *) 0;
    yyg->yy_init = 0;
    yyg->yy_start = 0;

    yyg->yy_start_stack_ptr = 0;
    yyg->yy_start_stack_depth = 0;
    yyg->yy_start_stack =  NULL;

/* Defined in main.c */
#ifdef YY_STDINIT
    yyin = stdin;
    yyout = stdout;
#else
    yyin = (FILE *) 0;
    yyout = (FILE *) 0;
#endif

    /* For future reference: Set errno on error, since we are called by
     * ast_yylex_init()
     */
    return 0;
}
static yy_state_type yy_try_NUL_trans ( yy_state_type  current_state,
yyscan_t  yyscanner 
) [static]
static void yyunput ( int  c,
char *  buf_ptr,
yyscan_t  yyscanner 
) [static]

Variable Documentation

int curlycount = 0 [static]

Definition at line 607 of file ast_expr2f.c.

char* expr2_token_equivs1[] [static]

Definition at line 2462 of file ast_expr2f.c.

Referenced by expr2_token_subst().

char* expr2_token_equivs2[] [static]

Definition at line 2488 of file ast_expr2f.c.

char extra_error_message[4095]

Definition at line 2445 of file ast_expr2f.c.

Definition at line 2446 of file ast_expr2f.c.

yyconst flex_int16_t yy_accept[63] [static]

Definition at line 371 of file ast_expr2f.c.

yyconst flex_int16_t yy_base[70] [static]

Definition at line 421 of file ast_expr2f.c.

yyconst flex_int16_t yy_chk[159] [static]

Definition at line 464 of file ast_expr2f.c.

yyconst flex_int16_t yy_def[70] [static]

Definition at line 432 of file ast_expr2f.c.

yyconst flex_int32_t yy_ec[256] [static]

Definition at line 382 of file ast_expr2f.c.

yyconst flex_int32_t yy_meta[29] [static]

Definition at line 414 of file ast_expr2f.c.

yyconst flex_int16_t yy_nxt[159] [static]

Definition at line 443 of file ast_expr2f.c.