EPEG.js
ePEG.js - Extended PEG.js for Node.js 4+
Install / Use
/learn @futagoza/EPEG.jsREADME
about ePEG.js
Originally intended to be a set of plugins for PEG.js itself, ePEG.js (Extended PEG.js) is now a extended rewrite of PEG.js made for Node.js v4 and above.
features
- [todo] Multi file glob support via command line:
epegjs [OPTIONS] <...files> - An optional location field returned with every AST of a ePEG.js (or PEG.js) grammar file
- [todo]
@import FILENAMEwill import all rules fromFILENAME, which can be a PEG.js or ePEG.js gammar file - [todo]
@import RULE = FILENAMEwill import the givenRULEonly from theFILENAMEgrammar - [todo] Template rules (
Sequence<T R> = (__ R __ T)*) to avoid repeated PEG.js grammar - [todo] Default arguments for templates (
EXPRESSIONorGROUP):ElementList<T S=','> = T Sequence<T S> - [todo] Spread operator to concat a sequence with only 2 expressions:
ArgumentList<T> = T ...Sequence<T ','> - [todo] Control of Repetition (
RULE = EXPRESSION+ / EXPRESSION*) using++RULEor--RULE(see 1) - [todo] AST generator for rules with labeled sequence's but no code blocks
- [todo] Sequence extraction using
@to return a single result from a sequence (see 2):Sequence<T R> = (__ R __ @T)* - [todo] Sequence selection using positive integer's as labels to return an array (no code blocks allowed)
- [todo] Attributes used by the ePEG.js compiler passes and generator to customize the generated parser
- [todo] Memoization attribute:
[memoization] RULE = EXPRESSION - [todo] Return type attribute for type-based languages:
[returns = 'Object<Any>'] RULE = EXPRESSION - [todo] Range based repetition:
RULE = RANGE|EXPRESSION, whereRANGEcan bemin..,min..max,..maxorexact - [todo] A language independent bytecode generator that can be used to build a parser in any language
- [todo] Class based and single function based JavaScript (ES5 or ES2015) parser generators
- https://github.com/pegjs/pegjs/issues/217#issuecomment-286595368
- https://github.com/pegjs/pegjs/issues/217#issuecomment-287097614
install
command line tool
npm install -g epeg.js
node.js module
npm install --save-dev epeg.js
development version
git clone https://github.com/futagoza/ePEG.js.git
cd ePEG.js
npm install
npm run build
license
Released under the MIT License, http://opensource.org/licenses/MIT.
PEG.js is developed by David Majda (@dmajda).
ePEG.js is developed by Futago-za Ryuu.
