[antlr-interest] ANTLR 3.0 question about common actions

Monty Zukowski monty at codetransform.com
Thu Jul 29 10:13:39 PDT 2004


On Jul 28, 2004, at 5:51 PM, Terence Parr wrote:

>> Currently you have an escape mechanism that says "this is all target
>> language, but pick out the tree stuff and $ stuff," and offers Ric the
>> opportunity to complain how ugly this is :)
>
> Yep, gross.
>
>> Inverting it might be appropriate.  How about "this is all standard
>> action language, but pick out special things and treat them as target
>> language?"  Think macros, real syntactic macros, not just text
>> substitution.
>
> Isn't that what we have now with $setType and #[...] that have to be
> parsed out?  Perhaps what we need as you are suggesting below is to
> have template references in code

Oops, yeah it is.

>
> lexer grammar(target="Java")
> ....
> NEWLINE : '\n' {if (some-condition) <skip()>;} ;

I like it.

Monty



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

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



More information about the antlr-interest mailing list