summaryrefslogtreecommitdiffstats
path: root/grammar/rscript.y
diff options
context:
space:
mode:
Diffstat (limited to 'grammar/rscript.y')
-rw-r--r--grammar/rscript.y33
1 files changed, 25 insertions, 8 deletions
diff --git a/grammar/rscript.y b/grammar/rscript.y
index 6954d38d..5bd8f0f9 100644
--- a/grammar/rscript.y
+++ b/grammar/rscript.y
@@ -19,30 +19,47 @@
%token <objType> BEGINOBJ
%token ENDOBJ
%token <s> CFSYSLINE
+%token BEGIN_ACTION
+%token <s> LEGACY_ACTION
+%token <s> PRIFILT
+%token <s> PROPFILT
%type <nvlst> nv nvlst
%type <obj> obj
+%type <s> actlst
+%type <s> act
%%
- /* conf: | conf global | conf action*/
-conf:
+conf: /* empty (to end recursion) */
| obj conf
| cfsysline conf
+ | rule conf
-obj: BEGINOBJ nvlst ENDOBJ { printf("XXXX: global processed\n");
- $$ = cnfobjNew($1, $2);
+obj: BEGINOBJ nvlst ENDOBJ { $$ = cnfobjNew($1, $2);
cnfobjPrint($$);
cnfobjDestruct($$);
}
+obj: BEGIN_ACTION nvlst ENDOBJ { struct cnfobj *t = cnfobjNew(CNFOBJ_ACTION, $2);
+ cnfobjPrint(t);
+ cnfobjDestruct(t);
+ printf("XXXX: this is an new-style action!\n");
+ }
cfsysline: CFSYSLINE { printf("XXXX: processing CFSYSLINE: %s\n", $1);
}
nvlst: { $$ = NULL; }
- | nvlst nv { printf("XXXX: nvlst $1: %p, $2 %p\n", $1,$2);
- $2->next = $1;
- $$ = $2;
- }
+ | nvlst nv { $2->next = $1; $$ = $2; }
nv: NAME '=' VALUE { $$ = nvlstNew($1, $3); }
+rule: PRIFILT actlst { printf("PRIFILT: %s\n", $1); free($1); }
+ | PROPFILT actlst
+
+actlst: act { printf("action (end actlst) %s\n", $1);$$=$1; }
+ | actlst '&' act { printf("in actionlist %s\n", $3); }
+act: BEGIN_ACTION nvlst ENDOBJ { $$ = "obj"; }
+ | LEGACY_ACTION { printf("legacy action: '%s'\n", $1);
+ /*free($1);*/
+ $$ = $1;}
+
%%
int yyerror(char *s)
{