Vcsn
2.0
Be Rational
|
Concrete Builder (the design pattern) for automata. More...
#include <edit-automaton.hh>
Public Types | |
using | super_t = automaton_editor |
using | automaton_t = Aut |
using | string_t = super_t::string_t |
Public Types inherited from vcsn::automaton_editor | |
using | string_t = symbol |
Public Member Functions | |
edit_automaton (const context_t &ctx) | |
virtual bool | open (bool o) overridefinal |
virtual void | add_state (string_t s) overridefinal |
Register the existence of state named s. More... | |
virtual void | add_pre (string_t s) overridefinal |
Register that state named s is preinitial. More... | |
virtual void | add_post (string_t s) overridefinal |
Register that state named s is postfinal. More... | |
virtual void | add_initial (string_t s, string_t weight=string_t{}) overridefinal |
virtual void | add_final (string_t s, string_t weight=string_t{}) overridefinal |
virtual void | add_transition (string_t src, string_t dst, string_t label, string_t weight=string_t{}) overridefinal |
Add a transition from src to dst. More... | |
virtual void | add_entry (string_t src, string_t dst, string_t entry) overridefinal |
Add transitions from src to dst, labeled by entry. More... | |
virtual dyn::automaton | result () overridefinal |
Return the built automaton. More... | |
virtual void | reset () overridefinal |
Detach the built automaton. More... | |
Public Member Functions inherited from vcsn::automaton_editor | |
virtual | ~automaton_editor () |
void | set_separator (char c) |
Set the label separator. Defaults to '+'. More... | |
Private Types | |
using | context_t = context_t_of< automaton_t > |
using | entry_t = typename polynomialset< context_t >::value_t |
using | state_t = state_t_of< automaton_t > |
using | label_t = label_t_of< automaton_t > |
using | labelset_t = labelset_t_of< automaton_t > |
using | weight_t = weight_t_of< automaton_t > |
using | state_map = std::unordered_map< string_t, state_t > |
State name -> state handle. More... | |
using | entry_map = std::unordered_map< string_t, entry_t > |
Memoize entry conversion. More... | |
using | label_map = std::unordered_map< string_t, label_t > |
Memoize label conversion. More... | |
using | weight_map = std::unordered_map< string_t, weight_t > |
Memoize weight conversion. More... | |
Private Member Functions | |
label_t | label_ (string_t l) |
Convert a label string to its value. More... | |
weight_t | weight_ (string_t w) |
Convert a weight string to its value. More... | |
state_t | state_ (string_t k) |
Convert a state name to a state handler. More... | |
Private Attributes | |
automaton_t | res_ |
The automaton under construction. More... | |
polynomialset< context_t > | ps_ |
Entries handler. More... | |
state_map | smap_ |
entry_map | emap_ |
label_map | lmap_ |
weight_map | wmap_ |
Additional Inherited Members | |
Protected Attributes inherited from vcsn::automaton_editor | |
char | sep_ = '+' |
The label separator. More... | |
Concrete Builder (the design pattern) for automata.
Returns (via result()) an allocated automaton.
FIXME: cannot be reused for several automata.
Definition at line 82 of file edit-automaton.hh.
using vcsn::edit_automaton< Aut >::automaton_t = Aut |
Definition at line 86 of file edit-automaton.hh.
|
private |
Definition at line 90 of file edit-automaton.hh.
|
private |
Memoize entry conversion.
Definition at line 255 of file edit-automaton.hh.
|
private |
Definition at line 91 of file edit-automaton.hh.
|
private |
Memoize label conversion.
Definition at line 258 of file edit-automaton.hh.
|
private |
Definition at line 93 of file edit-automaton.hh.
|
private |
Definition at line 94 of file edit-automaton.hh.
|
private |
State name -> state handle.
Definition at line 252 of file edit-automaton.hh.
|
private |
Definition at line 92 of file edit-automaton.hh.
using vcsn::edit_automaton< Aut >::string_t = super_t::string_t |
Definition at line 87 of file edit-automaton.hh.
using vcsn::edit_automaton< Aut >::super_t = automaton_editor |
Definition at line 85 of file edit-automaton.hh.
|
private |
Memoize weight conversion.
Definition at line 261 of file edit-automaton.hh.
|
private |
Definition at line 95 of file edit-automaton.hh.
|
inline |
Definition at line 98 of file edit-automaton.hh.
|
inlinefinaloverridevirtual |
Add transitions from src to dst, labeled by entry.
Implements vcsn::automaton_editor.
Definition at line 158 of file edit-automaton.hh.
References vcsn::conv(), vcsn::edit_automaton< Aut >::emap_, vcsn::edit_automaton< Aut >::ps_, vcsn::require(), vcsn::edit_automaton< Aut >::res_, vcsn::automaton_editor::sep_, and vcsn::edit_automaton< Aut >::state_().
|
inlinefinaloverridevirtual |
Implements vcsn::automaton_editor.
Definition at line 137 of file edit-automaton.hh.
|
inlinefinaloverridevirtual |
Implements vcsn::automaton_editor.
Definition at line 131 of file edit-automaton.hh.
|
inlinefinaloverridevirtual |
Register that state named s is postfinal.
Implements vcsn::automaton_editor.
Definition at line 125 of file edit-automaton.hh.
References vcsn::edit_automaton< Aut >::res_, and vcsn::edit_automaton< Aut >::smap_.
|
inlinefinaloverridevirtual |
Register that state named s is preinitial.
Implements vcsn::automaton_editor.
Definition at line 118 of file edit-automaton.hh.
References vcsn::edit_automaton< Aut >::res_, and vcsn::edit_automaton< Aut >::smap_.
|
inlinefinaloverridevirtual |
Register the existence of state named s.
Implements vcsn::automaton_editor.
Definition at line 111 of file edit-automaton.hh.
References vcsn::edit_automaton< Aut >::state_().
|
inlinefinaloverridevirtual |
Add a transition from src to dst.
Implements vcsn::automaton_editor.
Definition at line 143 of file edit-automaton.hh.
|
inlineprivate |
Convert a label string to its value.
Definition at line 216 of file edit-automaton.hh.
References vcsn::conv(), vcsn::edit_automaton< Aut >::lmap_, and vcsn::edit_automaton< Aut >::res_.
|
inlinefinaloverridevirtual |
Implements vcsn::automaton_editor.
Definition at line 104 of file edit-automaton.hh.
References vcsn::edit_automaton< Aut >::res_.
Referenced by vcsn::edit_automaton< Aut >::result().
|
inlinefinaloverridevirtual |
Detach the built automaton.
Implements vcsn::automaton_editor.
Definition at line 208 of file edit-automaton.hh.
References vcsn::edit_automaton< Aut >::res_.
|
inlinefinaloverridevirtual |
Return the built automaton.
Implements vcsn::automaton_editor.
Definition at line 200 of file edit-automaton.hh.
References vcsn::dyn::make_automaton(), vcsn::edit_automaton< Aut >::open(), and vcsn::edit_automaton< Aut >::res_.
|
inlineprivate |
Convert a state name to a state handler.
Definition at line 238 of file edit-automaton.hh.
References vcsn::edit_automaton< Aut >::res_, and vcsn::edit_automaton< Aut >::smap_.
Referenced by vcsn::edit_automaton< Aut >::add_entry(), and vcsn::edit_automaton< Aut >::add_state().
|
inlineprivate |
Convert a weight string to its value.
Definition at line 227 of file edit-automaton.hh.
References vcsn::conv(), vcsn::edit_automaton< Aut >::res_, and vcsn::edit_automaton< Aut >::wmap_.
|
private |
Definition at line 256 of file edit-automaton.hh.
Referenced by vcsn::edit_automaton< Aut >::add_entry().
|
private |
Definition at line 259 of file edit-automaton.hh.
Referenced by vcsn::edit_automaton< Aut >::label_().
|
private |
Entries handler.
Definition at line 249 of file edit-automaton.hh.
Referenced by vcsn::edit_automaton< Aut >::add_entry().
|
private |
The automaton under construction.
Definition at line 247 of file edit-automaton.hh.
Referenced by vcsn::edit_automaton< Aut >::add_entry(), vcsn::edit_automaton< Aut >::add_post(), vcsn::edit_automaton< Aut >::add_pre(), vcsn::edit_automaton< Aut >::label_(), vcsn::edit_automaton< Aut >::open(), vcsn::edit_automaton< Aut >::reset(), vcsn::edit_automaton< Aut >::result(), vcsn::edit_automaton< Aut >::state_(), and vcsn::edit_automaton< Aut >::weight_().
|
private |
Definition at line 253 of file edit-automaton.hh.
Referenced by vcsn::edit_automaton< Aut >::add_post(), vcsn::edit_automaton< Aut >::add_pre(), and vcsn::edit_automaton< Aut >::state_().
|
private |
Definition at line 262 of file edit-automaton.hh.
Referenced by vcsn::edit_automaton< Aut >::weight_().