34 std::set<std::string> symbols;
36 for(
const auto &symbol_pair : symbol_table.
symbols)
38 symbols.insert(
id2string(symbol_pair.first));
43 for(
const std::string &
id : symbols)
47 std::unique_ptr<languaget> ptr;
63 out << symbol.
name <<
" " << type_str <<
'\n';
71 out <<
'\n' <<
"Symbols:" <<
'\n' <<
'\n';
74 std::vector<std::string> symbols;
75 symbols.reserve(symbol_table.
symbols.size());
77 for(
const auto &symbol_pair : symbol_table.
symbols)
78 symbols.push_back(
id2string(symbol_pair.first));
79 std::sort(symbols.begin(), symbols.end());
85 const symbolt &symbol=ns.lookup(
id);
87 std::unique_ptr<languaget> ptr;
101 std::string type_str, value_str;
109 out <<
"Symbol......: " << symbol.
name <<
'\n' << std::flush;
110 out <<
"Pretty name.: " << symbol.
pretty_name <<
'\n';
111 out <<
"Module......: " << symbol.
module <<
'\n';
112 out <<
"Base name...: " << symbol.
base_name <<
'\n';
113 out <<
"Mode........: " << symbol.
mode <<
'\n';
114 out <<
"Type........: " << type_str <<
'\n';
115 out <<
"Value.......: " << value_str <<
'\n';
116 out <<
"Flags.......:";
121 out <<
" static_lifetime";
123 out <<
" thread_local";
125 out <<
" file_local";
152 out <<
"Location....: " << symbol.
location <<
'\n';
154 out <<
'\n' << std::flush;
171 for(
const auto &id_and_symbol : symbol_table.
symbols)
173 const symbolt &symbol = id_and_symbol.second;
175 std::unique_ptr<languaget> ptr;
189 std::string type_str, value_str;
217 symbol_json[
"isStaticLifetime"] =
219 symbol_json[
"isThreadLocal"] =
246 for(
const auto &id_and_symbol : symbol_table.
symbols)
248 const symbolt &symbol = id_and_symbol.second;
250 std::unique_ptr<languaget> ptr;
264 std::string type_str, value_str;
irep_idt name
The unique identifier.
const std::string & id2string(const irep_idt &d)
irep_idt mode
Language mode.
Provides methods for streaming JSON objects.
std::unique_ptr< languaget > get_default_language()
Returns the default language.
std::unique_ptr< languaget > get_language_from_mode(const irep_idt &mode)
Get the language corresponding to the given mode.
json_stream_objectt & push_back_stream_object()
Add a JSON object child stream.
exprt value
Initial value of symbol.
static jsont json_boolean(bool value)
irep_idt module
Name of module the symbol belongs to.
static void show_symbol_table_brief_json_ui(const symbol_tablet &symbol_table, ui_message_handlert &message_handler)
irep_idt pretty_name
Language-specific display name.
symbol_tablet symbol_table
Symbol table.
json_stream_arrayt & get_json_stream()
void show_symbol_table(const symbol_tablet &symbol_table, ui_message_handlert &ui)
void show_symbol_table_brief_plain(const symbol_tablet &symbol_table, std::ostream &out)
Provides methods for streaming JSON arrays.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Abstract interface to support a programming language.
json_stream_objectt & push_back_stream_object(const std::string &key)
Add a JSON object stream for a specific key.
dstringt has one field, an unsigned integer no which is an index into a static table of strings...
static void show_symbol_table_json_ui(const symbol_tablet &symbol_table, ui_message_handlert &message_handler)
json_objectt convert_from_irep(const irept &) const
To convert to JSON from an irep structure by recursively generating JSON for the different sub trees...
virtual bool from_type(const typet &type, std::string &code, const namespacet &ns)
Formats the given type in a language-specific way.
typet type
Type of symbol.
source_locationt location
Source code location of definition of symbol.
irep_idt base_name
Base (non-scoped) name.
void show_symbol_table_xml_ui()
virtual bool from_expr(const exprt &expr, std::string &code, const namespacet &ns)
Formats the given expression in a language-specific way.
void show_symbol_table_plain(const symbol_tablet &symbol_table, std::ostream &out)
void push_back(const std::string &key, const jsont &json)
Push back a JSON element into the current object stream.
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
void show_symbol_table_brief(const symbol_tablet &symbol_table, ui_message_handlert &ui)