www.pudn.com > cppcc.rar > cppcc_driver.hh


/*
 *  File:       cppcc_driver.hh
 *              $Id: cppcc_driver.hh,v 1.4 2002/05/27 02:58:55 alec Exp $
 *
 *  Author:     Alec Panovici (alecu@email.com)
 * 
 *  Comments:
 *
 *  Revision history:
 *
 *  $Log: cppcc_driver.hh,v $
 *  Revision 1.4  2002/05/27 02:58:55  alec
 *  doc update
 *
 *  Revision 1.3  2002/04/29 09:34:10  alec
 *  scanner ptree building compiles
 *
 */


/*
  Copyright (C) 2002 Alexandru Panoviciu (alecu@email.com)

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

 */

#ifndef __CPPCC_DRIVER__
#define __CPPCC_DRIVER__

class PropRegistry;

/**
 * This is the driver class of CppCC. It instantiates the parser, the parse
 * tree roots and runs all the stages needed to generate the scanner and
 * parser sources.
 */
class CppCcDriver
{
public:

  /**
   * Creates a new CppCcDriver object. Although this class is not singleton, a
   * single instance can be used because CppCcDriver in its turn uses a
   * LexYaccParser instance, and LexYaccParser IS a singleton.
   */
  CppCcDriver () {};


  /**
   * By calling this method the whole process of parsing/processing/generating
   * code is run. The method does not return until all the stages have been
   * completed and the C++ sources were generated.
   *
   * If this method ever returns, its return value indicates the success
   * status of the whole thing. However, it may die() in several places.
   */
  bool run (PropRegistry ®istry);
};

#endif /* #ifndef __CPPCC_DRIVER__ */