Class TreeToNFAConverter

java.lang.Object
antlr.TreeParser
org.antlr.grammar.v2.TreeToNFAConverter
All Implemented Interfaces:
TreeToNFAConverterTokenTypes

public class TreeToNFAConverter extends antlr.TreeParser implements TreeToNFAConverterTokenTypes
Build an NFA from a tree representing an ANTLR grammar.
  • Field Details

    • factory

      protected NFAFactory factory
      Factory used to create nodes and submachines
    • nfa

      protected NFA nfa
      Which NFA object are we filling in?
    • grammar

      protected Grammar grammar
      Which grammar are we converting an NFA for?
    • currentRuleName

      protected String currentRuleName
    • outerAltNum

      protected int outerAltNum
    • blockLevel

      protected int blockLevel
    • _tokenNames

      public static final String[] _tokenNames
    • _tokenSet_0

      public static final antlr.collections.impl.BitSet _tokenSet_0
  • Constructor Details

    • TreeToNFAConverter

      public TreeToNFAConverter(Grammar g, NFA nfa, NFAFactory factory)
    • TreeToNFAConverter

      public TreeToNFAConverter()
  • Method Details

    • addFollowTransition

      protected void addFollowTransition(String ruleName, NFAState following)
    • finish

      protected void finish()
    • reportError

      public void reportError(antlr.RecognitionException ex)
      Overrides:
      reportError in class antlr.TreeParser
    • grammar

      public final void grammar(antlr.collections.AST _t) throws antlr.RecognitionException
      Throws:
      antlr.RecognitionException
    • grammarSpec

      public final void grammarSpec(antlr.collections.AST _t) throws antlr.RecognitionException
      Throws:
      antlr.RecognitionException
    • attrScope

      public final void attrScope(antlr.collections.AST _t) throws antlr.RecognitionException
      Throws:
      antlr.RecognitionException
    • rules

      public final void rules(antlr.collections.AST _t) throws antlr.RecognitionException
      Throws:
      antlr.RecognitionException
    • rule

      public final void rule(antlr.collections.AST _t) throws antlr.RecognitionException
      Throws:
      antlr.RecognitionException
    • modifier

      public final void modifier(antlr.collections.AST _t) throws antlr.RecognitionException
      Throws:
      antlr.RecognitionException
    • ruleScopeSpec

      public final void ruleScopeSpec(antlr.collections.AST _t) throws antlr.RecognitionException
      Throws:
      antlr.RecognitionException
    • block

      public final StateCluster block(antlr.collections.AST _t) throws antlr.RecognitionException
      Throws:
      antlr.RecognitionException
    • exceptionGroup

      public final void exceptionGroup(antlr.collections.AST _t) throws antlr.RecognitionException
      Throws:
      antlr.RecognitionException
    • set

      public final StateCluster set(antlr.collections.AST _t) throws antlr.RecognitionException
      Throws:
      antlr.RecognitionException
    • alternative

      public final StateCluster alternative(antlr.collections.AST _t) throws antlr.RecognitionException
      Throws:
      antlr.RecognitionException
    • rewrite

      public final void rewrite(antlr.collections.AST _t) throws antlr.RecognitionException
      Throws:
      antlr.RecognitionException
    • element

      public final StateCluster element(antlr.collections.AST _t) throws antlr.RecognitionException
      Throws:
      antlr.RecognitionException
    • exceptionHandler

      public final void exceptionHandler(antlr.collections.AST _t) throws antlr.RecognitionException
      Throws:
      antlr.RecognitionException
    • finallyClause

      public final void finallyClause(antlr.collections.AST _t) throws antlr.RecognitionException
      Throws:
      antlr.RecognitionException
    • atom

      public final StateCluster atom(antlr.collections.AST _t, String scopeName) throws antlr.RecognitionException
      Throws:
      antlr.RecognitionException
    • atom_or_notatom

      public final StateCluster atom_or_notatom(antlr.collections.AST _t) throws antlr.RecognitionException
      Throws:
      antlr.RecognitionException
    • ebnf

      public final StateCluster ebnf(antlr.collections.AST _t) throws antlr.RecognitionException
      Throws:
      antlr.RecognitionException
    • tree

      public final StateCluster tree(antlr.collections.AST _t) throws antlr.RecognitionException
      Throws:
      antlr.RecognitionException
    • ast_suffix

      public final void ast_suffix(antlr.collections.AST _t) throws antlr.RecognitionException
      Throws:
      antlr.RecognitionException
    • setElement

      public final void setElement(antlr.collections.AST _t, IntSet elements) throws antlr.RecognitionException
      Throws:
      antlr.RecognitionException
    • setRule

      public final IntSet setRule(antlr.collections.AST _t) throws antlr.RecognitionException
      Throws:
      antlr.RecognitionException
    • testBlockAsSet

      public final void testBlockAsSet(antlr.collections.AST _t) throws antlr.RecognitionException
      Check to see if this block can be a set. Can't have actions etc... Also can't be in a rule with a rewrite as we need to track what's inside set for use in rewrite.
      Throws:
      antlr.RecognitionException
    • testSetElement

      public final void testSetElement(antlr.collections.AST _t) throws antlr.RecognitionException
      Match just an element; no ast suffix etc..
      Throws:
      antlr.RecognitionException
    • testSetRule

      public final void testSetRule(antlr.collections.AST _t) throws antlr.RecognitionException
      Throws:
      antlr.RecognitionException
    • mk_tokenSet_0

      private static final long[] mk_tokenSet_0()