manpagez: man pages & more
info bison
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.2.5 Calc++ Top Level

The top level file, ‘calc++.cc’, poses no problem.

 
#include <iostream>
#include "calc++-driver.hh"

int
main (int argc, 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;
      }
}

© manpagez.com 2000-2025
Individual documents may contain additional copyright information.