[antlr-interest] What is $Symbols
Paul Keir
paul at paulkeir.com
Mon Jun 25 07:00:24 PDT 2007
$Symbols is a stack of 'Symbols_scope' objects. 'Symbols_scope' is
defined as a protected class within the antlr-generated *Parser.java code.
My problem is that as my class is defined in its own file (to permit
step-debugging), I have a problem informing it about 'Symbols_scope'.
i.e. If I add a 'Symbols_scope' cast to the my_method example from before...
public void my_method(Stack sym) {
for (Object depth : sym)
((Symbols_scope)depth).types.add("hello"); // e.g.
}
...I am of course told that 'Symbols_scope' symbol cannot be found. Can anyone help?
(my_method is called from within my grammar with 'o.my_method($Symbols);')
Many thanks,
Paul
More information about the antlr-interest
mailing list