[antlr-interest] Tree grammar -> string template

Terence Parr parrt at cs.usfca.edu
Thu Jun 4 11:27:12 PDT 2009


howdy. you need to put in something like

foo : ^(TOK (x+=arg)+) ->pat(args={$x}) ;
Ter
On Jun 4, 2009, at 11:09 AM, Bill Andersen wrote:

> Folks,
>
> Sorry if this question is naive, but I'm at the end of my rope...
>
> I have a tree grammar with template output, a fragment of which looks
> like
>
> foo
> 	: ^(TOK arg+)
> 	  -> pat( args=... )
>
> and a string template pattern
>
> pat(args) ::= "function(<args; separator=", ">)"
>
> The question is, what should I write in the tree grammar in place of
> '...'?    Can't seem to glean this from the string template
> documentation
>
> Bill Andersen
> Ontology Works, Inc. (www.ontologyworks.com)
> 3600 O'Donnell Street, Suite 600
> Baltimore, MD 21224
> Office: +1.410.675.1201
> Cell: +1.443.858.6444
> Fax: +1.410.675.1204
>
>
>
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address



More information about the antlr-interest mailing list