27 ui_message_handler(_ui_message_handler)
51 std::ifstream infile(
widen(filename));
53 std::ifstream infile(filename);
58 error() <<
"failed to open input file `" << filename <<
"'" <<
eom;
62 std::pair<language_filest::file_mapt::iterator, bool>
64 std::pair<std::string, language_filet>(filename,
language_filet()));
76 error() <<
"failed to figure out type of file" <<
eom;
84 status() <<
"Parsing " << filename <<
eom;
86 if(language.
parse(infile, filename))
89 std::cerr <<
"PARSING ERROR\n";
107 error() <<
"CONVERSION ERROR" <<
eom;
120 error() <<
"CONVERSION ERROR" <<
eom;
140 error() <<
"cannot show symbol table in this format" <<
eom;
146 error() <<
"cannot show symbol table in this format" <<
eom;
154 out <<
"\nSymbols:\n\n";
157 std::set<std::string> symbols;
164 for(
const std::string &
id : symbols)
179 std::unique_ptr<languaget> p(ptr);
180 std::string type_str, value_str;
190 out << symbol.
name <<
" " << type_str <<
'\n';
194 out <<
"Symbol......: " << symbol.
name <<
'\n' << std::flush;
195 out <<
"Pretty name.: " << symbol.
pretty_name <<
'\n';
196 out <<
"Module......: " << symbol.
module <<
'\n';
197 out <<
"Base name...: " << symbol.
base_name <<
'\n';
198 out <<
"Mode........: " << symbol.
mode <<
'\n';
199 out <<
"Type........: " << type_str <<
'\n';
200 out <<
"Value.......: " << value_str <<
'\n';
201 out <<
"Flags.......:";
206 out <<
" static_lifetime";
208 out <<
" thread_local";
210 out <<
" file_local";
237 out <<
"Location....: " << symbol.
location <<
'\n';
239 out <<
'\n' << std::flush;
symbol_tablet symbol_table
irep_idt name
The unique identifier.
virtual bool lookup(const irep_idt &name, const symbolt *&symbol) const
virtual ~language_uit()
Destructor.
const std::string & id2string(const irep_idt &d)
#define forall_symbols(it, expr)
std::wstring widen(const char *s)
irep_idt mode
Language mode.
virtual void get_language_options(const cmdlinet &)
language_filest language_files
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)
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)
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)
languaget * get_default_language()
bool final(symbol_tablet &symbol_table)
virtual bool from_type(const typet &type, std::string &code, const namespacet &ns)
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()
languaget * get_language_from_mode(const irep_idt &mode)
languaget * get_language_from_filename(const std::string &filename)
irep_idt base_name
Base (non-scoped) name.
virtual bool from_expr(const exprt &expr, std::string &code, const namespacet &ns)
virtual bool parse(std::istream &instream, const std::string &path)=0
message_handlert * message_handler