[antlr-interest] ANTLR v4 planning stages

Terence Parr parrt at cs.usfca.edu
Tue Jan 19 12:55:08 PST 2010


yeah, I was wondering how we would integrate a generic language (NIL? neutral imperative language? chuckle) with the surrounding code in whatever language. Named method calls like this could work well.
Ter
On Jan 19, 2010, at 12:49 PM, Scott Stanchfield wrote:

> RE Language-agnostic actions - if you treat this as a strategy pattern
> (like I seem to recall you did in the antlr 2 code base) this could
> work really well. What would be really cool IMNSHO:
> 
>   grammar Foo;
>    foo : xxxxxx  {@doX(...); }  ;
>    fee : xxxxxx  {@doY(...); }  ;
> 
> and the generators could generate a spec/interface/abstract class for
> the action methods, like in Java:
> 
>  public interface FooActionStrategy {
>      void doX(...);
>      void doY(...);
>  }
> 
> and generate
> 
>   setActionStrategy(FooActionStrategy x) {...}
> 
> that would be used in the code. All that's needed is an implementation.
> 
> If all of the action code were simple action-strategy calls, this
> should be generatable in pretty much any target language. (Of course I
> haven't given this much thought, but it feels pretty good OTTOMH)
> 
> -- Scott
> 
> ----------------------------------------
> Scott Stanchfield
> http://javadude.com
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address



More information about the antlr-interest mailing list