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)
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);
158 if(!symbol_table.
insert(std::move(new_symbol)).second)
irep_idt rounding_mode_identifier()
Return the identifier of the program symbol used to store the current rounding mode.
A codet representing an assignment in the program.
A codet representing sequential composition of program statements.
void add(const codet &code)
codet representation of a function call statement.
optionalt< std::string > main
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
source_locationt & add_source_location()
typet & type()
Return the type of the expression.
static irep_idt entry_point()
Get the identifier of the entry point to a goto model.
Class that provides messages with a built-in verbosity 'level'.
virtual void set_message_handler(message_handlert &_message_handler)
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
Expression to hold a symbol (variable)
const symbol_base_mapt & symbol_base_map
Read-only field, used to look up symbol names given their base names.
const symbolst & symbols
Read-only field, used to look up symbols given their names.
bool add(const symbolt &symbol)
Add a new symbol to the symbol table.
virtual std::pair< symbolt &, bool > insert(symbolt symbol) override
Author: Diffblue Ltd.
irep_idt base_name
Base (non-scoped) name.
source_locationt location
Source code location of definition of symbol.
class symbol_exprt symbol_expr() const
Produces a symbol_exprt for a symbol.
typet type
Type of symbol.
irep_idt name
The unique identifier.
exprt value
Initial value of symbol.
irep_idt mode
Language mode.
Goto Programs with Functions.
const std::string & id2string(const irep_idt &d)
bool jsil_entry_point(symbol_tablet &symbol_table, message_handlert &message_handler)
static void create_initialize(symbol_tablet &symbol_table)
Ranges: pair of begin and end iterators, which can be initialized from containers,...
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.
#define INITIALIZE_FUNCTION