Z3
 
Loading...
Searching...
No Matches
Public Member Functions
parser_context Class Reference

#include <z3++.h>

+ Inheritance diagram for parser_context:

Public Member Functions

 parser_context (context &c)
 
 ~parser_context () override
 
 operator bool () const
 
 operator Z3_parser_context () const
 
 parser_context (const parser_context &o)
 
parser_contextoperator= (const parser_context &o)
 
void add_sort (const sort &s)
 Add a sort declaration.
 
void add_sort (const func_decl &f)
 Add a function declaration.
 
expr_vector parse_string (const char *s)
 Parse a string of SMTLIB2 commands. Return assertions.
 
- Public Member Functions inherited from object
 object (context &c)
 
virtual ~object ()=default
 
contextctx () const
 
Z3_error_code check_error () const
 

Additional Inherited Members

- Protected Attributes inherited from object
contextm_ctx
 

Detailed Description

Definition at line 871 of file z3++.h.

Constructor & Destructor Documentation

◆ parser_context() [1/2]

parser_context ( context c)
inlineexplicit

Definition at line 874 of file z3++.h.

context & ctx() const
Definition z3++.h:544
object(context &c)
Definition z3++.h:542
void Z3_API Z3_parser_context_inc_ref(Z3_context c, Z3_parser_context pc)
Increment the reference counter of the given Z3_parser_context object.
Z3_parser_context Z3_API Z3_mk_parser_context(Z3_context c)
Create a parser context.

◆ ~parser_context()

~parser_context ( )
inlineoverride

Definition at line 875 of file z3++.h.

875{ if (m_pc) Z3_parser_context_dec_ref(ctx(), m_pc); }
void Z3_API Z3_parser_context_dec_ref(Z3_context c, Z3_parser_context pc)
Decrement the reference counter of the given Z3_parser_context object.

◆ parser_context() [2/2]

Definition at line 878 of file z3++.h.

878:object(o), m_pc(o.m_pc) { Z3_parser_context_inc_ref(ctx(), m_pc); }

Member Function Documentation

◆ add_sort() [1/2]

void add_sort ( const func_decl f)
inline

Add a function declaration.

Definition at line 897 of file z3++.h.

Z3_error_code check_error() const
Definition z3++.h:545
void Z3_API Z3_parser_context_add_decl(Z3_context c, Z3_parser_context pc, Z3_func_decl f)
Add a function declaration.

◆ add_sort() [2/2]

void add_sort ( const sort s)
inline

Add a sort declaration.

Definition at line 892 of file z3++.h.

void Z3_API Z3_parser_context_add_sort(Z3_context c, Z3_parser_context pc, Z3_sort s)
Add a sort declaration.

◆ operator bool()

operator bool ( ) const
inlineexplicit

Definition at line 876 of file z3++.h.

876{ return m_pc; }

◆ operator Z3_parser_context()

operator Z3_parser_context ( ) const
inline

Definition at line 877 of file z3++.h.

877{ return m_pc; }

◆ operator=()

Definition at line 879 of file z3++.h.

879 {
880 if (this != &o) {
881 if (m_pc) Z3_parser_context_dec_ref(*m_ctx, m_pc);
882 Z3_parser_context_inc_ref(*o.m_ctx, o.m_pc);
883 object::operator=(o);
884 m_pc = o.m_pc;
885 }
886 return *this;
887 }
context * m_ctx
Definition z3++.h:540

◆ parse_string()

expr_vector parse_string ( const char s)
inline

Parse a string of SMTLIB2 commands. Return assertions.

Definition at line 902 of file z3++.h.

902 {
903 auto result = Z3_parser_context_from_string(ctx(), m_pc, s);
905 return expr_vector(ctx(), result);
906 }
Z3_error_code check_error() const
Auxiliary method used to check for API usage errors.
Definition z3++.h:241
Z3_ast_vector Z3_API Z3_parser_context_from_string(Z3_context c, Z3_parser_context pc, Z3_string s)
Parse a string of SMTLIB2 commands. Return assertions.
ast_vector_tpl< expr > expr_vector
Definition z3++.h:77