Made case requirements less strict (you can now have "control" as well as "Control") and added True/False grammar rules for parameters.
This commit is contained in:
parent
11e643f4b8
commit
483b8496d6
2 changed files with 13 additions and 1 deletions
|
@ -16,11 +16,21 @@ extern YYSTYPE yylval;
|
||||||
Options |
|
Options |
|
||||||
options return OPTIONS;
|
options return OPTIONS;
|
||||||
Mod1 |
|
Mod1 |
|
||||||
|
mod1 |
|
||||||
Mod2 |
|
Mod2 |
|
||||||
|
mod2 |
|
||||||
Mod3 |
|
Mod3 |
|
||||||
|
mod3 |
|
||||||
Mod4 |
|
Mod4 |
|
||||||
|
mod4 |
|
||||||
Control |
|
Control |
|
||||||
|
control |
|
||||||
|
shift |
|
||||||
Shift yylval = (int) strdup(yytext); return BINDING;
|
Shift yylval = (int) strdup(yytext); return BINDING;
|
||||||
|
true |
|
||||||
|
True yylval = (int) strdup(yytext); return TRUE;
|
||||||
|
false |
|
||||||
|
False yylval = (int) strdup(yytext); return FALSE;
|
||||||
[0-9]+ yylval = (int) strdup(yytext); return NUMBER;
|
[0-9]+ yylval = (int) strdup(yytext); return NUMBER;
|
||||||
\".+\" yylval = (int) strdup(yytext); return QUOTES;
|
\".+\" yylval = (int) strdup(yytext); return QUOTES;
|
||||||
[a-zA-Z_0-9]+ yylval = (int) strdup(yytext); return WORD;
|
[a-zA-Z_0-9]+ yylval = (int) strdup(yytext); return WORD;
|
||||||
|
|
|
@ -24,7 +24,7 @@ void yyerror(const char *c) {
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%token OBRACE EBRACE SEMICOLON DASH NUMBER QUOTES WORD BINDING OPTIONS
|
%token OBRACE EBRACE SEMICOLON DASH NUMBER QUOTES WORD BINDING OPTIONS TRUE FALSE
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
|
@ -86,6 +86,8 @@ parameter:
|
||||||
| NUMBER { ((parser*)parser_obj)->setArgumentNum($1); }
|
| NUMBER { ((parser*)parser_obj)->setArgumentNum($1); }
|
||||||
| DASH NUMBER { ((parser*)parser_obj)->setArgumentNegNum($2); }
|
| DASH NUMBER { ((parser*)parser_obj)->setArgumentNegNum($2); }
|
||||||
| QUOTES { ((parser*)parser_obj)->setArgumentStr($1); }
|
| QUOTES { ((parser*)parser_obj)->setArgumentStr($1); }
|
||||||
|
| TRUE { ((parser*)parser_obj)->setArgumentTrue($1); }
|
||||||
|
| FALSE { ((parser*)parser_obj)->setArgumentFalse($1); }
|
||||||
;
|
;
|
||||||
|
|
||||||
options_keyword:
|
options_keyword:
|
||||||
|
|
Loading…
Reference in a new issue