zaach / ebnf-parser Goto Github PK
View Code? Open in Web Editor NEWA parser for BNF and EBNF grammars used by jison
A parser for BNF and EBNF grammars used by jison
I noticed that lex-parser
allows leading underscores in names, but ebnf-parser doesn't. Is it intentional that nonterminal names shouldn't be able have leading underscores?
Would you please create a license file with your copyright information and the full text of the MIT license? The legal language in the MIT license requires that the text of the license accompany the source code.
Hey @cdibbs, I'm getting tests failures on the new feature. Were these passing for you? Are you using jison 0.4.10?
test named group ()
⚡ Error: Parse error on line 1:
one, two
^
Expecting 'word[alice]', got 'word'
at typal_constructor.parseError (/Users/zcarter/repos/ebnf-parser/node_modules/jison/lib/jison.js:1185:15)
at typal_constructor.parse (/Users/zcarter/repos/ebnf-parser/node_modules/jison/lib/jison.js:1301:22)
at /Users/zcarter/repos/ebnf-parser/tests/ebnf.js:62:39
at test (/Users/zcarter/repos/ebnf-parser/node_modules/test/test.js:29:20)
at next (/Users/zcarter/repos/ebnf-parser/node_modules/test/test.js:69:7)
at Object.end (/Users/zcarter/repos/ebnf-parser/node_modules/test/test.js:25:7)
at test (/Users/zcarter/repos/ebnf-parser/node_modules/test/test.js:41:28)
at next (/Users/zcarter/repos/ebnf-parser/node_modules/test/test.js:69:7)
at Object.end (/Users/zcarter/repos/ebnf-parser/node_modules/test/test.js:25:7)
at test (/Users/zcarter/repos/ebnf-parser/node_modules/test/test.js:41:28)
test named option (?)
⚡ Error: Parse error on line 1:
oneor two
^
Expecting 'word[alex]', got 'word'
at typal_constructor.parseError (/Users/zcarter/repos/ebnf-parser/node_modules/jison/lib/jison.js:1185:15)
at typal_constructor.parse (/Users/zcarter/repos/ebnf-parser/node_modules/jison/lib/jison.js:1301:22)
at /Users/zcarter/repos/ebnf-parser/tests/ebnf.js:62:39
at test (/Users/zcarter/repos/ebnf-parser/node_modules/test/test.js:29:20)
at next (/Users/zcarter/repos/ebnf-parser/node_modules/test/test.js:69:7)
at Object.end (/Users/zcarter/repos/ebnf-parser/node_modules/test/test.js:25:7)
at test (/Users/zcarter/repos/ebnf-parser/node_modules/test/test.js:46:14)
at next (/Users/zcarter/repos/ebnf-parser/node_modules/test/test.js:69:7)
at Object.end (/Users/zcarter/repos/ebnf-parser/node_modules/test/test.js:25:7)
at test (/Users/zcarter/repos/ebnf-parser/node_modules/test/test.js:41:28)
test named complex expression (())
⚡ Error: Parse error on line 1:
one two three four,
^
Expecting 'word[alpha]', got 'word'
at typal_constructor.parseError (/Users/zcarter/repos/ebnf-parser/node_modules/jison/lib/jison.js:1185:15)
at typal_constructor.parse (/Users/zcarter/repos/ebnf-parser/node_modules/jison/lib/jison.js:1301:22)
at /Users/zcarter/repos/ebnf-parser/tests/ebnf.js:62:39
at test (/Users/zcarter/repos/ebnf-parser/node_modules/test/test.js:29:20)
at next (/Users/zcarter/repos/ebnf-parser/node_modules/test/test.js:69:7)
at Object.end (/Users/zcarter/repos/ebnf-parser/node_modules/test/test.js:25:7)
at test (/Users/zcarter/repos/ebnf-parser/node_modules/test/test.js:46:14)
at next (/Users/zcarter/repos/ebnf-parser/node_modules/test/test.js:69:7)
at Object.end (/Users/zcarter/repos/ebnf-parser/node_modules/test/test.js:25:7)
at test (/Users/zcarter/repos/ebnf-parser/node_modules/test/test.js:46:14)
lex-parser
should be declared as a dependency instead of a devDependency in package.json
.
Since lex-parser
is currently declared as a devDependency, it's not being installed when I run npm install --save ebnf-parser
.
Consequently, I am getting the following error when I require("ebnf-parser")
in my code:
Error: Cannot find module 'lex-parser'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
at Function.Module._load (internal/modules/cjs/loader.js:529:25)
at Module.require (internal/modules/cjs/loader.js:657:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/Users/kyle/tyson/node_modules/ebnf-parser/ebnf-parser.js:3:16)
at Module._compile (internal/modules/cjs/loader.js:721:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
Declare lex-parser
as a dependency instead of a devDependency in package.json
.
Currently there is no tags in this repo. Adding tags help those who want to use the github repo directly like debian, rather than via npm.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.