mirror of
https://github.com/Z3Prover/z3
synced 2025-04-27 19:05:51 +00:00
parent
1488bf81ae
commit
53ab931626
6 changed files with 137 additions and 8 deletions
|
@ -3118,6 +3118,25 @@ namespace smt2 {
|
|||
return sexpr_ref(nullptr, sm());
|
||||
}
|
||||
|
||||
sort_ref parse_sort_ref(char const* context) {
|
||||
m_num_bindings = 0;
|
||||
m_num_open_paren = 0;
|
||||
|
||||
unsigned found_errors = 0;
|
||||
try {
|
||||
scan_core();
|
||||
parse_sort(context);
|
||||
if (!sort_stack().empty()) {
|
||||
return sort_ref(sort_stack().back(), m());
|
||||
}
|
||||
}
|
||||
catch (z3_exception & ex) {
|
||||
error(ex.msg());
|
||||
}
|
||||
return sort_ref(nullptr, m());
|
||||
}
|
||||
|
||||
|
||||
bool operator()() {
|
||||
m_num_bindings = 0;
|
||||
unsigned found_errors = 0;
|
||||
|
@ -3190,6 +3209,11 @@ bool parse_smt2_commands(cmd_context & ctx, std::istream & is, bool interactive,
|
|||
return p();
|
||||
}
|
||||
|
||||
sort_ref parse_smt2_sort(cmd_context & ctx, std::istream & is, bool interactive, params_ref const & ps, char const * filename) {
|
||||
smt2::parser p(ctx, is, interactive, ps, filename);
|
||||
return p.parse_sort_ref(filename);
|
||||
}
|
||||
|
||||
sexpr_ref parse_sexpr(cmd_context& ctx, std::istream& is, params_ref const& ps, char const* filename) {
|
||||
smt2::parser p(ctx, is, false, ps, filename);
|
||||
return p.parse_sexpr_ref();
|
||||
|
|
|
@ -24,3 +24,4 @@ bool parse_smt2_commands(cmd_context & ctx, std::istream & is, bool interactive
|
|||
|
||||
sexpr_ref parse_sexpr(cmd_context& ctx, std::istream& is, params_ref const& ps, char const* filename);
|
||||
|
||||
sort_ref parse_smt2_sort(cmd_context & ctx, std::istream & is, bool interactive, params_ref const & ps, char const * filename);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue