[antlr-interest] Difficulties compiling tree grammar using Antlr 3.1.1 using g++

Jim Idle jimi at temporal-wave.com
Thu Jan 29 10:33:27 PST 2009


Carter Cheng wrote:
> Oops I didnt see the buglist while surfing through the online materials. 
No problem - it was just an opportunity to remind people that JIRA is 
there. We are shortly going to make it easier to follow bugs too, so you 
can create an account and track bugs but cannot create or otherwise post 
things (as then you get 99% spambots :-().

> The problem was that with my tree parser apparently it was having difficulties at present negotiating certain constructs without backtracking on. 
>
> I guess I will try to fix this. I assume if each class of node has a unique root tag this wont be a problem?
>   

Yes - when you are in charge of the AST you should always construct an 
unambiguous one. Sometimes even though the tree is unambiguous you might 
up with a tree grammar that is because it is only looking at parts of 
the tree and so on. However that won't be a problem with a tree grammar 
that is traversing an otherwise unambiguous tree, assuming that your 
parser is debugged and always produces correct ASTs (even in error 
situations if you need an AST in that instance).

Basically you should not be getting errors in your tree parser as that 
would be a bug in your parser.

Jim


More information about the antlr-interest mailing list