org.antlr.analysis
Class MachineProbe

java.lang.Object
  extended by org.antlr.analysis.MachineProbe

public class MachineProbe
extends Object


Constructor Summary
MachineProbe(DFA dfa)
           
 
Method Summary
 List<DFAState> getAnyDFAPathToTarget(DFAState startState, DFAState targetState, Set<DFAState> visited)
           
 List<IntSet> getEdgeLabels(DFAState targetState)
          Return a list of edge labels from start state to targetState.
 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.
 String getInputSequenceDisplay(Grammar g, List<IntSet> labels)
          Given List, return a String with a useful representation of the associated input string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MachineProbe

public MachineProbe(DFA dfa)
Method Detail

getAnyDFAPathToTarget

public List<DFAState> getAnyDFAPathToTarget(DFAState startState,
                                            DFAState targetState,
                                            Set<DFAState> visited)

getEdgeLabels

public List<IntSet> getEdgeLabels(DFAState targetState)
Return a list of edge labels from start state to targetState.


getInputSequenceDisplay

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


getGrammarLocationsForInputSequence

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].



Copyright © 2011. All Rights Reserved.