Asterisk - The Open Source Telephony Project GIT-master-f36a736
Data Structures | Macros | Typedefs | Functions | Variables
ael_lex.c File Reference

Flex scanner description of tokens used in AEL2 . More...

#include "asterisk.h"
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <glob.h>
#include "asterisk/logger.h"
#include "asterisk/utils.h"
#include "asterisk/lock.h"
#include "asterisk/hashtab.h"
#include "ael/ael.tab.h"
#include "asterisk/ael_structs.h"
Include dependency graph for ael_lex.c:

Go to the source code of this file.

Data Structures

struct  stackelement
 
struct  yy_buffer_state
 
struct  yy_trans_info
 
struct  yyguts_t
 

Macros

#define ael_yywrap(n)   1
 
#define argg   3
 
#define ASTMM_LIBC   ASTMM_REDIRECT
 
#define BEGIN   yyg->yy_start = 1 + 2 *
 
#define brackstate   7
 
#define comment   4
 
#define curlystate   5
 
#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 GLOB_ABORTED   GLOB_ABEND
 
#define GLOB_BRACE   0
 
#define GLOB_NOMAGIC   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 MAX_INCLUDE_DEPTH   50
 
#define paren   1
 
#define REJECT   reject_used_but_not_detected
 
#define semic   2
 
#define STORE_LOC
 
#define STORE_POS
 
#define UINT16_MAX   (65535U)
 
#define UINT32_MAX   (4294967295U)
 
#define UINT8_MAX   (255U)
 
#define unput(c)   yyunput( c, yyg->yytext_ptr , yyscanner )
 
#define wordstate   6
 
#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   77
 
#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   ael_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   ael_yy_create_buffer
 
#define YY_NEW_FILE   ael_yyrestart(yyin ,yyscanner )
 
#define YY_NULL   0
 
#define YY_NUM_RULES   76
 
#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
 

Functions

struct pvalael2_parse (char *filename, int *errors)
 
YY_BUFFER_STATE ael_yy_create_buffer (FILE *file, int size, yyscan_t yyscanner)
 
void ael_yy_delete_buffer (YY_BUFFER_STATE b, yyscan_t yyscanner)
 
void ael_yy_flush_buffer (YY_BUFFER_STATE b, yyscan_t yyscanner)
 
static void ael_yy_init_buffer (YY_BUFFER_STATE b, FILE *file, yyscan_t yyscanner)
 
static void ael_yy_load_buffer_state (yyscan_t yyscanner)
 
YY_BUFFER_STATE ael_yy_scan_buffer (char *base, yy_size_t size, yyscan_t yyscanner)
 
YY_BUFFER_STATE ael_yy_scan_bytes (yyconst char *bytes, int len, yyscan_t yyscanner)
 
YY_BUFFER_STATE ael_yy_scan_string (yyconst char *yy_str, yyscan_t yyscanner)
 
void ael_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer, yyscan_t yyscanner)
 
void * ael_yyalloc (yy_size_t, yyscan_t yyscanner)
 
static void ael_yyensure_buffer_stack (yyscan_t yyscanner)
 
void ael_yyfree (void *, yyscan_t yyscanner)
 
int ael_yyget_column (yyscan_t yyscanner)
 
int ael_yyget_debug (yyscan_t yyscanner)
 
YY_EXTRA_TYPE ael_yyget_extra (yyscan_t yyscanner)
 
FILE * ael_yyget_in (yyscan_t yyscanner)
 
int ael_yyget_leng (yyscan_t yyscanner)
 
int ael_yyget_lineno (yyscan_t yyscanner)
 
YYLTYPEael_yyget_lloc (yyscan_t yyscanner)
 
YYSTYPEael_yyget_lval (yyscan_t yyscanner)
 
FILE * ael_yyget_out (yyscan_t yyscanner)
 
char * ael_yyget_text (yyscan_t yyscanner)
 
int ael_yylex (YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner)
 
int ael_yylex_destroy (yyscan_t yyscanner)
 
int ael_yylex_init (yyscan_t *scanner)
 
int ael_yylex_init_extra (YY_EXTRA_TYPE user_defined, yyscan_t *scanner)
 
int ael_yyparse (struct parse_io *)
 
void ael_yypop_buffer_state (yyscan_t yyscanner)
 
void ael_yypush_buffer_state (YY_BUFFER_STATE new_buffer, yyscan_t yyscanner)
 
void * ael_yyrealloc (void *, yy_size_t, yyscan_t yyscanner)
 
void ael_yyrestart (FILE *input_file, yyscan_t yyscanner)
 
void ael_yyset_column (int column_no, yyscan_t yyscanner)
 
void ael_yyset_debug (int debug_flag, yyscan_t yyscanner)
 
void ael_yyset_extra (YY_EXTRA_TYPE user_defined, yyscan_t yyscanner)
 
void ael_yyset_in (FILE *in_str, yyscan_t yyscanner)
 
void ael_yyset_lineno (int line_number, yyscan_t yyscanner)
 
void ael_yyset_lloc (YYLTYPE *yylloc_param, yyscan_t yyscanner)
 
void ael_yyset_lval (YYSTYPE *yylval_param, yyscan_t yyscanner)
 
void ael_yyset_out (FILE *out_str, yyscan_t yyscanner)
 
static int c_prevword (void)
 
 if (!yyg->yy_init)
 
static int input (yyscan_t yyscanner)
 
int isatty (int)
 
static int pbcpop (char x)
 
static int pbcpop2 (char x)
 
static int pbcpop3 (char x)
 
static void pbcpush (char x)
 
static void pbcpush2 (char x)
 
static void pbcpush3 (char x)
 
static void pbcwhere (const char *text, int *line, int *col)
 
void reset_argcount (yyscan_t yyscanner)
 
void reset_parencount (yyscan_t yyscanner)
 
void reset_semicount (yyscan_t yyscanner)
 
static void setup_filestack (char *fnamebuf, int fnamebuf_siz, glob_t *globbuf, int globpos, yyscan_t xscan, int create)
 
 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 struct stackelement include_stack [MAX_INCLUDE_DEPTH]
 
static int include_stack_index = 0
 
static int my_col = 1
 
char * my_file = 0
 
static int my_lineno = 1
 
static int parencount = 0
 
static int parencount2 = 0
 
static int parencount3 = 0
 
static int pbcpos = 0
 
static int pbcpos2 = 0
 
static int pbcpos3 = 0
 
static char pbcstack [400]
 
static char pbcstack2 [400]
 
static char pbcstack3 [400]
 
char * prev_word
 
static yyconst flex_int16_t yy_accept [285]
 
register int yy_act
 
static yyconst flex_int16_t yy_base [304]
 
register char * yy_bp
 
static yyconst flex_int16_t yy_chk [1073]
 
register char * yy_cp
 
 YY_DECL
 
static yyconst flex_int16_t yy_def [304]
 
static yyconst flex_int32_t yy_ec [256]
 
static yyconst flex_int32_t yy_meta [50]
 
static yyconst flex_int16_t yy_nxt [1073]
 
struct yyguts_tyyg = (struct yyguts_t*)yyscanner
 
 yylloc = yylloc_param
 
 yylval = yylval_param
 

Detailed Description

Flex scanner description of tokens used in AEL2 .

Definition in file ael_lex.c.

Macro Definition Documentation

◆ ael_yywrap

#define ael_yywrap (   n)    1

Definition at line 331 of file ael_lex.c.

◆ argg

#define argg   3

Definition at line 964 of file ael_lex.c.

◆ ASTMM_LIBC

#define ASTMM_LIBC   ASTMM_REDIRECT

Definition at line 1 of file ael_lex.c.

◆ BEGIN

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

Definition at line 145 of file ael_lex.c.

◆ brackstate

#define brackstate   7

Definition at line 968 of file ael_lex.c.

◆ comment

#define comment   4

Definition at line 965 of file ael_lex.c.

◆ curlystate

#define curlystate   5

Definition at line 966 of file ael_lex.c.

◆ ECHO

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

Definition at line 1111 of file ael_lex.c.

◆ EOB_ACT_CONTINUE_SCAN

#define EOB_ACT_CONTINUE_SCAN   0

Definition at line 176 of file ael_lex.c.

◆ EOB_ACT_END_OF_FILE

#define EOB_ACT_END_OF_FILE   1

Definition at line 177 of file ael_lex.c.

◆ EOB_ACT_LAST_MATCH

#define EOB_ACT_LAST_MATCH   2

Definition at line 178 of file ael_lex.c.

◆ FLEX_BETA

#define FLEX_BETA

Definition at line 17 of file ael_lex.c.

◆ FLEX_SCANNER

#define FLEX_SCANNER

Definition at line 12 of file ael_lex.c.

◆ FLEXINT_H

#define FLEXINT_H

Definition at line 33 of file ael_lex.c.

◆ GLOB_ABORTED

#define GLOB_ABORTED   GLOB_ABEND

Definition at line 828 of file ael_lex.c.

◆ GLOB_BRACE

#define GLOB_BRACE   0

Definition at line 831 of file ael_lex.c.

◆ GLOB_NOMAGIC

#define GLOB_NOMAGIC   0

Definition at line 834 of file ael_lex.c.

◆ INITIAL

#define INITIAL   0

Definition at line 961 of file ael_lex.c.

◆ INT16_MAX

#define INT16_MAX   (32767)

Definition at line 76 of file ael_lex.c.

◆ INT16_MIN

#define INT16_MIN   (-32767-1)

Definition at line 67 of file ael_lex.c.

◆ INT32_MAX

#define INT32_MAX   (2147483647)

Definition at line 79 of file ael_lex.c.

◆ INT32_MIN

#define INT32_MIN   (-2147483647-1)

Definition at line 70 of file ael_lex.c.

◆ INT8_MAX

#define INT8_MAX   (127)

Definition at line 73 of file ael_lex.c.

◆ INT8_MIN

#define INT8_MIN   (-128)

Definition at line 64 of file ael_lex.c.

◆ MAX_INCLUDE_DEPTH

#define MAX_INCLUDE_DEPTH   50

Definition at line 880 of file ael_lex.c.

◆ paren

#define paren   1

Definition at line 962 of file ael_lex.c.

◆ REJECT

#define REJECT   reject_used_but_not_detected

Definition at line 764 of file ael_lex.c.

◆ semic

#define semic   2

Definition at line 963 of file ael_lex.c.

◆ STORE_LOC

#define STORE_LOC

Definition at line 948 of file ael_lex.c.

◆ STORE_POS

#define STORE_POS

Definition at line 941 of file ael_lex.c.

◆ UINT16_MAX

#define UINT16_MAX   (65535U)

Definition at line 85 of file ael_lex.c.

◆ UINT32_MAX

#define UINT32_MAX   (4294967295U)

Definition at line 88 of file ael_lex.c.

◆ UINT8_MAX

#define UINT8_MAX   (255U)

Definition at line 82 of file ael_lex.c.

◆ unput

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

Definition at line 196 of file ael_lex.c.

◆ wordstate

#define wordstate   6

Definition at line 967 of file ael_lex.c.

◆ YY_AT_BOL

#define YY_AT_BOL ( )    (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)

Definition at line 327 of file ael_lex.c.

◆ YY_BREAK

#define YY_BREAK   break;

Definition at line 1192 of file ael_lex.c.

◆ YY_BUF_SIZE

#define YY_BUF_SIZE   16384

Definition at line 164 of file ael_lex.c.

◆ YY_BUFFER_EOF_PENDING

#define YY_BUFFER_EOF_PENDING   2

Definition at line 263 of file ael_lex.c.

◆ YY_BUFFER_NEW

#define YY_BUFFER_NEW   0

Definition at line 251 of file ael_lex.c.

◆ YY_BUFFER_NORMAL

#define YY_BUFFER_NORMAL   1

Definition at line 252 of file ael_lex.c.

◆ YY_CURRENT_BUFFER

#define YY_CURRENT_BUFFER
Value:
: NULL)
struct yyguts_t * yyg
Definition: ael_lex.c:1205
#define NULL
Definition: resample.c:96
YY_BUFFER_STATE * yy_buffer_stack
Definition: ast_expr2f.c:631
size_t yy_buffer_stack_top
Definition: ast_expr2f.c:629

Definition at line 274 of file ael_lex.c.

◆ YY_CURRENT_BUFFER_LVALUE

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

Definition at line 281 of file ael_lex.c.

◆ YY_DECL

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

Definition at line 1179 of file ael_lex.c.

◆ YY_DECL_IS_OURS

#define YY_DECL_IS_OURS   1

Definition at line 1174 of file ael_lex.c.

◆ YY_DO_BEFORE_ACTION

#define YY_DO_BEFORE_ACTION

Definition at line 348 of file ael_lex.c.

◆ YY_END_OF_BUFFER

#define YY_END_OF_BUFFER   77

Definition at line 357 of file ael_lex.c.

◆ YY_END_OF_BUFFER_CHAR

#define YY_END_OF_BUFFER_CHAR   0

Definition at line 160 of file ael_lex.c.

◆ YY_EXIT_FAILURE

#define YY_EXIT_FAILURE   2

Definition at line 2851 of file ael_lex.c.

◆ YY_EXTRA_TYPE

#define YY_EXTRA_TYPE   void *

Definition at line 979 of file ael_lex.c.

◆ YY_FATAL_ERROR

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

Definition at line 1165 of file ael_lex.c.

◆ yy_flex_debug

#define yy_flex_debug   yyg->yy_flex_debug_r

Definition at line 139 of file ael_lex.c.

◆ YY_FLEX_MAJOR_VERSION

#define YY_FLEX_MAJOR_VERSION   2

Definition at line 13 of file ael_lex.c.

◆ YY_FLEX_MINOR_VERSION

#define YY_FLEX_MINOR_VERSION   5

Definition at line 14 of file ael_lex.c.

◆ YY_FLEX_SUBMINOR_VERSION

#define YY_FLEX_SUBMINOR_VERSION   35

