IlegalStateException when I type unfinished code into a JEditorPane with syntax highlighting support
问题 Using ANTLR4 and the Netbeans Platform I have created a grammar for which I have implemented syntax highlighting in my Netbeans Platform application. Everything works fine up to the point when I try to alter my code. grammar MyRule; my_rule : '(' my_rule ')' | binary | binary_hyst | my_rule (AND my_rule)+ | my_rule (OR my_rule)+ ; binary : '(' binary ')' | unary (EQ | NE) unary ; binary_hyst : '(' binary_hyst ')' | unary hyst? ( GT | LT | GTE | LTE ) unary hyst? ; hyst : (HYST '(' unary ')');