Vcsn  2.8
Be Rational
vcsn::detail::dot::driver Class Reference

State and public interface for Dot parsing. More...

#include <driver.hh>

Collaboration diagram for vcsn::detail::dot::driver:

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< yyFlexLexerscanner_
 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_editoredit_
 An automaton editor that stores the one being built. More...
 

Friends

class parser
 

Detailed Description

State and public interface for Dot parsing.

Definition at line 19 of file driver.hh.

Constructor & Destructor Documentation

◆ driver()

vcsn::detail::dot::driver::driver ( )

Definition at line 21 of file driver.cc.

References edit_.

◆ ~driver()

vcsn::detail::dot::driver::~driver ( )

Definition at line 26 of file driver.cc.

Member Function Documentation

◆ error()

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().

Here is the call graph for this function:

◆ has_edit_()

bool vcsn::detail::dot::driver::has_edit_ ( const location_t l)
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().

◆ invalid()

void vcsn::detail::dot::driver::invalid ( const location_t l,
const std::string &  s 
)

The string s is invalid at l.

Definition at line 95 of file driver.cc.

◆ parse()

auto vcsn::detail::dot::driver::parse ( std::istream &  is,
const location_t l = location_t{} 
)

Parse this stream.

Exceptions
runtime_errorif 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().

Here is the call graph for this function:

◆ setup_()

void vcsn::detail::dot::driver::setup_ ( const location_t l,
const std::string &  ctx 
)
private

From context_, build edit_.

Exceptions
std::exceptionon 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().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ parser

friend class parser
friend

Definition at line 56 of file driver.hh.

Member Data Documentation

◆ edit_

std::shared_ptr<vcsn::automaton_editor> vcsn::detail::dot::driver::edit_
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_().

◆ errors

std::string vcsn::detail::dot::driver::errors

The error messages.

Definition at line 38 of file driver.hh.

Referenced by error(), and parse().

◆ location_

location_t vcsn::detail::dot::driver::location_
private

The inital location.

Definition at line 53 of file driver.hh.

Referenced by parse(), and vcsn::detail::dot::parser::parse().

◆ require_context_done_

bool vcsn::detail::dot::driver::require_context_done_ = false
private

Definition at line 50 of file driver.hh.

Referenced by has_edit_().

◆ scanner_

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().


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