![]() |
Vcsn
2.8
Be Rational
|
Concrete Builder (the design pattern) for automata. More...
#include <edit-automaton.hh>
Public Types | |
| using | super_t = automaton_editor |
| using | automaton_t = name_automaton< 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) | |
| bool | open (bool o) override final |
| Whether unknown letters should be added, or rejected. More... | |
| void | add_state (string_t s) override final |
| Register the existence of state named s. More... | |
| void | add_pre (string_t s) override final |
| Register that state named s is preinitial. More... | |
| void | add_post (string_t s) override final |
| Register that state named s is postfinal. More... | |
| void | add_initial (string_t s, string_t weight=string_t{}) override final |
| void | add_final (string_t s, string_t weight=string_t{}) override final |
| void | add_transition (string_t src, string_t dst, string_t label, string_t weight=string_t{}) override final |
| Add a transition from src to dst. More... | |
| void | add_entry (string_t src, string_t dst, string_t entry) override final |
| Add transitions from src to dst, labeled by entry. More... | |
| dyn::automaton | result () override final |
| Return the built automaton. More... | |
| void | reset () override final |
| 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 | 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... | |
| 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 85 of file edit-automaton.hh.
| using vcsn::edit_automaton< Aut >::automaton_t = name_automaton<Aut> |
Definition at line 89 of file edit-automaton.hh.
|
private |
Definition at line 93 of file edit-automaton.hh.
|
private |
Memoize entry conversion.
Definition at line 271 of file edit-automaton.hh.
|
private |
Definition at line 94 of file edit-automaton.hh.
|
private |
Memoize label conversion.
Definition at line 274 of file edit-automaton.hh.
|
private |
Definition at line 96 of file edit-automaton.hh.
|
private |
Definition at line 97 of file edit-automaton.hh.
|
private |
Definition at line 95 of file edit-automaton.hh.
| using vcsn::edit_automaton< Aut >::string_t = super_t::string_t |
Definition at line 90 of file edit-automaton.hh.
| using vcsn::edit_automaton< Aut >::super_t = automaton_editor |
Definition at line 88 of file edit-automaton.hh.
|
private |
Memoize weight conversion.
Definition at line 277 of file edit-automaton.hh.
|
private |
Definition at line 98 of file edit-automaton.hh.
|
inline |
Definition at line 101 of file edit-automaton.hh.
|
inlinefinaloverridevirtual |
Add transitions from src to dst, labeled by entry.
Implements vcsn::automaton_editor.
Definition at line 164 of file edit-automaton.hh.
References vcsn::conv(), vcsn::label_of(), vcsn::require(), vcsn::automaton_editor::sep_, VCSN_REQUIRE, and vcsn::weight_of().
|
inlinefinaloverridevirtual |
Implements vcsn::automaton_editor.
Definition at line 143 of file edit-automaton.hh.
|
inlinefinaloverridevirtual |
Implements vcsn::automaton_editor.
Definition at line 137 of file edit-automaton.hh.
|
inlinefinaloverridevirtual |
Register that state named s is postfinal.
Implements vcsn::automaton_editor.
Definition at line 131 of file edit-automaton.hh.
|
inlinefinaloverridevirtual |
Register that state named s is preinitial.
Implements vcsn::automaton_editor.
Definition at line 124 of file edit-automaton.hh.
|
inlinefinaloverridevirtual |
Register the existence of state named s.
Implements vcsn::automaton_editor.
Definition at line 117 of file edit-automaton.hh.
|
inlinefinaloverridevirtual |
Add a transition from src to dst.
Implements vcsn::automaton_editor.
Definition at line 149 of file edit-automaton.hh.
|
inlineprivate |
Convert a label string to its value.
Definition at line 238 of file edit-automaton.hh.
References vcsn::conv().
|
inlinefinaloverridevirtual |
Whether unknown letters should be added, or rejected.
| o | whether to accept |
Implements vcsn::automaton_editor.
Definition at line 110 of file edit-automaton.hh.
References vcsn::automaton_editor::open().
|
inlinefinaloverridevirtual |
Detach the built automaton.
Implements vcsn::automaton_editor.
Definition at line 230 of file edit-automaton.hh.
|
inlinefinaloverridevirtual |
Return the built automaton.
Implements vcsn::automaton_editor.
Definition at line 222 of file edit-automaton.hh.
References vcsn::automaton_editor::open().
|
inlineprivate |
Convert a state name to a state handler.
Definition at line 260 of file edit-automaton.hh.
|
inlineprivate |
Convert a weight string to its value.
Definition at line 249 of file edit-automaton.hh.
References vcsn::conv().
|
private |
Definition at line 272 of file edit-automaton.hh.
|
private |
Definition at line 275 of file edit-automaton.hh.
|
private |
Entries handler.
Definition at line 268 of file edit-automaton.hh.
|
private |
The automaton under construction.
Definition at line 266 of file edit-automaton.hh.
|
private |
Definition at line 278 of file edit-automaton.hh.