26 std::string file =
"file.fado";
28 boost::flyweight<std::string, boost::flyweights::no_tracking>;
41 if (kind !=
"@DFA" && kind !=
"@NFA")
42 raise(file,
": bad automaton kind: ", kind);
52 while ((c = is.get()) !=
'\n' && !is.eof())
53 if (c ==
' ' || c ==
'\t')
88 if (!init && !is.eof())
106 REGISTER_DEFINE(
fado);
111 detail::fado_registry().call(aut, out);
bool open(bool o)
Whether unknown letters should be added, or rejected.
std::shared_ptr< detail::automaton_base > automaton
automaton read_fado(std::istream &is)
void add_initial(string_t s, string_t w=string_t{})
Add s as an initial state.
void add_transition(string_t src, string_t dst, string_t lbl, string_t w=string_t{})
Add an acceptor transition from src to dst, labeled by lbl.
void add_final(string_t s, string_t w=string_t{})
Add s as a final state.
boost::flyweight< std::string, boost::flyweights::no_tracking > string_t
std::istringstream is
The input stream: the specification to translate.
std::ostream & fado(const automaton &aut, std::ostream &out)
Output in FAdo format.
dyn::automaton result()
Return the built automaton.
Build an automaton with unknown context.