[antlr-interest] StringTemplate

Liviu U liviu.u at gmail.com
Fri Mar 30 01:24:29 PDT 2007


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/539c636f/attachment.html 


More information about the antlr-interest mailing list