I just upgraded a project that was using the alpha version of ANTLR4 and matching an empty set worked fine. All that would happen was that ANTLR4 would throw a warning saying that it was matching and empty set.
Now using ANTLR language support 1.2.1 and parser generator 4.3.0 it now throws the error: "Error 1 '->' came as a complete surprise to me while matching a lexer rule" in both places I require it to match an empty set.
Some of the code it breaks on:
mode FILE_MODE;
ASCII: FASCII -> mode( PATH_MODE );
UTF8: FUTF8 -> mode( PATH_MODE );
UTF16: FUTF16 -> mode( PATH_MODE );
EMPTY_FILE_TYPE: -> skip, mode( PATH_MODE ); // Throws the error on this line
How does one now match an empty rule?
Terry