jison
jison copied to clipboard
Using "constructor" as a literal causes a parse error
While I was testing Jison here, I found that Jison was unable to generate a parser from this simple grammar, since it contains the literal "constructor"
:
/* lexical grammar */
%lex
%%
\s+ /* skip whitespace */
"constructor" return 'constructor'
<<EOF>> return 'EOF'
. return 'INVALID'
/lex
/* operator associations and precedence */
%start expressions
%% /* language grammar */
expressions
: "constructor" EOF
{return "constructor";}
;
It works when I replace "constructor"
with "constructor1"
, but it can't generate a parser from the grammar above. Is this a bug?