Definition at line 15 of file ael_lex.c.

◆ YY_FLUSH_BUFFER

#define YY_FLUSH_BUFFER   ael_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)

Definition at line 295 of file ael_lex.c.

◆ YY_INPUT

#define YY_INPUT (   buf,
  result,
  max_size 
)

Definition at line 1118 of file ael_lex.c.

◆ YY_INT_ALIGNED

#define YY_INT_ALIGNED   short int

Definition at line 8 of file ael_lex.c.

◆ YY_LESS_LINENO

#define YY_LESS_LINENO (   n)

Definition at line 180 of file ael_lex.c.

◆ YY_MORE_ADJ

#define YY_MORE_ADJ   yyg->yy_more_len

Definition at line 766 of file ael_lex.c.

◆ yy_new_buffer

#define yy_new_buffer   ael_yy_create_buffer

Definition at line 305 of file ael_lex.c.

◆ YY_NEW_FILE

#define YY_NEW_FILE   ael_yyrestart(yyin ,yyscanner )

Definition at line 158 of file ael_lex.c.

◆ YY_NULL

#define YY_NULL   0

Definition at line 115 of file ael_lex.c.

◆ YY_NUM_RULES

#define YY_NUM_RULES   76

Definition at line 356 of file ael_lex.c.

◆ YY_READ_BUF_SIZE

#define YY_READ_BUF_SIZE   8192

Definition at line 1103 of file ael_lex.c.

◆ YY_RESTORE_YY_MORE_OFFSET

#define YY_RESTORE_YY_MORE_OFFSET

Definition at line 767 of file ael_lex.c.

◆ YY_RULE_SETUP

#define YY_RULE_SETUP    YY_USER_ACTION

Definition at line 1195 of file ael_lex.c.

◆ YY_SC_TO_UI

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

Definition at line 122 of file ael_lex.c.

◆ yy_set_bol

#define yy_set_bol (   at_bol)

Definition at line 317 of file ael_lex.c.

◆ yy_set_interactive

#define yy_set_interactive (   is_interactive)

Definition at line 307 of file ael_lex.c.

◆ YY_SKIP_YYWRAP

#define YY_SKIP_YYWRAP

Definition at line 332 of file ael_lex.c.

◆ YY_START

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

Definition at line 151 of file ael_lex.c.

◆ YY_START_STACK_INCR

#define YY_START_STACK_INCR   25

Definition at line 1160 of file ael_lex.c.

◆ YY_STATE_BUF_SIZE

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

Definition at line 169 of file ael_lex.c.

◆ YY_STATE_EOF

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

Definition at line 155 of file ael_lex.c.

◆ YY_STRUCT_YY_BUFFER_STATE

#define YY_STRUCT_YY_BUFFER_STATE

Definition at line 204 of file ael_lex.c.

◆ YY_TYPEDEF_YY_BUFFER_STATE

#define YY_TYPEDEF_YY_BUFFER_STATE

Definition at line 172 of file ael_lex.c.

◆ YY_TYPEDEF_YY_SCANNER_T

#define YY_TYPEDEF_YY_SCANNER_T

Definition at line 126 of file ael_lex.c.

◆ YY_TYPEDEF_YY_SIZE_T

#define YY_TYPEDEF_YY_SIZE_T

Definition at line 199 of file ael_lex.c.

◆ YY_USER_ACTION

#define YY_USER_ACTION

Definition at line 1187 of file ael_lex.c.

◆ yycolumn

#define yycolumn   (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)

Definition at line 138 of file ael_lex.c.

◆ yyconst

#define yyconst

Definition at line 111 of file ael_lex.c.

◆ yyextra

#define yyextra   yyg->yyextra_r

Definition at line 134 of file ael_lex.c.

◆ yyin

#define yyin   yyg->yyin_r

Definition at line 132 of file ael_lex.c.

◆ yyleng

#define yyleng   yyg->yyleng_r

Definition at line 135 of file ael_lex.c.

◆ yyless [1/2]

#define yyless (   n)

Definition at line 2863 of file ael_lex.c.

◆ yyless [2/2]

#define yyless (   n)

Definition at line 2863 of file ael_lex.c.

◆ yylineno

#define yylineno   (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)

Definition at line 137 of file ael_lex.c.

◆ yylloc

#define yylloc   yyg->yylloc_r

Definition at line 1026 of file ael_lex.c.

◆ yylval

#define yylval   yyg->yylval_r

Definition at line 1024 of file ael_lex.c.

◆ yymore

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

Definition at line 765 of file ael_lex.c.

◆ yyout

#define yyout   yyg->yyout_r

Definition at line 133 of file ael_lex.c.

◆ YYSTATE

#define YYSTATE   YY_START

Definition at line 152 of file ael_lex.c.

◆ YYTABLES_NAME

#define YYTABLES_NAME   "yytables"

Definition at line 3215 of file ael_lex.c.

◆ yyterminate

#define yyterminate ( )    return YY_NULL

Definition at line 1155 of file ael_lex.c.

◆ yytext

#define yytext   yyg->yytext_r

Definition at line 136 of file ael_lex.c.

◆ yytext_ptr

#define yytext_ptr   yytext_r

Definition at line 338 of file ael_lex.c.

Typedef Documentation

◆ flex_int16_t

typedef short int flex_int16_t

Definition at line 55 of file ael_lex.c.

◆ flex_int32_t

typedef int flex_int32_t

Definition at line 56 of file ael_lex.c.

◆ flex_int8_t

typedef signed char flex_int8_t

Definition at line 54 of file ael_lex.c.

◆ flex_uint16_t

typedef unsigned short int flex_uint16_t

Definition at line 58 of file ael_lex.c.

◆ flex_uint32_t

typedef unsigned int flex_uint32_t

Definition at line 59 of file ael_lex.c.

◆ flex_uint8_t

typedef unsigned char flex_uint8_t

Definition at line 57 of file ael_lex.c.

◆ YY_BUFFER_STATE

Definition at line 173 of file ael_lex.c.

◆ YY_CHAR

typedef unsigned char YY_CHAR

Definition at line 334 of file ael_lex.c.

◆ yy_size_t

typedef size_t yy_size_t

Definition at line 200 of file ael_lex.c.

◆ yy_state_type

typedef int yy_state_type

Definition at line 336 of file ael_lex.c.

◆ yyscan_t

typedef void* yyscan_t

Definition at line 127 of file ael_lex.c.

Function Documentation

◆ ael2_parse()

struct pval * ael2_parse ( char *  filename,
int *  errors 
)

Definition at line 3344 of file ael_lex.c.

3345{
3346 struct pval *pvalue;
3347 struct parse_io *io;
3348 char *buffer;
3349 struct stat stats;
3350 FILE *fin;
3351
3352 /* extern int ael_yydebug; */
3353
3354 io = calloc(sizeof(struct parse_io),1);
3355 /* reset the global counters */
3356 prev_word = 0;
3357 my_lineno = 1;
3359 my_col = 0;
3360 /* ael_yydebug = 1; */
3361 ael_yylex_init(&io->scanner);
3362 fin = fopen(filename,"r");
3363 if ( !fin ) {
3364 ast_log(LOG_ERROR,"File %s could not be opened\n", filename);
3365 *errors = 1;
3366 return 0;
3367 }
3368 if (my_file)
3369 free(my_file);
3370 my_file = strdup(filename);
3371 if (stat(filename, &stats)) {
3372 ast_log(LOG_WARNING, "failed to populate stats from file '%s'\n", filename);
3373 }
3374 buffer = (char*)malloc(stats.st_size+2);
3375 if (fread(buffer, 1, stats.st_size, fin) != stats.st_size) {
3376 ast_log(LOG_ERROR, "fread() failed: %s\n", strerror(errno));
3377 }
3378 buffer[stats.st_size]=0;
3379 fclose(fin);
3380
3381 ael_yy_scan_string (buffer ,io->scanner);
3382 ael_yyset_lineno(1 , io->scanner);
3383
3384 /* ael_yyset_in (fin , io->scanner); OLD WAY */
3385
3386 ael_yyparse(io);
3387
3388
3389 pvalue = io->pval;
3390 *errors = io->syntax_error_count;
3391
3392 ael_yylex_destroy(io->scanner);
3393 free(buffer);
3394 free(io);
3395
3396 return pvalue;
3397}
static int my_col
Definition: ael_lex.c:876
char * prev_word
Definition: ael_lex.c:878
static int my_lineno
Definition: ael_lex.c:875
char * my_file
Definition: ael_lex.c:877
int ael_yyparse(struct parse_io *)
int ael_yylex_destroy(yyscan_t yyscanner)
Definition: ael_lex.c:3145
YY_BUFFER_STATE ael_yy_scan_string(yyconst char *yy_str, yyscan_t yyscanner)
Definition: ael_lex.c:2807
int ael_yylex_init(yyscan_t *scanner)
Definition: ael_lex.c:3054
static int include_stack_index
Definition: ael_lex.c:908
void ael_yyset_lineno(int line_number, yyscan_t yyscanner)
Definition: ael_lex.c:2965
#define strdup(a)
Definition: astmm.h:163
#define calloc(a, b)
Definition: astmm.h:155
#define ast_log
Definition: astobj2.c:42
static struct io_context * io
Definition: chan_ooh323.c:401
char * malloc()
void free()
#define LOG_ERROR
#define LOG_WARNING
int errno
Definition: pval.h:49

References ael_yy_scan_string(), ael_yylex_destroy(), ael_yylex_init(), ael_yyparse(), ael_yyset_lineno(), ast_log, calloc, errno, free(), include_stack_index, io, LOG_ERROR, LOG_WARNING, malloc(), my_col, my_file, my_lineno, prev_word, and strdup.

Referenced by pbx_load_module().

◆ ael_yy_create_buffer()

YY_BUFFER_STATE ael_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 2558 of file ael_lex.c.

2559{
2561
2562 b = (YY_BUFFER_STATE) ael_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
2563 if ( ! b )
2564 YY_FATAL_ERROR( "out of dynamic memory in ael_yy_create_buffer()" );
2565
2566 b->yy_buf_size = size;
2567
2568 /* yy_ch_buf has to be 2 characters longer than the size given because
2569 * we need to put in 2 end-of-buffer characters.
2570 */
2571 b->yy_ch_buf = (char *) ael_yyalloc(b->yy_buf_size + 2 ,yyscanner );
2572 if ( ! b->yy_ch_buf )
2573 YY_FATAL_ERROR( "out of dynamic memory in ael_yy_create_buffer()" );
2574
2575 b->yy_is_our_buffer = 1;
2576
2577 ael_yy_init_buffer(b,file ,yyscanner);
2578
2579 return b;
2580}
static void ael_yy_init_buffer(YY_BUFFER_STATE b, FILE *file, yyscan_t yyscanner)
Definition: ael_lex.c:2610
struct yy_buffer_state * YY_BUFFER_STATE
Definition: ael_lex.c:173
void * ael_yyalloc(yy_size_t, yyscan_t yyscanner)
Definition: ael_lex.c:3198
#define YY_FATAL_ERROR(msg)
Definition: ael_lex.c:1165
static struct test_val b

References ael_yy_init_buffer(), ael_yyalloc(), b, make_ari_stubs::file, and YY_FATAL_ERROR.

Referenced by ael_yyrestart(), and if().

◆ ael_yy_delete_buffer()

void ael_yy_delete_buffer ( YY_BUFFER_STATE  b,
yyscan_t  yyscanner 
)

Destroy the buffer.

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

Definition at line 2586 of file ael_lex.c.

2587{
2588 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2589
2590 if ( ! b )
2591 return;
2592
2593 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2595
2596 if ( b->yy_is_our_buffer )
2597 ael_yyfree((void *) b->yy_ch_buf ,yyscanner );
2598
2599 ael_yyfree((void *) b ,yyscanner );
2600}
#define YY_CURRENT_BUFFER_LVALUE
Definition: ael_lex.c:281
#define YY_CURRENT_BUFFER
Definition: ael_lex.c:274
void ael_yyfree(void *, yyscan_t yyscanner)
Definition: ael_lex.c:3226

References ael_yyfree(), b, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, and yyg.

Referenced by ael_yylex_destroy(), ael_yypop_buffer_state(), and while().

◆ ael_yy_flush_buffer()

void ael_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 2639 of file ael_lex.c.

2640{
2641 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2642 if ( ! b )
2643 return;
2644
2645 b->yy_n_chars = 0;
2646
2647 /* We always need two end-of-buffer characters. The first causes
2648 * a transition to the end-of-buffer state. The second causes
2649 * a jam in that state.
2650 */
2651 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2652 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2653
2654 b->yy_buf_pos = &b->yy_ch_buf[0];
2655
2656 b->yy_at_bol = 1;
2657 b->yy_buffer_status = YY_BUFFER_NEW;
2658
2659 if ( b == YY_CURRENT_BUFFER )
2660 ael_yy_load_buffer_state(yyscanner );
2661}
#define YY_BUFFER_NEW
Definition: ael_lex.c:251
static void ael_yy_load_buffer_state(yyscan_t yyscanner)
Definition: ael_lex.c:2543
#define YY_END_OF_BUFFER_CHAR
Definition: ael_lex.c:160

References ael_yy_load_buffer_state(), b, YY_BUFFER_NEW, YY_CURRENT_BUFFER, YY_END_OF_BUFFER_CHAR, and yyg.

Referenced by ael_yy_init_buffer().

◆ ael_yy_init_buffer()

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

Definition at line 2610 of file ael_lex.c.

2612{
2613 int oerrno = errno;
2614 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2615
2616 ael_yy_flush_buffer(b ,yyscanner);
2617
2618 b->yy_input_file = file;
2619 b->yy_fill_buffer = 1;
2620
2621 /* If b is the current buffer, then ael_yy_init_buffer was _probably_
2622 * called from ael_yyrestart() or through yy_get_next_buffer.
2623 * In that case, we don't want to reset the lineno or column.
2624 */
2625 if (b != YY_CURRENT_BUFFER){
2626 b->yy_bs_lineno = 1;
2627 b->yy_bs_column = 0;
2628 }
2629
2630 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2631
2632 errno = oerrno;
2633}
void ael_yy_flush_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner)
Definition: ael_lex.c:2639
int isatty(int)

References ael_yy_flush_buffer(), b, errno, make_ari_stubs::file, isatty(), YY_CURRENT_BUFFER, and yyg.

Referenced by ael_yy_create_buffer(), and ael_yyrestart().

◆ ael_yy_load_buffer_state()

static void ael_yy_load_buffer_state ( yyscan_t  yyscanner)
static

Definition at line 2543 of file ael_lex.c.

2544{
2545 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2547 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2548 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2550}
#define yyin
Definition: ael_lex.c:132
char yy_hold_char
Definition: ast_expr2f.c:632
int yy_n_chars
Definition: ast_expr2f.c:633
char * yy_c_buf_p
Definition: ast_expr2f.c:635

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

Referenced by ael_yy_flush_buffer(), ael_yy_switch_to_buffer(), ael_yypop_buffer_state(), ael_yypush_buffer_state(), ael_yyrestart(), and if().

◆ ael_yy_scan_buffer()

YY_BUFFER_STATE ael_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 2770 of file ael_lex.c.

2771{
2773
2774 if ( size < 2 ||
2775 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2776 base[size-1] != YY_END_OF_BUFFER_CHAR )
2777 /* They forgot to leave room for the EOB's. */
2778 return 0;
2779
2780 b = (YY_BUFFER_STATE) ael_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
2781 if ( ! b )
2782 YY_FATAL_ERROR( "out of dynamic memory in ael_yy_scan_buffer()" );
2783
2784 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2785 b->yy_buf_pos = b->yy_ch_buf = base;
2786 b->yy_is_our_buffer = 0;
2787 b->yy_input_file = 0;
2788 b->yy_n_chars = b->yy_buf_size;
2789 b->yy_is_interactive = 0;
2790 b->yy_at_bol = 1;
2791 b->yy_fill_buffer = 0;
2792 b->yy_buffer_status = YY_BUFFER_NEW;
2793
2794 ael_yy_switch_to_buffer(b ,yyscanner );
2795
2796 return b;
2797}
void ael_yy_switch_to_buffer(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner)
Definition: ael_lex.c:2511

References ael_yy_switch_to_buffer(), ael_yyalloc(), b, YY_BUFFER_NEW, YY_END_OF_BUFFER_CHAR, and YY_FATAL_ERROR.

Referenced by ael_yy_scan_bytes().

◆ ael_yy_scan_bytes()

YY_BUFFER_STATE ael_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 ael_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 2820 of file ael_lex.c.

2821{
2823 char *buf;
2824 yy_size_t n;
2825 int i;
2826
2827 /* Get memory for full buffer, including space for trailing EOB's. */
2828 n = _yybytes_len + 2;
2829 buf = (char *) ael_yyalloc(n ,yyscanner );
2830 if ( ! buf )
2831 YY_FATAL_ERROR( "out of dynamic memory in ael_yy_scan_bytes()" );
2832
2833 for ( i = 0; i < _yybytes_len; ++i )
2834 buf[i] = yybytes[i];
2835
2836 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2837
2838 b = ael_yy_scan_buffer(buf,n ,yyscanner);
2839 if ( ! b )
2840 YY_FATAL_ERROR( "bad buffer in ael_yy_scan_bytes()" );
2841
2842 /* It's okay to grow etc. this buffer, and we should throw it
2843 * away when we're done.
2844 */
2845 b->yy_is_our_buffer = 1;
2846
2847 return b;
2848}
YY_BUFFER_STATE ael_yy_scan_buffer(char *base, yy_size_t size, yyscan_t yyscanner)
Definition: ael_lex.c:2770
size_t yy_size_t
Definition: ast_expr2f.c:200
char buf[BUFSIZE]
Definition: eagi_proxy.c:66

References ael_yy_scan_buffer(), ael_yyalloc(), b, buf, YY_END_OF_BUFFER_CHAR, and YY_FATAL_ERROR.

Referenced by ael_yy_scan_string().

◆ ael_yy_scan_string()

YY_BUFFER_STATE ael_yy_scan_string ( yyconst char *  yystr,
yyscan_t  yyscanner 
)

Setup the input buffer state to scan a string. The next call to ael_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 ael_yy_scan_bytes() instead.

Definition at line 2807 of file ael_lex.c.

2808{
2809
2810 return ael_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
2811}
YY_BUFFER_STATE ael_yy_scan_bytes(yyconst char *bytes, int len, yyscan_t yyscanner)
Definition: ael_lex.c:2820

References ael_yy_scan_bytes().

Referenced by ael2_parse(), and setup_filestack().

◆ ael_yy_switch_to_buffer()

void ael_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 2511 of file ael_lex.c.

2512{
2513 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2514
2515 /* TODO. We should be able to replace this entire function body
2516 * with
2517 * ael_yypop_buffer_state();
2518 * ael_yypush_buffer_state(new_buffer);
2519 */
2520 ael_yyensure_buffer_stack (yyscanner);
2521 if ( YY_CURRENT_BUFFER == new_buffer )
2522 return;
2523
2524 if ( YY_CURRENT_BUFFER )
2525 {
2526 /* Flush out information for old buffer. */
2530 }
2531
2532 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2533 ael_yy_load_buffer_state(yyscanner );
2534
2535 /* We don't actually know whether we did this switch during
2536 * EOF (ael_yywrap()) processing, but the only time this flag
2537 * is looked at is after ael_yywrap() is called, so it's safe
2538 * to go ahead and always set it.
2539 */
2541}
static void ael_yyensure_buffer_stack(yyscan_t yyscanner)
Definition: ael_lex.c:2720
int yy_did_buffer_switch_on_eof
Definition: ast_expr2f.c:638

References ael_yy_load_buffer_state(), ael_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, yyguts_t::yy_n_chars, and yyg.

Referenced by ael_yy_scan_buffer(), setup_filestack(), and while().

◆ ael_yyalloc()

void * ael_yyalloc ( yy_size_t  size,
yyscan_t  yyscanner 
)

Definition at line 3198 of file ael_lex.c.

3199{
3200 return (void *) malloc( size );
3201}

References malloc().

Referenced by ael_yy_create_buffer(), ael_yy_scan_buffer(), ael_yy_scan_bytes(), ael_yyensure_buffer_stack(), ael_yylex_init(), and ael_yylex_init_extra().

◆ ael_yyensure_buffer_stack()

static void ael_yyensure_buffer_stack ( yyscan_t  yyscanner)
static

Definition at line 2720 of file ael_lex.c.

2721{
2722 int num_to_alloc;
2723 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2724
2725 if (!yyg->yy_buffer_stack) {
2726
2727 /* First allocation is just for 2 elements, since we don't know if this
2728 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2729 * immediate realloc on the next call.
2730 */
2731 num_to_alloc = 1;
2733 (num_to_alloc * sizeof(struct yy_buffer_state*)
2734 , yyscanner);
2735 if ( ! yyg->yy_buffer_stack )
2736 YY_FATAL_ERROR( "out of dynamic memory in ael_yyensure_buffer_stack()" );
2737
2738 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2739
2740 yyg->yy_buffer_stack_max = num_to_alloc;
2742 return;
2743 }
2744
2746
2747 /* Increase the buffer to prepare for a possible push. */
2748 int grow_size = 8 /* arbitrary grow size */;
2749
2750 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
2753 num_to_alloc * sizeof(struct yy_buffer_state*)
2754 , yyscanner);
2755 if ( ! yyg->yy_buffer_stack )
2756 YY_FATAL_ERROR( "out of dynamic memory in ael_yyensure_buffer_stack()" );
2757
2758 /* zero only the new slots.*/
2759 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
2760 yyg->yy_buffer_stack_max = num_to_alloc;
2761 }
2762}
void * ael_yyrealloc(void *, yy_size_t, yyscan_t yyscanner)
Definition: ael_lex.c:3203
size_t yy_buffer_stack_max
Definition: ast_expr2f.c:630

References ael_yyalloc(), ael_yyrealloc(), yyguts_t::yy_buffer_stack, yyguts_t::yy_buffer_stack_max, yyguts_t::yy_buffer_stack_top, YY_FATAL_ERROR, and yyg.

Referenced by ael_yy_switch_to_buffer(), ael_yypush_buffer_state(), ael_yyrestart(), and if().

◆ ael_yyfree()

void ael_yyfree ( void *  ptr,
yyscan_t  yyscanner 
)

Definition at line 3226 of file ael_lex.c.

3227{
3228 if (ptr)
3229 free( (char*) ptr );
3230}

References free().

Referenced by ael_yy_delete_buffer(), and ael_yylex_destroy().

◆ ael_yyget_column()

int ael_yyget_column ( yyscan_t  yyscanner)

Get the current column number.

Parameters
yyscannerThe scanner object.

Definition at line 2904 of file ael_lex.c.

2905{
2906 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2907
2908 if (! YY_CURRENT_BUFFER)
2909 return 0;
2910
2911 return yycolumn;
2912}
#define yycolumn
Definition: ael_lex.c:138

References YY_CURRENT_BUFFER, yycolumn, and yyg.

◆ ael_yyget_debug()

int ael_yyget_debug ( yyscan_t  yyscanner)

Definition at line 3009 of file ael_lex.c.

3010{
3011 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3012 return yy_flex_debug;
3013}
#define yy_flex_debug
Definition: ael_lex.c:139

References yy_flex_debug, and yyg.

◆ ael_yyget_extra()

YY_EXTRA_TYPE ael_yyget_extra ( yyscan_t  yyscanner)

Get the user-defined data for this scanner.

Parameters
yyscannerThe scanner object.

Definition at line 2882 of file ael_lex.c.

2883{
2884 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2885 return yyextra;
2886}
#define yyextra
Definition: ael_lex.c:134

References yyextra, and yyg.

◆ ael_yyget_in()

FILE * ael_yyget_in ( yyscan_t  yyscanner)

Get the input stream.

Parameters
yyscannerThe scanner object.

Definition at line 2917 of file ael_lex.c.

2918{
2919 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2920 return yyin;
2921}

References yyg, and yyin.

◆ ael_yyget_leng()

int ael_yyget_leng ( yyscan_t  yyscanner)

Get the length of the current token.

Parameters
yyscannerThe scanner object.

Definition at line 2935 of file ael_lex.c.

2936{
2937 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2938 return yyleng;
2939}
#define yyleng
Definition: ael_lex.c:135

References yyg, and yyleng.

◆ ael_yyget_lineno()

int ael_yyget_lineno ( yyscan_t  yyscanner)

Get the current line number.

Parameters
yyscannerThe scanner object.

Definition at line 2891 of file ael_lex.c.

2892{
2893 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2894
2895 if (! YY_CURRENT_BUFFER)
2896 return 0;
2897
2898 return yylineno;
2899}
#define yylineno
Definition: ael_lex.c:137

References YY_CURRENT_BUFFER, yyg, and yylineno.

◆ ael_yyget_lloc()

YYLTYPE * ael_yyget_lloc ( yyscan_t  yyscanner)

Definition at line 3035 of file ael_lex.c.

3036{
3037 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3038 return yylloc;
3039}
#define yylloc
Definition: ael_lex.c:1026

References yyg, and yylloc.

◆ ael_yyget_lval()

YYSTYPE * ael_yyget_lval ( yyscan_t  yyscanner)

Definition at line 3023 of file ael_lex.c.

3024{
3025 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3026 return yylval;
3027}
#define yylval
Definition: ael_lex.c:1024

References yyg, and yylval.

◆ ael_yyget_out()

FILE * ael_yyget_out ( yyscan_t  yyscanner)

Get the output stream.

Parameters
yyscannerThe scanner object.

Definition at line 2926 of file ael_lex.c.

2927{
2928 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2929 return yyout;
2930}
#define yyout
Definition: ael_lex.c:133

References yyg, and yyout.

◆ ael_yyget_text()

char * ael_yyget_text ( yyscan_t  yyscanner)

Get the current token.

Parameters
yyscannerThe scanner object.

Definition at line 2945 of file ael_lex.c.

2946{
2947 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2948 return yytext;
2949}
#define yytext
Definition: ael_lex.c:136

References yyg, and yytext.

◆ ael_yylex()

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

◆ ael_yylex_destroy()

int ael_yylex_destroy ( yyscan_t  yyscanner)

Definition at line 3145 of file ael_lex.c.

3146{
3147 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3148
3149 /* Pop the buffer stack, destroying each element. */
3150 while(YY_CURRENT_BUFFER){
3153 ael_yypop_buffer_state(yyscanner);
3154 }
3155
3156 /* Destroy the stack itself. */
3157 ael_yyfree(yyg->yy_buffer_stack ,yyscanner);
3159
3160 /* Destroy the start condition stack. */
3161 ael_yyfree(yyg->yy_start_stack ,yyscanner );
3163
3164 /* Reset the globals. This is important in a non-reentrant scanner so the next time
3165 * ael_yylex() is called, initialization will occur. */
3166 yy_init_globals( yyscanner);
3167
3168 /* Destroy the main struct (reentrant only). */
3169 ael_yyfree ( yyscanner , yyscanner );
3170 yyscanner = NULL;
3171 return 0;
3172}
static int yy_init_globals(yyscan_t yyscanner)
Definition: ael_lex.c:3111
void ael_yy_delete_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner)
Definition: ael_lex.c:2586
void ael_yypop_buffer_state(yyscan_t yyscanner)
Definition: ael_lex.c:2700
int * yy_start_stack
Definition: ast_expr2f.c:641

References ael_yy_delete_buffer(), ael_yyfree(), ael_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 yyg.

Referenced by ael2_parse().

◆ ael_yylex_init()

int ael_yylex_init ( yyscan_t scanner)

