Open mingodad opened 2 years ago
Going through the stack trace and adding this line here (dist/cli-cjs-es5.js:14994:19) :
if (!chk_g) {
try {
chk_g = ebnfParser.parse(grammar, options);
} catch (e) {
...
console.log(ebnfParser.bnf_parser.parser.__error_infos); ////!!!! inside here it's the line: 4465
throw err;
}
}
But probably there is a better way to show the offending line number.
Here is the original rule:
opt_existing_window_name:
ColId { $opt_existing_window_name = $ColId; }
| /*EMPTY*/ %prec Op { $opt_existing_window_name = NULL; }
;
And here the naked rule:
opt_existing_window_name :
ColId
| %prec Op /*14L*/ /*empty*/
;
Somehow byacc/bison manage to associate precedence to empty rules.
I'm testing
jison
with a naked postgresql-13.3 grammar generated by a modifedbison
(see https://github.com/mingodad/lalr-parser-test) the naked grammar is parsed properly bybison
andbyacc
see attached grammar gram.y.naked.zipThe output: