[antlr-interest] Stringtemplate : conditional expansion based on template type

Bill Andersen andersen at highfleet.com
Mon May 10 12:53:33 PDT 2010


Hi folks

I'd like to do something like the following with these template definitions

A() ::= <<
>>

B() ::= <<
>>

C(template_arg) ::= <<
// if value of template_arg is an instance of A
//    expand this way
// else if value of template_arg is an instance of B
//    expand some other way
>>

Question - is querying the type of a template passed as a parameter a legitimate predicate in an <if ...> construct?

	.bill

Bill Andersen 
Highfleet, Inc. (www.highfleet.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







More information about the antlr-interest mailing list