Definition at line 3054 of file ael_lex.c.

3056{
3057 if (ptr_yy_globals == NULL){
3058 errno = EINVAL;
3059 return 1;
3060 }
3061
3062 *ptr_yy_globals = (yyscan_t) ael_yyalloc ( sizeof( struct yyguts_t ), NULL );
3063
3064 if (*ptr_yy_globals == NULL){
3065 errno = ENOMEM;
3066 return 1;
3067 }
3068
3069 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
3070 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3071
3072 return yy_init_globals ( *ptr_yy_globals );
3073}
void * yyscan_t
Definition: ael_lex.c:127

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

Referenced by ael2_parse().

◆ ael_yylex_init_extra()

int ael_yylex_init_extra ( YY_EXTRA_TYPE  user_defined,
yyscan_t scanner 
)

Definition at line 3083 of file ael_lex.c.

3085{
3086 struct yyguts_t dummy_yyguts;
3087
3088 ael_yyset_extra (yy_user_defined, &dummy_yyguts);
3089
3090 if (ptr_yy_globals == NULL){
3091 errno = EINVAL;
3092 return 1;
3093 }
3094
3095 *ptr_yy_globals = (yyscan_t) ael_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
3096
3097 if (*ptr_yy_globals == NULL){
3098 errno = ENOMEM;
3099 return 1;
3100 }
3101
3102 /* By setting to 0xAA, we expose bugs in
3103 yy_init_globals. Leave at 0x00 for releases. */
3104 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3105
3106 ael_yyset_extra (yy_user_defined, *ptr_yy_globals);
3107
3108 return yy_init_globals ( *ptr_yy_globals );
3109}
void ael_yyset_extra(YY_EXTRA_TYPE user_defined, yyscan_t yyscanner)
Definition: ael_lex.c:2955

References ael_yyalloc(), ael_yyset_extra(), errno, NULL, and yy_init_globals().

◆ ael_yyparse()

int ael_yyparse ( struct parse_io )

Referenced by ael2_parse().

◆ ael_yypop_buffer_state()

void ael_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 2700 of file ael_lex.c.

2701{
2702 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2703 if (!YY_CURRENT_BUFFER)
2704 return;
2705
2708 if (yyg->yy_buffer_stack_top > 0)
2710
2711 if (YY_CURRENT_BUFFER) {
2712 ael_yy_load_buffer_state(yyscanner );
2714 }
2715}

References ael_yy_delete_buffer(), ael_yy_load_buffer_state(), NULL, yyguts_t::yy_buffer_stack_top, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yyguts_t::yy_did_buffer_switch_on_eof, and yyg.

Referenced by ael_yylex_destroy().

◆ ael_yypush_buffer_state()

void ael_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 2669 of file ael_lex.c.

2670{
2671 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2672 if (new_buffer == NULL)
2673 return;
2674
2675 ael_yyensure_buffer_stack(yyscanner);
2676
2677 /* This block is copied from ael_yy_switch_to_buffer. */
2678 if ( YY_CURRENT_BUFFER )
2679 {
2680 /* Flush out information for old buffer. */
2684 }
2685
2686 /* Only push if top exists. Otherwise, replace top. */
2689 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2690
2691 /* copied from ael_yy_switch_to_buffer. */
2692 ael_yy_load_buffer_state(yyscanner );
2694}

References ael_yy_load_buffer_state(), ael_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, yyguts_t::yy_n_chars, and yyg.

◆ ael_yyrealloc()

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

Definition at line 3203 of file ael_lex.c.

3204{
3205 /* The cast to (char *) in the following accommodates both
3206 * implementations that use char* generic pointers, and those
3207 * that use void* generic pointers. It works with the latter
3208 * because both ANSI C and C++ allow castless assignment from
3209 * any pointer type to void*, and deal with argument conversions
3210 * as though doing an assignment.
3211 */
3212 return (void *) realloc( (char *) ptr, size );
3213}
#define realloc(a, b)
Definition: astmm.h:161

References realloc.

Referenced by ael_yyensure_buffer_stack(), and yy_get_next_buffer().

◆ ael_yyrestart()

void ael_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 2493 of file ael_lex.c.

2494{
2495 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2496
2497 if ( ! YY_CURRENT_BUFFER ){
2498 ael_yyensure_buffer_stack (yyscanner);
2501 }
2502
2503 ael_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
2504 ael_yy_load_buffer_state(yyscanner );
2505}
YY_BUFFER_STATE ael_yy_create_buffer(FILE *file, int size, yyscan_t yyscanner)
Definition: ael_lex.c:2558
#define YY_BUF_SIZE
Definition: ael_lex.c:164

References ael_yy_create_buffer(), ael_yy_init_buffer(), ael_yy_load_buffer_state(), ael_yyensure_buffer_stack(), YY_BUF_SIZE, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yyg, and yyin.

Referenced by input(), and yy_get_next_buffer().

◆ ael_yyset_column()

void ael_yyset_column ( int  column_no,
yyscan_t  yyscanner 
)

Set the current column.

Parameters
line_number
yyscannerThe scanner object.

Definition at line 2980 of file ael_lex.c.

2981{
2982 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2983
2984 /* column is only valid if an input buffer exists. */
2985 if (! YY_CURRENT_BUFFER )
2986 yy_fatal_error( "ael_yyset_column called with no buffer" , yyscanner);
2987
2988 yycolumn = column_no;
2989}
static void yy_fatal_error(yyconst char msg[], yyscan_t yyscanner)

References YY_CURRENT_BUFFER, yy_fatal_error(), yycolumn, and yyg.

◆ ael_yyset_debug()

void ael_yyset_debug ( int  debug_flag,
yyscan_t  yyscanner 
)

Definition at line 3015 of file ael_lex.c.

3016{
3017 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3018 yy_flex_debug = bdebug ;
3019}

References yy_flex_debug, and yyg.

◆ ael_yyset_extra()

void ael_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 2955 of file ael_lex.c.

2956{
2957 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2958 yyextra = user_defined ;
2959}

References yyextra, and yyg.

Referenced by ael_yylex_init_extra().

◆ ael_yyset_in()

void ael_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
ael_yy_switch_to_buffer

Definition at line 2997 of file ael_lex.c.

2998{
2999 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3000 yyin = in_str ;
3001}

References yyg, and yyin.

◆ ael_yyset_lineno()

void ael_yyset_lineno ( int  line_number,
yyscan_t  yyscanner 
)

Set the current line number.

Parameters
line_number
yyscannerThe scanner object.

Definition at line 2965 of file ael_lex.c.

2966{
2967 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2968
2969 /* lineno is only valid if an input buffer exists. */
2970 if (! YY_CURRENT_BUFFER )
2971 yy_fatal_error( "ael_yyset_lineno called with no buffer" , yyscanner);
2972
2973 yylineno = line_number;
2974}

References YY_CURRENT_BUFFER, yy_fatal_error(), yyg, and yylineno.

Referenced by ael2_parse().

◆ ael_yyset_lloc()

void ael_yyset_lloc ( YYLTYPE yylloc_param,
yyscan_t  yyscanner 
)

Definition at line 3041 of file ael_lex.c.

3042{
3043 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3044 yylloc = yylloc_param;
3045}

References yyg, and yylloc.

◆ ael_yyset_lval()

void ael_yyset_lval ( YYSTYPE yylval_param,
yyscan_t  yyscanner 
)

Definition at line 3029 of file ael_lex.c.

3030{
3031 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3032 yylval = yylval_param;
3033}

References yyg, and yylval.

◆ ael_yyset_out()

void ael_yyset_out ( FILE *  out_str,
yyscan_t  yyscanner 
)

Definition at line 3003 of file ael_lex.c.

3004{
3005 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3006 yyout = out_str ;
3007}

References yyg, and yyout.

◆ c_prevword()

static int c_prevword ( void  )
static

Definition at line 3275 of file ael_lex.c.

3276{
3277 char *c = prev_word;
3278 if (c == NULL)
3279 return 0;
3280 while ( *c ) {
3281 switch (*c) {
3282 case '{':
3283 case '[':
3284 case '(':
3285 pbcpush(*c);
3286 break;
3287 case '}':
3288 case ']':
3289 case ')':
3290 if (pbcpop(*c))
3291 return 1;
3292 break;
3293 }
3294 c++;
3295 }
3296 return 0;
3297}
static void pbcpush(char x)
Definition: ael_lex.c:3221
static int pbcpop(char x)
Definition: ael_lex.c:3232
static struct test_val c

References c, NULL, pbcpop(), pbcpush(), and prev_word.

Referenced by reset_argcount(), and reset_parencount().

◆ if()

if ( !yyg->  yy_init)

Definition at line 1216 of file ael_lex.c.

1217 {
1218 yyg->yy_init = 1;
1219
1220#ifdef YY_USER_INIT
1221 YY_USER_INIT;
1222#endif
1223
1224 if ( ! yyg->yy_start )
1225 yyg->yy_start = 1; /* first start state */
1226
1227 if ( ! yyin )
1228 yyin = stdin;
1229
1230 if ( ! yyout )
1231 yyout = stdout;
1232
1233 if ( ! YY_CURRENT_BUFFER ) {
1234 ael_yyensure_buffer_stack (yyscanner);
1237 }
1238
1239 ael_yy_load_buffer_state(yyscanner );
1240 }
int yy_start
Definition: ast_expr2f.c:637
int yy_init
Definition: ast_expr2f.c:636

References ael_yy_create_buffer(), ael_yy_load_buffer_state(), ael_yyensure_buffer_stack(), YY_BUF_SIZE, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yyguts_t::yy_init, yyguts_t::yy_start, yyg, yyin, and yyout.

◆ input()

static int input ( yyscan_t  yyscanner)
static

Definition at line 2417 of file ael_lex.c.

2420{
2421 int c;
2422 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2423
2425
2427 {
2428 /* yy_c_buf_p now points to the character we want to return.
2429 * If this occurs *before* the EOB characters, then it's a
2430 * valid NUL; if not, then we've hit the end of the buffer.
2431 */
2432 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2433 /* This was really a NUL. */
2434 *yyg->yy_c_buf_p = '\0';
2435
2436 else
2437 { /* need more input */
2438 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
2439 ++yyg->yy_c_buf_p;
2440
2441 switch ( yy_get_next_buffer( yyscanner ) )
2442 {
2443 case EOB_ACT_LAST_MATCH:
2444 /* This happens because yy_g_n_b()
2445 * sees that we've accumulated a
2446 * token and flags that we need to
2447 * try matching the token before
2448 * proceeding. But for input(),
2449 * there's no matching to consider.
2450 * So convert the EOB_ACT_LAST_MATCH
2451 * to EOB_ACT_END_OF_FILE.
2452 */
2453
2454 /* Reset buffer status. */
2455 ael_yyrestart(yyin ,yyscanner);
2456
2457 /*FALLTHROUGH*/
2458
2460 {
2461 if ( ael_yywrap(yyscanner ) )
2462 return EOF;
2463
2466#ifdef __cplusplus
2467 return yyinput(yyscanner);
2468#else
2469 return input(yyscanner);
2470#endif
2471 }
2472
2474 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2475 break;
2476 }
2477 }
2478 }
2479
2480 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2481 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
2483
2484 return c;
2485}
#define YY_NEW_FILE
Definition: ael_lex.c:158
static int yy_get_next_buffer(yyscan_t yyscanner)
Definition: ael_lex.c:2183
void ael_yyrestart(FILE *input_file, yyscan_t yyscanner)
Definition: ael_lex.c:2493
static int input(yyscan_t yyscanner)
Definition: ael_lex.c:2417
#define EOB_ACT_END_OF_FILE
Definition: ael_lex.c:177
#define ael_yywrap(n)
Definition: ael_lex.c:331
#define EOB_ACT_LAST_MATCH
Definition: ael_lex.c:178
#define EOB_ACT_CONTINUE_SCAN
Definition: ael_lex.c:176

References ael_yyrestart(), ael_yywrap, c, EOB_ACT_CONTINUE_SCAN, EOB_ACT_END_OF_FILE, EOB_ACT_LAST_MATCH, input(), 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, yyg, and yyin.

Referenced by input().

◆ isatty()

int isatty ( int  )

Referenced by ael_yy_init_buffer().

◆ pbcpop()

static int pbcpop ( char  x)
static

Definition at line 3232 of file ael_lex.c.

3233{
3234 if ( ( x == ')' && pbcstack[pbcpos-1] == '(' )
3235 || ( x == ']' && pbcstack[pbcpos-1] == '[' )
3236 || ( x == '}' && pbcstack[pbcpos-1] == '{' )) {
3237 pbcpos--;
3238 return 0;
3239 }
3240 return 1; /* error */
3241}
static char pbcstack[400]
Definition: ael_lex.c:847
static int pbcpos
Definition: ael_lex.c:848

References pbcpos, and pbcstack.

Referenced by c_prevword(), and while().

◆ pbcpop2()

static int pbcpop2 ( char  x)
static

Definition at line 3248 of file ael_lex.c.

3249{
3250 if ( ( x == ')' && pbcstack2[pbcpos2-1] == '(' )
3251 || ( x == ']' && pbcstack2[pbcpos2-1] == '[' )
3252 || ( x == '}' && pbcstack2[pbcpos2-1] == '{' )) {
3253 pbcpos2--;
3254 return 0;
3255 }
3256 return 1; /* error */
3257}
static char pbcstack2[400]
Definition: ael_lex.c:856
static int pbcpos2
Definition: ael_lex.c:857

References pbcpos2, and pbcstack2.

Referenced by while().

◆ pbcpop3()

static int pbcpop3 ( char  x)
static

Definition at line 3264 of file ael_lex.c.

3265{
3266 if ( ( x == ')' && pbcstack3[pbcpos3-1] == '(' )
3267 || ( x == ']' && pbcstack3[pbcpos3-1] == '[' )
3268 || ( x == '}' && pbcstack3[pbcpos3-1] == '{' )) {
3269 pbcpos3--;
3270 return 0;
3271 }
3272 return 1; /* error */
3273}
static int pbcpos3
Definition: ael_lex.c:866
static char pbcstack3[400]
Definition: ael_lex.c:865

