Search in sources :

Example 16 with NFAState

use of org.antlr.analysis.NFAState in project antlrworks by antlr.

the class ANTLRGrammarEngineImpl method computeRuleError.

private void computeRuleError(GrammarError error, NonRegularDecisionMessage message) {
    NFAState state = message.probe.dfa.getNFADecisionStartState();
    for (Object alt : message.altsWithRecursion) {
        // Use currently the unreachable alt for display purpose only
        error.addUnreachableAlt(state, (Integer) alt);
        error.addStates(state);
        error.addRule(state.enclosingRule.name);
    }
}
Also used : NFAState(org.antlr.analysis.NFAState)

Example 17 with NFAState

use of org.antlr.analysis.NFAState in project antlrworks by antlr.

the class ANTLRGrammarEngineImpl method computeRuleError.

private void computeRuleError(GrammarError error, GrammarUnreachableAltsMessage message) {
    NFAState state = message.probe.dfa.getNFADecisionStartState();
    for (Object alt : message.alts) {
        error.addUnreachableAlt(state, (Integer) alt);
        error.addStates(state);
        error.addRule(state.enclosingRule.name);
    }
}
Also used : NFAState(org.antlr.analysis.NFAState)

Aggregations

NFAState (org.antlr.analysis.NFAState)17 ArrayList (java.util.ArrayList)5 RuleClosureTransition (org.antlr.analysis.RuleClosureTransition)4 Transition (org.antlr.analysis.Transition)3 FAState (org.antlr.works.visualization.fa.FAState)3 FATransition (org.antlr.works.visualization.fa.FATransition)3 List (java.util.List)2 DFA (org.antlr.analysis.DFA)2 Grammar (org.antlr.tool.Grammar)2 Rule (org.antlr.tool.Rule)2 FAFactory (org.antlr.works.visualization.fa.FAFactory)2 GGraph (org.antlr.works.visualization.graphics.graph.GGraph)2 Set (java.util.Set)1 DOTGenerator (org.antlr.tool.DOTGenerator)1 ANTLRGrammarEngine (org.antlr.works.grammar.antlr.ANTLRGrammarEngine)1 GGraphGroup (org.antlr.works.visualization.graphics.graph.GGraphGroup)1 GPath (org.antlr.works.visualization.graphics.path.GPath)1 GPathElement (org.antlr.works.visualization.graphics.path.GPathElement)1 GNode (org.antlr.works.visualization.graphics.shape.GNode)1