28 ui_message_handler(_ui_message_handler)
50 std::ifstream infile(
widen(filename));
52 std::ifstream infile(filename);
57 error() <<
"failed to open input file `" << filename <<
"'" <<
eom;
69 error() <<
"failed to figure out type of file" <<
eom;
77 status() <<
"Parsing " << filename <<
eom;
79 if(language.
parse(infile, filename))
82 std::cerr <<
"PARSING ERROR\n";
100 error() <<
"CONVERSION ERROR" <<
eom;
117 error() <<
"CONVERSION ERROR" <<
eom;
139 error() <<
"cannot show symbol table in this format" <<
eom;
145 error() <<
"cannot show symbol table in this format" <<
eom;
153 out <<
"\nSymbols:\n\n";
156 std::set<std::string> symbols;
160 symbols.insert(
id2string(symbol_pair.first));
165 for(
const std::string &
id : symbols)
169 std::unique_ptr<languaget> ptr;
183 std::string type_str, value_str;
193 out << symbol.
name <<
" " << type_str <<
'\n';
197 out <<
"Symbol......: " << symbol.
name <<
'\n' << std::flush;
198 out <<
"Pretty name.: " << symbol.
pretty_name <<
'\n';
199 out <<
"Module......: " << symbol.
module <<
'\n';
200 out <<
"Base name...: " << symbol.
base_name <<
'\n';
201 out <<
"Mode........: " << symbol.
mode <<
'\n';
202 out <<
"Type........: " << type_str <<
'\n';
203 out <<
"Value.......: " << value_str <<
'\n';
204 out <<
"Flags.......:";
209 out <<
" static_lifetime";
211 out <<
" thread_local";
213 out <<
" file_local";
240 out <<
"Location....: " << symbol.
location <<
'\n';
242 out <<
'\n' << std::flush;
symbol_tablet symbol_table
irep_idt name
The unique identifier.
virtual ~language_uit()
Destructor.
const std::string & id2string(const irep_idt &d)
bool final(symbol_table_baset &symbol_table)
std::wstring widen(const char *s)
irep_idt mode
Language mode.
std::unique_ptr< languaget > get_default_language()
Returns the default language.
virtual void get_language_options(const cmdlinet &)
std::unique_ptr< languaget > get_language_from_mode(const irep_idt &mode)
Get the language corresponding to the given mode.
language_filest language_files
language_filet & add_file(const std::string &filename)
exprt value
Initial value of symbol.
irep_idt module
Name of module the symbol belongs to.
irep_idt pretty_name
Language-specific display name.
const cmdlinet & _cmdline
virtual void show_symbol_table(bool brief=false)
std::unique_ptr< languaget > get_language_from_filename(const std::string &filename)
Get the language corresponding to the registered file name extensions.
Symbol table entry.This is a symbol in the symbol table, stored in an object of type symbol_tablet...
static mstreamt & eom(mstreamt &m)
virtual void show_symbol_table_xml_ui(bool brief)
std::unique_ptr< languaget > language
virtual bool isset(char option) const
language_uit(const cmdlinet &cmdline, ui_message_handlert &ui_message_handler)
Constructor.
source_locationt source_location
void set_file(const irep_idt &file)
ui_message_handlert & ui_message_handler
Abstract interface to support a programming language.
bool typecheck(symbol_tablet &symbol_table)
virtual void set_message_handler(message_handlert &_message_handler)
void set_should_generate_opaque_method_stubs(bool stubs_enabled)
Turn on or off stub generation for all the languages.
virtual bool from_type(const typet &type, std::string &code, const namespacet &ns)
Formats the given type in a language-specific way.
virtual void show_symbol_table_plain(std::ostream &out, bool brief)
typet type
Type of symbol.
source_locationt location
Source code location of definition of symbol.
message_handlert & get_message_handler()
mstreamt & status() const
irep_idt base_name
Base (non-scoped) name.
virtual bool from_expr(const exprt &expr, std::string &code, const namespacet &ns)
Formats the given expression in a language-specific way.
virtual bool parse(std::istream &instream, const std::string &path)=0
message_handlert * message_handler
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See namespace_baset::lookup().
void set_object_bits_from_symbol_table(const symbol_tablet &)
Sets the number of bits used for object addresses.