Top Description Fields Constructors Methods
org.antlr.v4.tool

public Class DOTGenerator

extends Object
Class Inheritance
Imports
org.antlr.v4.misc.Utils, org.antlr.v4.runtime.atn.ATNConfig, .ATNState, .AbstractPredicateTransition, .ActionTransition, .AtomTransition, .BlockEndState, .BlockStartState, .DecisionState, .NotSetTransition, .PlusBlockStartState, .PlusLoopbackState, .RangeTransition, .RuleStartState, .RuleStopState, .RuleTransition, .SetTransition, .StarBlockStartState, .StarLoopEntryState, .StarLoopbackState, .Transition, org.antlr.v4.runtime.dfa.DFA, .DFAState, org.antlr.v4.runtime.misc.IntegerList, org.stringtemplate.v4.ST, .STGroup, .STGroupFile, java.util.ArrayList, .HashSet, .LinkedList, .List, .Set

The DOT (part of graphviz) generation aspect.

Field Summary

Modifier and TypeField and Description
protected String
protected Grammar
protected String
public static final STGroup
stlib

Library of output templates; use <attrname> format.

public static final boolean

Constructor Summary

AccessConstructor and Description
public
DOTGenerator(Grammar grammar)

This aspect is associated with a grammar

Method Summary

Modifier and TypeMethod and Description
public String
getDOT(DFA dfa, boolean isLexer)

public String
getDOT(ATNState startState)

public String
getDOT(ATNState startState, boolean isLexer)

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.

protected String
getEdgeLabel(String label)

Fix edge strings so they print out in DOT properly; generate any gated predicates on edge too.

protected String
protected String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

arrowheadback to summary
protected String arrowhead
grammarback to summary
protected Grammar grammar
rankdirback to summary
protected String rankdir
stlibback to summary
public static final STGroup stlib

Library of output templates; use <attrname> format.

STRIP_NONREDUCED_STATESback to summary
public static final boolean STRIP_NONREDUCED_STATES

Constructor Detail

DOTGeneratorback to summary
public DOTGenerator(Grammar grammar)

This aspect is associated with a grammar

Method Detail

getDOTback to summary
public String getDOT(DFA dfa, boolean isLexer)
getDOTback to summary
public String getDOT(ATNState startState)
getDOTback to summary
public String getDOT(ATNState startState, boolean isLexer)
getDOTback to summary
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.

getEdgeLabelback to summary
protected String getEdgeLabel(String label)

Fix edge strings so they print out in DOT properly; generate any gated predicates on edge too.

getStateLabelback to summary
protected String getStateLabel(DFAState s)
getStateLabelback to summary
protected String getStateLabel(ATNState s)