Class NFA

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

public class NFA extends 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 Details

    • INVALID_ALT_NUMBER

      public static final int INVALID_ALT_NUMBER
      See Also:
    • grammar

      public Grammar grammar
      This NFA represents which grammar?
    • factory

      protected NFAFactory factory
      Which factory created this NFA?
    • complete

      public boolean complete
  • Constructor Details

  • Method Details

    • getNewNFAStateNumber

      public int getNewNFAStateNumber()
    • addState

      public void addState(NFAState state)
    • getState

      public NFAState getState(int s)
    • getFactory

      public NFAFactory getFactory()
    • setFactory

      public void setFactory(NFAFactory factory)