4 Mar 2005 08:50
Re: [groovy-dev] groovy for IDEA custom language API
Jeremy, why not do as Zohar just says, and use Groovy's AST? Its got a visitor ready for you... On 2 Mar 2005, at 17:25, Jeremy Rayner wrote: >> Looking at the eclipse work and talking to Franck, I suggest there is >> no >> need to write any parser or lexer ( these are provided by groovy ) >> Just do as the eclipse code does and use the AST generated by the >> groovy >> compiler to generate the PSI . The groovy AST supports visitors >> which should make it simple to do.... > > Antlr supports tree-walkers, which provide more context than a simple > visitor > http://www.antlr.org/article/1100569809276/use.tree.grammars.tml > > The Studman grammar (which our groovy.g is based upon) also comes with > a java.tree.g, > http://www.antlr.org/grammar/1090713067533/index.html > > Loring Craymer has even suggested a way of automatically creating a > tree-walker > given a grammar file (i.e. groovy.g --autogen--> groovy.tree.g ) > (Loring: maybe we could get an early copy of this code) > > http://www.antlr.org/workshop/ANTLR2004/proceedings/ANTLRTrees.pdf > > I suggest we use the techniques above to create a groovy.tree.g, that > can be used as > a basis for creating PSI nodes. I'd love to help Dierk... > > jez. > -- > http://javanicus.com/blog2 > > James ------- http://radio.weblogs.com/0112098/
)
>
>
RSS Feed