mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-10 12:53:03 +00:00
* doc/bison.texinfo (Calc++): Add the extraction marks. * examples/extexi: New, from the aborted GNU Programming 2E. Separate the different paragraph of a file with empty lines. * examples/Makefile: Use it to extract the whole calc++ example.
38 lines
667 B
C++
38 lines
667 B
C++
#line 7140 "../../doc/bison.texinfo"
|
|
#include "calc++-driver.hh"
|
|
#include "calc++-parser.hh"
|
|
|
|
calcxx_driver::calcxx_driver ()
|
|
: trace_scanning (false), trace_parsing (false)
|
|
{
|
|
variables["one"] = 1;
|
|
variables["two"] = 2;
|
|
}
|
|
|
|
calcxx_driver::~calcxx_driver ()
|
|
{
|
|
}
|
|
|
|
void
|
|
calcxx_driver::parse (const std::string &f)
|
|
{
|
|
file = f;
|
|
scan_begin ();
|
|
yy::calcxx_parser parser (*this);
|
|
parser.set_debug_level (trace_parsing);
|
|
parser.parse ();
|
|
scan_end ();
|
|
}
|
|
|
|
void
|
|
calcxx_driver::error (const yy::location& l, const std::string& m)
|
|
{
|
|
std::cerr << l << ": " << m << std::endl;
|
|
}
|
|
|
|
void
|
|
calcxx_driver::error (const std::string& m)
|
|
{
|
|
std::cerr << m << std::endl;
|
|
}
|