I need to parse SRGS files written in ABNF format. I need to catch missing enclosing double quote character, ex:
public $sdsid300035= $<sdsid300101>s number "hee; // missing enclosing "
public $sdsid300036= $<sdsid300101>'s number "that's";
I've this lexer rule:
DOUBLE_QUOTED_CHARACTERS: '\"' ~(['\"'])*? '\"'
It matches valid input, like: "some text". But how to write a rule for detecting and throwing error for missing enclosing double quote character like in an example ?
Here is the link to implementation of this rule in ANTLR v3: ANTLR4 lexer rule with @init block