summaryrefslogtreecommitdiff
path: root/src/parser/parser.cpp
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2009-11-25 00:42:52 +0000
committerMorgan Deters <mdeters@gmail.com>2009-11-25 00:42:52 +0000
commit2a1ac62e56d43893c59c4c2d91bcaca0dd7ce417 (patch)
tree5d2e6b493d8d366ab75163effaf13191dbf0bd71 /src/parser/parser.cpp
parent06b391f721c8e9de4835e5a5bf2c60383ea7f8e9 (diff)
additional work on parser hookup, configuration + build
Diffstat (limited to 'src/parser/parser.cpp')
-rw-r--r--src/parser/parser.cpp86
1 files changed, 77 insertions, 9 deletions
diff --git a/src/parser/parser.cpp b/src/parser/parser.cpp
index 89170beeb..42ff506fa 100644
--- a/src/parser/parser.cpp
+++ b/src/parser/parser.cpp
@@ -8,19 +8,87 @@
** information.
**
** Parser implementation.
- **
- ** The Analysis of Computer Systems Group (ACSys)
- ** Courant Institute of Mathematical Sciences
- ** New York University
**/
-#include "parser.h"
-#include "parser_temp.h"
-#include "parser_exception.h"
+#include "parser/parser.h"
+#include "parser/parser_state.h"
+#include "parser/parser_exception.h"
+#include "parser/pl.hpp"
+//#include "parser/smtlib.hpp"
+
+// The communication entry points of the actual parsers
+
+// for presentation language (PL.y and PL.lex)
+extern int PLparse();
+extern void *PL_createBuffer(int);
+extern void PL_deleteBuffer(void *);
+extern void PL_switchToBuffer(void *);
+extern int PL_bufSize();
+extern void *PL_bufState();
+void PL_setInteractive(bool);
+
+// for smtlib language (smtlib.y and smtlib.lex)
+extern int smtlibparse();
+extern void *smtlib_createBuffer(int);
+extern void smtlib_deleteBuffer(void *);
+extern void smtlib_switchToBuffer(void *);
+extern int smtlib_bufSize();
+extern void *smtlibBufState();
+void smtlib_setInteractive(bool);
namespace CVC4 {
+namespace parser {
-ParserTemp *parserTemp;
+ParserState *parserState;
-}/* CVC4 namespace */
+Parser::Parser(CVC4::SmtEngine* smt, Language lang, std::istream& is, CVC4::Options* opts, bool interactive) throw()
+ : d_smt(smt),
+ d_is(is),
+ d_opts(opts),
+ d_lang(lang),
+ d_interactive(interactive),
+ d_buffer(0) {
+
+ parserState->lineNum = 1;
+ switch(d_lang) {
+ case PL:
+ d_buffer = ::PL_createBuffer(::PL_bufSize());
+ break;
+ case SMTLIB:
+ //d_buffer = ::smtlib_createBuffer(::smtlib_bufSize());
+ break;
+ default:
+ Unhandled();
+ }
+}
+Parser::~Parser() throw() {
+ switch(d_lang) {
+ case PL:
+ ::PL_deleteBuffer(d_buffer);
+ break;
+ case SMTLIB:
+ //::smtlib_deleteBuffer(d_buffer);
+ break;
+ default:
+ Unhandled();
+ }
+}
+
+CVC4::Command* Parser::next() throw() {
+ return 0;
+}
+
+bool Parser::done() const throw() {
+ return false;
+}
+
+void Parser::printLocation(std::ostream & out) const throw() {
+}
+
+void Parser::reset() throw() {
+}
+
+
+}/* CVC4::parser namespace */
+}/* CVC4 namespace */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback