Vcsn  2.4
Be Rational
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/value.hh>
4 #include <lib/vcsn/rat/driver.hh>
5 
6 namespace vcsn
7 {
8  namespace rat
9  {
12  std::istream& is, const location& l)
13  {
14  vcsn::rat::driver d{ctx, ids};
15  auto res = d.parse(is, l);
16  if (!d.errors.empty())
17  throw std::runtime_error(d.errors);
18  return res;
19  }
20  }
21 }
static dyn::context ctx(const driver &d)
Get the context of the driver.
Definition: parse.cc:82
return res
Definition: multiply.hh:398
static identities ids(const driver &d)
Get the identities of the driver.
Definition: parse.cc:89
dyn::expression read(const dyn::context &ctx, rat::identities ids, std::istream &is, const location &l)
The expression in stream is.
Definition: read.cc:11
State and public interface for rational expression parsing.
Definition: driver.hh:18
Definition: a-star.hh:8
Template-less root for contexts.
Definition: context.hh:16
An expressionset can implement several different sets of identities on expressions.
Definition: identities.hh:21
value_impl< detail::expression_tag > expression
Definition: fwd.hh:25
Abstract a location.
Definition: location.hh:47