Closed nwhetsell closed 6 years ago
This particular grammar was copied from a paper/book to test against Jison and doesn't necessarily compile/work-as-expected.
This type of activity will happen more often, so Jison has been augmented to provide a slightly better error report:
$ node dist/cli-cjs.js --main examples/test-ll2-arrows-fail.jison
W:\Users\Ger\Projects\sites\library.visyond.gov\80\lib\tooling\jison\dist\cli-cjs.js:26664
throw err;
^
JisonParserError:
rule id should be followed by a colon instead of an arrow:
please adjust your grammar to use this format:
rule_id : terms { optional action code }
| terms { optional action code }
...
;
Erroneous area:
38: S → G;
^^....^
39:
40: G → P
at Object.parseError (...\jison\dist\cli-cjs.js:21184:15)
at Object.yyError (...\jison\dist\cli-cjs.js:21343:25)
at Object.parser__PerformAction (...\jison\dist\cli-cjs.js:19293:14)
at Object.parse (...\jison\dist\cli-cjs.js:22544:40)
at Object.parse (...\jison\dist\cli-cjs.js:25426:23)
at autodetectAndConvertToJSONformat (...\jison\dist\cli-cjs.js:26617:32)
at new Jison_Generator (...\jison\dist\cli-cjs.js:34893:15)
at Object.generateParserString (...\tooling\jison\dist\cli-cjs.js:35435:25)
at processInputFile (...\tooling\jison\dist\cli-cjs.js:35350:30)
at Object.cliMain [as main] (...\tooling\jison\dist\cli-cjs.js:35428:13)
Attempting to create a JavaScript file from examples/test-ll2-grammar-1.jison using Jison 0.4.18-180 results in:
(I made the file paths shorter for clarity’s sake.)