Vcsn  2.8
Be Rational
vcsn::detail::printer< Aut > Class Template Reference

Factor common bits in automaton formatting. More...

#include <printer.hh>

Inheritance diagram for vcsn::detail::printer< Aut >:
Collaboration diagram for vcsn::detail::printer< Aut >:

Public Types

using state_t = state_t_of< automaton_t >
 

Public Member Functions

 printer (const automaton_t &aut, std::ostream &out)
 

Protected Types

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 polynomialset_t = polynomialset< context_t >
 
using polynomial_t = typename polynomialset_t::value_t
 
using states_t = std::vector< state_t >
 A list of states. More...
 
using is_transducer_t = std::integral_constant< bool, 2<=rank< labelset_t_of< automaton_t > >::value >
 Whether is a transducer (two-tape automaton) as opposed to an acceptor. More...
 

Protected Member Functions

virtual std::string label_ (const label_t &l) const
 Convert a label to its representation. More...
 
virtual void print_transition_ (transition_t t) const
 Output the transition t. More...
 
void print_state_ (const state_t s)
 Output transitions, sorted lexicographically on (Label, Dest). More...
 
void print_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

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_tws_ = *aut_->weightset()
 Short-hand to the weightset. More...
 
const polynomialset_t ps_ {aut_->context()}
 Short-hand to the polynomialset used to print the entries. More...
 
const is_transducer_t is_transducer_ = {}
 

Detailed Description

template<Automaton Aut>
class vcsn::detail::printer< Aut >

Factor common bits in automaton formatting.

Template Parameters
Autan automaton type.

Definition at line 37 of file printer.hh.

Member Typedef Documentation

◆ automaton_t

template<Automaton Aut>
using vcsn::detail::printer< Aut >::automaton_t = Aut
protected

Definition at line 40 of file printer.hh.

◆ context_t

template<Automaton Aut>
using vcsn::detail::printer< Aut >::context_t = context_t_of<automaton_t>
protected

Definition at line 53 of file printer.hh.

◆ is_transducer_t

template<Automaton Aut>
using vcsn::detail::printer< Aut >::is_transducer_t = std::integral_constant<bool, 2 <= rank<labelset_t_of<automaton_t> >::value>
protected

Whether is a transducer (two-tape automaton) as opposed to an acceptor.

Definition at line 146 of file printer.hh.

◆ label_t

template<Automaton Aut>
using vcsn::detail::printer< Aut >::label_t = label_t_of<automaton_t>
protected

Definition at line 54 of file printer.hh.

◆ polynomial_t

template<Automaton Aut>
using vcsn::detail::printer< Aut >::polynomial_t = typename polynomialset_t::value_t
protected

Definition at line 59 of file printer.hh.

◆ polynomialset_t

template<Automaton Aut>
using vcsn::detail::printer< Aut >::polynomialset_t = polynomialset<context_t>
protected

Definition at line 58 of file printer.hh.

◆ state_t

template<Automaton Aut>
using vcsn::detail::printer< Aut >::state_t = state_t_of<automaton_t>

Definition at line 50 of file printer.hh.

◆ states_t

template<Automaton Aut>
using vcsn::detail::printer< Aut >::states_t = std::vector<state_t>
protected

A list of states.

Definition at line 62 of file printer.hh.

◆ transition_t

template<Automaton Aut>
using vcsn::detail::printer< Aut >::transition_t = transition_t_of<automaton_t>
protected

Definition at line 55 of file printer.hh.

◆ weight_t

template<Automaton Aut>
using vcsn::detail::printer< Aut >::weight_t = weight_t_of<automaton_t>
protected

Definition at line 57 of file printer.hh.

◆ weightset_t

template<Automaton Aut>
using vcsn::detail::printer< Aut >::weightset_t = weightset_t_of<automaton_t>
protected

Definition at line 56 of file printer.hh.

Constructor & Destructor Documentation

◆ printer()

template<Automaton Aut>
vcsn::detail::printer< Aut >::printer ( const automaton_t aut,
std::ostream &  out 
)
inline

Definition at line 43 of file printer.hh.

Member Function Documentation

◆ finals_()

template<Automaton Aut>
states_t vcsn::detail::printer< Aut >::finals_ ( )
inlineprotected

The list of final states, sorted.

Definition at line 123 of file printer.hh.

References vcsn::detail::final_transitions(), vcsn::res, and vcsn::sort().

Referenced by vcsn::detail::fado_impl< Aut >::operator()(), vcsn::detail::grail_impl< Aut >::operator()(), and vcsn::detail::dot_impl< Aut >::print_states_().

Here is the call graph for this function:

◆ initials_()

template<Automaton Aut>
states_t vcsn::detail::printer< Aut >::initials_ ( )
inlineprotected

The list of initial states, sorted.

Definition at line 113 of file printer.hh.

References vcsn::detail::initial_transitions(), vcsn::res, and vcsn::sort().

Referenced by vcsn::detail::fado_impl< Aut >::operator()(), vcsn::detail::grail_impl< Aut >::operator()(), and vcsn::detail::dot_impl< Aut >::print_states_().

Here is the call graph for this function:

◆ label_()

template<Automaton Aut>
virtual std::string vcsn::detail::printer< Aut >::label_ ( const label_t l) const
inlineprotectedvirtual

Convert a label to its representation.

Definition at line 66 of file printer.hh.

References vcsn::to_string().

Here is the call graph for this function:

◆ list_states_()

template<Automaton Aut>
void vcsn::detail::printer< Aut >::list_states_ ( const states_t ss)
inlineprotected

List names of states in ss, preceded by ' '.

Definition at line 103 of file printer.hh.

Referenced by vcsn::detail::fado_impl< Aut >::operator()().

◆ print_state_()

template<Automaton Aut>
void vcsn::detail::printer< Aut >::print_state_ ( const state_t  s)
inlineprotected

Output transitions, sorted lexicographically on (Label, Dest).

Definition at line 81 of file printer.hh.

References vcsn::detail::out(), and vcsn::sort().

Referenced by vcsn::detail::efsmer< Aut >::print_transitions_().

Here is the call graph for this function:

◆ print_transition_()

template<Automaton Aut>
virtual void vcsn::detail::printer< Aut >::print_transition_ ( transition_t  t) const
inlineprotectedvirtual

Output the transition t.

Do not insert eol. "Src Label Dst".

Reimplemented in vcsn::detail::efsmer< Aut >, and vcsn::detail::fado_impl< Aut >.

Definition at line 73 of file printer.hh.

◆ print_transitions_()

template<Automaton Aut>
void vcsn::detail::printer< Aut >::print_transitions_ ( )
inlineprotected

Output transitions, sorted lexicographically.

"Src Label Dst\n".

Definition at line 96 of file printer.hh.

Referenced by vcsn::detail::fado_impl< Aut >::operator()(), and vcsn::detail::grail_impl< Aut >::operator()().

Member Data Documentation

◆ aut_

◆ is_transducer_

◆ ls_

template<Automaton Aut>
const labelset_t_of<automaton_t>& vcsn::detail::printer< Aut >::ls_ = *aut_->labelset()
protected

◆ os_

◆ ps_

template<Automaton Aut>
const polynomialset_t vcsn::detail::printer< Aut >::ps_ {aut_->context()}
protected

Short-hand to the polynomialset used to print the entries.

Definition at line 141 of file printer.hh.

Referenced by vcsn::detail::daut_impl< Aut >::print_transitions_(), vcsn::detail::tikzer< Aut >::print_transitions_(), and vcsn::detail::dot_impl< Aut >::print_transitions_().

◆ ws_


The documentation for this class was generated from the following file: