[antlr-interest] howto write stringtemplate for optional rule?

Oliver Kowalke oliver.kowalke at gmx.de
Fri Feb 22 02:18:22 PST 2008


Hello,
how can I express in the stringtemplate that DEILMETER is optional?

rule_x
	:
	rule_y( DELIMETER )?
	-> template(y={$rule_y.text},delim={$DELIMETER.text}) "<y><delim>"
	;

rule_y : /* ... some EBNF ... */ ;

best regards,
Oliver

-- 
Psst! Geheimtipp: Online Games kostenlos spielen bei den GMX Free Games! 
http://games.entertainment.web.de/de/entertainment/games/free


More information about the antlr-interest mailing list