[antlr-interest] philosophy about translation

Terence Parr parrt at cs.usfca.edu
Wed Nov 1 12:05:14 PST 2006


On Nov 1, 2006, at 11:45 AM, Andy Tripp wrote:
>> Try feeding Java code or an ANTLR grammar to a C++ compiler. ;-)
>>
> Of course you need to know the input syntax and symantics (a  
> little). That's different from
> knowing the details of what the tool is doing. When talking to Ter,  
> at one point I said
> "and how do I know how many times that pattern was matched?" and he  
> said "just check
> n < 4". How was I supposed to know that ANTLR generated some code  
> that included
> a variable called n?

You aren't.  You need to generate int n=0 and n++ code so you know  
what's up. ;)

Ter


More information about the antlr-interest mailing list