X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=util%2Fepist%2Fepist.y;h=243e416877c5ca8f268efd198c68b2bb00c9d02d;hb=f1b9e2168d8c1b03b0fcf0b6dd70aa46c513059d;hp=d956a4cabc02ce835d6b6f2b67610a18f22fa66a;hpb=bd05f7ec58f3e1f5839c372ad4fb007a8d8866f5;p=chaz%2Fopenbox diff --git a/util/epist/epist.y b/util/epist/epist.y index d956a4ca..243e4168 100644 --- a/util/epist/epist.y +++ b/util/epist/epist.y @@ -1,11 +1,18 @@ %{ +#ifdef HAVE_CONFIG_H +# include "../../config.h" +#endif // HAVE_CONFIG_H + #include #include #include "parser.hh" #define YYPARSE_PARAM parser_obj #define YYSTYPE char* - + +extern int yylineno; +extern char *yytext; + extern "C" { int yylex(); int yywrap() { @@ -13,14 +20,15 @@ extern "C" { } } -void yyerror(const char *c) { - printf("ERROR: %s\n", c); +void yyerror(const char *c) +{ + printf("ERROR: %s, on line %d, near %s\n", c, yylineno, yytext); } - %} -%token OBRACE EBRACE SEMICOLON DASH NUMBER QUOTES WORD BINDING OPTIONS +%token OBRACE EBRACE SEMICOLON DASH NUMBER QUOTES WORD BINDING OPTIONS TRUE FALSE +%expect 1 %% @@ -82,6 +90,8 @@ parameter: | NUMBER { ((parser*)parser_obj)->setArgumentNum($1); } | DASH NUMBER { ((parser*)parser_obj)->setArgumentNegNum($2); } | QUOTES { ((parser*)parser_obj)->setArgumentStr($1); } + | TRUE { ((parser*)parser_obj)->setArgumentTrue($1); } + | FALSE { ((parser*)parser_obj)->setArgumentFalse($1); } ; options_keyword: