On Sep 4, 8:16 am, Emilian Bold <[email protected]> wrote:
> I asked about the same thing not long ago. If you ever find out  
> something more about this, please CC me.
>
> A grammar would help me because it would be a nice documentation of  
> the AST (ie. about the AST structure).
>
> --emi
>
> On Sep 4, 2009, at 12:04 PM, Johan Compagner wrote:
>
>
>
> > Hi,
>
> > at the dltk project we now have a grammar file for generating an AST  
> > tree
> > for formatting code (and later on for code completion and so on)
> > But the problem is now we have to completely be in sync with the AST  
> > of
> > rhino. for example we dont have the grammer currently for E4X
> > which we also would like to have (we just know how to skip it and  
> > see it as
> > 1 big node)
>
> > It would really great if rhino would have a grammar and use that  
> > also for
> > generating its internal AST stuff.
> > Then IDE's that want to build support for rhino scripting can then  
> > just take
> > that grammar and generate the stuff for there tooling to get
> > full support of what rhino handles.
>
> > Is there somewhere a grammar file that has full javascript version 1.7
> > support and E4X ?
>
> > johan
> > _______________________________________________
> > dev-tech-js-engine-rhino mailing list
> > [email protected]
> >https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

One of the goals of the new AST was to make it easier for people to
use the Rhino parser for doing things like you mention. But it sounds
like you also have your own parser. Did you consider using the Rhino
parser, or is that out of scope for what you're trying to do in the
dltk project?

And are you asking for a grammar in the sense of a LALR grammar that
can be used as input to a parser generator? We've always built a
custom lexer/parser in Rhino for a number of reasons (speed, handling
semicolon insertion, handling different versions of the language
within a single parser, etc.). The closest thing there is to a formal
grammar is the ECMA standard, either the old edition 3 or the new
edition 5.

--Norris
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to