Fix shift/reduce conflict in the sec lang grammar.

This commit is contained in:
Felipe Zimmerle 2015-10-01 17:36:18 -03:00
parent 941b9e75c4
commit 03eabd9c12

View File

@ -144,7 +144,6 @@ using ModSecurity::Variables::Variable;
PIPE PIPE
; ;
%left SPACE CONFIG_VALUE_RELEVANT_ONLY CONFIG_VALUE_ON CONFIG_VALUE_OFF
%token <std::string> QUOTATION_MARK %token <std::string> QUOTATION_MARK
%token <std::string> DIRECTIVE %token <std::string> DIRECTIVE
%token <std::string> CONFIG_DIR_REQ_BODY_LIMIT %token <std::string> CONFIG_DIR_REQ_BODY_LIMIT
@ -250,19 +249,20 @@ using ModSecurity::Variables::Variable;
%type <Action *> act %type <Action *> act
%type <std::vector<Action *> *> actings %type <std::vector<Action *> *> actings
%printer { yyoutput << $$; } <*>; %printer { yyoutput << $$; } <*>;
%% %%
%start input; %start input;
input: input:
%empty input line
| input line | line
| SPACE | SPACE
; ;
line: expression line: expression
| SPACE expression
| expression SPACE | expression SPACE
; ;
@ -352,6 +352,7 @@ actings:
} }
; ;
expression: expression:
audit_log audit_log
| DIRECTIVE SPACE variables SPACE OPERATOR SPACE actings | DIRECTIVE SPACE variables SPACE OPERATOR SPACE actings