Package org.antlr.tool
Class DOTGenerator
java.lang.Object
org.antlr.tool.DOTGenerator
The DOT (part of graphviz) generation aspect.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
protected Grammar
protected Set
To prevent infinite recursion when walking state machines, record which states we've visited.protected String
static org.antlr.stringtemplate.StringTemplateGroup
Library of output templates; useformat static final boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn a String containing a DOT description that, when displayed, will show the incoming state machine visually.protected String
getEdgeLabel
(Transition edge) Fix edge strings so they print out in DOT properly; generate any gated predicates on edge too.protected String
void
setArrowheadType
(String arrowhead) void
setRankdir
(String rankdir) protected void
walkCreatingDFADOT
(org.antlr.stringtemplate.StringTemplate dot, DFAState s) Do a depth-first walk of the state machine graph and fill a DOT description template.protected void
walkRuleNFACreatingDOT
(org.antlr.stringtemplate.StringTemplate dot, State s) Do a depth-first walk of the state machine graph and fill a DOT description template.
-
Field Details
-
STRIP_NONREDUCED_STATES
public static final boolean STRIP_NONREDUCED_STATES- See Also:
-
arrowhead
-
rankdir
-
stlib
public static org.antlr.stringtemplate.StringTemplateGroup stlibLibrary of output templates; useformat -
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
-
-
Constructor Details
-
DOTGenerator
This aspect is associated with a grammar
-
-
Method Details
-
getDOT
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
Do a depth-first walk of the state machine graph and fill a DOT description template. Keep filling the states and edges attributes. -
walkRuleNFACreatingDOT
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
Fix edge strings so they print out in DOT properly; generate any gated predicates on edge too. -
getStateLabel
-
getArrowheadType
-
setArrowheadType
-
getRankdir
-
setRankdir
-