[antlr-interest] Unnecessary Java output file diffs

Terence Parr parrt at cs.usfca.edu
Wed May 20 13:05:44 PDT 2009


I'm not opposed to allowing things to alter the output template  
easily; I always envisioned this kind of thing, which is why I use  
@name-of-action rather than a keyword like members. So, you would do

@timestamp { <grammar.name>... }

  in the grammar file... I am pretty sure these automatically get  
stored in a hash table and templates could then ask for  
<actions.timestamp> or whatever. The dynamic binding and template  
mechanism of ST allows you to refer to attributes within the template  
you specify as you see above.

Give it a try. my guess is it will just work.
Ter
PS hooray for ST ;)

On May 20, 2009, at 12:56 PM, Sam Harwell wrote:

> "timestamp" works for the timestamp, but not for the line/column  
> numbers
> throughout. That is the type of option I'm referring to though.
>
> Would we make it two options, or find a name that means something for
> both items?
>
> Sam
>
> -----Original Message-----
> From: Jim Idle [mailto:jimi at temporal-wave.com]
> Sent: Wednesday, May 20, 2009 2:47 PM
> To: Terence Parr
> Cc: Sam Harwell; antlr-interest at antlr.org
> Subject: Re: [antlr-interest] Unnecessary Java output file diffs
>
> Terence Parr wrote:
>> All you have to do is alter the line in Java.stg template file.  We
>> could add an action variable like @members that fills in the version
>> template string.
>>
> Changing the template means they have to do it for every release  
> though,
>
> which is probably a pain. I like that latter idea actually, probably
> better than options { timestamp = false; } as then you can make it  
> hold
> whatever you like.
>
>
> Jim
>
>



More information about the antlr-interest mailing list