kaby76 / AntlrVSIX

AntlrVSIX is a language server for use with Visual Studio 2019, Visual Studio Code, and Gnu Emacs to support Antlr, Bison, and W3C EBNF grammars. In addition to the IDE extensions provided here, a command-line tool is available to refactor grammars in order to make them cleaner, more readable, and more efficient.
https://marketplace.visualstudio.com/items?itemName=KenDomino.AntlrVSIX
MIT License
90 stars 13 forks source link

Parsing of Antlr4 grammars [\"] fails #119

Closed kaby76 closed 3 years ago

kaby76 commented 3 years ago

I just noticed that the parser fails for this kind of input in the lexer grammar:

STRINGTEXT : ~[\"\\] -> more;
CHARANY     :  ~[\'\\] -> more, mode(CHAREND);

An escape of single or double quotes should be okay (the Antlr4 tool accepts it), but it fails to parse. v8.2

kaby76 commented 3 years ago

Not a bug. It's wrong syntax.