www.pudn.com > cppcc.rar > main.cc


/*
 *  File:       main.cc
 *              $Id: main.cc,v 1.2 2002/07/09 03:04:58 alec Exp $
 *
 *  Author:     Alec Panoviciu (alecu@email.com)
 *
 *  Comments:
 *
 *  Revision history:
 *
 *  $Log: main.cc,v $
 *  Revision 1.2  2002/07/09 03:04:58  alec
 *  OWN_STRINGS bu*beep*it finally vanished
 *  gcc 3.1&mingw - related cleanups
 *
 *  Revision 1.1  2002/06/23 23:41:37  alec
 *  *** empty log message ***
 *
 */

/*
 * This file is Public Domain software. Use it as you wish and in good
 * health.
 */

/*
 * This is the driver for the sample Verilog parser. In order to obtain a
 * binary, run cppcc on the verilog.cg file, then compile&link the resulting
 * sources together with this file.
 */

#include 
#include 
#include 
using namespace std;

#include "cppcc_parser.hh"

using namespace cppcc;

int main (int argc, char *argv[])
{
  argc--, argv++;
  istream *ifs;
  if (argc == 0) ifs = &cin;
  else ifs = new ifstream(argv[0]);

  CppccParser parser(ifs);
  try {
    parser.grammarFile();
  } catch (ScanException &scex)
  {
    cerr << argv[0] << ": " << (string) scex << endl;
    return 1;
  } catch (ParseException &pex)
  {
    cerr << argv[0] << ": " << (string) pex << endl;
    return 1;
  }
  return 0;
}