diff options
Diffstat (limited to 'grammar')
-rw-r--r-- | grammar/grammar.y | 2 | ||||
-rw-r--r-- | grammar/lexer.l | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/grammar/grammar.y b/grammar/grammar.y index 65793fb1..f455a21f 100644 --- a/grammar/grammar.y +++ b/grammar/grammar.y @@ -66,6 +66,7 @@ extern int yyerror(char*); %token BEGIN_TPL %token STOP %token <s> LEGACY_ACTION +%token <s> LEGACY_RULESET %token <s> PRIFILT %token <s> PROPFILT %token <s> BSD_TAG_SELECTOR @@ -123,6 +124,7 @@ extern int yyerror(char*); conf: /* empty (to end recursion) */ | conf obj { cnfDoObj($2); } | conf stmt { cnfDoScript($2); } + | conf LEGACY_RULESET { cnfDoCfsysline($2); } | conf BSD_TAG_SELECTOR { cnfDoBSDTag($2); } | conf BSD_HOST_SELECTOR { cnfDoBSDHost($2); } obj: BEGINOBJ nvlst ENDOBJ { $$ = cnfobjNew($1, $2); } diff --git a/grammar/lexer.l b/grammar/lexer.l index c52e5a01..14e95e81 100644 --- a/grammar/lexer.l +++ b/grammar/lexer.l @@ -137,8 +137,8 @@ int fileno(FILE *stream); /* line number support because the "preprocessor" combines lines and so needs * to tell us the real source line. */ -"stop" { dbgprintf("STOP\n"); return STOP; } -"else" { dbgprintf("STOP\n"); return ELSE; } +"stop" { return STOP; } +"else" { return ELSE; } "preprocfilelinenumber(" { BEGIN LINENO; } <LINENO>[0-9]+ { yylineno = atoi(yytext) - 1; } <LINENO>")" { BEGIN INITIAL; } @@ -191,6 +191,9 @@ int fileno(FILE *stream); if(!strncasecmp(yytext, "$includeconfig ", 14)) { yyless(14); BEGIN INCL; + } else if(!strncasecmp(yytext, "$ruleset ", 8)) { + yylval.s = strdup(yytext); + return LEGACY_RULESET; } else { cnfDoCfsysline(strdup(yytext)); } |