#include "expr/expr.h"
#include "expr/expr_manager.h"
-#include "parser/cvc/cvc_parser.h"
+#include "parser/parser.h"
using namespace CVC4;
using namespace CVC4::parser;
class CvcParserBlack : public CxxTest::TestSuite {
private:
ExprManager *d_exprManager;
+ Parser::InputLanguage d_lang;
public:
void setUp() {
d_exprManager = new ExprManager();
+ d_lang = Parser::LANG_CVC4;
}
void testGoodInputs() {
// cout << "In testGoodInputs()\n";
for(int i = 0; i < sizeof(goodInputs); ++i) {
istringstream stream(goodInputs[i]);
- CvcParser cvcParser(d_exprManager, stream);
- TS_ASSERT( !cvcParser.done() );
- while(!cvcParser.done()) {
- TS_ASSERT( cvcParser.parseNextCommand() != NULL );
+ Parser* cvcParser = Parser::getNewParser(d_exprManager, d_lang, stream);
+ TS_ASSERT( !cvcParser->done() );
+ while(!cvcParser->done()) {
+ TS_ASSERT( cvcParser->parseNextCommand() != NULL );
}
+ delete cvcParser;
}
}
// cout << "In testGoodInputs()\n";
for(int i = 0; i < sizeof(badInputs); ++i) {
istringstream stream(badInputs[i]);
- CvcParser cvcParser(d_exprManager, stream);
- TS_ASSERT_THROWS( cvcParser.parseNextCommand(), ParserException );
+ Parser* cvcParser = Parser::getNewParser(d_exprManager, d_lang, stream);
+ TS_ASSERT_THROWS( cvcParser->parseNextCommand(), ParserException );
+ delete cvcParser;
}
}
// cout << "In testGoodInputs()\n";
for(int i = 0; i < sizeof(goodBooleanExprs); ++i) {
istringstream stream(goodBooleanExprs[i]);
- CvcParser cvcParser(d_exprManager, stream);
- TS_ASSERT( !cvcParser.done() );
- while(!cvcParser.done()) {
- TS_ASSERT( !cvcParser.parseNextExpression().isNull() );
+ Parser* cvcParser = Parser::getNewParser(d_exprManager, d_lang, stream);
+ TS_ASSERT( !cvcParser->done() );
+ while(!cvcParser->done()) {
+ TS_ASSERT( !cvcParser->parseNextExpression().isNull() );
}
+ delete cvcParser;
}
}
// cout << "In testGoodInputs()\n";
for(int i = 0; i < sizeof(badBooleanExprs); ++i) {
istringstream stream(badBooleanExprs[i]);
- CvcParser cvcParser(d_exprManager, stream);
- TS_ASSERT_THROWS( cvcParser.parseNextExpression(), ParserException );
+ Parser* cvcParser = Parser::getNewParser(d_exprManager, d_lang, stream);
+ TS_ASSERT_THROWS( cvcParser->parseNextExpression(), ParserException );
+ delete cvcParser;
}
}
#include "expr/expr.h"
#include "expr/expr_manager.h"
-#include "parser/smt/smt_parser.h"
+#include "parser/parser.h"
using namespace CVC4;
using namespace CVC4::parser;
class SmtParserBlack : public CxxTest::TestSuite {
private:
ExprManager *d_exprManager;
-
+ Parser::InputLanguage d_lang;
public:
void setUp() {
d_exprManager = new ExprManager();
+ d_lang = Parser::LANG_SMTLIB;
}
void testGoodInputs() {
// cout << "In testGoodInputs()\n";
for(int i = 0; i < sizeof(goodInputs); ++i) {
istringstream stream(goodInputs[i]);
- SmtParser smtParser(d_exprManager, stream);
- TS_ASSERT( !smtParser.done() );
- while(!smtParser.done()) {
- TS_ASSERT( smtParser.parseNextCommand() != NULL );
+ Parser* smtParser = Parser::getNewParser(d_exprManager, d_lang, stream);
+ TS_ASSERT( !smtParser->done() );
+ while(!smtParser->done()) {
+ TS_ASSERT( smtParser->parseNextCommand() != NULL );
}
+ delete smtParser;
}
}
// cout << "In testGoodInputs()\n";
for(int i = 0; i < sizeof(badInputs); ++i) {
istringstream stream(badInputs[i]);
- SmtParser smtParser(d_exprManager, stream);
- TS_ASSERT_THROWS( smtParser.parseNextCommand(), ParserException );
+ Parser* smtParser = Parser::getNewParser(d_exprManager, d_lang, stream);
+ TS_ASSERT_THROWS( smtParser->parseNextCommand(), ParserException );
+ delete smtParser;
}
}
// cout << "In testGoodInputs()\n";
for(int i = 0; i < sizeof(goodBooleanExprs); ++i) {
istringstream stream(goodBooleanExprs[i]);
- SmtParser smtParser(d_exprManager, stream);
- TS_ASSERT( !smtParser.done() );
- while(!smtParser.done()) {
- TS_ASSERT( !smtParser.parseNextExpression().isNull() );
+ Parser* smtParser = Parser::getNewParser(d_exprManager, d_lang, stream);
+ TS_ASSERT( !smtParser->done() );
+ while(!smtParser->done()) {
+ TS_ASSERT( !smtParser->parseNextExpression().isNull() );
}
+ delete smtParser;
}
}