Vcsn  2.0
Be Rational
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
read.cc
Go to the documentation of this file.
1 #include <lib/vcsn/rat/read.hh>
2 #include <vcsn/dyn/context.hh>
3 #include <vcsn/dyn/ratexp.hh>
4 #include <vcsn/dyn/ratexpset.hh>
5 #include <lib/vcsn/rat/driver.hh>
6 #include <vcsn/dyn/algos.hh> // make_ratexpset
7 
8 namespace vcsn
9 {
10  namespace rat
11  {
12  dyn::ratexp read(std::istream& is, const dyn::ratexpset& rs,
13  const location& l)
14  {
15  vcsn::rat::driver d(rs);
16  auto res = d.parse(is, l);
17  if (!d.errors.empty())
18  throw std::runtime_error(d.errors);
19  return res;
20  }
21  }
22 }
dyn::ratexp parse(std::istream &is, const location &l=location{})
Parse this stream.
Definition: driver.cc:67
std::shared_ptr< detail::ratexp_base > ratexp
Definition: fwd.hh:64
dyn::ratexp read(std::istream &is, const dyn::ratexpset &rs, const location &l)
The ratexp in stream is, with rs as default ratexpset.
Definition: read.cc:12
State and public interface for rational expression parsing.
Definition: driver.hh:19
std::shared_ptr< const detail::ratexpset_base > ratexpset
Definition: fwd.hh:73
std::istringstream is
The input stream: the specification to translate.
Definition: translate.cc:329
Abstract a location.
Definition: location.hh:47
std::string errors
The error messages.
Definition: driver.hh:38