d_in(*options.in),
d_out(*options.out),
d_language(options.inputLanguage) {
- ParserBuilder parserBuilder(exprManager,INPUT_FILENAME,options);
+ ParserBuilder parserBuilder(&exprManager,INPUT_FILENAME,options);
/* Create parser with bogus input. */
d_parser = parserBuilder.withStringInput("").build();
}/* InteractiveShell::InteractiveShell() */
Parser* replayParser = NULL;
if( options.replayFilename != "" ) {
- ParserBuilder replayParserBuilder(exprMgr, options.replayFilename, options);
+ ParserBuilder replayParserBuilder(&exprMgr, options.replayFilename, options);
if( options.replayFilename == "-") {
if( inputFromStdin ) {
}
} else {
ParserBuilder parserBuilder =
- ParserBuilder(exprMgr, filename, options);
+ ParserBuilder(&exprMgr, filename, options);
if( inputFromStdin ) {
parserBuilder.withStreamInput(cin);
namespace parser {
-ParserBuilder::ParserBuilder(ExprManager& exprManager,
+ParserBuilder::ParserBuilder(ExprManager* exprManager,
const std::string& filename) :
d_filename(filename),
d_exprManager(exprManager) {
init(exprManager,filename);
}
-ParserBuilder::ParserBuilder(ExprManager& exprManager,
+ParserBuilder::ParserBuilder(ExprManager* exprManager,
const std::string& filename,
const Options& options) :
d_filename(filename),
withOptions(options);
}
-void ParserBuilder::init(ExprManager& exprManager,
+void ParserBuilder::init(ExprManager* exprManager,
const std::string& filename) {
d_inputType = FILE_INPUT;
d_lang = language::input::LANG_AUTO;
Parser *parser = NULL;
switch(d_lang) {
case language::input::LANG_SMTLIB:
- parser = new Smt(&d_exprManager, input, d_strictMode);
+ parser = new Smt(d_exprManager, input, d_strictMode);
break;
case language::input::LANG_SMTLIB_V2:
- parser = new Smt2(&d_exprManager, input, d_strictMode);
+ parser = new Smt2(d_exprManager, input, d_strictMode);
break;
default:
- parser = new Parser(&d_exprManager, input, d_strictMode);
+ parser = new Parser(d_exprManager, input, d_strictMode);
}
if( d_checksEnabled ) {
return *this;
}
-ParserBuilder& ParserBuilder::withExprManager(ExprManager& exprManager) {
+ParserBuilder& ParserBuilder::withExprManager(ExprManager* exprManager) {
d_exprManager = exprManager;
return *this;
}
}
ParserBuilder& ParserBuilder::withOptions(const Options& options) {
- return
+ return
withInputLanguage(options.inputLanguage)
.withMmap(options.memoryMap)
.withChecks(options.semanticChecks)
std::istream *d_streamInput;
/** The expression manager */
- ExprManager& d_exprManager;
+ ExprManager* d_exprManager;
/** Should semantic checks be enabled during parsing? */
bool d_checksEnabled;
/** Should we memory-map a file input? */
bool d_mmap;
- void init(ExprManager& exprManager, const std::string& filename);
+ void init(ExprManager* exprManager, const std::string& filename);
public:
/** Create a parser builder using the given ExprManager and filename. */
- ParserBuilder(ExprManager& exprManager, const std::string& filename);
+ ParserBuilder(ExprManager* exprManager, const std::string& filename);
- ParserBuilder(ExprManager& exprManager, const std::string& filename,
+ ParserBuilder(ExprManager* exprManager, const std::string& filename,
const Options& options);
/** Build the parser, using the current settings. */
ParserBuilder& withChecks(bool flag = true);
/** Set the ExprManager to use with the parser. */
- ParserBuilder& withExprManager(ExprManager& exprManager);
+ ParserBuilder& withExprManager(ExprManager* exprManager);
/** Set the parser to read a file for its input. (Default) */
ParserBuilder& withFileInput();