mirror of
https://github.com/Z3Prover/z3
synced 2025-04-25 10:05:32 +00:00
Merge branch 'develop' into upstream-master
Conflicts: .gitignore README src/ast/ast_smt2_pp.h src/ast/ast_smt_pp.cpp src/ast/reg_decl_plugins.cpp src/cmd_context/cmd_context.cpp src/parsers/smt2/smt2parser.cpp
This commit is contained in:
commit
d79837eed0
17 changed files with 5647 additions and 8 deletions
|
@ -23,6 +23,7 @@ Revision History:
|
|||
#include"bv_decl_plugin.h"
|
||||
#include"arith_decl_plugin.h"
|
||||
#include"seq_decl_plugin.h"
|
||||
#include"str_decl_plugin.h"
|
||||
#include"ast_pp.h"
|
||||
#include"well_sorted.h"
|
||||
#include"pattern_validation.h"
|
||||
|
@ -67,6 +68,8 @@ namespace smt2 {
|
|||
scoped_ptr<bv_util> m_bv_util;
|
||||
scoped_ptr<arith_util> m_arith_util;
|
||||
scoped_ptr<seq_util> m_seq_util;
|
||||
scoped_ptr<str_util> m_str_util;
|
||||
|
||||
scoped_ptr<pattern_validator> m_pattern_validator;
|
||||
scoped_ptr<var_shifter> m_var_shifter;
|
||||
|
||||
|
@ -284,6 +287,12 @@ namespace smt2 {
|
|||
return *(m_bv_util.get());
|
||||
}
|
||||
|
||||
str_util & strutil() {
|
||||
if (m_str_util.get() == 0)
|
||||
m_str_util = alloc(str_util, m());
|
||||
return *(m_str_util.get());
|
||||
}
|
||||
|
||||
pattern_validator & pat_validator() {
|
||||
if (m_pattern_validator.get() == 0) {
|
||||
m_pattern_validator = alloc(pattern_validator, m());
|
||||
|
@ -1073,10 +1082,29 @@ namespace smt2 {
|
|||
next();
|
||||
}
|
||||
|
||||
// sorry, breaking theory_seq for a bit
|
||||
/*
|
||||
void parse_string_const() {
|
||||
SASSERT(curr() == scanner::STRING_TOKEN);
|
||||
expr_stack().push_back(sutil().str.mk_string(symbol(m_scanner.get_string())));
|
||||
TRACE("smt2parser", tout << "new string: " << mk_pp(expr_stack().back(), m()) << "\n";);
|
||||
next();
|
||||
}
|
||||
*/
|
||||
|
||||
void parse_string_const() {
|
||||
parse_string();
|
||||
}
|
||||
|
||||
void parse_string() {
|
||||
SASSERT(curr() == scanner::STRING_TOKEN);
|
||||
char const *original_token = m_scanner.get_string();
|
||||
size_t bufsize = strlen(original_token);
|
||||
char * buf = alloc_svect(char, bufsize + 1);
|
||||
strncpy(buf, original_token, bufsize);
|
||||
buf[bufsize] = '\0';
|
||||
TRACE("parse_string", tout << "new string constant: " << buf << " length=" << bufsize << "\n";);
|
||||
expr_stack().push_back(strutil().mk_string(buf));
|
||||
next();
|
||||
}
|
||||
|
||||
|
@ -1739,6 +1767,9 @@ namespace smt2 {
|
|||
case scanner::BV_TOKEN:
|
||||
parse_bv_numeral();
|
||||
break;
|
||||
case scanner::STRING_TOKEN:
|
||||
parse_string();
|
||||
break;
|
||||
case scanner::LEFT_PAREN:
|
||||
push_expr_frame(m_num_expr_frames == 0 ? 0 : static_cast<expr_frame*>(m_stack.top()));
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue