Top Fields Constructors Methods
org.antlr.analysis

public Class MachineProbe

extends Object
Class Inheritance
Imports
org.antlr.misc.IntSet, org.antlr.runtime.CommonToken, .Token, org.antlr.tool.Grammar, java.util.ArrayList, .HashSet, .List, .Set

Field Summary

Modifier and TypeField and Description
pack-priv DFA

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv List<DFAState>
public List<DFAState>
getAnyDFAPathToTarget(DFAState startState, DFAState targetState, Set<DFAState> visited)

public List<IntSet>
getEdgeLabels(DFAState targetState)

Return a list of edge labels from start state to targetState.

public List<Token>
getGrammarLocationsForInputSequence(List<Set<NFAState>> nfaStates, List<IntSet> labels)

Given an alternative associated with a DFA state, return the list of tokens (from grammar) associated with path through NFA following the labels sequence.

public String
getInputSequenceDisplay(Grammar g, List<IntSet> labels)

Given List<IntSet>, return a String with a useful representation of the associated input string.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dfaback to summary
pack-priv DFA dfa

Constructor Detail

MachineProbeback to summary
public MachineProbe(DFA dfa)

Method Detail

getAnyDFAPathToTargetback to summary
pack-priv List<DFAState> getAnyDFAPathToTarget(DFAState targetState)
getAnyDFAPathToTargetback to summary
public List<DFAState> getAnyDFAPathToTarget(DFAState startState, DFAState targetState, Set<DFAState> visited)
getEdgeLabelsback to summary
public List<IntSet> getEdgeLabels(DFAState targetState)

Return a list of edge labels from start state to targetState.

getGrammarLocationsForInputSequenceback to summary
public List<Token> getGrammarLocationsForInputSequence(List<Set<NFAState>> nfaStates, List<IntSet> labels)

Given an alternative associated with a DFA state, return the list of tokens (from grammar) associated with path through NFA following the labels sequence. The nfaStates gives the set of NFA states associated with alt that take us from start to stop. One of the NFA states in nfaStates[i] will have an edge intersecting with labels[i].

getInputSequenceDisplayback to summary
public String getInputSequenceDisplay(Grammar g, List<IntSet> labels)

Given List<IntSet>, return a String with a useful representation of the associated input string. One could show something different for lexers and parsers, for example.