Skip to content

ANTLR backend: Spurious escaping of single quotes in character sets #329

@kaby76

Description

@kaby76

I'm using BNF.cf and bnfc 2.8.4 to generate an Antlr4 grammar which I then strip and use for my extension in a language server. The generated lexer code is syntactically incorrect and not accepted by the Antlr 4.9 tool.

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

I'm not sure why this isn't accepted by the Antlr grammar, after all, EscAny is in Antlr4's lexer rule. I will investigate further. But I recommend removing the backslashes before the single and double-quotes.

Disregard if this is already fixed.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions