[antlr-interest] shorthand for sequence of same tokens, e.g., A A A A A A

Christian chwchw at gmx.de
Thu Dec 15 14:00:41 PST 2011


Hi again,

is there a way to abbreviate the definition of rule like the following?

Unicode_escape_sequence:
  | '\\u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT;

It would be great to say something like that:

Unicode_escape_sequence:
  | '\\u' HEX_DIGIT{4};

Regards,
Christian


More information about the antlr-interest mailing list