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.altToAcceptStateWe only want one accept state per predicted alt; track hereAnalysisRecursionOverflowException.ovfStateDFA.startStateWhat's the start state for this DFA?Fields in org.antlr.analysis with type parameters of type DFAStateModifier and TypeFieldDescriptionDecisionProbe.danglingStatesThe set of states w/o emanating edges and w/o resolving sem preds.DFA.specialStatesList of special DFAState objectsDFA.statesMaps the state number to the actual DFAState.DecisionProbe.statesResolvedWithSemanticPredicatesSetWas 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.statesWithSyntacticallyAmbiguousAltsSetTrack all DFA states with nondeterministic alternatives.protected Map<DFAState, Map<Integer, SemanticContext>> DecisionProbe.stateToAltSetWithSemanticPredicatesMapTrack the predicates for each alt per DFA state; more than one DFA state might have syntactically ambig alt prediction.DecisionProbe.stateToIncompletelyCoveredAltsMapTracks alts insufficiently covered.DecisionProbe.stateToSyntacticallyAmbiguousTokensRuleAltsMapTrack just like stateToSyntacticallyAmbiguousAltsMap, but only for nondeterminisms that arise in the Tokens rule such as keyword vs ID rule.DFA.uniqueStatesA set of all uniquely-numbered DFA states.DFA.uniqueStatesA set of all uniquely-numbered DFA states.NFAToDFAConverter.workA list of DFA states we still need to process during NFA conversionMethods in org.antlr.analysis that return DFAStateModifier and TypeMethodDescriptionprotected DFAStateNFAToDFAConverter.addDFAStateToWorkList(DFAState d) Add a new DFA state to the DFA if not already present.protected DFAStateAdd a new DFA state to this DFA if not already present.protected DFAStateNFAToDFAConverter.computeStartState()From this first NFA state of a decision, create a DFA.protected DFAStateNFAToDFAConverter.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) intDFA._getMaxLookaheadDepth(DFAState d, int depth) (package private) boolean(package private) booleanDFA._hasSemPred(DFAState d, Set<DFAState> busy) (package private) booleanDFA._hasSynPred(DFAState d, Set<DFAState> busy) protected DFAStateNFAToDFAConverter.addDFAStateToWorkList(DFAState d) Add a new DFA state to the DFA if not already present.protected voidNFAToDFAConverter.addPredicateTransitions(DFAState d) for each NFA config in d, look for "predicate required" sign set during nondeterminism resolution.protected DFAStateAdd a new DFA state to this DFA if not already present.intDFAState.addTransition(DFAState target, Label label) Add a transition from this state to target with label.protected static intNFAToDFAConverter.addTransition(DFAState d, Label label, DFAState targetState, Map<Integer, Transition> targetToLabelMap) Add a transition from state d to targetState with label in normal case.voidFor 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.voidNFAToDFAConverter.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 booleanNFAToDFAConverter.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 DFAStateNFAToDFAConverter.convertToAcceptState(DFAState d, int alt) protected voidNFAToDFAConverter.convertToEOTAcceptState(DFAState d) Walk the configurations of this DFA state d looking for the configuration, c, that has a transition on EOT.protected voidDFA.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 voidDFA.createMinMaxTables(DFAState s) protected voidDFA.createSpecialTable(DFAState s) protected voidprotected booleanfigure 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 voidNFAToDFAConverter.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 voidDFAOptimizer.optimizeEOTBranches(DFAState d) protected voidDFAOptimizer.optimizeExitBranches(DFAState d) Given the set of NFA states in DFA state d, find all NFA states reachable traversing label arcs.protected booleanDecisionProbe.reachesState(DFAState startState, DFAState targetState, Set<DFAState> states) Given a start state and a target state, return true if start can reach target state.voidDecisionProbe.removeRecursiveOverflowState(DFAState d) If a recursion overflow is resolve with predicates, then we need to shut off the warning that would be generated.voidDFA.removeState(DFAState d) voidDecisionProbe.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.voidDecisionProbe.reportDanglingState(DFAState d) Report the fact that DFA state d is not a state resolved with predicates and yet it has no emanating edges.voidDecisionProbe.reportIncompletelyCoveredAlts(DFAState d, Map<Integer, Set<org.antlr.runtime.Token>> altToLocationsReachableWithoutPredicate) voidDecisionProbe.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.voidDecisionProbe.reportNondeterminism(DFAState d, Set<Integer> nondeterministicAlts) voidDecisionProbe.reportNondeterminismResolvedWithSemanticPredicate(DFAState d) voidDecisionProbe.reportRecursionOverflow(DFAState d, NFAConfiguration recursionNFAConfiguration) protected intNFAToDFAConverter.resolveByChoosingFirstAlt(DFAState d, Set<Integer> nondeterministicAlts) protected intNFAToDFAConverter.resolveByPickingExitAlt(DFAState d, Set<Integer> nondeterministicAlts) Resolve state d by choosing exit alt, which is same value as the number of alternatives.protected intNFAToDFAConverter.resolveByPickingMinAlt(DFAState d, Set<Integer> nondeterministicAlts) Turn off all configurations associated with the set of incoming nondeterministic alts except the min alt number.voidNFAToDFAConverter.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.voidDFA.setAcceptState(int alt, DFAState acceptState) voidprotected booleanNFAToDFAConverter.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 voidNFAToDFAConverter.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) booleanDFA._hasSemPred(DFAState d, Set<DFAState> busy) (package private) booleanDFA._hasSynPred(DFAState d, Set<DFAState> busy) MachineProbe.getAnyDFAPathToTarget(DFAState startState, DFAState targetState, Set<DFAState> visited) protected voidDecisionProbe.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 booleanDecisionProbe.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 booleanCodeGenerator.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.STCodeGenerator.generateSpecialState(DFAState s) A special state is huge (too big for state tables) or has a predicated edge.protected org.stringtemplate.v4.STACyclicDFACodeGenerator.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.problemStateGrammarInsufficientPredicatesMessage.problemStateGrammarNonDeterminismMessage.problemStateRecursionOverflowMessage.sampleBadStateMethods in org.antlr.tool with parameters of type DFAStateModifier and TypeMethodDescriptionstatic voidErrorManager.danglingState(DecisionProbe probe, DFAState d) static voidErrorManager.insufficientPredicates(DecisionProbe probe, DFAState d, Map<Integer, Set<org.antlr.runtime.Token>> altToUncoveredLocations) static voidErrorManager.nondeterminism(DecisionProbe probe, DFAState d) static voidErrorManager.recursionOverflow(DecisionProbe probe, DFAState sampleBadState, int alt, Collection<String> targetRules, Collection<? extends Collection<? extends NFAState>> callSiteStates) protected voidDOTGenerator.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<org.antlr.runtime.Token>> altToLocations) GrammarNonDeterminismMessage(DecisionProbe probe, DFAState problemState) RecursionOverflowMessage(DecisionProbe probe, DFAState sampleBadState, int alt, Collection<String> targetRules, Collection<? extends Collection<? extends NFAState>> callSiteStates)