[stringtemplate-interest] File based templates and maps
Caleb Lyness
caleb.lyness at ezswitch.net
Thu Oct 19 16:10:35 PDT 2006
Terence Parr wrote:
> try now...a spammer created 100 spam users. :(
Sorted.
-----
Here is another problem I ran into while playing with maps:
If the map has a number in the key you can't reference it directly.
E.g.
The map is defined as:
collectionFailure ::= [
"1": "Revoked",
"2": "Other",
"A": "Settled",
"B": "Frozen",
default: "Unknown"
]
If a tempate .st file refers to the map directly
$collectionFailure.1$ - it fails (see below)
$collectionFailure.A$ - works
but if I use $collectionFailure.(reasonCode)$
then Bobs your uncle it can be 1 or A...
action parse error in group base templates line 0; template context is
[bodies/example1]
line 1:19: unexpected token: 1
at
org.antlr.stringtemplate.language.ActionParser.primaryExpr(ActionParser.java:703)
at
org.antlr.stringtemplate.language.ActionParser.expr(ActionParser.java:430)
at
org.antlr.stringtemplate.language.ActionParser.templatesExpr(ActionParser.java:212)
at
org.antlr.stringtemplate.language.ActionParser.action(ActionParser.java:126)
> Ter
>
> On Oct 19, 2006, at 10:39 AM, Caleb Lyness wrote:
>
>>>> I think it would be nice for future newbies if there was an example
>>>> along side the file based template (.st) method in the source.
>>>> Would speed the learning curve up a bit. cf:
>>>> src\org\antlr\stringtemplate\test.
>>> Add a quick tutorial :) http://www.antlr.org/wiki/display/ST/Tutorials
>> Pitty, I cannot:
>> I don't have a login and I can't create one.
>>
>> The following error(s) occurred:
>> This installation of Confluence is not licensed to add any more
>> users. Please contact the site administrators for more information.
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org:8080/pipermail/stringtemplate-interest/attachments/20061020/7935725a/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3269 bytes
Desc: S/MIME Cryptographic Signature
Url : http://www.antlr.org:8080/pipermail/stringtemplate-interest/attachments/20061020/7935725a/attachment.bin
More information about the stringtemplate-interest
mailing list