1 /********************* -*- C++ -*- */
3 ** This file is part of the CVC4 prototype.
4 ** Copyright (c) 2009 The Analysis of Computer Systems Group (ACSys)
5 ** Courant Institute of Mathematical Sciences
7 ** See the file COPYING in the top-level source directory for licensing
10 ** Parser abstraction.
13 #ifndef __CVC4__PARSER__PARSER_H
14 #define __CVC4__PARSER__PARSER_H
16 #include "core/exception.h"
17 #include "core/lang.h"
22 class ValidityChecker
;
25 // Internal parser state and other data
31 // Internal methods for constructing and destroying the actual parser
36 Parser(ValidityChecker
* vc
, InputLanguage lang
,
37 // The 'interactive' flag is ignored when fileName != ""
38 bool interactive
= true,
39 const std::string
& fileName
= "");
40 Parser(ValidityChecker
* vc
, InputLanguage lang
, std::istream
& is
,
41 bool interactive
= false);
44 // Read the next command.
46 // Check if we are done (end of input has been reached)
48 // The same check can be done by using the class Parser's value as
50 operator bool() const { return done(); }
51 void printLocation(std::ostream
& out
) const;
52 // Reset any local data that depends on validity checker
54 }; // end of class Parser
56 // The global pointer to ParserTemp. Each instance of class Parser
57 // sets this pointer before any calls to the lexer. We do it this
58 // way because flex and bison use global vars, and we want each
59 // Parser object to appear independent.
61 extern ParserTemp
* parserTemp
;
63 }/* CVC4::parser namespace */
66 #endif /* __CVC4__PARSER__PARSER_H */