Go to the documentation of this file.
31 initialize.
mode=
"jsil";
45 initialize.
value=init_code;
47 if(symbol_table.
add(initialize))
65 std::list<irep_idt> matches;
67 for(
const auto &symbol_name_entry :
71 symbol_tablet::symbolst::const_iterator s_it =
72 symbol_table.
symbols.find(symbol_name_entry.second);
74 if(s_it==symbol_table.
symbols.end())
77 if(s_it->second.type.id() == ID_code && !s_it->second.is_property)
78 matches.push_back(symbol_name_entry.second);
84 message.
error() <<
"main symbol '" <<
config.
main.value() <<
"' not found"
97 main_symbol=matches.front();
103 symbol_tablet::symbolst::const_iterator s_it=
104 symbol_table.
symbols.find(main_symbol);
106 if(s_it==symbol_table.
symbols.end())
114 const symbolt &symbol=s_it->second;
120 message.
error() <<
"main symbol '" << main_symbol <<
"' has no body"
132 symbol_tablet::symbolst::const_iterator init_it=
135 if(init_it==symbol_table.
symbols.end())
140 init_code.
add(call_init);
149 init_code.
add(call_main);
159 if(!symbol_table.
insert(std::move(new_symbol)).second)
Class that provides messages with a built-in verbosity 'level'.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
A codet representing sequential composition of program statements.
const symbol_base_mapt & symbol_base_map
Read-only field, used to look up symbol names given their base names.
typet type
Type of symbol.
optionalt< std::string > main
irep_idt base_name
Base (non-scoped) name.
Expression to hold a symbol (variable)
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
typet & type()
Return the type of the expression.
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
goto_instruction_codet representation of a function call statement.
irep_idt mode
Language mode.
const std::string & id2string(const irep_idt &d)
class symbol_exprt symbol_expr() const
Produces a symbol_exprt for a symbol.
#define INITIALIZE_FUNCTION
virtual void set_message_handler(message_handlert &_message_handler)
virtual std::pair< symbolt &, bool > insert(symbolt symbol) override
Author: Diffblue Ltd.
void add(const codet &code)
irep_idt rounding_mode_identifier()
Return the identifier of the program symbol used to store the current rounding mode.
bool add(const symbolt &symbol)
Add a new symbol to the symbol table.
exprt value
Initial value of symbol.
bool jsil_entry_point(symbol_tablet &symbol_table, message_handlert &message_handler)
source_locationt location
Source code location of definition of symbol.
const symbolst & symbols
Read-only field, used to look up symbols given their names.
static irep_idt entry_point()
Get the identifier of the entry point to a goto model.
source_locationt & add_source_location()
A goto_instruction_codet representing an assignment in the program.
irep_idt name
The unique identifier.
ranget< typename multimapt::const_iterator > equal_range(const multimapt &multimap, const typename multimapt::key_type &key)
Utility function to make equal_range method of multimap easier to use by returning a ranget object.
static void create_initialize(symbol_tablet &symbol_table)