views:

214

answers:

1

I'm a enthusiast AntlrWorks user. I built a very nice little DSL with it (and antlr of course) that lets me specify interesting data structures using a very simple english-like syntax. The next step is for me to help the user while they type and to do that I would like to have access to the parsing information in exactly the same way as AntlrWorks provides in a graphical form. Using the debugger, I have tried to see how I can achieve this using CommonTree, but the information I get there is only way too poor as there is no information on the successive transformation rules that a node has been recognized to match. I see there's a xmlSerialize method in BaseAST, but I don't understand how to get such an object as the CommonTree resulting from a parse does not let you access anything else than the CommonTree nodes it's made of.

A: 

Did you find a solution.I have the same problem too.

Thank's

Nikolz
AFAIK there's no other way than manually construct the tree in the production rules. AntlrWorks seems to be using a "debug" option which you can specify your parser to run with, but I doubt that's really meant to be used for production parsers.