34 static std::unique_ptr<languaget>
39 return language_from_mode;
63 ptr->from_type(symbol.
type, type_str, ns);
65 out << symbol.
name <<
" " << type_str <<
'\n';
73 out <<
'\n' <<
"Symbols:" <<
'\n' <<
'\n';
84 std::string type_str, value_str;
87 ptr->from_type(symbol.
type, type_str, ns);
90 ptr->from_expr(symbol.
value, value_str, ns);
92 out <<
"Symbol......: " << symbol.
name <<
'\n' << std::flush;
93 out <<
"Pretty name.: " << symbol.
pretty_name <<
'\n';
94 out <<
"Module......: " << symbol.
module <<
'\n';
95 out <<
"Base name...: " << symbol.
base_name <<
'\n';
96 out <<
"Mode........: " << symbol.
mode <<
'\n';
97 out <<
"Type........: " << type_str <<
'\n';
98 out <<
"Value.......: " << value_str <<
'\n';
99 out <<
"Flags.......:";
104 out <<
" static_lifetime";
106 out <<
" thread_local";
108 out <<
" file_local";
135 out <<
"Location....: " << symbol.
location <<
'\n';
137 out <<
'\n' << std::flush;
154 for(
const auto &id_and_symbol : symbol_table.
symbols)
156 const symbolt &symbol = id_and_symbol.second;
160 std::string type_str, value_str;
163 ptr->from_type(symbol.
type, type_str, ns);
166 ptr->from_expr(symbol.
value, value_str, ns);
216 for(
const auto &id_and_symbol : symbol_table.
symbols)
218 const symbolt &symbol = id_and_symbol.second;
222 std::string type_str, value_str;
225 ptr->from_type(symbol.
type, type_str, ns);
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
symbol_tablet symbol_table
Symbol table.
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.
Provides methods for streaming JSON arrays.
json_stream_objectt & push_back_stream_object()
Add a JSON object child stream.
Provides methods for streaming JSON objects.
void push_back(const std::string &key, const jsont &json)
Push back a JSON element into the current object stream.
json_stream_objectt & push_back_stream_object(const std::string &key)
Add a JSON object stream for a specific key.
static jsont json_boolean(bool value)
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().
The symbol table base class interface.
std::vector< irep_idt > sorted_symbol_names() const
Build and return a lexicographically sorted vector of symbol names from all symbols stored in this sy...
const symbolst & symbols
Read-only field, used to look up symbols given their names.
irep_idt base_name
Base (non-scoped) name.
irep_idt module
Name of module the symbol belongs to.
source_locationt location
Source code location of definition of symbol.
typet type
Type of symbol.
irep_idt name
The unique identifier.
irep_idt pretty_name
Language-specific display name.
exprt value
Initial value of symbol.
irep_idt mode
Language mode.
virtual uit get_ui() const
virtual json_stream_arrayt & get_json_stream()
const std::string & id2string(const irep_idt &d)
Abstract interface to support a programming language.
std::unique_ptr< languaget > get_language_from_mode(const irep_idt &mode)
Get the language corresponding to the given mode.
std::unique_ptr< languaget > get_default_language()
Returns the default language.
void show_symbol_table_brief_plain(const symbol_table_baset &symbol_table, std::ostream &out)
void show_symbol_table(const symbol_table_baset &symbol_table, ui_message_handlert &ui)
static void show_symbol_table_json_ui(const symbol_table_baset &symbol_table, ui_message_handlert &message_handler)
void show_symbol_table_plain(const symbol_table_baset &symbol_table, std::ostream &out)
static void show_symbol_table_brief_json_ui(const symbol_table_baset &symbol_table, ui_message_handlert &message_handler)
void show_symbol_table_xml_ui()
static std::unique_ptr< languaget > get_show_symbol_language(const symbolt &symbol)
Gets the language which should be used for showing the type and value of the supplied symbol.
void show_symbol_table_brief(const symbol_table_baset &symbol_table, ui_message_handlert &ui)