parser_temp.h

Go to the documentation of this file.
00001 /*****************************************************************************/
00002 /*!
00003  * \file parser_temp.h
00004  * 
00005  * Author: Sergey Berezin
00006  * 
00007  * Created: Wed Feb  5 17:53:02 2003
00008  *
00009  * <hr>
00010  *
00011  * License to use, copy, modify, sell and/or distribute this software
00012  * and its documentation for any purpose is hereby granted without
00013  * royalty, subject to the terms and conditions defined in the \ref
00014  * LICENSE file provided with this distribution.
00015  * 
00016  * <hr>
00017  * 
00018  * A class used to communicate with the actual parser.  No one else
00019  * should use it.
00020  */
00021 /*****************************************************************************/
00022 
00023 #ifndef _cvc3__parser_temp_h_
00024 #define _cvc3__parser_temp_h_
00025 
00026 #include "expr.h"
00027 #include "exception.h"
00028 
00029 namespace CVC3 {
00030 
00031   class ValidityChecker;
00032 
00033   class ParserTemp {
00034   private:
00035     // Counter for uniqueID of bound variables
00036     int d_uid;
00037     // The main prompt when running interactive
00038     std::string prompt1;
00039     // The interactive prompt in the middle of a multi-line command
00040     std::string prompt2;
00041     // The currently used prompt
00042     std::string prompt;
00043   public:
00044     ValidityChecker* vc;
00045     std::istream* is;
00046     // The current input line
00047     int lineNum;
00048     // File name
00049     std::string fileName;
00050     // The last parsed Expr
00051     Expr expr;
00052     // Whether we are done or not
00053     bool done;
00054     // Whether we are running interactive
00055     bool interactive;
00056     // Whether arrays are enabled for smt-lib format
00057     bool arrFlag;
00058     // Whether bit-vectors are enabled for smt-lib format
00059     bool bvFlag;
00060     // Size of bit-vectors for smt-lib format
00061     int bvSize;
00062     // Default constructor
00063     ParserTemp() : d_uid(0), prompt1("CVC> "), prompt2("- "),
00064       prompt("CVC> "), lineNum(1), done(false), arrFlag(false) { }
00065     // Parser error handling (implemented in parser.cpp)
00066     int error(const std::string& s);
00067     // Get the next uniqueID as a string
00068     std::string uniqueID() {
00069       std::ostringstream ss;
00070       ss << d_uid++;
00071       return ss.str();
00072     }
00073     // Get the current prompt
00074     std::string getPrompt() { return prompt; }
00075     // Set the prompt to the main one
00076     void setPrompt1() { prompt = prompt1; }
00077     // Set the prompt to the secondary one
00078     void setPrompt2() { prompt = prompt2; }
00079   };
00080 
00081 } // end of namespace CVC3
00082 
00083 #endif

Generated on Tue Jul 3 14:33:38 2007 for CVC3 by  doxygen 1.5.1