[antlr-interest] StringTemplate

Micheal J open.zone at virgin.net
Fri Mar 30 02:56:23 PDT 2007


Hi,
 
Not sure I understand why you gave up on ANTLR3/C# since v3.0b5 still works
just fine.
 
As for your query (and this is better posted to the ST list btw),
$foreach$...$end$ is not valid ST syntax. See the user manual in your ST
distro (or the ST website or wiki).
 
Micheal

-----------------------
The best way to contact me is via the list/forum. My time is very limited. 

-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Liviu U
Sent: 30 March 2007 09:24
To: antlr-interest at antlr.org
Subject: [antlr-interest] StringTemplate


After giving up hope with ANTLR 3 I tried StringTemplate3.
 
This template:
 
using System;
using System.Data;
using System.Collections.Generic;
using DataExtensions;

public namespace $namespace$
{
 $foreach class in classes$
 public partial class $class$
 {
 }
 $end$ 
}


CODE:



StringTemplate template = new StringTemplate (Resources.ClassTemplate); 

I get an error output and template generation does not work:

action parse error line 0: template context is [anonymous]

IF I REMOTE THE FOREACH STATEMENT I DO NOT GET ANY ERROR AND TEMPLATE
GENERATION WORKS?

HAS ANYBODY GOT A CLUE?

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070330/b17e4007/attachment.html 


More information about the antlr-interest mailing list