References pbcpos3, and pbcstack3.

Referenced by while().

◆ pbcpush()

static void pbcpush ( char  x)
static

Definition at line 3221 of file ael_lex.c.

3222{
3223 pbcstack[pbcpos++] = x;
3224}

References pbcpos, and pbcstack.

Referenced by c_prevword(), reset_argcount(), reset_parencount(), and while().

◆ pbcpush2()

static void pbcpush2 ( char  x)
static

Definition at line 3243 of file ael_lex.c.

3244{
3245 pbcstack2[pbcpos2++] = x;
3246}

References pbcpos2, and pbcstack2.

Referenced by while().

◆ pbcpush3()

static void pbcpush3 ( char  x)
static

Definition at line 3259 of file ael_lex.c.

3260{
3261 pbcstack3[pbcpos3++] = x;
3262}

References pbcpos3, and pbcstack3.

Referenced by while().

◆ pbcwhere()

static void pbcwhere ( const char *  text,
int *  line,
int *  col 
)
static

Definition at line 923 of file ael_lex.c.

924{
925 int loc_line = *line;
926 int loc_col = *col;
927 char c;
928 while ( (c = *text++) ) {
929 if ( c == '\t' ) {
930 loc_col += 8 - (loc_col % 8);
931 } else if ( c == '\n' ) {
932 loc_line++;
933 loc_col = 1;
934 } else
935 loc_col++;
936 }
937 *line = loc_line;
938 *col = loc_col;
939}
char * text
Definition: app_queue.c:1668

References c, and text.

◆ reset_argcount()

void reset_argcount ( yyscan_t  yyscanner)

Definition at line 3333 of file ael_lex.c.

3334{
3335 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3336 parencount = 0;
3337 pbcpos = 0;
3338 pbcpush('('); /* push '(' so the last pcbpop (parencount= -1) will succeed */
3339 c_prevword();
3340 BEGIN(argg);
3341}
static int c_prevword(void)
Definition: ael_lex.c:3275
#define argg
Definition: ael_lex.c:964
static int parencount
Definition: ael_lex.c:851
#define BEGIN
Definition: ael_lex.c:145

References argg, BEGIN, c_prevword(), parencount, pbcpos, pbcpush(), and yyg.

Referenced by yyparse().

◆ reset_parencount()

void reset_parencount ( yyscan_t  yyscanner)

Definition at line 3314 of file ael_lex.c.

3315{
3316 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3317 parencount = 0;
3318 pbcpos = 0;
3319 pbcpush('('); /* push '(' so the last pcbpop (parencount= -1) will succeed */
3320 c_prevword();
3321 BEGIN(paren);
3322}
#define paren
Definition: ael_lex.c:962

References BEGIN, c_prevword(), paren, parencount, pbcpos, pbcpush(), and yyg.

Referenced by yyparse().

◆ reset_semicount()

void reset_semicount ( yyscan_t  yyscanner)

Definition at line 3325 of file ael_lex.c.

3326{
3327 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3328 pbcpos = 0;
3329 BEGIN(semic);
3330}
#define semic
Definition: ael_lex.c:963

References BEGIN, pbcpos, semic, and yyg.

Referenced by yyparse().

◆ setup_filestack()

static void setup_filestack ( char *  fnamebuf,
int  fnamebuf_siz,
glob_t *  globbuf,
int  globpos,
yyscan_t  xscan,
int  create 
)
static

Definition at line 3399 of file ael_lex.c.

3400{
3401 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3402 int error, i;
3403 FILE *in1;
3404 char fnamebuf[2048];
3405
3406 if (globbuf && globbuf->gl_pathv && globbuf->gl_pathc > 0)
3407#if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE_AEL)
3408 strncpy(fnamebuf, globbuf->gl_pathv[globpos], fnamebuf_siz);
3409#else
3410 ast_copy_string(fnamebuf, globbuf->gl_pathv[globpos], fnamebuf_siz);
3411#endif
3412 else {
3413 ast_log(LOG_ERROR,"Include file name not present!\n");
3414 return;
3415 }
3416 for (i=0; i<include_stack_index; i++) {
3417 if ( !strcmp(fnamebuf,include_stack[i].fname )) {
3418 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Nice Try!!! But %s has already been included (perhaps by another file), and would cause an infinite loop of file inclusions!!! Include directive ignored\n",
3419 my_file, my_lineno, my_col, fnamebuf);
3420 break;
3421 }
3422 }
3423 error = 1;
3424 if (i == include_stack_index)
3425 error = 0; /* we can use this file */
3426 if ( !error ) { /* valid file name */
3427 /* relative vs. absolute */
3428 if (fnamebuf[0] != '/')
3429 snprintf(fnamebuf2, fnamebuf_siz, "%s/%s", ast_config_AST_CONFIG_DIR, fnamebuf);
3430 else
3431#if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE_AEL)
3432 strncpy(fnamebuf2, fnamebuf, fnamebuf_siz);
3433#else
3434 ast_copy_string(fnamebuf2, fnamebuf, fnamebuf_siz);
3435#endif
3436 in1 = fopen( fnamebuf2, "r" );
3437
3438 if ( ! in1 ) {
3439 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Couldn't find the include file: %s; ignoring the Include directive!\n", my_file, my_lineno, my_col, fnamebuf2);
3440 } else {
3441 char *buffer;
3442 struct stat stats;
3443 if (stat(fnamebuf2, &stats)) {
3444 ast_log(LOG_WARNING, "Failed to populate stats from file '%s'\n", fnamebuf2);
3445 }
3446 buffer = (char*)malloc(stats.st_size+1);
3447 if (fread(buffer, 1, stats.st_size, in1) != stats.st_size) {
3448 ast_log(LOG_ERROR, "fread() failed: %s\n", strerror(errno));
3449 }
3450 buffer[stats.st_size] = 0;
3451 ast_debug(1, " --Read in included file %s, %d chars\n",fnamebuf2, (int)stats.st_size);
3452 fclose(in1);
3456 }
3460 if (my_file)
3461 free(my_file);
3462 my_file = strdup(fnamebuf2);
3463 if (create)
3465
3467
3469 if (create)
3471 ael_yy_switch_to_buffer(ael_yy_scan_string (buffer ,yyscanner),yyscanner);
3472 free(buffer);
3473 my_lineno = 1;
3474 my_col = 1;
3475 BEGIN(INITIAL);
3476 }
3477 }
3478}
static struct stackelement include_stack[MAX_INCLUDE_DEPTH]
Definition: ael_lex.c:907
#define INITIAL
Definition: ael_lex.c:961
#define ast_debug(level,...)
Log a DEBUG message.
const char * ast_config_AST_CONFIG_DIR
Definition: options.c:151
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
Definition: strings.h:80
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Definition: strings.h:425
int globbuf_pos
Definition: ael_lex.c:903
int lineno
Definition: ael_lex.c:900
YY_BUFFER_STATE bufstate
Definition: ael_lex.c:904
char * fname
Definition: ael_lex.c:899
glob_t globbuf
Definition: ael_lex.c:902
int error(const char *format,...)
Definition: utils/frame.c:999

References ael_yy_scan_string(), ael_yy_switch_to_buffer(), ast_config_AST_CONFIG_DIR, ast_copy_string(), ast_debug, ast_log, BEGIN, stackelement::bufstate, stackelement::colno, errno, error(), stackelement::fname, free(), stackelement::globbuf, stackelement::globbuf_pos, include_stack, include_stack_index, INITIAL, stackelement::lineno, LOG_ERROR, LOG_WARNING, malloc(), my_col, my_file, my_lineno, S_OR, strdup, YY_CURRENT_BUFFER, yyg, and yyleng.

Referenced by while().

◆ while()

while ( )

Definition at line 1242 of file ael_lex.c.

