we are still on Rhino 1.6R7
and we did try to use the rhino parser. But there are not enough hooks to
generate a real ast that is usable in eclipse
for example if you want to do formatting you have to have everything
specified completely, everything should be a node (if / do while / ect)

I dont know the exact internals but the people of xored (that build it for
us for the dltk javascript package) tried it with the internal rhino parser
but they said that was not really possible.

I know that the next release of 1.7 will have a complete new parser? I hope
that then it will be open and good enough to be useable in ide's

currently we this:

This ANTLR 3 LL(*) grammar is based on Ecma-262 3rd edition (JavaScript 1.5,
JScript 5.5).

johan


On Fri, Sep 4, 2009 at 22:46, Norris Boyd <[email protected]> wrote:

> 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
>
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to