Hi,
2013/2/6 <
ek.s...@gmail.com>:
> Hi,
> I wanted to specify a grammar, call pegjs.buildParser and then access the AST corresponding to the grammer to, say create programs following the grammar.
>
> Do you think pegjs allows me to do that?
PEG.js exports its grammar parser in the "parser" property. Just do:
var ast = PEG.parser.parse(input);
and you'll have the AST in hand.
--
David Majda
Entropy fighter
http://majda.cz/