1243 {
1244 yyg->yy_more_len = 0;
1245 if ( yyg->yy_more_flag )
1246 {
1247 yyg->yy_more_len = yyg->yy_c_buf_p - yyg->yytext_ptr;
1248 yyg->yy_more_flag = 0;
1249 }
1250 yy_cp = yyg->yy_c_buf_p;
1251
1252 /* Support of yytext. */
1254
1255 /* yy_bp points to the position in yy_ch_buf of the start of
1256 * the current run.
1257 */
1258 yy_bp = yy_cp;
1259
1260 yy_current_state = yyg->yy_start;
1261yy_match:
1262 do
1263 {
1264 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1265 if ( yy_accept[yy_current_state] )
1266 {
1267 yyg->yy_last_accepting_state = yy_current_state;
1269 }
1270 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1271 {
1272 yy_current_state = (int) yy_def[yy_current_state];
1273 if ( yy_current_state >= 285 )
1274 yy_c = yy_meta[(unsigned int) yy_c];
1275 }
1276 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1277 ++yy_cp;
1278 }
1279 while ( yy_current_state != 284 );
1281 yy_current_state = yyg->yy_last_accepting_state;
1282
1283yy_find_action:
1284 yy_act = yy_accept[yy_current_state];
1285
1287
1288do_action: /* This label is used only to access EOF actions. */
1289
1290 switch ( yy_act )
1291 { /* beginning of action switch */
1292 case 0: /* must back up */
1293 /* undo the effects of YY_DO_BEFORE_ACTION */
1296 yy_current_state = yyg->yy_last_accepting_state;
1297 goto yy_find_action;
1298
1299case 1:
1301#line 222 "ael.flex"
1302{ STORE_POS; return LC;}
1303 YY_BREAK
1304case 2:
1306#line 223 "ael.flex"
1307{ STORE_POS; return RC;}
1308 YY_BREAK
1309case 3:
1311#line 224 "ael.flex"
1312{ STORE_POS; return LP;}
1313 YY_BREAK
1314case 4:
1316#line 225 "ael.flex"
1317{ STORE_POS; return RP;}
1318 YY_BREAK
1319case 5:
1321#line 226 "ael.flex"
1322{ STORE_POS; return SEMI;}
1323 YY_BREAK
1324case 6:
1326#line 227 "ael.flex"
1327{ STORE_POS; return EQ;}
1328 YY_BREAK
1329case 7:
1331#line 228 "ael.flex"
1332{ STORE_POS; return COMMA;}
1333 YY_BREAK
1334case 8:
1336#line 229 "ael.flex"
1337{ STORE_POS; return COLON;}
1338 YY_BREAK
1339case 9:
1341#line 230 "ael.flex"
1342{ STORE_POS; return AMPER;}
1343 YY_BREAK
1344case 10:
1346#line 231 "ael.flex"
1347{ STORE_POS; return BAR;}
1348 YY_BREAK
1349case 11:
1351#line 232 "ael.flex"
1352{ STORE_POS; return EXTENMARK;}
1353 YY_BREAK
1354case 12:
1356#line 233 "ael.flex"
1357{ STORE_POS; return AT;}
1358 YY_BREAK
1359case 13:
1361#line 234 "ael.flex"
1362{/*comment*/}
1363 YY_BREAK
1364case 14:
1366#line 235 "ael.flex"
1367{ STORE_POS; return KW_CONTEXT;}
1368 YY_BREAK
1369case 15:
1371#line 236 "ael.flex"
1372{ STORE_POS; return KW_ABSTRACT;}
1373 YY_BREAK
1374case 16:
1376#line 237 "ael.flex"
1377{ STORE_POS; return KW_EXTEND;}
1378 YY_BREAK
1379case 17:
1381#line 238 "ael.flex"
1382{ STORE_POS; return KW_MACRO;};
1383 YY_BREAK
1384case 18:
1386#line 239 "ael.flex"
1387{ STORE_POS; return KW_GLOBALS;}
1388 YY_BREAK
1389case 19:
1391#line 240 "ael.flex"
1392{ STORE_POS; return KW_LOCAL;}
1393 YY_BREAK
1394case 20:
1396#line 241 "ael.flex"
1397{ STORE_POS; return KW_IGNOREPAT;}
1398 YY_BREAK
1399case 21:
1401#line 242 "ael.flex"
1402{ STORE_POS; return KW_SWITCH;}
1403 YY_BREAK
1404case 22:
1406#line 243 "ael.flex"
1407{ STORE_POS; return KW_IF;}
1408 YY_BREAK
1409case 23:
1411#line 244 "ael.flex"
1412{ STORE_POS; return KW_IFTIME;}
1413 YY_BREAK
1414case 24:
1416#line 245 "ael.flex"
1417{ STORE_POS; return KW_RANDOM;}
1418 YY_BREAK
1419case 25:
1421#line 246 "ael.flex"
1422{ STORE_POS; return KW_REGEXTEN;}
1423 YY_BREAK
1424case 26:
1426#line 247 "ael.flex"
1427{ STORE_POS; return KW_HINT;}
1428 YY_BREAK
1429case 27:
1431#line 248 "ael.flex"
1432{ STORE_POS; return KW_ELSE;}
1433 YY_BREAK
1434case 28:
1436#line 249 "ael.flex"
1437{ STORE_POS; return KW_GOTO;}
1438 YY_BREAK
1439case 29:
1441#line 250 "ael.flex"
1442{ STORE_POS; return KW_JUMP;}
1443 YY_BREAK
1444case 30:
1446#line 251 "ael.flex"
1447{ STORE_POS; return KW_RETURN;}
1448 YY_BREAK
1449case 31:
1451#line 252 "ael.flex"
1452{ STORE_POS; return KW_BREAK;}
1453 YY_BREAK
1454case 32:
1456#line 253 "ael.flex"
1457{ STORE_POS; return KW_CONTINUE;}
1458 YY_BREAK
1459case 33:
1461#line 254 "ael.flex"
1462{ STORE_POS; return KW_FOR;}
1463 YY_BREAK
1464case 34:
1466#line 255 "ael.flex"
1467{ STORE_POS; return KW_WHILE;}
1468 YY_BREAK
1469case 35:
1471#line 256 "ael.flex"
1472{ STORE_POS; return KW_CASE;}
1473 YY_BREAK
1474case 36:
1476#line 257 "ael.flex"
1477{ STORE_POS; return KW_DEFAULT;}
1478 YY_BREAK
1479case 37:
1481#line 258 "ael.flex"
1482{ STORE_POS; return KW_PATTERN;}
1483 YY_BREAK
1484case 38:
1486#line 259 "ael.flex"
1487{ STORE_POS; return KW_CATCH;}
1488 YY_BREAK
1489case 39:
1491#line 260 "ael.flex"
1492{ STORE_POS; return KW_SWITCHES;}
1493 YY_BREAK
1494case 40:
1496#line 261 "ael.flex"
1497{ STORE_POS; return KW_ESWITCHES;}
1498 YY_BREAK
1499case 41:
1501#line 262 "ael.flex"
1502{ STORE_POS; return KW_INCLUDES;}
1503 YY_BREAK
1504case 42:
1506#line 263 "ael.flex"
1507{ BEGIN(comment); my_col += 2; }
1508 YY_BREAK
1509case 43:
1511#line 265 "ael.flex"
1512{ my_col += yyleng; }
1513 YY_BREAK
1514case 44:
1515/* rule 44 can match eol */
1517#line 266 "ael.flex"
1518{ ++my_lineno; my_col=1;}
1519 YY_BREAK
1520case 45:
1522#line 267 "ael.flex"
1523{ my_col += yyleng; }
1524 YY_BREAK
1525case 46:
1526/* rule 46 can match eol */
1528#line 268 "ael.flex"
1529{ ++my_lineno; my_col=1;}
1530 YY_BREAK
1531case 47:
1533#line 269 "ael.flex"
1534{ my_col += 2; BEGIN(INITIAL); } /* the nice thing about comments is that you know exactly what ends them */
1535 YY_BREAK
1536case 48:
1537/* rule 48 can match eol */
1539#line 271 "ael.flex"
1540{ my_lineno++; my_col = 1; }
1541 YY_BREAK
1542case 49:
1544#line 272 "ael.flex"
1545{ my_col += yyleng; }
1546 YY_BREAK
1547case 50:
1549#line 273 "ael.flex"
1550{ my_col += (yyleng*8)-(my_col%8); }
1551 YY_BREAK
1552case 51:
1554#line 275 "ael.flex"
1555{
1556 /* boy did I open a can of worms when I changed the lexical token "word".
1557 all the above keywords can be used as a beginning to a "word".-
1558 before, a "word" would match a longer sequence than the above
1559 keywords, and all would be well. But now "word" is a single char
1560 and feeds into a statemachine sort of sequence from there on. So...
1561 I added the {KEYWORD}? to the beginning of the word match sequence */
1562
1563 if (!strcmp(yytext,"${")) {
1564 parencount2 = 0;
1565 pbcpos2 = 0;
1566 pbcpush2('{'); /* push '{' so the last pcbpop (parencount2 = -1) will succeed */
1568 yymore();
1569 } else if (!strcmp(yytext,"$[")) {
1570 parencount3 = 0;
1571 pbcpos3 = 0;
1572 pbcpush3('['); /* push '[' so the last pcbpop (parencount3 = -1) will succeed */
1574 yymore();
1575 } else {
1577 yymore();
1578 }
1579 }
1580 YY_BREAK
1581case 52:
1583#line 301 "ael.flex"
1584{ yymore(); /* Keep going */ }
1585 YY_BREAK
1586case 53:
1588#line 302 "ael.flex"
1589{ yymore(); /* Keep going */ }
1590 YY_BREAK
1591case 54:
1593#line 303 "ael.flex"
1594{ yymore(); /* Keep Going */ }
1595 YY_BREAK
1596case 55:
1598#line 304 "ael.flex"
1599{ /* the beginning of a ${} construct. prepare and pop into curlystate */
1600 parencount2 = 0;
1601 pbcpos2 = 0;
1602 pbcpush2('{'); /* push '{' so the last pcbpop (parencount2 = -1) will succeed */
1604 yymore();
1605 }
1606 YY_BREAK
1607case 56:
1609#line 311 "ael.flex"
1610{ /* the beginning of a $[] construct. prepare and pop into brackstate */
1611 parencount3 = 0;
1612 pbcpos3 = 0;
1613 pbcpush3('['); /* push '[' so the last pcbpop (parencount3 = -1) will succeed */
1615 yymore();
1616 }
1617 YY_BREAK
1618case 57:
1619/* rule 57 can match eol */
1621#line 318 "ael.flex"
1622{
1623 /* a non-word constituent char, like a space, tab, curly, paren, etc */
1624 char c = yytext[yyleng-1];
1625 STORE_POS;
1626 yylval->str = malloc(yyleng);
1627 strncpy(yylval->str, yytext, yyleng);
1628 yylval->str[yyleng-1] = 0;
1629 unput(c); /* put this ending char back in the stream */
1630 BEGIN(0);
1631 return word;
1632 }
1633 YY_BREAK
1634case 58:
1635/* rule 58 can match eol */
1637#line 331 "ael.flex"
1638{
1639 if ( pbcpop2('}') ) { /* error */
1640 STORE_LOC;
1641 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext);
1642 BEGIN(0);
1643 yylval->str = malloc(yyleng+1);
1644 strncpy(yylval->str, yytext, yyleng);
1645 yylval->str[yyleng] = 0;
1646 return word;
1647 }
1648 parencount2--;
1649 if ( parencount2 >= 0) {
1650 yymore();
1651 } else {
1652 BEGIN(wordstate); /* Finished with the current ${} construct. Return to word gathering state */
1653 yymore();
1654 }
1655 }
1656 YY_BREAK
1657case 59:
1658/* rule 59 can match eol */
1660#line 350 "ael.flex"
1661{
1662 char c = yytext[yyleng-1];
1663 if (c == '{')
1664 parencount2++;
1665 pbcpush2(c);
1666 yymore();
1667 }
1668 YY_BREAK
1669case 60:
1670/* rule 60 can match eol */
1672#line 358 "ael.flex"
1673{
1674 char c = yytext[yyleng-1];
1675 if ( pbcpop2(c)) { /* error */
1676 STORE_LOC;
1677 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
1679 BEGIN(0);
1680 yylval->str = malloc(yyleng+1);
1681 strncpy(yylval->str, yytext, yyleng);
1682 yylval->str[yyleng] = 0;
1683 return word;
1684 }
1685 yymore();
1686 }
1687 YY_BREAK
1688case 61:
1689/* rule 61 can match eol */
1691#line 374 "ael.flex"
1692{
1693 if ( pbcpop3(']') ) { /* error */
1694 STORE_LOC;
1695 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext);
1696 BEGIN(0);
1697 yylval->str = malloc(yyleng+1);
1698 strncpy(yylval->str, yytext, yyleng);
1699 yylval->str[yyleng] = 0;
1700 return word;
1701 }
1702 parencount3--;
1703 if ( parencount3 >= 0) {
1704 yymore();
1705 } else {
1706 BEGIN(wordstate); /* Finished with the current ${} construct. Return to word gathering state */
1707 yymore();
1708 }
1709 }
1710 YY_BREAK
1711case 62:
1712/* rule 62 can match eol */
1714#line 393 "ael.flex"
1715{
1716 char c = yytext[yyleng-1];
1717 if (c == '[')
1718 parencount3++;
1719 pbcpush3(c);
1720 yymore();
1721 }
1722 YY_BREAK
1723case 63:
1724/* rule 63 can match eol */
1726#line 401 "ael.flex"
1727{
1728 char c = yytext[yyleng-1];
1729 if ( pbcpop3(c)) { /* error */
1730 STORE_LOC;
1731 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
1733 BEGIN(0);
1734 yylval->str = malloc(yyleng+1);
1735 strncpy(yylval->str, yytext, yyleng);
1736 yylval->str[yyleng] = 0;
1737 return word;
1738 }
1739 yymore();
1740 }
1741 YY_BREAK
1742/*
1743 * context used for arguments of if_head, random_head, switch_head,
1744 * for (last statement), while (XXX why not iftime_head ?).
1745 * End with the matching parentheses.
1746 * A comma at the top level is valid here, unlike in argg where it
1747 * is an argument separator so it must be returned as a token.
1748 */
1749case 64:
1750/* rule 64 can match eol */
1752#line 424 "ael.flex"
1753{
1754 if ( pbcpop(')') ) { /* error */
1755 STORE_LOC;
1756 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext);
1757 BEGIN(0);
1758 yylval->str = malloc(yyleng+1);
1759 strncpy(yylval->str, yytext, yyleng);
1760 yylval->str[yyleng] = 0;
1761 prev_word = 0;
1762 return word;
1763 }
1764 parencount--;
1765 if ( parencount >= 0) {
1766 yymore();
1767 } else {
1768 STORE_LOC;
1769 yylval->str = malloc(yyleng);
1770 strncpy(yylval->str, yytext, yyleng);
1771 yylval->str[yyleng-1] = 0;
1772 unput(')');
1773 BEGIN(0);
1774 return word;
1775 }
1776 }
1777 YY_BREAK
1778case 65:
1779/* rule 65 can match eol */
1781#line 449 "ael.flex"
1782{
1783 char c = yytext[yyleng-1];
1784 if (c == '(')
1785 parencount++;
1786 pbcpush(c);
1787 yymore();
1788 }
1789 YY_BREAK
1790case 66:
1791/* rule 66 can match eol */
1793#line 457 "ael.flex"
1794{
1795 char c = yytext[yyleng-1];
1796 if ( pbcpop(c)) { /* error */
1797 STORE_LOC;
1798 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
1800 BEGIN(0);
1801 yylval->str = malloc(yyleng+1);
1802 strncpy(yylval->str, yytext, yyleng);
1803 yylval->str[yyleng] = 0;
1804 return word;
1805 }
1806 yymore();
1807 }
1808 YY_BREAK
1809/*
1810 * handlers for arguments to a macro or application calls.
1811 * We enter this context when we find the initial '(' and
1812 * stay here until we close all matching parentheses,
1813 * and find the comma (argument separator) or the closing ')'
1814 * of the (external) call, which happens when parencount == 0
1815 * before the decrement.
1816 */
1817case 67:
1818/* rule 67 can match eol */
1820#line 481 "ael.flex"
1821{
1822 char c = yytext[yyleng-1];
1823 if (c == '(')
1824 parencount++;
1825 pbcpush(c);
1826 yymore();
1827 }
1828 YY_BREAK
1829case 68:
1830/* rule 68 can match eol */
1832#line 489 "ael.flex"
1833{
1834 if ( pbcpop(')') ) { /* error */
1835 STORE_LOC;
1836 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression!\n", my_file, my_lineno, my_col);
1837 BEGIN(0);
1838 yylval->str = malloc(yyleng+1);
1839 strncpy(yylval->str, yytext, yyleng);
1840 yylval->str[yyleng] = 0;
1841 return word;
1842 }
1843
1844 parencount--;
1845 if( parencount >= 0){
1846 yymore();
1847 } else {
1848 STORE_LOC;
1849 BEGIN(0);
1850 if ( !strcmp(yytext, ")") )
1851 return RP;
1852 yylval->str = malloc(yyleng);
1853 strncpy(yylval->str, yytext, yyleng);
1854 yylval->str[yyleng-1] = '\0'; /* trim trailing ')' */
1855 unput(')');
1856 return word;
1857 }
1858 }
1859 YY_BREAK
1860case 69:
1861/* rule 69 can match eol */
1863#line 516 "ael.flex"
1864{
1865 if( parencount != 0) { /* ast_log(LOG_NOTICE,"Folding in a comma!\n"); */
1866 yymore();
1867 } else {
1868 STORE_LOC;
1869 if( !strcmp(yytext,"," ) )
1870 return COMMA;
1871 yylval->str = malloc(yyleng);
1872 strncpy(yylval->str, yytext, yyleng);
1873 yylval->str[yyleng-1] = '\0'; /* trim trailing ',' */
1874 unput(',');
1875 return word;
1876 }
1877 }
1878 YY_BREAK
1879case 70:
1880/* rule 70 can match eol */
1882#line 531 "ael.flex"
1883{
1884 char c = yytext[yyleng-1];
1885 if ( pbcpop(c) ) { /* error */
1886 STORE_LOC;
1887 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c);
1888 BEGIN(0);
1889 yylval->str = malloc(yyleng+1);
1890 strncpy(yylval->str, yytext, yyleng);
1891 yylval->str[yyleng] = '\0';
1892 return word;
1893 }
1894 yymore();
1895 }
1896 YY_BREAK
1897/*
1898 * context used to find tokens in the right hand side of assignments,
1899 * or in the first and second operand of a 'for'. As above, match
1900 * commas and use ';' as a separator (hence return it as a separate token).
1901 */
1902case 71:
1903/* rule 71 can match eol */
1905#line 550 "ael.flex"
1906{
1907 char c = yytext[yyleng-1];
1908 yymore();
1909 pbcpush(c);
1910 }
1911 YY_BREAK
1912case 72:
1913/* rule 72 can match eol */
1915#line 556 "ael.flex"
1916{
1917 char c = yytext[yyleng-1];
1918 if ( pbcpop(c) ) { /* error */
1919 STORE_LOC;
1920 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c);
1921 BEGIN(0);
1922 yylval->str = malloc(yyleng+1);
1923 strncpy(yylval->str, yytext, yyleng);
1924 yylval->str[yyleng] = '\0';
1925 return word;
1926 }
1927 yymore();
1928 }
1929 YY_BREAK
1930case 73:
1931/* rule 73 can match eol */
1933#line 570 "ael.flex"
1934{
1935 STORE_LOC;
1936 yylval->str = malloc(yyleng);
1937 strncpy(yylval->str, yytext, yyleng);
1938 yylval->str[yyleng-1] = '\0'; /* trim trailing ';' */
1939 unput(';');
1940 BEGIN(0);
1941 return word;
1942 }
1943 YY_BREAK
1944case 74:
1945/* rule 74 can match eol */
1947#line 580 "ael.flex"
1948{
1949 char fnamebuf[1024],*p1,*p2;
1950 int glob_ret;
1951 glob_t globbuf; /* the current globbuf */
1952 int globbuf_pos = -1; /* where we are in the current globbuf */
1953 globbuf.gl_offs = 0; /* initialize it to silence gcc */
1954
1955 p1 = strchr(yytext,'"');
1956 p2 = strrchr(yytext,'"');
1958 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Includes nested too deeply! Wow!!! How did you do that?\n", my_file, my_lineno, my_col);
1959 } else if ( (int)(p2-p1) > sizeof(fnamebuf) - 1 ) {
1960 ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Filename is incredibly way too long (%d chars!). Inclusion ignored!\n", my_file, my_lineno, my_col, yyleng - 10);
1961 } else {
1962 strncpy(fnamebuf, p1+1, p2-p1-1);
1963 fnamebuf[p2-p1-1] = 0;
1964 if (fnamebuf[0] != '/') {
1965 char fnamebuf2[1024];
1966 snprintf(fnamebuf2,sizeof(fnamebuf2), "%s/%s", (char *)ast_config_AST_CONFIG_DIR, fnamebuf);
1967 ast_copy_string(fnamebuf,fnamebuf2,sizeof(fnamebuf));
1968 }
1969#ifdef SOLARIS
1970 glob_ret = glob(fnamebuf, GLOB_NOCHECK, NULL, &globbuf);
1971#else
1972 glob_ret = glob(fnamebuf, GLOB_NOMAGIC|GLOB_BRACE, NULL, &globbuf);
1973#endif
1974 if (glob_ret == GLOB_NOSPACE) {
1976 "Glob Expansion of pattern '%s' failed: Not enough memory\n", fnamebuf);
1977 } else if (glob_ret == GLOB_ABORTED) {
1979 "Glob Expansion of pattern '%s' failed: Read error\n", fnamebuf);
1980 } else if (glob_ret == GLOB_NOMATCH) {
1982 "Glob Expansion of pattern '%s' failed: No matches!\n", fnamebuf);
1983 } else {
1984 globbuf_pos = 0;
1985 }
1986 }
1987 if (globbuf_pos > -1) {
1988 setup_filestack(fnamebuf, sizeof(fnamebuf), &globbuf, 0, yyscanner, 1);
1989 }
1990 }
1991 YY_BREAK
1992case YY_STATE_EOF(INITIAL):
1993case YY_STATE_EOF(paren):
1994case YY_STATE_EOF(semic):
1995case YY_STATE_EOF(argg):
1996case YY_STATE_EOF(comment):
2000#line 625 "ael.flex"
2001{
2002 char fnamebuf[2048];
2003 if (include_stack_index > 0 && include_stack[include_stack_index-1].globbuf_pos < include_stack[include_stack_index-1].globbuf.gl_pathc-1) {
2006 setup_filestack(fnamebuf, sizeof(fnamebuf), &include_stack[include_stack_index-1].globbuf, include_stack[include_stack_index-1].globbuf_pos, yyscanner, 0);
2007 /* finish this */
2008
2009 } else {
2013 }
2014 if (my_file) {
2015 free(my_file);
2016 my_file = 0;
2017 }
2018 if ( --include_stack_index < 0 ) {
2019 yyterminate();
2020 } else {
2021 globfree(&include_stack[include_stack_index].globbuf);
2023
2029 }
2030 }
2031 }
2032 YY_BREAK
2033case 75:
2034/* rule 75 can match eol */
2036#line 657 "ael.flex"
2037{ /* default rule */ ast_log(LOG_ERROR,"Unhandled char(s): %s\n", yytext); }
2038 YY_BREAK
2039case 76:
2041#line 659 "ael.flex"
2042YY_FATAL_ERROR( "flex scanner jammed" );
2043 YY_BREAK
2044#line 2042 "ael_lex.c"
2045
2046 case YY_END_OF_BUFFER:
2047 {
2048 /* Amount of text matched not including the EOB char. */
2049 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
2050
2051 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2054
2055 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2056 {
2057 /* We're scanning a new file or input source. It's
2058 * possible that this happened because the user
2059 * just pointed yyin at a new source and called
2060 * ael_yylex(). If so, then we have to assure
2061 * consistency between YY_CURRENT_BUFFER and our
2062 * globals. Here is the right place to do so, because
2063 * this is the first action (other than possibly a
2064 * back-up) that will match for the new input source.
2065 */
2067 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
2068 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2069 }
2070
2071 /* Note that here we test for yy_c_buf_p "<=" to the position
2072 * of the first EOB in the buffer, since yy_c_buf_p will
2073 * already have been incremented past the NUL character
2074 * (since all states make transitions on EOB to the
2075 * end-of-buffer state). Contrast this with the test
2076 * in input().
2077 */
2078 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2079 { /* This was really a NUL. */
2080 yy_state_type yy_next_state;
2081
2082 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
2083
2084 yy_current_state = yy_get_previous_state( yyscanner );
2085
2086 /* Okay, we're now positioned to make the NUL
2087 * transition. We couldn't have
2088 * yy_get_previous_state() go ahead and do it
2089 * for us because it doesn't know how to deal
2090 * with the possibility of jamming (and we don't
2091 * want to build jamming into it because then it
2092 * will run more slowly).
2093 */
2094
2095 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
2096
2097 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2098
2099 if ( yy_next_state )
2100 {
2101 /* Consume the NUL. */
2102 yy_cp = ++yyg->yy_c_buf_p;
2103 yy_current_state = yy_next_state;
2104 goto yy_match;
2105 }
2106
2107 else
2108 {
2110 yy_current_state = yyg->yy_last_accepting_state;
2111 goto yy_find_action;
2112 }
2113 }
2114
2115 else switch ( yy_get_next_buffer( yyscanner ) )
2116 {
2118 {
2120
2121 if ( ael_yywrap(yyscanner ) )
2122 {
2123 /* Note: because we've taken care in
2124 * yy_get_next_buffer() to have set up
2125 * yytext, we can now set up
2126 * yy_c_buf_p so that if some total
2127 * hoser (like flex itself) wants to
2128 * call the scanner after we return the
2129 * YY_NULL, it'll still work - another
2130 * YY_NULL will get returned.
2131 */
2132 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
2133
2135 goto do_action;
2136 }
2137
2138 else
2139 {
2142 }
2143 break;
2144 }
2145
2147 yyg->yy_c_buf_p =
2148 yyg->yytext_ptr + yy_amount_of_matched_text;
2149
2150 yy_current_state = yy_get_previous_state( yyscanner );
2151
2152 yy_cp = yyg->yy_c_buf_p;
2153 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2154 goto yy_match;
2155
2156 case EOB_ACT_LAST_MATCH:
2157 yyg->yy_c_buf_p =
2159
2160 yy_current_state = yy_get_previous_state( yyscanner );
2161
2162 yy_cp = yyg->yy_c_buf_p;
2163 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2164 goto yy_find_action;
2165 }
2166 break;
2167 }
2168
2169 default:
2171 "fatal flex scanner internal error--no action found" );
2172 } /* end of action switch */
2173 } /* end of scanning one token */
@ KW_HINT
Definition: ael.tab.c:191
@ RP
Definition: ael.tab.c:166
@ KW_IGNOREPAT
Definition: ael.tab.c:176
@ KW_GLOBALS
Definition: ael.tab.c:175
@ KW_EXTEND
Definition: ael.tab.c:183
@ COLON
Definition: ael.tab.c:170
@ KW_IF
Definition: ael.tab.c:178
@ KW_FOR
Definition: ael.tab.c:192
@ LC
Definition: ael.tab.c:163
@ KW_BREAK
Definition: ael.tab.c:188
@ KW_ESWITCHES
Definition: ael.tab.c:199
@ LP
Definition: ael.tab.c:165
@ KW_RANDOM
Definition: ael.tab.c:181
@ KW_ABSTRACT
Definition: ael.tab.c:182
@ KW_GOTO
Definition: ael.tab.c:185
@ SEMI
Definition: ael.tab.c:167
@ EXTENMARK
Definition: ael.tab.c:184
@ KW_WHILE
Definition: ael.tab.c:193
@ KW_IFTIME
Definition: ael.tab.c:179
@ KW_RETURN
Definition: ael.tab.c:187
@ KW_CASE
Definition: ael.tab.c:194
@ AT
Definition: ael.tab.c:173
@ KW_CATCH
Definition: ael.tab.c:197
@ KW_MACRO
Definition: ael.tab.c:174
@ AMPER
Definition: ael.tab.c:171
@ EQ
Definition: ael.tab.c:168
@ BAR
Definition: ael.tab.c:172
@ KW_SWITCH
Definition: ael.tab.c:177
@ KW_CONTINUE
Definition: ael.tab.c:189
@ KW_PATTERN
Definition: ael.tab.c:195
@ KW_INCLUDES
Definition: ael.tab.c:200
@ KW_CONTEXT
Definition: ael.tab.c:162
@ KW_DEFAULT
Definition: ael.tab.c:196
@ RC
Definition: ael.tab.c:164
@ KW_ELSE
Definition: ael.tab.c:180
@ KW_REGEXTEN
Definition: ael.tab.c:190
@ KW_JUMP
Definition: ael.tab.c:186
@ KW_LOCAL
Definition: ael.tab.c:201
@ KW_SWITCHES
Definition: ael.tab.c:198
@ COMMA
Definition: ael.tab.c:169
static yyconst flex_int16_t yy_def[304]
Definition: ael_lex.c:479
static yyconst flex_int16_t yy_accept[285]
Definition: ael_lex.c:365
static yyconst flex_int16_t yy_nxt[1073]
Definition: ael_lex.c:517
static yyconst flex_int16_t yy_base[304]
Definition: ael_lex.c:441
#define STORE_LOC
Definition: ael_lex.c:948
#define curlystate
Definition: ael_lex.c:966
static int pbcpop2(char x)
Definition: ael_lex.c:3248
static yy_state_type yy_try_NUL_trans(yy_state_type current_state, yyscan_t yyscanner)
Definition: ael_lex.c:2351
#define YY_BREAK
Definition: ael_lex.c:1192
#define comment
Definition: ael_lex.c:965
#define unput(c)
Definition: ael_lex.c:196
static int pbcpop3(char x)
Definition: ael_lex.c:3264
#define YY_RESTORE_YY_MORE_OFFSET
Definition: ael_lex.c:767
static void setup_filestack(char *fnamebuf, int fnamebuf_siz, glob_t *globbuf, int globpos, yyscan_t xscan, int create)
Definition: ael_lex.c:3399
#define YY_BUFFER_NORMAL
Definition: ael_lex.c:252
#define MAX_INCLUDE_DEPTH
Definition: ael_lex.c:880
#define YY_MORE_ADJ
Definition: ael_lex.c:766
#define YY_RULE_SETUP
Definition: ael_lex.c:1195
#define STORE_POS
Definition: ael_lex.c:941
register char * yy_bp
Definition: ael_lex.c:1203
#define yymore()
Definition: ael_lex.c:765
register int yy_act
Definition: ael_lex.c:1204
#define YY_START
Definition: ael_lex.c:151
#define GLOB_BRACE
Definition: ael_lex.c:831
static int parencount3
Definition: ael_lex.c:869
static int parencount2
Definition: ael_lex.c:860
static yyconst flex_int16_t yy_chk[1073]
Definition: ael_lex.c:639
static void pbcpush2(char x)
Definition: ael_lex.c:3243
static void pbcpush3(char x)
Definition: ael_lex.c:3259
#define YY_END_OF_BUFFER
Definition: ael_lex.c:357
#define YY_STATE_EOF(state)
Definition: ael_lex.c:155
#define GLOB_ABORTED
Definition: ael_lex.c:828
static yyconst flex_int32_t yy_meta[50]
Definition: ael_lex.c:432
register char * yy_cp
Definition: ael_lex.c:1203
#define yyterminate()
Definition: ael_lex.c:1155
static yyconst flex_int32_t yy_ec[256]
Definition: ael_lex.c:400
#define GLOB_NOMAGIC
Definition: ael_lex.c:834
#define YY_DO_BEFORE_ACTION
Definition: ael_lex.c:348
#define wordstate
Definition: ael_lex.c:967
#define brackstate
Definition: ael_lex.c:968
static yy_state_type yy_get_previous_state(yyscan_t yyscanner)
Definition: ael_lex.c:2318
#define YY_SC_TO_UI(c)
Definition: ael_lex.c:122
unsigned char YY_CHAR
Definition: ast_expr2f.c:334
int yy_state_type
Definition: ast_expr2f.c:336
short word
yy_state_type yy_last_accepting_state
Definition: ast_expr2f.c:642
int yy_more_len
Definition: ast_expr2f.c:650
int yy_more_flag
Definition: ast_expr2f.c:649
char * yy_last_accepting_cpos
Definition: ast_expr2f.c:643

