public String toString() { GrammarAST decisionASTNode = probe.dfa.getDecisionASTNode(); line = decisionASTNode.getLine(); column = decisionASTNode.getColumn(); String fileName = probe.dfa.nfa.grammar.getFileName(); if ( fileName!=null ) { file = fileName; } StringTemplate st = getMessageTemplate(); String ruleName = probe.dfa.getNFADecisionStartState().enclosingRule.name; st.setAttribute("ruleName", ruleName); List sortedAlts = new ArrayList(); sortedAlts.addAll(altsWithRecursion); Collections.sort(sortedAlts); // make sure it's 1, 2, ... st.setAttribute("alts", sortedAlts); return super.toString(st); }
@Override public String toString() { GrammarAST decisionASTNode = probe.dfa.getDecisionASTNode(); line = decisionASTNode.getLine(); column = decisionASTNode.getCharPositionInLine(); String fileName = probe.dfa.nfa.grammar.getFileName(); if ( fileName!=null ) { file = fileName; } ST st = getMessageTemplate(); String ruleName = probe.dfa.getNFADecisionStartState().enclosingRule.name; st.add("ruleName", ruleName); List<Integer> sortedAlts = new ArrayList<Integer>(); sortedAlts.addAll(altsWithRecursion); Collections.sort(sortedAlts); // make sure it's 1, 2, ... st.add("alts", sortedAlts); return super.toString(st); }
public String toString() { GrammarAST decisionASTNode = probe.dfa.getDecisionASTNode(); line = decisionASTNode.getLine(); column = decisionASTNode.getColumn(); String fileName = probe.dfa.nfa.grammar.getFileName(); if ( fileName!=null ) { file = fileName; } StringTemplate st = getMessageTemplate(); String ruleName = probe.dfa.getNFADecisionStartState().enclosingRule.name; st.setAttribute("ruleName", ruleName); List sortedAlts = new ArrayList(); sortedAlts.addAll(altsWithRecursion); Collections.sort(sortedAlts); // make sure it's 1, 2, ... st.setAttribute("alts", sortedAlts); return super.toString(st); }
@Override public String toString() { GrammarAST decisionASTNode = probe.dfa.getDecisionASTNode(); line = decisionASTNode.getLine(); column = decisionASTNode.getCharPositionInLine(); String fileName = probe.dfa.nfa.grammar.getFileName(); if ( fileName!=null ) { file = fileName; } ST st = getMessageTemplate(); String ruleName = probe.dfa.getNFADecisionStartState().enclosingRule.name; st.add("ruleName", ruleName); List<Integer> sortedAlts = new ArrayList<Integer>(); sortedAlts.addAll(altsWithRecursion); Collections.sort(sortedAlts); // make sure it's 1, 2, ... st.add("alts", sortedAlts); return super.toString(st); }
private GrammarError buildUnreachableAltsError(GrammarUnreachableAltsMessage message) { GrammarError error = new GrammarError(); error.setLine(message.probe.dfa.getDecisionASTNode().getLine()-1); error.setMessageText("The following alternatives are unreachable: "+message.alts); error.setMessage(message); return error; }
public String toString() { GrammarAST decisionASTNode = probe.dfa.getDecisionASTNode(); line = decisionASTNode.getLine(); column = decisionASTNode.getColumn(); String fileName = probe.dfa.nfa.grammar.getFileName(); if ( fileName!=null ) { file = fileName; } List labels = probe.getSampleNonDeterministicInputSequence(problemState); String input = probe.getInputSequenceDisplay(labels); StringTemplate st = getMessageTemplate(); List alts = new ArrayList(); alts.addAll(problemState.getAltSet()); Collections.sort(alts); st.setAttribute("danglingAlts", alts); st.setAttribute("input", input); return super.toString(st); }
public String toString() { GrammarAST decisionASTNode = probe.dfa.getDecisionASTNode(); line = decisionASTNode.getLine(); column = decisionASTNode.getColumn(); String fileName = probe.dfa.nfa.grammar.getFileName(); if ( fileName!=null ) { file = fileName; } List labels = probe.getSampleNonDeterministicInputSequence(problemState); String input = probe.getInputSequenceDisplay(labels); StringTemplate st = getMessageTemplate(); List alts = new ArrayList(); alts.addAll(problemState.getAltSet()); Collections.sort(alts); st.setAttribute("danglingAlts", alts); st.setAttribute("input", input); return super.toString(st); }
@Override public String toString() { GrammarAST decisionASTNode = probe.dfa.getDecisionASTNode(); line = decisionASTNode.getLine(); column = decisionASTNode.getCharPositionInLine(); String fileName = probe.dfa.nfa.grammar.getFileName(); if ( fileName!=null ) { file = fileName; } List<Label> labels = probe.getSampleNonDeterministicInputSequence(problemState); String input = probe.getInputSequenceDisplay(labels); ST st = getMessageTemplate(); List<Integer> alts = new ArrayList<Integer>(); alts.addAll(problemState.getAltSet()); Collections.sort(alts); st.add("danglingAlts", alts); st.add("input", input); return super.toString(st); }
@Override public String toString() { GrammarAST decisionASTNode = probe.dfa.getDecisionASTNode(); line = decisionASTNode.getLine(); column = decisionASTNode.getCharPositionInLine(); String fileName = probe.dfa.nfa.grammar.getFileName(); if ( fileName!=null ) { file = fileName; } List<Label> labels = probe.getSampleNonDeterministicInputSequence(problemState); String input = probe.getInputSequenceDisplay(labels); ST st = getMessageTemplate(); List<Integer> alts = new ArrayList<Integer>(); alts.addAll(problemState.getAltSet()); Collections.sort(alts); st.add("danglingAlts", alts); st.add("input", input); return super.toString(st); }
private GrammarError buildNonRegularDecisionError(NonRegularDecisionMessage message) { GrammarError error = new GrammarError(); error.setLine(message.probe.dfa.getDecisionASTNode().getLine()-1); error.setMessageText(message.toString()); error.setMessage(message); return error; }
public String toString() { GrammarAST decisionASTNode = probe.dfa.getDecisionASTNode(); line = decisionASTNode.getLine(); column = decisionASTNode.getColumn(); String fileName = probe.dfa.nfa.grammar.getFileName(); if ( fileName!=null ) { file = fileName; } StringTemplate st = getMessageTemplate(); st.setAttribute("enclosingRule", probe.dfa.getNFADecisionStartState().enclosingRule.name); return super.toString(st); }
@Override public String toString() { GrammarAST decisionASTNode = probe.dfa.getDecisionASTNode(); line = decisionASTNode.getLine(); column = decisionASTNode.getCharPositionInLine(); String fileName = probe.dfa.nfa.grammar.getFileName(); if ( fileName!=null ) { file = fileName; } ST st = getMessageTemplate(); st.add("enclosingRule", probe.dfa.getNFADecisionStartState().enclosingRule.name); return super.toString(st); }
public String toString() { GrammarAST decisionASTNode = probe.dfa.getDecisionASTNode(); line = decisionASTNode.getLine(); column = decisionASTNode.getColumn(); String fileName = probe.dfa.nfa.grammar.getFileName(); if ( fileName!=null ) { file = fileName; } StringTemplate st = getMessageTemplate(); st.setAttribute("enclosingRule", probe.dfa.getNFADecisionStartState().enclosingRule.name); return super.toString(st); }
@Override public String toString() { GrammarAST decisionASTNode = probe.dfa.getDecisionASTNode(); line = decisionASTNode.getLine(); column = decisionASTNode.getCharPositionInLine(); String fileName = probe.dfa.nfa.grammar.getFileName(); if ( fileName!=null ) { file = fileName; } ST st = getMessageTemplate(); st.add("enclosingRule", probe.dfa.getNFADecisionStartState().enclosingRule.name); return super.toString(st); }
public String toString() { GrammarAST decisionASTNode = probe.dfa.getDecisionASTNode(); line = decisionASTNode.getLine(); column = decisionASTNode.getColumn(); String fileName = probe.dfa.nfa.grammar.getFileName(); if ( fileName!=null ) { file = fileName; } StringTemplate st = getMessageTemplate(); if ( probe.dfa.isTokensRuleDecision() ) { // alts are token rules, convert to the names instead of numbers for (int i = 0; i < alts.size(); i++) { Integer altI = (Integer) alts.get(i); String tokenName = probe.getTokenNameForTokensRuleAlt(altI.intValue()); // reset the line/col to the token definition NFAState ruleStart = probe.dfa.nfa.grammar.getRuleStartState(tokenName); line = ruleStart.associatedASTNode.getLine(); column = ruleStart.associatedASTNode.getColumn(); st.setAttribute("tokens", tokenName); } } else { // regular alt numbers, show the alts st.setAttribute("alts", alts); } return super.toString(st); }
private GrammarError buildNonDeterministicError(GrammarNonDeterminismMessage message) { GrammarError error = new GrammarError(); error.setLine(message.probe.dfa.getDecisionASTNode().getLine()-1); List labels = message.probe.getSampleNonDeterministicInputSequence(message.problemState); error.setLabels(labels); String input = message.probe.getInputSequenceDisplay(labels); error.setMessageText("Decision can match input such as \""+input+"\" using multiple alternatives"); error.setMessage(message); return error; }
@Override public String toString() { GrammarAST decisionASTNode = probe.dfa.getDecisionASTNode(); line = decisionASTNode.getLine(); column = decisionASTNode.getCharPositionInLine(); String fileName = probe.dfa.nfa.grammar.getFileName(); if ( fileName!=null ) { file = fileName; } ST st = getMessageTemplate(); st.add("targetRules", targetRules); st.add("alt", alt); st.add("callSiteStates", callSiteStates); List<Label> labels = probe.getSampleNonDeterministicInputSequence(sampleBadState); String input = probe.getInputSequenceDisplay(labels); st.add("input", input); return super.toString(st); }
public String toString() { GrammarAST decisionASTNode = probe.dfa.getDecisionASTNode(); line = decisionASTNode.getLine(); column = decisionASTNode.getColumn(); String fileName = probe.dfa.nfa.grammar.getFileName(); if ( fileName!=null ) { file = fileName; } StringTemplate st = getMessageTemplate(); st.setAttribute("targetRules", targetRules); st.setAttribute("alt", alt); st.setAttribute("callSiteStates", callSiteStates); List labels = probe.getSampleNonDeterministicInputSequence(sampleBadState); String input = probe.getInputSequenceDisplay(labels); st.setAttribute("input", input); return super.toString(st); }
public String toString() { GrammarAST decisionASTNode = probe.dfa.getDecisionASTNode(); line = decisionASTNode.getLine(); column = decisionASTNode.getColumn(); String fileName = probe.dfa.nfa.grammar.getFileName(); if ( fileName!=null ) { file = fileName; } StringTemplate st = getMessageTemplate(); st.setAttribute("targetRules", targetRules); st.setAttribute("alt", alt); st.setAttribute("callSiteStates", callSiteStates); List labels = probe.getSampleNonDeterministicInputSequence(sampleBadState); String input = probe.getInputSequenceDisplay(labels); st.setAttribute("input", input); return super.toString(st); }
@Override public String toString() { GrammarAST decisionASTNode = probe.dfa.getDecisionASTNode(); line = decisionASTNode.getLine(); column = decisionASTNode.getCharPositionInLine(); String fileName = probe.dfa.nfa.grammar.getFileName(); if ( fileName!=null ) { file = fileName; } ST st = getMessageTemplate(); st.add("targetRules", targetRules); st.add("alt", alt); st.add("callSiteStates", callSiteStates); List<Label> labels = probe.getSampleNonDeterministicInputSequence(sampleBadState); String input = probe.getInputSequenceDisplay(labels); st.add("input", input); return super.toString(st); }