[antlr-interest] String Lexer Rule with strange limiters

lists at mainiero.de lists at mainiero.de
Tue May 22 03:38:44 PDT 2007


Hi,

i have the following lexer rule to detect strings:

LONGSTRING
	:	'['('=')*'[' ( EscapeSequence | ~('\\'|']') )* ']'('=')*']'
	;

How can i ensure that the number of = before and after the string are
the same.

For example:

[==[Hello World]==] would be ok
[[Hello World]=] won't

thanks, nicolai





More information about the antlr-interest mailing list