simplify handling of line numbers

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@23153 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Luigi Rizzo 2006-04-28 15:42:13 +00:00
parent dad2812867
commit d30ead1474
2 changed files with 83 additions and 117 deletions

View File

@ -149,21 +149,15 @@ static void pbcwhere(const char *text, int *line, int *col )
my_col+=yyleng; \ my_col+=yyleng; \
} while (0) } while (0)
#define STORE_START do { \ #define STORE_LOC do { \
yylloc->first_line = my_lineno; \ yylloc->first_line = my_lineno; \
yylloc->first_column=my_col; \ yylloc->first_column=my_col; \
} while (0)
#define STORE_END do { \
pbcwhere(yytext, &my_lineno, &my_col); \ pbcwhere(yytext, &my_lineno, &my_col); \
yylloc->last_line = my_lineno; \ yylloc->last_line = my_lineno; \
yylloc->last_column = my_col - 1; \ yylloc->last_column = my_col - 1; \
} while (0) } while (0)
#define STORE_LOC do { STORE_START; STORE_END } while (0)
#else #else
#define STORE_POS #define STORE_POS
#define STORE_START
#define STORE_END
#define STORE_LOC #define STORE_LOC
#endif #endif
%} %}
@ -232,9 +226,8 @@ includes { STORE_POS; return KW_INCLUDES;}
<paren>{NOPARENS}\) { <paren>{NOPARENS}\) {
STORE_START;
if ( pbcpop(')') ) { /* error */ if ( pbcpop(')') ) { /* error */
STORE_END; STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext); ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext);
BEGIN(0); BEGIN(0);
yylval->str = strdup(yytext); yylval->str = strdup(yytext);
@ -245,7 +238,7 @@ includes { STORE_POS; return KW_INCLUDES;}
if ( parencount >= 0) { if ( parencount >= 0) {
yymore(); yymore();
} else { } else {
STORE_END; STORE_LOC;
yylval->str = strdup(yytext); yylval->str = strdup(yytext);
*(yylval->str+strlen(yylval->str)-1)=0; *(yylval->str+strlen(yylval->str)-1)=0;
/* printf("Got paren word %s\n", yylval->str); */ /* printf("Got paren word %s\n", yylval->str); */
@ -257,7 +250,6 @@ includes { STORE_POS; return KW_INCLUDES;}
<paren>{NOPARENS}[\(\[\{] { <paren>{NOPARENS}[\(\[\{] {
char c = yytext[yyleng-1]; char c = yytext[yyleng-1];
// STORE_START;
if (c == '(') if (c == '(')
parencount++; parencount++;
pbcpush(c); pbcpush(c);
@ -266,9 +258,8 @@ includes { STORE_POS; return KW_INCLUDES;}
<paren>{NOPARENS}[\]\}] { <paren>{NOPARENS}[\]\}] {
char c = yytext[yyleng-1]; char c = yytext[yyleng-1];
STORE_START;
if ( pbcpop(c)) { /* error */ if ( pbcpop(c)) { /* error */
STORE_END; STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
my_file, my_lineno, my_col, c); my_file, my_lineno, my_col, c);
BEGIN(0); BEGIN(0);
@ -280,7 +271,6 @@ includes { STORE_POS; return KW_INCLUDES;}
<argg>{NOARGG}[\(\[\{] { <argg>{NOARGG}[\(\[\{] {
char c = yytext[yyleng-1]; char c = yytext[yyleng-1];
STORE_START;
if (c == '(') if (c == '(')
parencount++; parencount++;
pbcpush(c); pbcpush(c);
@ -288,9 +278,8 @@ includes { STORE_POS; return KW_INCLUDES;}
} }
<argg>{NOARGG}\) { <argg>{NOARGG}\) {
STORE_START;
if ( pbcpop(')') ) { /* error */ if ( pbcpop(')') ) { /* error */
STORE_END; STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression!\n", my_file, my_lineno, my_col); ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression!\n", my_file, my_lineno, my_col);
BEGIN(0); BEGIN(0);
yylval->str = strdup(yytext); yylval->str = strdup(yytext);
@ -301,7 +290,7 @@ includes { STORE_POS; return KW_INCLUDES;}
if( parencount >= 0){ if( parencount >= 0){
yymore(); yymore();
} else { } else {
STORE_END; STORE_LOC;
yylval->str = strdup(yytext); yylval->str = strdup(yytext);
if(yyleng > 1 ) if(yyleng > 1 )
*(yylval->str+yyleng-1)=0; *(yylval->str+yyleng-1)=0;
@ -319,12 +308,10 @@ includes { STORE_POS; return KW_INCLUDES;}
} }
<argg>{NOARGG}\, { <argg>{NOARGG}\, {
if( parencount != 0) { if( parencount != 0) { /* printf("Folding in a comma!\n"); */
/* printf("Folding in a comma!\n"); */
yymore(); yymore();
} else { } else {
STORE_START; STORE_LOC;
STORE_END;
if( !commaout ) { if( !commaout ) {
if( !strcmp(yytext,"," ) ) { if( !strcmp(yytext,"," ) ) {
commaout = 0; commaout = 0;
@ -348,9 +335,8 @@ includes { STORE_POS; return KW_INCLUDES;}
<argg>{NOARGG}[\]\}] { <argg>{NOARGG}[\]\}] {
char c = yytext[yyleng-1]; char c = yytext[yyleng-1];
STORE_START;
if ( pbcpop(c) ) { /* error */ if ( pbcpop(c) ) { /* error */
STORE_END; STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c); ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c);
BEGIN(0); BEGIN(0);
yylval->str = strdup(yytext); yylval->str = strdup(yytext);
@ -363,16 +349,14 @@ includes { STORE_POS; return KW_INCLUDES;}
<semic>{NOSEMIC}[\(\[\{] { <semic>{NOSEMIC}[\(\[\{] {
char c = yytext[yyleng-1]; char c = yytext[yyleng-1];
STORE_START;
yymore(); yymore();
pbcpush(c); pbcpush(c);
} }
<semic>{NOSEMIC}[\)\]\}] { <semic>{NOSEMIC}[\)\]\}] {
char c = yytext[yyleng-1]; char c = yytext[yyleng-1];
STORE_START;
if ( pbcpop(c) ) { /* error */ if ( pbcpop(c) ) { /* error */
STORE_END; STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c); ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c);
BEGIN(0); BEGIN(0);
yylval->str = strdup(yytext); yylval->str = strdup(yytext);
@ -382,8 +366,7 @@ includes { STORE_POS; return KW_INCLUDES;}
} }
<semic>{NOSEMIC}; { <semic>{NOSEMIC}; {
STORE_START; STORE_LOC;
STORE_END;
yylval->str = strdup(yytext); yylval->str = strdup(yytext);
if(yyleng > 1) if(yyleng > 1)
*(yylval->str+yyleng-1)=0; *(yylval->str+yyleng-1)=0;

View File

@ -765,24 +765,18 @@ static void pbcwhere(const char *text, int *line, int *col )
my_col+=yyleng; \ my_col+=yyleng; \
} while (0) } while (0)
#define STORE_START do { \ #define STORE_LOC do { \
yylloc->first_line = my_lineno; \ yylloc->first_line = my_lineno; \
yylloc->first_column=my_col; \ yylloc->first_column=my_col; \
} while (0)
#define STORE_END do { \
pbcwhere(yytext, &my_lineno, &my_col); \ pbcwhere(yytext, &my_lineno, &my_col); \
yylloc->last_line = my_lineno; \ yylloc->last_line = my_lineno; \
yylloc->last_column = my_col - 1; \ yylloc->last_column = my_col - 1; \
} while (0) } while (0)
#define STORE_LOC do { STORE_START; STORE_END } while (0)
#else #else
#define STORE_POS #define STORE_POS
#define STORE_START
#define STORE_END
#define STORE_LOC #define STORE_LOC
#endif #endif
#line 786 "ael_lex.c" #line 780 "ael_lex.c"
#define INITIAL 0 #define INITIAL 0
#define paren 1 #define paren 1
@ -1022,10 +1016,10 @@ YY_DECL
register int yy_act; register int yy_act;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
#line 178 "ael.flex" #line 172 "ael.flex"
#line 1029 "ael_lex.c" #line 1023 "ael_lex.c"
yylval = yylval_param; yylval = yylval_param;
@ -1116,218 +1110,218 @@ do_action: /* This label is used only to access EOF actions. */
case 1: case 1:
YY_RULE_SETUP YY_RULE_SETUP
#line 180 "ael.flex" #line 174 "ael.flex"
{ STORE_POS; return LC;} { STORE_POS; return LC;}
YY_BREAK YY_BREAK
case 2: case 2:
YY_RULE_SETUP YY_RULE_SETUP
#line 181 "ael.flex" #line 175 "ael.flex"
{ STORE_POS; return RC;} { STORE_POS; return RC;}
YY_BREAK YY_BREAK
case 3: case 3:
YY_RULE_SETUP YY_RULE_SETUP
#line 182 "ael.flex" #line 176 "ael.flex"
{ STORE_POS; return LP;} { STORE_POS; return LP;}
YY_BREAK YY_BREAK
case 4: case 4:
YY_RULE_SETUP YY_RULE_SETUP
#line 183 "ael.flex" #line 177 "ael.flex"
{ STORE_POS; return RP;} { STORE_POS; return RP;}
YY_BREAK YY_BREAK
case 5: case 5:
YY_RULE_SETUP YY_RULE_SETUP
#line 184 "ael.flex" #line 178 "ael.flex"
{ STORE_POS; return SEMI;} { STORE_POS; return SEMI;}
YY_BREAK YY_BREAK
case 6: case 6:
YY_RULE_SETUP YY_RULE_SETUP
#line 185 "ael.flex" #line 179 "ael.flex"
{ STORE_POS; return EQ;} { STORE_POS; return EQ;}
YY_BREAK YY_BREAK
case 7: case 7:
YY_RULE_SETUP YY_RULE_SETUP
#line 186 "ael.flex" #line 180 "ael.flex"
{ STORE_POS; return COMMA;} { STORE_POS; return COMMA;}
YY_BREAK YY_BREAK
case 8: case 8:
YY_RULE_SETUP YY_RULE_SETUP
#line 187 "ael.flex" #line 181 "ael.flex"
{ STORE_POS; return COLON;} { STORE_POS; return COLON;}
YY_BREAK YY_BREAK
case 9: case 9:
YY_RULE_SETUP YY_RULE_SETUP
#line 188 "ael.flex" #line 182 "ael.flex"
{ STORE_POS; return AMPER;} { STORE_POS; return AMPER;}
YY_BREAK YY_BREAK
case 10: case 10:
YY_RULE_SETUP YY_RULE_SETUP
#line 189 "ael.flex" #line 183 "ael.flex"
{ STORE_POS; return BAR;} { STORE_POS; return BAR;}
YY_BREAK YY_BREAK
case 11: case 11:
YY_RULE_SETUP YY_RULE_SETUP
#line 190 "ael.flex" #line 184 "ael.flex"
{ STORE_POS; return EXTENMARK;} { STORE_POS; return EXTENMARK;}
YY_BREAK YY_BREAK
case 12: case 12:
YY_RULE_SETUP YY_RULE_SETUP
#line 191 "ael.flex" #line 185 "ael.flex"
{ STORE_POS; return AT;} { STORE_POS; return AT;}
YY_BREAK YY_BREAK
case 13: case 13:
YY_RULE_SETUP YY_RULE_SETUP
#line 192 "ael.flex" #line 186 "ael.flex"
{/*comment*/} {/*comment*/}
YY_BREAK YY_BREAK
case 14: case 14:
YY_RULE_SETUP YY_RULE_SETUP
#line 193 "ael.flex" #line 187 "ael.flex"
{ STORE_POS; return KW_CONTEXT;} { STORE_POS; return KW_CONTEXT;}
YY_BREAK YY_BREAK
case 15: case 15:
YY_RULE_SETUP YY_RULE_SETUP
#line 194 "ael.flex" #line 188 "ael.flex"
{ STORE_POS; return KW_ABSTRACT;} { STORE_POS; return KW_ABSTRACT;}
YY_BREAK YY_BREAK
case 16: case 16:
YY_RULE_SETUP YY_RULE_SETUP
#line 195 "ael.flex" #line 189 "ael.flex"
{ STORE_POS; return KW_MACRO;}; { STORE_POS; return KW_MACRO;};
YY_BREAK YY_BREAK
case 17: case 17:
YY_RULE_SETUP YY_RULE_SETUP
#line 196 "ael.flex" #line 190 "ael.flex"
{ STORE_POS; return KW_GLOBALS;} { STORE_POS; return KW_GLOBALS;}
YY_BREAK YY_BREAK
case 18: case 18:
YY_RULE_SETUP YY_RULE_SETUP
#line 197 "ael.flex" #line 191 "ael.flex"
{ STORE_POS; return KW_IGNOREPAT;} { STORE_POS; return KW_IGNOREPAT;}
YY_BREAK YY_BREAK
case 19: case 19:
YY_RULE_SETUP YY_RULE_SETUP
#line 198 "ael.flex" #line 192 "ael.flex"
{ STORE_POS; return KW_SWITCH;} { STORE_POS; return KW_SWITCH;}
YY_BREAK YY_BREAK
case 20: case 20:
YY_RULE_SETUP YY_RULE_SETUP
#line 199 "ael.flex" #line 193 "ael.flex"
{ STORE_POS; return KW_IF;} { STORE_POS; return KW_IF;}
YY_BREAK YY_BREAK
case 21: case 21:
YY_RULE_SETUP YY_RULE_SETUP
#line 200 "ael.flex" #line 194 "ael.flex"
{ STORE_POS; return KW_IFTIME;} { STORE_POS; return KW_IFTIME;}
YY_BREAK YY_BREAK
case 22: case 22:
YY_RULE_SETUP YY_RULE_SETUP
#line 201 "ael.flex" #line 195 "ael.flex"
{ STORE_POS; return KW_RANDOM;} { STORE_POS; return KW_RANDOM;}
YY_BREAK YY_BREAK
case 23: case 23:
YY_RULE_SETUP YY_RULE_SETUP
#line 202 "ael.flex" #line 196 "ael.flex"
{ STORE_POS; return KW_REGEXTEN;} { STORE_POS; return KW_REGEXTEN;}
YY_BREAK YY_BREAK
case 24: case 24:
YY_RULE_SETUP YY_RULE_SETUP
#line 203 "ael.flex" #line 197 "ael.flex"
{ STORE_POS; return KW_HINT;} { STORE_POS; return KW_HINT;}
YY_BREAK YY_BREAK
case 25: case 25:
YY_RULE_SETUP YY_RULE_SETUP
#line 204 "ael.flex" #line 198 "ael.flex"
{ STORE_POS; return KW_ELSE;} { STORE_POS; return KW_ELSE;}
YY_BREAK YY_BREAK
case 26: case 26:
YY_RULE_SETUP YY_RULE_SETUP
#line 205 "ael.flex" #line 199 "ael.flex"
{ STORE_POS; return KW_GOTO;} { STORE_POS; return KW_GOTO;}
YY_BREAK YY_BREAK
case 27: case 27:
YY_RULE_SETUP YY_RULE_SETUP
#line 206 "ael.flex" #line 200 "ael.flex"
{ STORE_POS; return KW_JUMP;} { STORE_POS; return KW_JUMP;}
YY_BREAK YY_BREAK
case 28: case 28:
YY_RULE_SETUP YY_RULE_SETUP
#line 207 "ael.flex" #line 201 "ael.flex"
{ STORE_POS; return KW_RETURN;} { STORE_POS; return KW_RETURN;}
YY_BREAK YY_BREAK
case 29: case 29:
YY_RULE_SETUP YY_RULE_SETUP
#line 208 "ael.flex" #line 202 "ael.flex"
{ STORE_POS; return KW_BREAK;} { STORE_POS; return KW_BREAK;}
YY_BREAK YY_BREAK
case 30: case 30:
YY_RULE_SETUP YY_RULE_SETUP
#line 209 "ael.flex" #line 203 "ael.flex"
{ STORE_POS; return KW_CONTINUE;} { STORE_POS; return KW_CONTINUE;}
YY_BREAK YY_BREAK
case 31: case 31:
YY_RULE_SETUP YY_RULE_SETUP
#line 210 "ael.flex" #line 204 "ael.flex"
{ STORE_POS; return KW_FOR;} { STORE_POS; return KW_FOR;}
YY_BREAK YY_BREAK
case 32: case 32:
YY_RULE_SETUP YY_RULE_SETUP
#line 211 "ael.flex" #line 205 "ael.flex"
{ STORE_POS; return KW_WHILE;} { STORE_POS; return KW_WHILE;}
YY_BREAK YY_BREAK
case 33: case 33:
YY_RULE_SETUP YY_RULE_SETUP
#line 212 "ael.flex" #line 206 "ael.flex"
{ STORE_POS; return KW_CASE;} { STORE_POS; return KW_CASE;}
YY_BREAK YY_BREAK
case 34: case 34:
YY_RULE_SETUP YY_RULE_SETUP
#line 213 "ael.flex" #line 207 "ael.flex"
{ STORE_POS; return KW_DEFAULT;} { STORE_POS; return KW_DEFAULT;}
YY_BREAK YY_BREAK
case 35: case 35:
YY_RULE_SETUP YY_RULE_SETUP
#line 214 "ael.flex" #line 208 "ael.flex"
{ STORE_POS; return KW_PATTERN;} { STORE_POS; return KW_PATTERN;}
YY_BREAK YY_BREAK
case 36: case 36:
YY_RULE_SETUP YY_RULE_SETUP
#line 215 "ael.flex" #line 209 "ael.flex"
{ STORE_POS; return KW_CATCH;} { STORE_POS; return KW_CATCH;}
YY_BREAK YY_BREAK
case 37: case 37:
YY_RULE_SETUP YY_RULE_SETUP
#line 216 "ael.flex" #line 210 "ael.flex"
{ STORE_POS; return KW_SWITCHES;} { STORE_POS; return KW_SWITCHES;}
YY_BREAK YY_BREAK
case 38: case 38:
YY_RULE_SETUP YY_RULE_SETUP
#line 217 "ael.flex" #line 211 "ael.flex"
{ STORE_POS; return KW_ESWITCHES;} { STORE_POS; return KW_ESWITCHES;}
YY_BREAK YY_BREAK
case 39: case 39:
YY_RULE_SETUP YY_RULE_SETUP
#line 218 "ael.flex" #line 212 "ael.flex"
{ STORE_POS; return KW_INCLUDES;} { STORE_POS; return KW_INCLUDES;}
YY_BREAK YY_BREAK
case 40: case 40:
/* rule 40 can match eol */ /* rule 40 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 220 "ael.flex" #line 214 "ael.flex"
{ my_lineno++; my_col = 1; } { my_lineno++; my_col = 1; }
YY_BREAK YY_BREAK
case 41: case 41:
YY_RULE_SETUP YY_RULE_SETUP
#line 221 "ael.flex" #line 215 "ael.flex"
{ my_col += yyleng; } { my_col += yyleng; }
YY_BREAK YY_BREAK
case 42: case 42:
YY_RULE_SETUP YY_RULE_SETUP
#line 222 "ael.flex" #line 216 "ael.flex"
{ my_col += (yyleng*8)-(my_col%8); } { my_col += (yyleng*8)-(my_col%8); }
YY_BREAK YY_BREAK
case 43: case 43:
YY_RULE_SETUP YY_RULE_SETUP
#line 224 "ael.flex" #line 218 "ael.flex"
{ {
STORE_POS; STORE_POS;
yylval->str = strdup(yytext); yylval->str = strdup(yytext);
@ -1338,11 +1332,10 @@ YY_RULE_SETUP
case 44: case 44:
/* rule 44 can match eol */ /* rule 44 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 234 "ael.flex" #line 228 "ael.flex"
{ {
STORE_START;
if ( pbcpop(')') ) { /* error */ if ( pbcpop(')') ) { /* error */
STORE_END; STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext); ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext);
BEGIN(0); BEGIN(0);
yylval->str = strdup(yytext); yylval->str = strdup(yytext);
@ -1353,7 +1346,7 @@ YY_RULE_SETUP
if ( parencount >= 0) { if ( parencount >= 0) {
yymore(); yymore();
} else { } else {
STORE_END; STORE_LOC;
yylval->str = strdup(yytext); yylval->str = strdup(yytext);
*(yylval->str+strlen(yylval->str)-1)=0; *(yylval->str+strlen(yylval->str)-1)=0;
/* printf("Got paren word %s\n", yylval->str); */ /* printf("Got paren word %s\n", yylval->str); */
@ -1366,10 +1359,9 @@ YY_RULE_SETUP
case 45: case 45:
/* rule 45 can match eol */ /* rule 45 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 258 "ael.flex" #line 251 "ael.flex"
{ {
char c = yytext[yyleng-1]; char c = yytext[yyleng-1];
// STORE_START;
if (c == '(') if (c == '(')
parencount++; parencount++;
pbcpush(c); pbcpush(c);
@ -1379,12 +1371,11 @@ YY_RULE_SETUP
case 46: case 46:
/* rule 46 can match eol */ /* rule 46 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 267 "ael.flex" #line 259 "ael.flex"
{ {
char c = yytext[yyleng-1]; char c = yytext[yyleng-1];
STORE_START;
if ( pbcpop(c)) { /* error */ if ( pbcpop(c)) { /* error */
STORE_END; STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
my_file, my_lineno, my_col, c); my_file, my_lineno, my_col, c);
BEGIN(0); BEGIN(0);
@ -1397,10 +1388,9 @@ YY_RULE_SETUP
case 47: case 47:
/* rule 47 can match eol */ /* rule 47 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 281 "ael.flex" #line 272 "ael.flex"
{ {
char c = yytext[yyleng-1]; char c = yytext[yyleng-1];
STORE_START;
if (c == '(') if (c == '(')
parencount++; parencount++;
pbcpush(c); pbcpush(c);
@ -1410,11 +1400,10 @@ YY_RULE_SETUP
case 48: case 48:
/* rule 48 can match eol */ /* rule 48 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 290 "ael.flex" #line 280 "ael.flex"
{ {
STORE_START;
if ( pbcpop(')') ) { /* error */ if ( pbcpop(')') ) { /* error */
STORE_END; STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression!\n", my_file, my_lineno, my_col); ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression!\n", my_file, my_lineno, my_col);
BEGIN(0); BEGIN(0);
yylval->str = strdup(yytext); yylval->str = strdup(yytext);
@ -1425,7 +1414,7 @@ YY_RULE_SETUP
if( parencount >= 0){ if( parencount >= 0){
yymore(); yymore();
} else { } else {
STORE_END; STORE_LOC;
yylval->str = strdup(yytext); yylval->str = strdup(yytext);
if(yyleng > 1 ) if(yyleng > 1 )
*(yylval->str+yyleng-1)=0; *(yylval->str+yyleng-1)=0;
@ -1445,14 +1434,12 @@ YY_RULE_SETUP
case 49: case 49:
/* rule 49 can match eol */ /* rule 49 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 321 "ael.flex" #line 310 "ael.flex"
{ {
if( parencount != 0) { if( parencount != 0) { /* printf("Folding in a comma!\n"); */
/* printf("Folding in a comma!\n"); */
yymore(); yymore();
} else { } else {
STORE_START; STORE_LOC;
STORE_END;
if( !commaout ) { if( !commaout ) {
if( !strcmp(yytext,"," ) ) { if( !strcmp(yytext,"," ) ) {
commaout = 0; commaout = 0;
@ -1477,12 +1464,11 @@ YY_RULE_SETUP
case 50: case 50:
/* rule 50 can match eol */ /* rule 50 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 349 "ael.flex" #line 336 "ael.flex"
{ {
char c = yytext[yyleng-1]; char c = yytext[yyleng-1];
STORE_START;
if ( pbcpop(c) ) { /* error */ if ( pbcpop(c) ) { /* error */
STORE_END; STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c); ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c);
BEGIN(0); BEGIN(0);
yylval->str = strdup(yytext); yylval->str = strdup(yytext);
@ -1494,10 +1480,9 @@ YY_RULE_SETUP
case 51: case 51:
/* rule 51 can match eol */ /* rule 51 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 364 "ael.flex" #line 350 "ael.flex"
{ {
char c = yytext[yyleng-1]; char c = yytext[yyleng-1];
STORE_START;
yymore(); yymore();
pbcpush(c); pbcpush(c);
} }
@ -1505,12 +1490,11 @@ YY_RULE_SETUP
case 52: case 52:
/* rule 52 can match eol */ /* rule 52 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 371 "ael.flex" #line 356 "ael.flex"
{ {
char c = yytext[yyleng-1]; char c = yytext[yyleng-1];
STORE_START;
if ( pbcpop(c) ) { /* error */ if ( pbcpop(c) ) { /* error */
STORE_END; STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c); ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c);
BEGIN(0); BEGIN(0);
yylval->str = strdup(yytext); yylval->str = strdup(yytext);
@ -1522,10 +1506,9 @@ YY_RULE_SETUP
case 53: case 53:
/* rule 53 can match eol */ /* rule 53 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 384 "ael.flex" #line 368 "ael.flex"
{ {
STORE_START; STORE_LOC;
STORE_END;
yylval->str = strdup(yytext); yylval->str = strdup(yytext);
if(yyleng > 1) if(yyleng > 1)
*(yylval->str+yyleng-1)=0; *(yylval->str+yyleng-1)=0;
@ -1537,7 +1520,7 @@ YY_RULE_SETUP
case 54: case 54:
/* rule 54 can match eol */ /* rule 54 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 395 "ael.flex" #line 378 "ael.flex"
{ {
FILE *in1; FILE *in1;
char fnamebuf[1024],*p1,*p2; char fnamebuf[1024],*p1,*p2;
@ -1604,7 +1587,7 @@ case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(paren): case YY_STATE_EOF(paren):
case YY_STATE_EOF(semic): case YY_STATE_EOF(semic):
case YY_STATE_EOF(argg): case YY_STATE_EOF(argg):
#line 457 "ael.flex" #line 440 "ael.flex"
{ {
if ( --include_stack_index < 0 ) { if ( --include_stack_index < 0 ) {
yyterminate(); yyterminate();
@ -1620,10 +1603,10 @@ case YY_STATE_EOF(argg):
YY_BREAK YY_BREAK
case 55: case 55:
YY_RULE_SETUP YY_RULE_SETUP
#line 470 "ael.flex" #line 453 "ael.flex"
ECHO; ECHO;
YY_BREAK YY_BREAK
#line 1627 "ael_lex.c" #line 1610 "ael_lex.c"
case YY_END_OF_BUFFER: case YY_END_OF_BUFFER:
{ {
@ -2753,7 +2736,7 @@ void ael_yyfree (void * ptr , yyscan_t yyscanner)
#define YYTABLES_NAME "yytables" #define YYTABLES_NAME "yytables"
#line 470 "ael.flex" #line 453 "ael.flex"