[prev in list] [next in list] [prev in thread] [next in thread]
List: stringtemplate-interest
Subject: [stringtemplate-interest] map syntax
From: Terence Parr <parrt () cs ! usfca ! edu>
Date: 2009-12-11 0:52:01
Message-ID: D2EC59AE-E700-40E4-A144-F9DAA7F920F0 () cs ! usfca ! edu
[Download RAW message or body]
Hi, wondering about syntax for applying template to an expr. To insert a template, \
we do
<template()>
to pass a single arg, we can do
<template(expr)>
Or, in v3, we can do
<expr:template()>
In v4, I was proposing no parens:
<expr:template>
but now I'm wondering if that's correct. I would like to be able to store a template \
into an attribute and then apply it.
foo(names, t={x | hi <x>}) ::= "<names:t>"
But that is what i use for when t is a literal template name not an attr. Perhaps we \
leave it as template() for the literal name.
I'm also adding syntax to evaluate an expression to get a template name like this:
<expr:(e)> convert e to a string template name and apply to expr
but maybe that should be:
<expr:(e)()>
Elsewhere I use <(e)()> syntax to eval e to a string and then invoke the template so \
it'd be more consistent.
<expr:template()>
<expr:attribute>
<expr:(expr)()>
<expr:{arg | ...}>
Any thoughts on syntax/semantics?
Ter
_______________________________________________
stringtemplate-interest mailing list
stringtemplate-interest@antlr.org
http://www.antlr.org/mailman/listinfo/stringtemplate-interest
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic