d_input->setParser(*this);
}
+Parser::~Parser() {
+ for (std::list<Command*>::iterator iter = d_commandQueue.begin();
+ iter != d_commandQueue.end(); ++iter) {
+ Command* command = *iter;
+ delete command;
+ }
+ d_commandQueue.clear();
+ delete d_input;
+}
+
Expr Parser::getSymbol(const std::string& name, SymbolType type) {
checkDeclaration(name, CHECK_DECLARED, type);
assert(isDeclared(name, type));
* "Preemption commands": extra commands implied by subterms that
* should be issued before the currently-being-parsed command is
* issued. Used to support SMT-LIBv2 ":named" attribute on terms.
+ *
+ * Owns the memory of the Commands in the queue.
*/
std::list<Command*> d_commandQueue;
public:
- virtual ~Parser() {
- delete d_input;
- }
+ virtual ~Parser();
/** Get the associated <code>ExprManager</code>. */
inline ExprManager* getExprManager() const {