[antlr-interest] [ST] Difference between <foo> and $foo$

Arnulf Heller aheller at gmx.at
Tue Mar 4 10:22:27 PST 2008


the delimiter is your choice and depends on the needs of your target language

XML for instance makes heavy use of angle brackets; that's why angle 
brackets are no good idea to separate string template code from the 
target language.

see the difference between
http://www.stringtemplate.org/doc/api/org/antlr/stringtemplate/language/AngleBracketTemplateLexer.html
and
http://www.stringtemplate.org/doc/api/org/antlr/stringtemplate/language/DefaultTemplateLexer.html


At 19:02 04.03.2008, Cristian Peraferrer wrote:
>Hi,
>
>I've found that in some places is used <foo> and in some others $foo$
>is used, let's see an example:
>
>xmlheader(v,e) ::= <<
>\<?xml version="<v>" encoding="<e>" ?\>
> >>
>
>and now the other way:
>
>xmlheader(v,e) ::= <<
>\<?xml version="$v$" encoding="$e$" ?\>
> >>
>
>So what's the difference? for what it is used each form?
>
>Regards,
>
>Cris.
>
>--
>GPG Key-ID: 0x564903FA - Jabber ID: corellian at swissjabber.ch



More information about the antlr-interest mailing list