public String getInfoString() {
StringBuilder info = new StringBuilder();
Object payload = getPayload();
if(payload instanceof CommonToken) {
CommonToken t = (CommonToken)payload;
info.append("Type: ").append(grammar.getTokenDisplayName(t.getType())).append("\n");
info.append("Text: ").append(t.getText()).append("\n");
info.append("Line: ").append(t.getLine()).append("\n");
info.append("Char: ").append(t.getCharPositionInLine()).append("\n");
info.append("Channel: ").append(t.getChannel()).append("\n");
} else if(payload instanceof NoViableAltException) {
NoViableAltException e = (NoViableAltException)payload;
info.append("Description: ").append(e.grammarDecisionDescription).append("\n");
info.append("Descision: ").append(e.decisionNumber).append("\n");
info.append("State: ").append(e.stateNumber).append("\n");