As a foreword, ANTLR 4 would not behave in a strange manner here. Both ANTLR 3 and ANTLR 4 should be matching ALPHANUM
, then giving 2 syntax errors, then matching another ALPHANUM
, and I can state with confidence that ANTLR 4 will behave that way.
- It looks like your
HOST
rule might be better suited to behost
, a parser rule. - You need to make sure and provide a lexer rule that can match
.
(either together or as two separate tokens).