Regards
Marcin
2011/10/12 Marcin Stefaniuk <marcin.s...@gmail.com>:
> I would like to present small DSL I've created as proof-of-concept.
> Using single PEG grammar I've defined a transforming parser and code
> editor with simple content completion. All built with excellent
> PEG.js.
>
> The language as its output gives metamodel for Concrete editor (http://
> concrete-editor.org/). You can check the demo on
> http://mstefaniuk.github.com/Concrete-Freetext/editor/index.html. Base
> implementation details are described on
> http://eutechne.stefaniuk.info/2011/10/dsl-editor-with-code-completion-in.html.
I looked only briefly, but it looks like a very nice project.
> I have few suggestion that can be taken into account in next versions
> of PEG.js.
> 1. To make grammar more readable maybe implementation can be
> optionally separated as in Mouse - Java PEG parser (http://
> www.romanredz.se/freesoft.htm). It gives possibility to use single
> grammar with pluggable parsing logic.
Please file an issue on GitHub. I'd really appreciate more specific
thoughts about how would you like this to work.
> 2. It would be more convenient to receive parser using constructor
> than via global variable. Constructor gives possibility to provide
> configuration object that can be used internally by parser.
> Configuration can be external model, resources or parsing settings.
Why wouldn't a configuration object passed to the "parse" method be sufficient?
> 3. To build a code completion I need to slighty modify generated
> parser to provide in error structure also expectations list (https://
> gist.github.com/1281239). Is it possible to add it in next version?
Sure, I'll reply to the mail with the patch you sent me later.
--
David Majda
Entropy fighter
http://majda.cz/
Would the ability to pass a configuration object to the "parse"
method (which would be visible in the parser) be a sufficient solution
for you?