Uses of Class
org.antlr.analysis.DFAState
Packages that use DFAState
-
Uses of DFAState in org.antlr.analysis
Fields in org.antlr.analysis declared as DFAStateModifier and TypeFieldDescriptionprotected DFAState[]
DFA.altToAcceptState
We only want one accept state per predicted alt; track hereAnalysisRecursionOverflowException.ovfState
DFA.startState
What's the start state for this DFA?Fields in org.antlr.analysis with type parameters of type DFAStateModifier and TypeFieldDescriptionDecisionProbe.danglingStates
The set of states w/o emanating edges and w/o resolving sem preds.DFA.specialStates
List of special DFAState objectsDFA.states
Maps the state number to the actual DFAState.DecisionProbe.statesResolvedWithSemanticPredicatesSet
Was a syntactic ambiguity resolved with predicates? Any DFA state that predicts more than one alternative, must be resolved with predicates or it should be reported to the user.DecisionProbe.statesWithSyntacticallyAmbiguousAltsSet
Track all DFA states with nondeterministic alternatives.protected Map
<DFAState, Map<Integer, SemanticContext>> DecisionProbe.stateToAltSetWithSemanticPredicatesMap
Track the predicates for each alt per DFA state; more than one DFA state might have syntactically ambig alt prediction.DecisionProbe.stateToIncompletelyCoveredAltsMap
Tracks alts insufficiently covered.DecisionProbe.stateToSyntacticallyAmbiguousTokensRuleAltsMap
Track just like stateToSyntacticallyAmbiguousAltsMap, but only for nondeterminisms that arise in the Tokens rule such as keyword vs ID rule.DFA.uniqueStates
A set of all uniquely-numbered DFA states.DFA.uniqueStates
A set of all uniquely-numbered DFA states.NFAToDFAConverter.work
A list of DFA states we still need to process during NFA conversionMethods in org.antlr.analysis that return DFAStateModifier and TypeMethodDescriptionprotected DFAState
NFAToDFAConverter.addDFAStateToWorkList
(DFAState d) Add a new DFA state to the DFA if not already present.protected DFAState
Add a new DFA state to this DFA if not already present.protected DFAState
NFAToDFAConverter.computeStartState()
From this first NFA state of a decision, create a DFA.protected DFAState
NFAToDFAConverter.convertToAcceptState
(DFAState d, int alt) DFA.getAcceptState
(int alt) DFA.getState
(int stateNumber) DFA.newState()
Given the set of NFA states in DFA state d, find all NFA states reachable traversing label arcs.Methods in org.antlr.analysis that return types with arguments of type DFAStateModifier and TypeMethodDescriptionMachineProbe.getAnyDFAPathToTarget
(DFAState targetState) MachineProbe.getAnyDFAPathToTarget
(DFAState startState, DFAState targetState, Set<DFAState> visited) DecisionProbe.getDanglingStates()
return set of states w/o emanating edges and w/o resolving sem preds.DecisionProbe.getDFAPathStatesToTarget
(DFAState targetState) DecisionProbe.getDFAStatesWithSyntacticallyAmbiguousAlts()
Return all DFA states in this DFA that have NFA configurations that conflict.DecisionProbe.getNondeterministicStatesResolvedWithSemanticPredicate()
DFA.getUniqueStates()
DFA.getUniqueStates()
Methods in org.antlr.analysis with parameters of type DFAStateModifier and TypeMethodDescription(package private) int
DFA._getMaxLookaheadDepth
(DFAState d, int depth) (package private) boolean
(package private) boolean
DFA._hasSemPred
(DFAState d, Set<DFAState> busy) (package private) boolean
DFA._hasSynPred
(DFAState d, Set<DFAState> busy) protected DFAState
NFAToDFAConverter.addDFAStateToWorkList
(DFAState d) Add a new DFA state to the DFA if not already present.protected void
NFAToDFAConverter.addPredicateTransitions
(DFAState d) for each NFA config in d, look for "predicate required" sign set during nondeterminism resolution.protected DFAState
Add a new DFA state to this DFA if not already present.int
DFAState.addTransition
(DFAState target, Label label) Add a transition from this state to target with label.protected static int
NFAToDFAConverter.addTransition
(DFAState d, Label label, DFAState targetState, Map<Integer, Transition> targetToLabelMap) Add a transition from state d to targetState with label in normal case.void
For all NFA states (configurations) merged in d, compute the epsilon closure; that is, find all NFA states reachable from the NFA states in d via purely epsilon transitions.void
NFAToDFAConverter.closure
(NFAState p, int alt, NFAContext context, SemanticContext semanticContext, DFAState d, boolean collectPredicates) Where can we get from NFA state p traversing only epsilon transitions? Add new NFA states + context to DFA state d.static boolean
NFAToDFAConverter.closureIsBusy
(DFAState d, NFAConfiguration proposedNFAConfiguration) A closure operation should abort if that computation has already been done or a computation with a conflicting context has already been done.protected DFAState
NFAToDFAConverter.convertToAcceptState
(DFAState d, int alt) protected void
NFAToDFAConverter.convertToEOTAcceptState
(DFAState d) Walk the configurations of this DFA state d looking for the configuration, c, that has a transition on EOT.protected void
DFA.createEOTAndEOFTables
(DFAState s) Set up the EOT and EOF tables; we cannot put -1 min/max values so we need another way to test that in the DFA transition function.protected void
DFA.createMinMaxTables
(DFAState s) protected void
DFA.createSpecialTable
(DFAState s) protected void
protected boolean
figure out if this state eventually reaches an accept state and modify the instance variable 'reduced' to indicate if we find at least one state that cannot reach an accept state.protected void
NFAToDFAConverter.findNewDFAStatesAndAddDFATransitions
(DFAState d) From this node, add a d--a-->t transition for all labels 'a' where t is a DFA node created from the set of NFA states reachable from any NFA state in DFA state d.MachineProbe.getAnyDFAPathToTarget
(DFAState targetState) MachineProbe.getAnyDFAPathToTarget
(DFAState startState, DFAState targetState, Set<DFAState> visited) DecisionProbe.getDFAPathStatesToTarget
(DFAState targetState) DecisionProbe.getDisabledAlternatives
(DFAState d) Which alts were specifically turned off to resolve nondeterminisms? This is different than the unreachable alts.MachineProbe.getEdgeLabels
(DFAState targetState) Return a list of edge labels from start state to targetState.DecisionProbe.getIncompletelyCoveredAlts
(DFAState d) Return a list of alts whose predicate context was insufficient to resolve a nondeterminism for state d.DecisionProbe.getNonDeterministicAltsForState
(DFAState targetState) Return the sorted list of alts that conflict within a single state.protected Map
<Integer, SemanticContext> NFAToDFAConverter.getPredicatesPerNonDeterministicAlt
(DFAState d, Set<Integer> nondeterministicAlts) Return a mapping from nondeterministc alt to combined list of predicates.DecisionProbe.getSampleNonDeterministicInputSequence
(DFAState targetState) Return a List<Label> indicating an input sequence that can be matched from the start state of the DFA to the targetState (which is known to have a problem).DecisionProbe.getSemanticContextForAlt
(DFAState d, int alt) Each state in the DFA represents a different input sequence for an alt of the decision.protected void
DFAOptimizer.optimizeEOTBranches
(DFAState d) protected void
DFAOptimizer.optimizeExitBranches
(DFAState d) Given the set of NFA states in DFA state d, find all NFA states reachable traversing label arcs.protected boolean
DecisionProbe.reachesState
(DFAState startState, DFAState targetState, Set<DFAState> states) Given a start state and a target state, return true if start can reach target state.void
DecisionProbe.removeRecursiveOverflowState
(DFAState d) If a recursion overflow is resolve with predicates, then we need to shut off the warning that would be generated.void
DFA.removeState
(DFAState d) void
DecisionProbe.reportAltPredicateContext
(DFAState d, Map<Integer, ? extends SemanticContext> altPredicateContext) Report the list of predicates found for each alternative; copy the list because this set gets altered later by the method tryToResolveWithSemanticPredicates() while flagging NFA configurations in d as resolved.void
DecisionProbe.reportDanglingState
(DFAState d) Report the fact that DFA state d is not a state resolved with predicates and yet it has no emanating edges.void
DecisionProbe.reportIncompletelyCoveredAlts
(DFAState d, Map<Integer, Set<Token>> altToLocationsReachableWithoutPredicate) void
DecisionProbe.reportLexerRuleNondeterminism
(DFAState d, Set<Integer> nondeterministicAlts) Currently the analysis reports issues between token definitions, but we don't print out warnings in favor of just picking the first token definition found in the grammar ala lex/flex.void
DecisionProbe.reportNondeterminism
(DFAState d, Set<Integer> nondeterministicAlts) void
DecisionProbe.reportNondeterminismResolvedWithSemanticPredicate
(DFAState d) void
DecisionProbe.reportRecursionOverflow
(DFAState d, NFAConfiguration recursionNFAConfiguration) protected int
NFAToDFAConverter.resolveByChoosingFirstAlt
(DFAState d, Set<Integer> nondeterministicAlts) protected int
NFAToDFAConverter.resolveByPickingExitAlt
(DFAState d, Set<Integer> nondeterministicAlts) Resolve state d by choosing exit alt, which is same value as the number of alternatives.protected int
NFAToDFAConverter.resolveByPickingMinAlt
(DFAState d, Set<Integer> nondeterministicAlts) Turn off all configurations associated with the set of incoming nondeterministic alts except the min alt number.void
NFAToDFAConverter.resolveNonDeterminisms
(DFAState d) If > 1 NFA configurations within this DFA state have identical NFA state and context, but differ in their predicted TODO update for new context suffix stuff 3-9-2005 alternative then a single input sequence predicts multiple alts.void
DFA.setAcceptState
(int alt, DFAState acceptState) void
protected boolean
NFAToDFAConverter.tryToResolveWithSemanticPredicates
(DFAState d, Set<Integer> nondeterministicAlts) See if a set of nondeterministic alternatives can be disambiguated with the semantic predicate contexts of the alternatives.protected static void
NFAToDFAConverter.turnOffOtherAlts
(DFAState d, int min, Set<Integer> nondeterministicAlts) turn off all states associated with alts other than the good one (as long as they are one of the nondeterministic ones)Method parameters in org.antlr.analysis with type arguments of type DFAStateModifier and TypeMethodDescription(package private) boolean
(package private) boolean
DFA._hasSemPred
(DFAState d, Set<DFAState> busy) (package private) boolean
DFA._hasSynPred
(DFAState d, Set<DFAState> busy) MachineProbe.getAnyDFAPathToTarget
(DFAState startState, DFAState targetState, Set<DFAState> visited) protected void
DecisionProbe.getSampleInputSequenceUsingStateSet
(State startState, State targetState, Set<DFAState> states, List<Label> labels) Given a start state and a final state, find a list of edge labels between the two ignoring epsilon.protected boolean
DecisionProbe.reachesState
(DFAState startState, DFAState targetState, Set<DFAState> states) Given a start state and a target state, return true if start can reach target state.Constructors in org.antlr.analysis with parameters of type DFAStateModifierConstructorDescriptionAnalysisRecursionOverflowException
(DFAState ovfState, NFAConfiguration proposedNFAConfiguration) -
Uses of DFAState in org.antlr.codegen
Methods in org.antlr.codegen with parameters of type DFAStateModifier and TypeMethodDescriptionprotected boolean
CodeGenerator.canGenerateSwitch
(DFAState s) You can generate a switch rather than if-then-else for a DFA state if there are no semantic predicates and the number of edge label values is small enough; e.g., don't generate a switch for a state containing an edge label such as 20..52330 (the resulting byte codes would overflow the method 65k limit probably).org.stringtemplate.v4.ST
CodeGenerator.generateSpecialState
(DFAState s) A special state is huge (too big for state tables) or has a predicated edge.protected org.stringtemplate.v4.ST
ACyclicDFACodeGenerator.walkFixedDFAGeneratingStateMachine
(org.stringtemplate.v4.STGroup templates, DFA dfa, DFAState s, int k) -
Uses of DFAState in org.antlr.tool
Fields in org.antlr.tool declared as DFAStateModifier and TypeFieldDescriptionGrammarDanglingStateMessage.problemState
GrammarInsufficientPredicatesMessage.problemState
GrammarNonDeterminismMessage.problemState
RecursionOverflowMessage.sampleBadState
Methods in org.antlr.tool with parameters of type DFAStateModifier and TypeMethodDescriptionstatic void
ErrorManager.danglingState
(DecisionProbe probe, DFAState d) static void
ErrorManager.insufficientPredicates
(DecisionProbe probe, DFAState d, Map<Integer, Set<Token>> altToUncoveredLocations) static void
ErrorManager.nondeterminism
(DecisionProbe probe, DFAState d) static void
ErrorManager.recursionOverflow
(DecisionProbe probe, DFAState sampleBadState, int alt, Collection<String> targetRules, Collection<? extends Collection<? extends NFAState>> callSiteStates) protected void
DOTGenerator.walkCreatingDFADOT
(org.stringtemplate.v4.ST dot, DFAState s) Do a depth-first walk of the state machine graph and fill a DOT description template.Constructors in org.antlr.tool with parameters of type DFAStateModifierConstructorDescriptionGrammarDanglingStateMessage
(DecisionProbe probe, DFAState problemState) GrammarInsufficientPredicatesMessage
(DecisionProbe probe, DFAState problemState, Map<Integer, Set<Token>> altToLocations) GrammarNonDeterminismMessage
(DecisionProbe probe, DFAState problemState) RecursionOverflowMessage
(DecisionProbe probe, DFAState sampleBadState, int alt, Collection<String> targetRules, Collection<? extends Collection<? extends NFAState>> callSiteStates)