Class DOTGenerator

java.lang.Object
org.antlr.v4.tool.DOTGenerator

public class DOTGenerator extends Object
The DOT (part of graphviz) generation aspect.
  • Field Details

    • STRIP_NONREDUCED_STATES

      public static final boolean STRIP_NONREDUCED_STATES
      See Also:
    • arrowhead

      protected String arrowhead
    • rankdir

      protected String rankdir
    • stlib

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

      protected Grammar grammar
  • Constructor Details

    • DOTGenerator

      public DOTGenerator(Grammar grammar)
      This aspect is associated with a grammar
  • Method Details

    • getDOT

      public String getDOT(DFA dfa, boolean isLexer)
    • getStateLabel

      protected String getStateLabel(DFAState s)
    • getDOT

      public String getDOT(ATNState startState)
    • getDOT

      public String getDOT(ATNState startState, boolean isLexer)
    • getDOT

      public String getDOT(ATNState startState, String[] ruleNames, boolean isLexer)
      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.
    • getEdgeLabel

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

      protected String getStateLabel(ATNState s)