aboutsummaryrefslogtreecommitdiffstats
path: root/pbx/ael/ael.y
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2009-02-18 22:43:14 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2009-02-18 22:43:14 +0000
commitc34b77f216b53c4bfbd6c008b8573d6cb6753722 (patch)
tree7e7b13035ccbc5bccb0073a618461bbc2beb7f06 /pbx/ael/ael.y
parentc79298cc220361483baf3b9fe4352841352a3e92 (diff)
This patch fixes a regression of sorts that was introduced in
rev 24425. It basically fixes AST-190/ABE-1782. What was wrong: the user has 6000 extensions in one context; and then 6000 contexts, one per extension. The parser could only handle about 4893 of the 6000 extens in the single context. This was due to the regression I mentioned. To get rid of shift/reduce conflicts, Luigi set up right-recursive lists for globals, context elements, switch lists, and statements. Right recursive lists got rid of the warnings, but instead, they use up a tremendous amount of stack space when the lists are long. I saw this a few years back, and resolved not to fix it until someone complained. That day has arrived! After the changes were made, I ran the regression test suite, and there were no problems. I took the test case the user provided, and added 100,000 extensions to the single context, that already had 6,000 extens in it. (I'll see your 6, and raise you 100!) It takes a few minutes to read it all in, check it and generate code for it, but no problems. So, I think I can say that fundamentally, there are no longer any limits on the number of items you can place in contexts, statement blocks, switches, or globals, beyond your virt mem constraints. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@177225 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx/ael/ael.y')
-rw-r--r--pbx/ael/ael.y24
1 files changed, 12 insertions, 12 deletions
diff --git a/pbx/ael/ael.y b/pbx/ael/ael.y
index 7ff058b91..e2ddda1ad 100644
--- a/pbx/ael/ael.y
+++ b/pbx/ael/ael.y
@@ -155,7 +155,7 @@ static pval *update_last(pval *, YYLTYPE *);
/* there will be two shift/reduce conflicts, they involve the if statement, where a single statement occurs not wrapped in curlies in the "true" section
the default action to shift will attach the else to the preceeding if. */
-%expect 3
+%expect 28
%error-verbose
/*
@@ -231,7 +231,7 @@ globals : KW_GLOBALS LC global_statements RC {
;
global_statements : { $$ = NULL; }
- | assignment global_statements {$$ = linku1($1, $2); }
+ | global_statements assignment {$$ = linku1($1, $2); }
| error global_statements {$$=$2;}
;
@@ -249,7 +249,7 @@ arglist : /* empty */ { $$ = NULL; }
;
elements : {$$=0;}
- | element elements { $$ = linku1($1, $2); }
+ | elements element { $$ = linku1($1, $2); }
| error elements { $$=$2;}
;
@@ -293,7 +293,7 @@ extension : word EXTENMARK statement {
/* list of statements in a block or after a case label - can be empty */
statements : /* empty */ { $$ = NULL; }
- | statement statements { $$ = linku1($1, $2); }
+ | statements statement { $$ = linku1($1, $2); }
| error statements {$$=$2;}
;
@@ -603,7 +603,7 @@ eval_arglist : word_list { $$ = nword($1, &@1); }
;
case_statements: /* empty */ { $$ = NULL; }
- | case_statement case_statements { $$ = linku1($1, $2); }
+ | case_statements case_statement { $$ = linku1($1, $2); }
;
case_statement: KW_CASE word COLON statements {
@@ -621,7 +621,7 @@ case_statement: KW_CASE word COLON statements {
;
macro_statements: /* empty */ { $$ = NULL; }
- | macro_statement macro_statements { $$ = linku1($1, $2); }
+ | macro_statements macro_statement { $$ = linku1($1, $2); }
;
macro_statement : statement {$$=$1;}
@@ -643,16 +643,16 @@ eswitches : KW_ESWITCHES LC switchlist RC {
;
switchlist : /* empty */ { $$ = NULL; }
- | word SEMI switchlist { $$ = linku1(nword($1, &@1), $3); }
- | word AT word SEMI switchlist {
+ | switchlist word SEMI { $$ = linku1($1,nword($2, &@2)); }
+ | switchlist word AT word SEMI {
char *x;
- if (asprintf(&x,"%s@%s", $1, $3) < 0) {
+ if (asprintf(&x,"%s@%s", $2, $4) < 0) {
ast_log(LOG_WARNING, "asprintf() failed\n");
$$ = NULL;
} else {
- free($1);
- free($3);
- $$ = linku1(nword(x, &@1), $5);
+ free($2);
+ free($4);
+ $$ = linku1($1,nword(x, &@2));
}
}
| error switchlist {$$=$2;}