程序包 org.antlr.tool

类 DOTGenerator


  • public class DOTGenerator
    extends java.lang.Object
    The DOT (part of graphviz) generation aspect.
    • 字段概要

      字段 
      修饰符和类型 字段 说明
      protected java.lang.String arrowhead  
      protected Grammar grammar  
      protected java.util.Set<java.lang.Object> markedStates
      To prevent infinite recursion when walking state machines, record which states we've visited.
      protected java.lang.String rankdir  
      static org.stringtemplate.v4.STGroup stlib
      Library of output templates; use <attrname> format
      static boolean STRIP_NONREDUCED_STATES  
    • 构造器概要

      构造器 
      构造器 说明
      DOTGenerator​(Grammar grammar)
      This aspect is associated with a grammar
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      java.lang.String getArrowheadType()  
      java.lang.String getDOT​(State startState)
      Return a String containing a DOT description that, when displayed, will show the incoming state machine visually.
      protected java.lang.String getEdgeLabel​(Transition edge)
      Fix edge strings so they print out in DOT properly; generate any gated predicates on edge too.
      java.lang.String getRankdir()  
      protected java.lang.String getStateLabel​(State s)  
      void setArrowheadType​(java.lang.String arrowhead)  
      void setRankdir​(java.lang.String rankdir)  
      protected void walkCreatingDFADOT​(org.stringtemplate.v4.ST dot, DFAState s)
      Do a depth-first walk of the state machine graph and fill a DOT description template.
      protected void walkRuleNFACreatingDOT​(org.stringtemplate.v4.ST dot, State s)
      Do a depth-first walk of the state machine graph and fill a DOT description template.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 字段详细资料

      • STRIP_NONREDUCED_STATES

        public static final boolean STRIP_NONREDUCED_STATES
        另请参阅:
        常量字段值
      • arrowhead

        protected java.lang.String arrowhead
      • rankdir

        protected java.lang.String rankdir
      • stlib

        public static org.stringtemplate.v4.STGroup stlib
        Library of output templates; use <attrname> format
      • markedStates

        protected java.util.Set<java.lang.Object> markedStates
        To prevent infinite recursion when walking state machines, record which states we've visited. Make a new set every time you start walking in case you reuse this object.
      • grammar

        protected Grammar grammar
    • 构造器详细资料

      • DOTGenerator

        public DOTGenerator​(Grammar grammar)
        This aspect is associated with a grammar
    • 方法详细资料

      • getDOT

        public java.lang.String getDOT​(State startState)
        Return a String containing a DOT description that, when displayed, will show the incoming state machine visually. All nodes reachable from startState will be included.
      • walkCreatingDFADOT

        protected void walkCreatingDFADOT​(org.stringtemplate.v4.ST dot,
                                          DFAState s)
        Do a depth-first walk of the state machine graph and fill a DOT description template. Keep filling the states and edges attributes.
      • walkRuleNFACreatingDOT

        protected void walkRuleNFACreatingDOT​(org.stringtemplate.v4.ST dot,
                                              State s)
        Do a depth-first walk of the state machine graph and fill a DOT description template. Keep filling the states and edges attributes. We know this is an NFA for a rule so don't traverse edges to other rules and don't go past rule end state.
      • getEdgeLabel

        protected java.lang.String getEdgeLabel​(Transition edge)
        Fix edge strings so they print out in DOT properly; generate any gated predicates on edge too.
      • getStateLabel

        protected java.lang.String getStateLabel​(State s)
      • getArrowheadType

        public java.lang.String getArrowheadType()
      • setArrowheadType

        public void setArrowheadType​(java.lang.String arrowhead)
      • getRankdir

        public java.lang.String getRankdir()
      • setRankdir

        public void setRankdir​(java.lang.String rankdir)