예제 #1
0
static unsigned pp_symbol(std::ostream & out, symbol const & s) {
    if (is_smt2_quoted_symbol(s)) {
        std::string str = mk_smt2_quoted_symbol(s);
        out << str;
        return static_cast<unsigned>(str.length());
    }
    else if (s.is_numerical()) {
        std::string str = s.str();
        out << str;
        return static_cast<unsigned>(str.length());
    }
    else {
        out << s.bare_str();
        return static_cast<unsigned>(strlen(s.bare_str()));
    }
}
예제 #2
0
 virtual void set_next_arg(cmd_context & ctx, symbol const & s) {
     cmd * c = ctx.find_cmd(s);
     if (c == 0) {
         std::string err_msg("unknown command '");
         err_msg = err_msg + s.bare_str() + "'";
         throw cmd_exception(err_msg);
     }
     m_cmds.push_back(s);
 }
예제 #3
0
 void set_next_arg(cmd_context & ctx, symbol const & s) override {
     cmd * c = ctx.find_cmd(s);
     if (c == nullptr) {
         std::string err_msg("unknown command '");
         err_msg = err_msg + s.bare_str() + "'";
         throw cmd_exception(std::move(err_msg));
     }
     m_cmds.push_back(s);
 }
예제 #4
0
파일: params.cpp 프로젝트: greatmazinger/z3
 bool split_name(symbol const& name, symbol & prefix, symbol & suffix) const {
     if (name.is_numerical()) return false;
     char const* str = name.bare_str();
     char const* period = strchr(str,'.');
     if (!period) return false;
     svector<char> prefix_((unsigned)(period-str), str);
     prefix_.push_back(0);
     prefix = symbol(prefix_.c_ptr());
     suffix = symbol(period + 1);
     return true;
 }
예제 #5
0
std::string mk_smt2_quoted_symbol(symbol const & s) {
    SASSERT(is_smt2_quoted_symbol(s));
    string_buffer<> buffer;
    buffer.append('|');
    char const * str = s.bare_str();
    while (*str) {
        if (*str == '|' || *str == '\\')
            buffer.append('\\');
        buffer.append(*str);
        str++;
    }
    buffer.append('|');
    return std::string(buffer.c_str());
}
예제 #6
0
 bool operator()(symbol const & s1, symbol const & s2) const { return strcmp(s1.bare_str(), s2.bare_str()) < 0; }
예제 #7
0
bool is_smt2_quoted_symbol(symbol const & s) {
    if (s.is_numerical())
        return false;
    return is_smt2_quoted_symbol(s.bare_str());
}
예제 #8
0
파일: params.cpp 프로젝트: greatmazinger/z3
std::string norm_param_name(symbol const & n) {
    return norm_param_name(n.bare_str());
}