问题
Given below is the code i written. I need to add the parserRulecontext that cause the syntax error when ever there is a error in the code. I am using the antlr4 as well.
if (tree instanceof TerminalNodeImpl) {
Token token = ((TerminalNodeImpl) tree).getSymbol();
map.put("line", token.getLine());
map.put("column", token.getCharPositionInLine());
map.put("type",JavaScriptLexer.VOCABULARY.getSymbolicName(token.getType()));
map.put("text", token.getText());
}
来源:https://stackoverflow.com/questions/57951251/adding-the-parserrulecontext-when-there-is-a-syntax-error-in-the-source-code