42 error() <<
"unknown parse-tree element: " << item.
id() <<
eom;
65 const exprt &this_expr=
69 assert(this_expr.
type().
id()==ID_pointer);
72 assert(t.id()==ID_struct);
89 const std::string &module,
93 cpp_parse_tree, symbol_table, module, message_handler);
102 const unsigned errors_before=
126 catch(
const std::string &e)
167 assert(symbol.
type.
id()!=ID_code);
176 assert(symbol.
value.
id()==ID_code);
206 init_symbol.
mode=ID_cpp;
209 init_symbol.
type.
add(ID_return_type)=
typet(ID_constructor);
230 if(symbol.
value.
id()==
"cpp_not_typechecked" &&
233 assert(symbol.
type.
id()==ID_code);
262 if(symbol.
value.
id()==
"cpp_not_typechecked")
273 symbol_tablet::symbolst::iterator cur_it = it;
276 symbolt &symbol = cur_it->second;
284 else if(symbol.
type.
id()==ID_struct ||
285 symbol.
type.
id()==ID_union)
295 data_members.reserve(components.size());
299 (struct_union_type.
add(ID_methods).
get_sub());
301 function_members.reserve(components.size());
303 for(
const auto &compo_it : components)
305 if(compo_it.get_bool(ID_is_static) ||
306 compo_it.get_bool(ID_is_type))
310 else if(compo_it.type().id()==ID_code)
312 function_members.push_back(compo_it);
316 data_members.push_back(compo_it);
320 struct_union_type.
components().swap(data_members);
The type of an expression.
irep_idt name
The unique identifier.
void convert_function(symbolt &symbol)
const typet & follow(const typet &src) const
virtual bool lookup(const irep_idt &name, const symbolt *&symbol) const
Linking: Zero Initialization.
const std::string & id2string(const irep_idt &d)
const symbol_tablet & get_symbol_table() const
irep_idt mode
Language mode.
bool is_static_assert() const
void copy_to_operands(const exprt &expr)
std::vector< componentt > componentst
void move_to_operands(exprt &expr)
exprt value
Initial value of symbol.
const componentst & components() const
void static_and_dynamic_initialization()
Initialization of static objects:
irep_idt module
Name of module the symbol belongs to.
bool cpp_typecheck(cpp_parse_treet &cpp_parse_tree, symbol_tablet &symbol_table, const std::string &module, message_handlert &message_handler)
Symbol table entry.This is a symbol in the symbol table, stored in an object of type symbol_tablet...
static mstreamt & eom(mstreamt &m)
bool get_bool(const irep_namet &name) const
C++ Language Type Checking.
void convert(cpp_linkage_spect &)
symbol_tablet & symbol_table
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a generic typet to a struct_union_typet.
#define Forall_symbols(it, expr)
void default_assignop_value(const symbolt &symbol, cpp_declaratort &declarator)
Generate code for the implicit default assignment operator.
bool is_declaration() const
bool is_namespace_spec() const
const irep_idt & id() const
cpp_namespace_spect & get_namespace_spec()
virtual void typecheck()
typechecking main method
std::string expr2cpp(const exprt &expr, const namespacet &ns)
source_locationt source_location
bool cpp_is_pod(const typet &type) const
cpp_parse_treet & cpp_parse_tree
cpp_static_assertt & get_static_assert()
const irep_idt & get(const irep_namet &name) const
C++ Language Type Checking.
bool move(symbolt &symbol, symbolt *&new_symbol)
Move a symbol into the symbol table.
std::vector< exprt > operandst
const struct_typet & to_struct_type(const typet &type)
Cast a generic typet to a struct_typet.
typet type
Type of symbol.
source_locationt location
Source code location of definition of symbol.
cpp_declarationt & to_cpp_declaration(irept &irep)
Base type of C structs and unions, and C++ classes.
void do_not_typechecked()
irep_idt current_linkage_spec
std::string type2cpp(const typet &type, const namespacet &ns)
Base class for all expressions.
irep_idt base_name
Base (non-scoped) name.
cpp_scopet & current_scope()
const source_locationt & source_location() const
irept & add(const irep_namet &name)
virtual std::string to_string(const typet &type)
cpp_linkage_spect & get_linkage_spec()
const struct_typet & this_struct_type()
dynamic_initializationst dynamic_initializations
bool disable_access_control
source_locationt & add_source_location()
A statement in a programming language.
exprt cpp_symbol_expr(const symbolt &symbol)
const typet & subtype() const
codet cpp_constructor(const source_locationt &source_location, const exprt &object, const exprt::operandst &operands)
bool is_linkage_spec() const
unsigned get_message_count(unsigned level) const