References ael_yy_delete_buffer(), ael_yy_switch_to_buffer(), ael_yywrap, AMPER, argg, ast_config_AST_CONFIG_DIR, ast_copy_string(), ast_log, AT, BAR, BEGIN, brackstate, c, stackelement::colno, COLON, COMMA, comment, curlystate, EOB_ACT_CONTINUE_SCAN, EOB_ACT_END_OF_FILE, EOB_ACT_LAST_MATCH, EQ, EXTENMARK, stackelement::fname, free(), GLOB_ABORTED, GLOB_BRACE, GLOB_NOMAGIC, stackelement::globbuf_pos, include_stack, include_stack_index, INITIAL, KW_ABSTRACT, KW_BREAK, KW_CASE, KW_CATCH, KW_CONTEXT, KW_CONTINUE, KW_DEFAULT, KW_ELSE, KW_ESWITCHES, KW_EXTEND, KW_FOR, KW_GLOBALS, KW_GOTO, KW_HINT, KW_IF, KW_IFTIME, KW_IGNOREPAT, KW_INCLUDES, KW_JUMP, KW_LOCAL, KW_MACRO, KW_PATTERN, KW_RANDOM, KW_REGEXTEN, KW_RETURN, KW_SWITCH, KW_SWITCHES, KW_WHILE, LC, stackelement::lineno, LOG_ERROR, LOG_WARNING, LP, malloc(), MAX_INCLUDE_DEPTH, my_col, my_file, my_lineno, NULL, paren, parencount, parencount2, parencount3, pbcpop(), pbcpop2(), pbcpop3(), pbcpos2, pbcpos3, pbcpush(), pbcpush2(), pbcpush3(), prev_word, RC, RP, SEMI, semic, setup_filestack(), STORE_LOC, STORE_POS, strdup, unput, wordstate, yy_accept, yy_act, yy_base, yy_bp, YY_BREAK, YY_BUFFER_NEW, YY_BUFFER_NORMAL, yyguts_t::yy_c_buf_p, yy_chk, yy_cp, YY_CURRENT_BUFFER, 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, yyguts_t::yy_start, YY_START, YY_STATE_EOF, yy_try_NUL_trans(), yyg, yyin, yyleng, yylval, yymore, yyterminate, and yytext.

