[antlr-interest] philosophy about translation
Terence Parr
parrt at cs.usfca.edu
Wed Nov 1 13:26:52 PST 2006
On Nov 1, 2006, at 12:58 PM, Andy Tripp wrote:
>> You aren't. You need to generate int n=0 and n++ code so you
>> know what's up. ;)
>
> Or better yet, just call some sort of astNode.getChildCount()
> method while walking the AST :)
>
> So, to sum up...when I have
> ...( statement )+...
> Not only do I not want to have to figure out and then generate the
> "n-type-code" is that I need to
> embedd in the ANTLR-generated code, I don't even want to walk the
> tree and call astNode.getChildCount()!
Or, better yet:
statement+[4]
to match just 4. Better than using code. ;)
> Guess I'm just being difficult :)
Good on you! I'm always difficult ;)
Ter
More information about the antlr-interest
mailing list