40 const std::string &module,
42 const bool keep_file_local)
47 parse_tree, new_symbol_table, module, message_handler))
52 if(
linking(symbol_table, new_symbol_table, message_handler))
59 std::istream &instream,
60 const std::string &path,
65 statement_list_parser.set_line_no(0);
66 statement_list_parser.set_file(path);
67 statement_list_parser.in = &instream;
68 bool result = statement_list_parser.parse();
88 const std::string &module,
91 return typecheck(symbol_table, module, message_handler,
true);
151 return std::make_unique<statement_list_languaget>();
156 return std::make_unique<statement_list_languaget>();
161 return "Statement List";
166 return "Statement List Language by Siemens";
Base class for all expressions.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
void modules_provided(std::set< std::string > &modules) override
object_factory_parameterst params
void set_language_options(const optionst &options, message_handlert &message_handler) override
Sets language specific options.
bool to_expr(const std::string &code, const std::string &module, exprt &expr, const namespacet &ns, message_handlert &message_handler) override
Parses the given string into an expression.
std::set< std::string > extensions() const override
void show_parse(std::ostream &out, message_handlert &) override
Prints the parse tree to the given output stream.
bool typecheck(symbol_table_baset &symbol_table, const std::string &module, message_handlert &message_handler, const bool keep_file_local) override
Converts the current parse tree into a symbol table.
std::unique_ptr< languaget > new_language() override
statement_list_languaget()
std::string id() const override
bool generate_support_functions(symbol_table_baset &symbol_table, message_handlert &) override
Currently unused.
bool from_type(const typet &type, std::string &code, const namespacet &ns) override
Formats the given type in a language-specific way.
~statement_list_languaget() override
statement_list_parse_treet parse_tree
bool from_expr(const exprt &expr, std::string &code, const namespacet &ns) override
Formats the given expression in a language-specific way.
std::string description() const override
bool can_keep_file_local() override
Is it possible to call three-argument typecheck() on this object?
bool type_to_name(const typet &type, std::string &name, const namespacet &ns) override
Encodes the given type in a language-specific way.
bool parse(std::istream &instream, const std::string &path, message_handlert &message_handler) override
Parses input given by instream and saves this result to this instance's parse tree.
void clear()
Removes all functions and function blocks from the parse tree.
Responsible for starting the parse process and to translate the result into a statement_list_parse_tr...
The symbol table base class interface.
The type of an expression, extends irept.
std::string expr2stl(const exprt &expr, const namespacet &ns)
Converts a given expression to human-readable STL code.
std::string type2stl(const typet &type, const namespacet &ns)
Converts a given type to human-readable STL code.
std::string get_base_name(const std::string &in, bool strip_suffix)
cleans a filename from path and extension
bool linking(symbol_table_baset &dest_symbol_table, const symbol_table_baset &new_symbol_table, message_handlert &message_handler)
Merges the symbol table new_symbol_table into dest_symbol_table, renaming symbols from new_symbol_tab...
void remove_internal_symbols(symbol_table_baset &symbol_table, message_handlert &mh, const bool keep_file_local)
Removes internal symbols from a symbol table A symbol is EXPORTED if it is a.
Remove symbols that are internal only.
bool statement_list_entry_point(symbol_table_baset &symbol_table, message_handlert &message_handler)
Creates a new entry point for the Statement List language.
Statement List Language Entry Point.
std::unique_ptr< languaget > new_statement_list_language()
Statement List Language Interface.
void output_parse_tree(std::ostream &out, const statement_list_parse_treet &parse_tree)
Prints the given Statement List parse tree in a human-readable form to the given output stream.
Statement List Language Parse Tree Output.
Statement List Language Parser.
bool statement_list_typecheck(const statement_list_parse_treet &parse_tree, symbol_table_baset &symbol_table, const std::string &module, message_handlert &message_handler)
Create a new statement_list_typecheckt object and perform a type check to fill the symbol table.
Statement List Language Type Checking.