Greetings, I am trying to make a treewalker for my grammar in order to check if it contains nondeterminism. I would like to be able to set some properties for every node I encounter, so I figured it would be a good idea to use my own ASTLabelType.
I have set "ASTLabelType=GrooveTree" in my options, and my grammar uses this labeltype now, but I get the following exception when trying to use the checker: java.lang.ClassCastException: org.antlr.runtime.tree.CommonTree cannot be cast to groove.control.parse.GrooveTree at groove.control.parse.GCLDeterminismChecker.program(GCLDeterminismChecker.java:139) This line contains: root_0 = (GrooveTree)adaptor.nil(); and is part of the program() method. Somehow I think this is a beginner's error, but I cannot find the solution. I have tried to work around it by using the default ASTLabelType and keeping a Map<CommonTree,Boolean> to keep track of the property I would like, but this seems cumbersome. Could anyone point me in a good direction? Thanks! Olaf Keijsers List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
-- You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en.
