[antlr-interest] philosophy about translation

Sohail Somani sohail at taggedtype.net
Sat Oct 7 19:26:36 PDT 2006


On Sat, 2006-10-07 at 13:40 -0400, Andy Tripp wrote:
> The getContainingFunction() method is real. 
> It looks backwards
> (while balancing matching braces) for something that looks like a 
> function declaration: a "{"
> preceeded by a ")", with a matching "(" that's preceeded by an ID.
> 
> Crazy, I know :)

Yikes! For me its something like:

functionDefn : <function_defn_syntax>
{setCurrentFunction(function_name);}

Why you need to parse the thing umpteen times, I don't know, but you
might have a valid reason!

Sohail



More information about the antlr-interest mailing list