[antlr-interest] Re: treewalker as interpreter

Terence Parr parrt at jguru.com
Mon Feb 25 09:32:31 PST 2002

On Monday, February 25, 2002, at 12:01  AM, marc_schellens wrote:

>> I would have a instruction "cracker" routine that basically figured
> out
>> what tree fits with the instruction.  Then I'd have just a list of
> these
>> suckers in the tree grammar (i.e., lots and lots of start rules).
> Then
>> I'd call them individually to parse/handle that kind of element.
>> Ter
> Thanks,
> but how to handle GOTO statements then?
> I.e. how to tell the tree walker to continue with a
> specific CommonAST subclass?

Well, the goto has to have a number or symbol target.  Your symbol table 
will point to the tree created for the target statement :)  Look it up 
and then jump :)

Chief Scientist & Co-founder, http://www.jguru.com
Creator, ANTLR Parser Generator: http://www.antlr.org


Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

More information about the antlr-interest mailing list