Vcsn
2.0
Be Rational
|
Format an automaton into Dot. More...
#include <dot.hh>
Public Member Functions | |
dotter (const automaton_t &aut, std::ostream &out, bool dot2tex=false) | |
std::ostream & | operator() () |
Print the automaton on the stream. More... | |
Public Member Functions inherited from vcsn::detail::outputter< Aut > | |
outputter (const automaton_t &aut, std::ostream &out) | |
Private Types | |
using | super_t = outputter< Aut > |
using | automaton_t = Aut |
using | state_t = state_t_of< automaton_t > |
using | transition_t = transition_t_of< automaton_t > |
using | weightset_t = weightset_t_of< automaton_t > |
using | weight_t = weight_t_of< automaton_t > |
Private Member Functions | |
void | print_prologue_ () |
Start the dot graph. More... | |
void | print_epilogue_ () |
Finish the dot graph. More... | |
bool | format_ (const std::string &sep, const std::string &kind, const weight_t &w) |
Format a TikZ attribute. More... | |
void | print_state_ (state_t s) |
Pretty-print state s for both dot and dot2tex. More... | |
void | print_states_ () |
Print the states. More... | |
void | print_transitions_ () |
Print all the transitions. More... | |
void | enable_ () |
Enable the escaping of backslashes. More... | |
void | disable_ () |
Disable the escaping of backslashes. More... | |
Private Attributes | |
const char * | gray = "color = DimGray" |
bool | dot2tex_ = false |
Whether to format for dot2tex. More... | |
std::unordered_set< state_t_of < Aut > > | useful_ = useful_states(aut_) |
Useful states. More... | |
detail::io::filtering_ostream | bos_ |
The output stream, with a backslashify filter. More... | |
Additional Inherited Members | |
Public Types inherited from vcsn::detail::outputter< Aut > | |
using | state_t = state_t_of< automaton_t > |
Protected Types inherited from vcsn::detail::outputter< Aut > | |
using | automaton_t = Aut |
using | context_t = context_t_of< automaton_t > |
using | label_t = label_t_of< automaton_t > |
using | transition_t = transition_t_of< automaton_t > |
using | weightset_t = weightset_t_of< automaton_t > |
using | weight_t = weight_t_of< automaton_t > |
using | states_t = std::vector< state_t > |
A list of states. More... | |
Protected Member Functions inherited from vcsn::detail::outputter< Aut > | |
virtual std::string | label_ (const label_t &l) |
Convert a label to its representation. More... | |
virtual void | output_transition_ (transition_t t) |
Output the transition t. More... | |
std::ostream & | print_entry_ (state_t src, state_t dst, std::ostream &os, const std::string &fmt="text") |
The labels and weights of transitions from src to dst. More... | |
void | output_state_ (const state_t s) |
Output transitions, sorted lexicographically on (Label, Dest). More... | |
void | output_transitions_ () |
Output transitions, sorted lexicographically. More... | |
void | list_states_ (const states_t &ss) |
List names of states in ss, preceded by ' '. More... | |
states_t | initials_ () |
The list of initial states, sorted. More... | |
states_t | finals_ () |
The list of final states, sorted. More... | |
Protected Attributes inherited from vcsn::detail::outputter< Aut > | |
const automaton_t & | aut_ |
The automaton we have to output. More... | |
std::ostream & | os_ |
Output stream. More... | |
const labelset_t_of < automaton_t > & | ls_ = *aut_->labelset() |
Short-hand to the labelset. More... | |
const weightset_t & | ws_ = *aut_->weightset() |
Short-hand to the weightset. More... | |
const polynomialset < context_t_of< automaton_t > > | ps_ {aut_->context()} |
Short-hand to the polynomialset used to print the entries. More... | |
Format an automaton into Dot.
Aut | an automaton type. |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
inline |
Definition at line 53 of file dot.hh.
References vcsn::detail::dotter< Aut >::bos_.
|
inlineprivate |
Disable the escaping of backslashes.
Definition at line 327 of file dot.hh.
References vcsn::detail::dotter< Aut >::bos_.
Referenced by vcsn::detail::dotter< Aut >::print_state_(), and vcsn::detail::dotter< Aut >::print_transitions_().
|
inlineprivate |
Enable the escaping of backslashes.
Definition at line 320 of file dot.hh.
References vcsn::detail::dotter< Aut >::bos_.
Referenced by vcsn::detail::dotter< Aut >::print_state_(), and vcsn::detail::dotter< Aut >::print_transitions_().
|
inlineprivate |
Format a TikZ attribute.
sep | the separator to print before (if we print something). |
kind | the attribute name (e.g., "initial"). |
w | the associated weight (e.g., initial weight). |
Definition at line 112 of file dot.hh.
References vcsn::detail::dotter< Aut >::bos_, and vcsn::detail::outputter< Aut >::ws_.
Referenced by vcsn::detail::dotter< Aut >::print_state_().
|
inline |
Print the automaton on the stream.
Definition at line 63 of file dot.hh.
References vcsn::detail::outputter< Aut >::os_, vcsn::detail::dotter< Aut >::print_epilogue_(), vcsn::detail::dotter< Aut >::print_prologue_(), vcsn::detail::dotter< Aut >::print_states_(), and vcsn::detail::dotter< Aut >::print_transitions_().
|
inlineprivate |
Finish the dot graph.
Definition at line 103 of file dot.hh.
References vcsn::detail::dotter< Aut >::bos_.
Referenced by vcsn::detail::dotter< Aut >::operator()().
|
inlineprivate |
Start the dot graph.
Definition at line 74 of file dot.hh.
References vcsn::detail::outputter< Aut >::aut_, vcsn::detail::dotter< Aut >::bos_, and vcsn::detail::dotter< Aut >::dot2tex_.
Referenced by vcsn::detail::dotter< Aut >::operator()().
|
inlineprivate |
Pretty-print state s for both dot and dot2tex.
Definition at line 131 of file dot.hh.
References vcsn::detail::outputter< Aut >::aut_, vcsn::detail::dotter< Aut >::bos_, vcsn::detail::dotter< Aut >::disable_(), vcsn::detail::dotter< Aut >::dot2tex_, vcsn::detail::dotter< Aut >::enable_(), vcsn::detail::dotter< Aut >::format_(), vcsn::detail::dotter< Aut >::gray, vcsn::has(), and vcsn::detail::dotter< Aut >::useful_.
Referenced by vcsn::detail::dotter< Aut >::print_states_().
|
inlineprivate |
Print the states.
Definition at line 200 of file dot.hh.
References vcsn::detail::outputter< Aut >::aut_, vcsn::detail::dotter< Aut >::bos_, vcsn::detail::dotter< Aut >::dot2tex_, vcsn::detail::outputter< Aut >::finals_(), vcsn::detail::outputter< Aut >::initials_(), and vcsn::detail::dotter< Aut >::print_state_().
Referenced by vcsn::detail::dotter< Aut >::operator()().
|
inlineprivate |
Print all the transitions.
Definition at line 259 of file dot.hh.
References vcsn::detail::outputter< Aut >::aut_, vcsn::detail::dotter< Aut >::bos_, vcsn::detail::dotter< Aut >::disable_(), vcsn::detail::dotter< Aut >::dot2tex_, vcsn::detail::dotter< Aut >::enable_(), vcsn::detail::dotter< Aut >::gray, vcsn::has(), vcsn::detail::outputter< Aut >::print_entry_(), and vcsn::detail::dotter< Aut >::useful_.
Referenced by vcsn::detail::dotter< Aut >::operator()().
|
private |
The output stream, with a backslashify filter.
Definition at line 338 of file dot.hh.
Referenced by vcsn::detail::dotter< Aut >::disable_(), vcsn::detail::dotter< Aut >::dotter(), vcsn::detail::dotter< Aut >::enable_(), vcsn::detail::dotter< Aut >::format_(), vcsn::detail::dotter< Aut >::print_epilogue_(), vcsn::detail::dotter< Aut >::print_prologue_(), vcsn::detail::dotter< Aut >::print_state_(), vcsn::detail::dotter< Aut >::print_states_(), and vcsn::detail::dotter< Aut >::print_transitions_().
|
private |
Whether to format for dot2tex.
Definition at line 334 of file dot.hh.
Referenced by vcsn::detail::dotter< Aut >::print_prologue_(), vcsn::detail::dotter< Aut >::print_state_(), vcsn::detail::dotter< Aut >::print_states_(), and vcsn::detail::dotter< Aut >::print_transitions_().
|
private |
Definition at line 50 of file dot.hh.
Referenced by vcsn::detail::dotter< Aut >::print_state_(), and vcsn::detail::dotter< Aut >::print_transitions_().
|
private |
Useful states.
Definition at line 336 of file dot.hh.
Referenced by vcsn::detail::dotter< Aut >::print_state_(), and vcsn::detail::dotter< Aut >::print_transitions_().