org.antlr.analysis
Class NFA

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

public class NFA
extends java.lang.Object

An NFA (collection of NFAStates) constructed from a grammar. This NFA is one big machine for entire grammar. Decision points are recorded by the Grammar object so we can, for example, convert to DFA or simulate the NFA (interpret a decision).


Field Summary
protected  NFAFactory factory
          Which factory created this NFA?
 Grammar grammar
          This NFA represents which grammar?
static int INVALID_ALT_NUMBER
           
protected  java.util.Vector numberToStateList
          The NFA states in this NFA.
 
Constructor Summary
NFA(Grammar g)
           
 
Method Summary
 void addState(NFAState state)
           
 NFAFactory getFactory()
           
 NFAState getState(int s)
           
 void setFactory(NFAFactory factory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INVALID_ALT_NUMBER

public static final int INVALID_ALT_NUMBER
See Also:
Constant Field Values

grammar

public Grammar grammar
This NFA represents which grammar?


numberToStateList

protected java.util.Vector numberToStateList
The NFA states in this NFA. Maps state number to NFAState object. This is a Vector instead of a List because I need to be able to grow this properly. After talking to Josh Bloch, Collections guy at Sun, I decided this was easiest solution.


factory

protected NFAFactory factory
Which factory created this NFA?

Constructor Detail

NFA

public NFA(Grammar g)
Method Detail

addState

public void addState(NFAState state)

getState

public NFAState getState(int s)

getFactory

public NFAFactory getFactory()

setFactory

public void setFactory(NFAFactory factory)