Home > Back-end >  Any meaning in the grouping parens in ANTLR
Any meaning in the grouping parens in ANTLR

Time:08-10

Are the following two rules the same in ANTLR4, or does using a parens give any additional grouping information or such, similar to a regex capturing group:

WS  : (' '|'\t'|'\r'|'\n')  -> skip;

WS  : [ \t\r\n]  -> skip;

CodePudding user response:

Those are synonymous. The latter is just a more concise syntax for the former.

  • Related