more merge of common blocks through intermediate rules.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@23614 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
Luigi Rizzo 20 years ago
parent f4b05f86cc
commit 813f565de7

File diff suppressed because it is too large Load Diff

@ -117,11 +117,12 @@
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#line 53 "ael.y" #line 53 "ael.y"
typedef union YYSTYPE { typedef union YYSTYPE {
char *str; int intval; /* integer value, typically flags */
struct pval *pval; char *str; /* strings */
struct pval *pval; /* full objects */
} YYSTYPE; } YYSTYPE;
/* Line 1447 of yacc.c. */ /* Line 1447 of yacc.c. */
#line 125 "ael.tab.h" #line 126 "ael.tab.h"
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_TRIVIAL 1

@ -51,8 +51,9 @@ static char *ael_token_subst(char *mess);
%union { %union {
char *str; int intval; /* integer value, typically flags */
struct pval *pval; char *str; /* strings */
struct pval *pval; /* full objects */
} }
%{ %{
@ -117,6 +118,7 @@ static pval *update_last(pval *, YYLTYPE *);
/* XXX lr changes */ /* XXX lr changes */
%type <pval>opt_else %type <pval>opt_else
%type <pval>elements_block %type <pval>elements_block
%type <pval>switchlist_block
%type <str>opt_word %type <str>opt_word
%type <str>word_or_default %type <str>word_or_default
@ -126,6 +128,8 @@ static pval *update_last(pval *, YYLTYPE *);
%type <str>word3_list %type <str>word3_list
%type <str>includedname %type <str>includedname
%type <intval>opt_abstract
/* /*
* OPTIONS * OPTIONS
*/ */
@ -160,7 +164,7 @@ static pval *update_last(pval *, YYLTYPE *);
ignorepat element elements arglist global_statement ignorepat element elements arglist global_statement
global_statements globals macro context object objects global_statements globals macro context object objects
opt_else opt_else
elements_block elements_block switchlist_block
%destructor { free($$);} word word_list goto_word word3_list includedname opt_word word_or_default %destructor { free($$);} word word_list goto_word word3_list includedname opt_word word_or_default
@ -195,15 +199,16 @@ word_or_default : word { $$ = $1; }
| KW_DEFAULT { $$ = strdup("default"); } | KW_DEFAULT { $$ = strdup("default"); }
; ;
context : KW_CONTEXT word_or_default elements_block { context : opt_abstract KW_CONTEXT word_or_default elements_block {
$$ = npval2(PV_CONTEXT, &@1, &@3);
$$->u1.str = $2;
$$->u2.statements = $3; }
| KW_ABSTRACT KW_CONTEXT word_or_default elements_block {
$$ = npval2(PV_CONTEXT, &@1, &@4); $$ = npval2(PV_CONTEXT, &@1, &@4);
$$->u1.str = $3; $$->u1.str = $3;
$$->u2.statements = $4; $$->u2.statements = $4;
$$->u3.abstract = 1; } $$->u3.abstract = $1; }
;
/* optional "abstract" keyword */
opt_abstract: KW_ABSTRACT { $$ = 1; }
| /* nothing */ { $$ = 0; }
; ;
macro : KW_MACRO word LP arglist RP LC macro_statements RC { macro : KW_MACRO word LP arglist RP LC macro_statements RC {
@ -671,11 +676,13 @@ switches : KW_SWITCHES LC switchlist RC {
$$ = npval2(PV_SWITCHES, &@1, &@3); } $$ = npval2(PV_SWITCHES, &@1, &@3); }
; ;
eswitches : KW_ESWITCHES LC switchlist RC { eswitches : KW_ESWITCHES switchlist_block {
$$ = npval2(PV_ESWITCHES, &@1, &@4); $$ = npval2(PV_ESWITCHES, &@1, &@2);
$$->u1.list = $3; } $$->u1.list = $2; }
| KW_ESWITCHES LC RC { /* empty switch list OK */ ;
$$ = npval2(PV_ESWITCHES, &@1, &@3); } /* if there's nothing to declare, why include it? */
switchlist_block : LC switchlist RC { $$ = $2; }
| LC RC { $$ = NULL; }
; ;
switchlist : word SEMI { switchlist : word SEMI {

Loading…
Cancel
Save