[stringtemplate-interest] [ST4] Specifying delimiter in group files

Udo Borkowski ub at abego-software.de
Wed Jan 26 02:19:48 PST 2011


Hi,

I am currently using different sets of delimiter in different group files (e.g. '$','$' vs. '<','>'). Depending on this I need to make sure the STGroup is create with the proper delimiter.

What do you think of making it more explicit in the group file, what delimiter it uses?

This may be achieved with a new (optional) syntax element in the group grammar, defining the delimiter for this file. It may look like:

delimiter
	: 'delimiter' s=STRING e=STRING {
				//TODO: check if s and e have length 1, or better: use CHAR token
				group.delimiterStartChar=$s.charAt(0);
				group.delimiterEndChar=$e.charAt(0);
			}

(Code not tested)

This statement would overwrite the previous delimiter setting in the group.

The delimiter statement need to be speficied before the first def element.



Udo


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/stringtemplate-interest/attachments/20110126/440b2779/attachment.html 


More information about the stringtemplate-interest mailing list