[antlr-interest] Match token {n} times

Jonne Zutt jonne.zutt.ml at gmail.com
Sun Aug 28 06:20:34 PDT 2011


Dear all,

Is it possible with antlr to match a token exactly n times?
Something like the following:

ACCOUNT : NUMBER{8};

NUMBER	:	ZERO
	|	(NONZERO DIGIT*)
	;
ZERO	:	'0';
NONZERO	:	'1'..'9';
DIGIT	:	'0'..'9';

Thanks,
Jonne.


More information about the antlr-interest mailing list