[antlr-interest] Can the C Target be used with String template?

Jim Idle jimi at temporal-wave.com
Wed Nov 18 09:06:24 PST 2009


StringTemplate is an object oriented system that relies on run time type information and so on. It does not work with C. You need to construct a small set of C functions that can accumulate strings, or use the builtin ANTLR3_STRING stuff that I provide (but make sure you understand it first so you don't use too much memory to achieve your ends - it is a convenience thing in the library and better to have your own specific things to suit your purpose). Avoid printf directly - best to build a buffer then do what you need to do with that.

Jim

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Heiko Folkerts
> Sent: Wednesday, November 18, 2009 2:20 AM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] Can the C Target be used with String
> template?
> 
> Hi,
> I'd like to write a translator as explained in the ANTLR book using the
> String Template Library. When I try to run antlr I get an error that
> the file "ST.stg" was not found. Changing the target language to jave
> e.g. results in other errors which propably come from erros in my
> grammar.
> 
> So, can the C Target be used together with the String template library?
> If not, are there alternatives beside print statements?
> Regards
> Heiko
> 
> 
> Mit freundlichem Gruß
> Heiko Folkerts
> Systementwicklung und -design
> --
> ______________________________________________
> DAVID GmbH · Wendenring 1 · 38114 Braunschweig
> Tel.: +49 531 24379-14
> Fax.: +49 531 24379-79
> E-Mail: mailto:Heiko.Folkerts at david-bs.de
> WWW:   http://www.david-bs.de
> Eintragung: Amtsgericht Braunschweig, HRB 3167
> Geschäftsführer: Frank Ptok
> ______________________________________________
> 
> 
> 
> 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