[stringtemplate-interest] File based templates and maps.

Caleb Lyness caleb.lyness at ezswitch.net
Mon Oct 23 13:35:51 PDT 2006


Chie Ng wrote:
>
> Hi, will this change in the future?   Meaning will we be able to use
> maps with file based templates?   Otherwise .stg will become a
> monolithic gigantic file that prevent reusability.  Or am I
> misunderstanding group files?  I have 5+ template files that represent
> components and 3 main template files that represent reports.  These
> report templates selectively load component templates.  If I have to
> add all files into one .stg and someone wants to change the format of
> a report, they would have to modify the .stg which is shared by
> everyone.  This seems bad to me.  Thanks.
Hi Chie,

I am no guru, but you probably want to come up with a way to extend your
group templates dynamically and then
have the users override the macro's they want to change - "inheritance"
type of thing. This is supported with
group template files and template files. Just need a bit more smarts in
the code using the template library.

Cheers
    Caleb
>
>
>
>
> *Terence Parr <parrt at cs.usfca.edu>*
> Sent by: stringtemplate-interest-bounces at antlr.org
>
> 10/18/2006 08:53 PM
>
> 	
> To
> 	StringTemplate <stringtemplate-interest at antlr.org>
> cc
> 	
> Subject
> 	Re: [stringtemplate-interest] File based templates and maps.
>
>
>
> 	
>
>
>
>
>
>
> On Oct 18, 2006, at 5:16 PM, Caleb Lyness wrote:
>
> > Hi,
> >
> > I have been trying to use a map for file based templates. So far no  
> > luck. Is this actually
> > possible or have I missed the point. I have tried too many  
> > combination to list them here, so
> > I just list the last thing I tried:
> >
> > hash map defined in reason.st:
> > ---
> > $[
> >   "1":"reason for 1",
> >   "2":"reason for 2",
> >   "D":"reason for D",
> >   default : "unknown reason"
> > ]$
> > ---
> >
> > Now this would make some sense, no?
>
> Hi, sorry.  Those maps only work in group file formats (.stg files).
>
> Terence
>
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org:8080/mailman/listinfo/stringtemplate-interest
>
>
>
> --
> This e-mail may contain confidential and/or privileged information. If
> you are not the intended recipient (or have received this e-mail in
> error) please notify the sender immediately and destroy this e-mail.
> Any unauthorized copying, disclosure or distribution of the material
> in this e-mail is strictly forbidden.
> ------------------------------------------------------------------------
>
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org:8080/mailman/listinfo/stringtemplate-interest
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org:8080/pipermail/stringtemplate-interest/attachments/20061023/fef24259/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3269 bytes
Desc: S/MIME Cryptographic Signature
Url : http://www.antlr.org:8080/pipermail/stringtemplate-interest/attachments/20061023/fef24259/attachment.bin 


More information about the stringtemplate-interest mailing list