◆ yy_fatal_error() [1/2]

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

Definition at line 2854 of file ael_lex.c.

2855{
2856 (void) fprintf( stderr, "%s\n", msg );
2857 exit( YY_EXIT_FAILURE );
2858}
#define YY_EXIT_FAILURE
Definition: ael_lex.c:2851

References YY_EXIT_FAILURE.

◆ yy_fatal_error() [2/2]

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

◆ yy_get_next_buffer()

static int yy_get_next_buffer ( yyscan_t  yyscanner)
static

Definition at line 2183 of file ael_lex.c.

2184{
2185 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2186 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2187 register char *source = yyg->yytext_ptr;
2188 register int number_to_move, i;
2189 int ret_val;
2190
2191 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
2193 "fatal flex scanner internal error--end of buffer missed" );
2194
2195 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2196 { /* Don't try to fill the buffer, so this is an EOF. */
2197 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
2198 {
2199 /* We matched a single character, the EOB, so
2200 * treat this as a final EOF.
2201 */
2202 return EOB_ACT_END_OF_FILE;
2203 }
2204
2205 else
2206 {
2207 /* We matched some text prior to the EOB, first
2208 * process it.
2209 */
2210 return EOB_ACT_LAST_MATCH;
2211 }
2212 }
2213
2214 /* Try to read more data. */
2215
2216 /* First move last chars to start of buffer. */
2217 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
2218
2219 for ( i = 0; i < number_to_move; ++i )
2220 *(dest++) = *(source++);
2221
2222 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2223 /* don't do the read, it's not guaranteed to return an EOF,
2224 * just force an EOF
2225 */
2226 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
2227
2228 else
2229 {
2230 int num_to_read =
2231 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2232
2233 while ( num_to_read <= 0 )
2234 { /* Not enough room in the buffer - grow it. */
2235
2236 /* just a shorter name for the current buffer */
2238
2239 int yy_c_buf_p_offset =
2240 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
2241
2242 if ( b->yy_is_our_buffer )
2243 {
2244 int new_size = b->yy_buf_size * 2;
2245
2246 if ( new_size <= 0 )
2247 b->yy_buf_size += b->yy_buf_size / 8;
2248 else
2249 b->yy_buf_size *= 2;
2250
2251 b->yy_ch_buf = (char *)
2252 /* Include room in for 2 EOB chars. */
2253 ael_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
2254 }
2255 else
2256 /* Can't grow it, we don't own it. */
2257 b->yy_ch_buf = 0;
2258
2259 if ( ! b->yy_ch_buf )
2261 "fatal error - scanner input buffer overflow" );
2262
2263 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
2264
2265 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2266 number_to_move - 1;
2267
2268 }
2269
2270 if ( num_to_read > YY_READ_BUF_SIZE )
2271 num_to_read = YY_READ_BUF_SIZE;
2272
2273 /* Read in more data. */
2274 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2275 yyg->yy_n_chars, (size_t) num_to_read );
2276
2278 }
2279
2280 if ( yyg->yy_n_chars == 0 )
2281 {
2282 if ( number_to_move == YY_MORE_ADJ )
2283 {
2284 ret_val = EOB_ACT_END_OF_FILE;
2285 ael_yyrestart(yyin ,yyscanner);
2286 }
2287
2288 else
2289 {
2290 ret_val = EOB_ACT_LAST_MATCH;
2291 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2293 }
2294 }
2295
2296 else
2297 ret_val = EOB_ACT_CONTINUE_SCAN;
2298
2299 if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2300 /* Extend the array by 50%, plus the number we really need. */
2301 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
2302 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) ael_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
2303 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2304 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2305 }
2306
2307 yyg->yy_n_chars += number_to_move;
2310
2311 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2312
2313 return ret_val;
2314}
#define YY_READ_BUF_SIZE
Definition: ael_lex.c:1103
#define YY_INPUT(buf, result, max_size)
Definition: ael_lex.c:1118
#define YY_BUFFER_EOF_PENDING
Definition: ael_lex.c:263

References ael_yyrealloc(), ael_yyrestart(), b, EOB_ACT_CONTINUE_SCAN, EOB_ACT_END_OF_FILE, EOB_ACT_LAST_MATCH, YY_BUFFER_EOF_PENDING, yyguts_t::yy_c_buf_p, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, YY_END_OF_BUFFER_CHAR, YY_FATAL_ERROR, YY_INPUT, YY_MORE_ADJ, yyguts_t::yy_n_chars, YY_READ_BUF_SIZE, yyg, and yyin.

Referenced by input(), and while().

◆ yy_get_previous_state()

static yy_state_type yy_get_previous_state ( yyscan_t  yyscanner)
static

Definition at line 2318 of file ael_lex.c.

2319{
2320 register yy_state_type yy_current_state;
2321 register char *yy_cp;
2322 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2323
2324 yy_current_state = yyg->yy_start;
2325
2326 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
2327 {
2328 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2329 if ( yy_accept[yy_current_state] )
2330 {
2331 yyg->yy_last_accepting_state = yy_current_state;
2333 }
2334 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2335 {
2336 yy_current_state = (int) yy_def[yy_current_state];
2337 if ( yy_current_state >= 285 )
2338 yy_c = yy_meta[(unsigned int) yy_c];
2339 }
2340 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2341 }
2342
2343 return yy_current_state;
2344}

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, yyguts_t::yy_start, and yyg.

Referenced by while().

◆ yy_init_globals()

static int yy_init_globals ( yyscan_t  yyscanner)
static

Definition at line 3111 of file ael_lex.c.

3112{
3113 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3114 /* Initialization is the same as for the non-reentrant scanner.
3115 * This function is called from ael_yylex_destroy(), so don't allocate here.
3116 */
3117
3118 yyg->yy_buffer_stack = 0;
3121 yyg->yy_c_buf_p = (char *) 0;
3122 yyg->yy_init = 0;
3123 yyg->yy_start = 0;
3124
3128
3129/* Defined in main.c */
3130#ifdef YY_STDINIT
3131 yyin = stdin;
3132 yyout = stdout;
3133#else
3134 yyin = (FILE *) 0;
3135 yyout = (FILE *) 0;
3136#endif
3137
3138 /* For future reference: Set errno on error, since we are called by
3139 * ael_yylex_init()
3140 */
3141 return 0;
3142}
int yy_start_stack_ptr
Definition: ast_expr2f.c:639
int yy_start_stack_depth
Definition: ast_expr2f.c:640

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, yyg, yyin, and yyout.

Referenced by ael_yylex_destroy(), ael_yylex_init(), and ael_yylex_init_extra().

◆ yy_try_NUL_trans()

static yy_state_type yy_try_NUL_trans ( yy_state_type  current_state,
yyscan_t  yyscanner 
)
static

Definition at line 2351 of file ael_lex.c.

2352{
2353 register int yy_is_jam;
2354 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
2355 register char *yy_cp = yyg->yy_c_buf_p;
2356
2357 register YY_CHAR yy_c = 1;
2358 if ( yy_accept[yy_current_state] )
2359 {
2360 yyg->yy_last_accepting_state = yy_current_state;
2362 }
2363 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2364 {
2365 yy_current_state = (int) yy_def[yy_current_state];
2366 if ( yy_current_state >= 285 )
2367 yy_c = yy_meta[(unsigned int) yy_c];
2368 }
2369 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2370 yy_is_jam = (yy_current_state == 284);
2371
2372 return yy_is_jam ? 0 : yy_current_state;
2373}

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, yy_nxt, and yyg.

Referenced by while().

◆ 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 2375 of file ael_lex.c.

2376{
2377 register char *yy_cp;
2378 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2379
2380 yy_cp = yyg->yy_c_buf_p;
2381
2382 /* undo effects of setting up yytext */
2384
2385 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2386 { /* need to shift things up to make room */
2387 /* +2 for EOB chars. */
2388 register int number_to_move = yyg->yy_n_chars + 2;
2389 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
2390 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
2391 register char *source =
2392 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
2393
2394 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2395 *--dest = *--source;
2396
2397 yy_cp += (int) (dest - source);
2398 yy_bp += (int) (dest - source);
2399 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
2400 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
2401
2402 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2403 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2404 }
2405
2406 *--yy_cp = (char) c;
2407
2408 yyg->yytext_ptr = yy_bp;
2410 yyg->yy_c_buf_p = yy_cp;
2411}

References c, yy_bp, yyguts_t::yy_c_buf_p, yy_cp, YY_CURRENT_BUFFER_LVALUE, YY_FATAL_ERROR, yyguts_t::yy_hold_char, yyguts_t::yy_n_chars, and yyg.

Variable Documentation

◆ include_stack

struct stackelement include_stack[MAX_INCLUDE_DEPTH]
static

Definition at line 907 of file ael_lex.c.

Referenced by setup_filestack(), and while().

◆ include_stack_index

int include_stack_index = 0
static

Definition at line 908 of file ael_lex.c.

Referenced by ael2_parse(), setup_filestack(), and while().

◆ my_col

int my_col = 1
static

Definition at line 876 of file ael_lex.c.

Referenced by ael2_parse(), setup_filestack(), and while().

◆ my_file

char* my_file = 0

Definition at line 877 of file ael_lex.c.

Referenced by ael2_parse(), npval(), setup_filestack(), while(), yyerror(), and yyparse().

◆ my_lineno

int my_lineno = 1
static

Definition at line 875 of file ael_lex.c.

Referenced by ael2_parse(), setup_filestack(), and while().

◆ parencount

int parencount = 0
static

Definition at line 851 of file ael_lex.c.

Referenced by reset_argcount(), reset_parencount(), and while().

◆ parencount2

int parencount2 = 0
static

Definition at line 860 of file ael_lex.c.

Referenced by while().

◆ parencount3

int parencount3 = 0
static

Definition at line 869 of file ael_lex.c.

Referenced by while().

◆ pbcpos

int pbcpos = 0
static

Definition at line 848 of file ael_lex.c.

Referenced by pbcpop(), pbcpush(), reset_argcount(), reset_parencount(), and reset_semicount().

◆ pbcpos2

int pbcpos2 = 0
static

Definition at line 857 of file ael_lex.c.

Referenced by pbcpop2(), pbcpush2(), and while().

◆ pbcpos3

int pbcpos3 = 0
static

Definition at line 866 of file ael_lex.c.

Referenced by pbcpop3(), pbcpush3(), and while().

◆ pbcstack

char pbcstack[400]
static

Definition at line 847 of file ael_lex.c.

Referenced by pbcpop(), and pbcpush().

◆ pbcstack2

char pbcstack2[400]
static

Definition at line 856 of file ael_lex.c.

Referenced by pbcpop2(), and pbcpush2().

◆ pbcstack3

char pbcstack3[400]
static

Definition at line 865 of file ael_lex.c.

Referenced by pbcpop3(), and pbcpush3().

◆ prev_word

char* prev_word

Definition at line 878 of file ael_lex.c.

Referenced by ael2_parse(), c_prevword(), while(), yydestruct(), and yyparse().

◆ yy_accept

yyconst flex_int16_t yy_accept[285]
static

Definition at line 365 of file ael_lex.c.

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

◆ yy_act

register int yy_act

Definition at line 1204 of file ael_lex.c.

Referenced by while().

◆ yy_base

yyconst flex_int16_t yy_base[304]
static

Definition at line 441 of file ael_lex.c.

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

◆ yy_bp

register char * yy_bp

Definition at line 1203 of file ael_lex.c.

Referenced by while(), and yyunput().

◆ yy_chk

yyconst flex_int16_t yy_chk[1073]
static

Definition at line 639 of file ael_lex.c.

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

◆ yy_cp

register char* yy_cp

Definition at line 1203 of file ael_lex.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

The main scanner function which does all the work.

Definition at line 1200 of file ael_lex.c.

◆ yy_def

yyconst flex_int16_t yy_def[304]
static

Definition at line 479 of file ael_lex.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 400 of file ael_lex.c.

Referenced by while(), and yy_get_previous_state().

◆ yy_meta

yyconst flex_int32_t yy_meta[50]
static

Definition at line 432 of file ael_lex.c.

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

◆ yy_nxt

yyconst flex_int16_t yy_nxt[1073]
static

Definition at line 517 of file ael_lex.c.

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

◆ yyg

struct yyguts_t* yyg = (struct yyguts_t*)yyscanner

◆ yylloc

yylloc = yylloc_param

Definition at line 1214 of file ael_lex.c.

◆ yylval

yylval = yylval_param

Definition at line 1212 of file ael_lex.c.