summaryrefslogtreecommitdiffstats
path: root/grammar
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-10-01 18:52:58 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-10-01 18:52:58 +0200
commitfa541af5778a78e148d3e4a43da7f0d34513ed82 (patch)
treea9489dacbb41271188e8ab12961948646921b88c /grammar
parent81c8658769962dcc988734b23e354dfb1e54fcb0 (diff)
downloadrsyslog-fa541af5778a78e148d3e4a43da7f0d34513ed82.tar.gz
rsyslog-fa541af5778a78e148d3e4a43da7f0d34513ed82.tar.xz
rsyslog-fa541af5778a78e148d3e4a43da7f0d34513ed82.zip
implement "continue" RainerScript statement
Diffstat (limited to 'grammar')
-rw-r--r--grammar/grammar.y2
-rw-r--r--grammar/lexer.l1
-rw-r--r--grammar/rainerscript.c7
3 files changed, 9 insertions, 1 deletions
diff --git a/grammar/grammar.y b/grammar/grammar.y
index 61878554..343daaaa 100644
--- a/grammar/grammar.y
+++ b/grammar/grammar.y
@@ -68,6 +68,7 @@ extern int yyerror(char*);
%token STOP
%token SET
%token UNSET
+%token CONTINUE
%token <cnfstmt> CALL
%token <s> LEGACY_ACTION
%token <s> LEGACY_RULESET
@@ -161,6 +162,7 @@ stmt: actlst { $$ = $1; }
| PRIFILT block { $$ = cnfstmtNewPRIFILT($1, $2); }
| PROPFILT block { $$ = cnfstmtNewPROPFILT($1, $2); }
| CALL NAME { $$ = cnfstmtNewCall($2); }
+ | CONTINUE { $$ = cnfstmtNewContinue(); }
block: stmt { $$ = $1; }
| '{' script '}' { $$ = $2; }
actlst: s_act { $$ = $1; }
diff --git a/grammar/lexer.l b/grammar/lexer.l
index f45dbc2a..76b1298c 100644
--- a/grammar/lexer.l
+++ b/grammar/lexer.l
@@ -156,6 +156,7 @@ int fileno(FILE *stream);
"call" { BEGIN INCALL; return CALL; }
"set" { BEGIN EXPR; return SET; }
"unset" { BEGIN EXPR; return UNSET; }
+"continue" { return CONTINUE; }
/* line number support because the "preprocessor" combines lines and so needs
* to tell us the real source line.
*/
diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c
index a72b4155..7e75326c 100644
--- a/grammar/rainerscript.c
+++ b/grammar/rainerscript.c
@@ -2129,7 +2129,6 @@ struct cnfstmt *
cnfstmtNewCall(es_str_t *name)
{
struct cnfstmt* cnfstmt;
-dbgprintf("DDDD: got CALL\n");
if((cnfstmt = cnfstmtNew(S_CALL)) != NULL) {
cnfstmt->d.s_call.name = name;
}
@@ -2147,6 +2146,12 @@ cnfstmtNewUnset(char *var)
}
struct cnfstmt *
+cnfstmtNewContinue(void)
+{
+ return cnfstmtNew(S_NOP);
+}
+
+struct cnfstmt *
cnfstmtNewPRIFILT(char *prifilt, struct cnfstmt *t_then)
{
struct cnfstmt* cnfstmt;