Files
bison/examples/calc++/calc++.cc
Akim Demaille 1c59e0a121 Extract calc++ from the documentation.
* 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.
2005-07-05 07:21:30 +00:00

20 lines
426 B
C++

#line 7414 "../../doc/bison.texinfo"
#include <iostream>
#include "calc++-driver.hh"
int
main (int argc, const char* argv[])
{
calcxx_driver driver;
for (++argv; argv[0]; ++argv)
if (*argv == std::string ("-p"))
driver.trace_parsing = true;
else if (*argv == std::string ("-s"))
driver.trace_scanning = true;
else
{
driver.parse (*argv);
std::cout << driver.result << std::endl;
}
}