[antlr-interest] Problem with carriage returns in c# stringtemplate

Tech tech at swingkid.fsnet.co.uk
Sun Oct 23 06:08:37 PDT 2005


I have managed to fix this by using a subtemplate instead of a string or 
anonymous subtemplate, ie:

    newline() ::= "$\r$$\n$"

    program(statements) ::= <<
    class Wrapper$\r$
    {
        $statements; separator={$newline()$}$
    }
     >>

works, but

    program(statements) ::= <<
    class Wrapper$\r$
    {
        $statements; separator={$\r$$\n$}$
    }
     >>

does not. Also,

    program(statements) ::= <<
    class Wrapper$\r$
    {
        $statements; separator={
        }$
    }
     >>

works as well.

At least its working, but if anyone could explain what the problem is, 
it is always nice to know these things! :-)

Thanks,

Mark









-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.361 / Virus Database: 267.12.4/146 - Release Date: 21/10/2005




More information about the antlr-interest mailing list