diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2017-07-17 01:18:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-17 01:18:10 -0400 |
commit | efac53e969ccefc01bace1a5f095dfd3570c3767 (patch) | |
tree | 0cfcf50944619bc0e7c452f9aa918a56ebd3d540 /src/parser/smt2/Smt2.g | |
parent | 949e19cbc2881996e5c5eed613f4506264482039 (diff) |
Remove PtrCloser (#198)
With C++11, we don't need PtrCloser anymore because we can
just use std::unique_ptr.
Diffstat (limited to 'src/parser/smt2/Smt2.g')
-rw-r--r-- | src/parser/smt2/Smt2.g | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/parser/smt2/Smt2.g b/src/parser/smt2/Smt2.g index 5d24ec024..88709c29a 100644 --- a/src/parser/smt2/Smt2.g +++ b/src/parser/smt2/Smt2.g @@ -85,7 +85,8 @@ using namespace CVC4::parser; // files. See the documentation in "parser/antlr_undefines.h" for more details. #include "parser/antlr_undefines.h" -#include "base/ptr_closer.h" +#include <memory> + #include "parser/parser.h" #include "parser/antlr_tracing.h" #include "smt/command.h" @@ -205,7 +206,7 @@ parseExpr returns [CVC4::parser::smt2::myExpr expr] */ parseCommand returns [CVC4::Command* cmd_return = NULL] @declarations { - CVC4::PtrCloser<CVC4::Command> cmd; + std::unique_ptr<CVC4::Command> cmd; std::string name; } @after { @@ -241,7 +242,7 @@ parseCommand returns [CVC4::Command* cmd_return = NULL] */ parseSygus returns [CVC4::Command* cmd_return = NULL] @declarations { - CVC4::PtrCloser<CVC4::Command> cmd; + std::unique_ptr<CVC4::Command> cmd; std::string name; } @after { @@ -255,7 +256,7 @@ parseSygus returns [CVC4::Command* cmd_return = NULL] * Parse the internal portion of the command, ignoring the surrounding * parentheses. */ -command [CVC4::PtrCloser<CVC4::Command>* cmd] +command [std::unique_ptr<CVC4::Command>* cmd] @declarations { std::string name; std::vector<std::string> names; @@ -455,7 +456,7 @@ command [CVC4::PtrCloser<CVC4::Command>* cmd] PARSER_STATE->pushUnsatCoreNameScope(); cmd->reset(new PushCommand()); } else { - CVC4::PtrCloser<CommandSequence> seq(new CommandSequence()); + std::unique_ptr<CommandSequence> seq(new CommandSequence()); do { PARSER_STATE->pushScope(); PARSER_STATE->pushUnsatCoreNameScope(); @@ -495,7 +496,7 @@ command [CVC4::PtrCloser<CVC4::Command>* cmd] PARSER_STATE->popScope(); cmd->reset(new PopCommand()); } else { - CVC4::PtrCloser<CommandSequence> seq(new CommandSequence()); + std::unique_ptr<CommandSequence> seq(new CommandSequence()); do { PARSER_STATE->popUnsatCoreNameScope(); PARSER_STATE->popScope(); @@ -554,7 +555,7 @@ command [CVC4::PtrCloser<CVC4::Command>* cmd] } ; -sygusCommand [CVC4::PtrCloser<CVC4::Command>* cmd] +sygusCommand [std::unique_ptr<CVC4::Command>* cmd] @declarations { std::string name, fun; std::vector<std::string> names; @@ -565,7 +566,7 @@ sygusCommand [CVC4::PtrCloser<CVC4::Command>* cmd] std::vector<Expr> sygus_vars; std::vector<std::pair<std::string, Type> > sortedVarNames; SExpr sexpr; - CVC4::PtrCloser<CVC4::CommandSequence> seq; + std::unique_ptr<CVC4::CommandSequence> seq; std::vector< std::vector< CVC4::SygusGTerm > > sgts; std::vector< CVC4::Datatype > datatypes; std::vector< std::vector<Expr> > ops; @@ -1075,7 +1076,7 @@ sygusGTerm[CVC4::SygusGTerm& sgt, std::string& fun] ; // Separate this into its own rule (can be invoked by set-info or meta-info) -metaInfoInternal[CVC4::PtrCloser<CVC4::Command>* cmd] +metaInfoInternal[std::unique_ptr<CVC4::Command>* cmd] @declarations { std::string name; SExpr sexpr; @@ -1105,7 +1106,7 @@ metaInfoInternal[CVC4::PtrCloser<CVC4::Command>* cmd] } ; -setOptionInternal[CVC4::PtrCloser<CVC4::Command>* cmd] +setOptionInternal[std::unique_ptr<CVC4::Command>* cmd] @init { std::string name; SExpr sexpr; @@ -1122,7 +1123,7 @@ setOptionInternal[CVC4::PtrCloser<CVC4::Command>* cmd] } ; -smt25Command[CVC4::PtrCloser<CVC4::Command>* cmd] +smt25Command[std::unique_ptr<CVC4::Command>* cmd] @declarations { std::string name; std::string fname; @@ -1136,7 +1137,7 @@ smt25Command[CVC4::PtrCloser<CVC4::Command>* cmd] std::vector<Expr> funcs; std::vector<Expr> func_defs; Expr aexpr; - CVC4::PtrCloser<CVC4::CommandSequence> seq; + std::unique_ptr<CVC4::CommandSequence> seq; } /* meta-info */ : META_INFO_TOK metaInfoInternal[cmd] @@ -1330,7 +1331,7 @@ smt25Command[CVC4::PtrCloser<CVC4::Command>* cmd] // GET_UNSAT_ASSUMPTIONS ; -extendedCommand[CVC4::PtrCloser<CVC4::Command>* cmd] +extendedCommand[std::unique_ptr<CVC4::Command>* cmd] @declarations { std::vector<CVC4::Datatype> dts; Expr e, e2; @@ -1340,7 +1341,7 @@ extendedCommand[CVC4::PtrCloser<CVC4::Command>* cmd] std::vector<Expr> terms; std::vector<Type> sorts; std::vector<std::pair<std::string, Type> > sortedVarNames; - CVC4::PtrCloser<CVC4::CommandSequence> seq; + std::unique_ptr<CVC4::CommandSequence> seq; } /* Extended SMT-LIB set of commands syntax, not permitted in * --smtlib2 compliance mode. */ @@ -1495,7 +1496,7 @@ extendedCommand[CVC4::PtrCloser<CVC4::Command>* cmd] ; -datatypes_2_5_DefCommand[bool isCo, CVC4::PtrCloser<CVC4::Command>* cmd] +datatypes_2_5_DefCommand[bool isCo, std::unique_ptr<CVC4::Command>* cmd] @declarations { std::vector<CVC4::Datatype> dts; std::string name; @@ -1515,7 +1516,7 @@ datatypes_2_5_DefCommand[bool isCo, CVC4::PtrCloser<CVC4::Command>* cmd] } ; -datatypeDefCommand[bool isCo, CVC4::PtrCloser<CVC4::Command>* cmd] +datatypeDefCommand[bool isCo, std::unique_ptr<CVC4::Command>* cmd] @declarations { std::vector<CVC4::Datatype> dts; std::string name; @@ -1530,7 +1531,7 @@ datatypeDefCommand[bool isCo, CVC4::PtrCloser<CVC4::Command>* cmd] { cmd->reset(new DatatypeDeclarationCommand(PARSER_STATE->mkMutualDatatypeTypes(dts))); } ; -datatypesDefCommand[bool isCo, CVC4::PtrCloser<CVC4::Command>* cmd] +datatypesDefCommand[bool isCo, std::unique_ptr<CVC4::Command>* cmd] @declarations { std::vector<CVC4::Datatype> dts; std::string name; @@ -1593,7 +1594,7 @@ datatypesDefCommand[bool isCo, CVC4::PtrCloser<CVC4::Command>* cmd] } ; -rewriterulesCommand[CVC4::PtrCloser<CVC4::Command>* cmd] +rewriterulesCommand[std::unique_ptr<CVC4::Command>* cmd] @declarations { std::vector<std::pair<std::string, Type> > sortedVarNames; std::vector<Expr> args, guards, heads, triggers; |