How to get an AST from the Smacc Java parser

Anthony Hannan ajh18 at cornell.edu
Thu Dec 23 21:32:09 UTC 2004


Alexandre Bergel <bergel at iam.unibe.ch> wrote:
> The expression: 
> JavaParser parse: 'Some Java code'
> produces a collection of SmaCCToken. This is not an ast!
> Is there a way to get a tree from this collection?

I believe the collection is a tree. Is it a flat list or are there
nested collections? You have to add your own code next to the grammar
expressions if you want to create custom nodes. Check out the closure
compiler's SqueakParser for an example.

Cheers,
Anthony



More information about the Squeak-dev mailing list