![]() |
Vcsn
2.8
Be Rational
|
State and public interface for Dot parsing. More...
#include <driver.hh>
Public Member Functions | |
driver () | |
~driver () | |
dyn::automaton | parse (std::istream &is, const location_t &l=location_t{}) |
Parse this stream. More... | |
void | error (const location_t &l, const std::string &m) |
Report an error m at l. More... | |
ATTRIBUTE_NORETURN void | invalid (const location_t &l, const std::string &s) |
The string s is invalid at l. More... | |
Public Attributes | |
std::string | errors |
The error messages. More... | |
std::unique_ptr< yyFlexLexer > | scanner_ |
The scanner. More... | |
Private Member Functions | |
void | setup_ (const location_t &l, const std::string &ctx) |
From context_, build edit_. More... | |
bool | has_edit_ (const location_t &l) |
Require that vcsn_context was defined. More... | |
Private Attributes | |
bool | require_context_done_ = false |
location_t | location_ |
The inital location. More... | |
std::shared_ptr< vcsn::automaton_editor > | edit_ |
An automaton editor that stores the one being built. More... | |
Friends | |
class | parser |
void vcsn::detail::dot::driver::error | ( | const location_t & | l, |
const std::string & | m | ||
) |
Report an error m at l.
Definition at line 84 of file driver.cc.
References errors, vcsn::detail::print_caret(), and scanner_.
Referenced by vcsn::detail::dot::parser::error().
|
private |
Require that vcsn_context was defined.
But do it only once, no need to spam the user.
Definition at line 71 of file driver.cc.
References edit_, and require_context_done_.
Referenced by vcsn::detail::dot::parser::parse().
void vcsn::detail::dot::driver::invalid | ( | const location_t & | l, |
const std::string & | s | ||
) |
auto vcsn::detail::dot::driver::parse | ( | std::istream & | is, |
const location_t & | l = location_t{} |
||
) |
Parse this stream.
runtime_error | if there are problem, including syntax errors. |
Definition at line 30 of file driver.cc.
References edit_, errors, location_, vcsn::detail::dot::parser::parse(), vcsn::require(), vcsn::res, scanner_, and vcsn::detail::dot::parser::set_debug_level().
Referenced by vcsn::guess_automaton_format().
|
private |
From context_, build edit_.
std::exception | on invalid contexts. |
Definition at line 56 of file driver.cc.
References edit_, vcsn::dyn::make_automaton_editor(), and vcsn::dyn::make_context().
Referenced by vcsn::detail::dot::parser::parse().
|
private |
An automaton editor that stores the one being built.
Definition at line 55 of file driver.hh.
Referenced by driver(), has_edit_(), parse(), vcsn::detail::dot::parser::parse(), and setup_().
std::string vcsn::detail::dot::driver::errors |
|
private |
The inital location.
Definition at line 53 of file driver.hh.
Referenced by parse(), and vcsn::detail::dot::parser::parse().
|
private |
Definition at line 50 of file driver.hh.
Referenced by has_edit_().
std::unique_ptr<yyFlexLexer> vcsn::detail::dot::driver::scanner_ |
The scanner.
Definition at line 40 of file driver.hh.
Referenced by error(), parse(), and vcsn::detail::dot::yylex().