[antlr-interest] Shorthand notation for separated lists
finis at in.tum.de
Fri Jan 27 00:24:48 PST 2012
Am 26.01.2012 21:51, schrieb Gavin Lambert:
> At 04:47 27/01/2012, Jan Finis wrote:
> >(id ** ",") is automatically expanded to [ id ("," id)* ] and
> >(id ++ ",") is automatically expaned to id ("," id)*
> Actually, it would make more sense if (id ** COMMA) expanded to (id
> (COMMA id)*) and (id ++ COMMA) expanded to (id (COMMA id)+). You can
> already make the whole expression optional simply by putting a ? on
> the end.
> (And I don't know why you were using square brackets. They don't mean
> what you seem to think they do.)
sorry, got mixed up, of course I meant ()? instead of [ ]. It would just
be a shorthand notation for parsing separated lists of tokens.
More information about the antlr-interest