Go to the documentation of this file.
39 std::istream &instream,
40 const std::string &path,
41 std::ostream &outstream)
51 std::istream &instream,
52 const std::string &path)
58 std::ostringstream o_preprocessed;
63 std::istringstream i_preprocessed(o_preprocessed.str());
69 std::istringstream codestr(code);
105 const std::string &module,
106 const bool keep_file_local)
108 return typecheck(symbol_table, module, keep_file_local, {});
113 const std::string &module,
114 const bool keep_file_local,
115 const std::set<irep_idt> &keep)
152 return util_make_unique<ansi_c_languaget>();
183 const std::string &code,
192 std::istringstream i_preprocessed(
193 "void __my_expression = (void) (\n"+code+
"\n);");
221 if(expr.
id()==ID_typecast &&
222 expr.
type().
id()==ID_empty &&
ansi_c_parsert ansi_c_parser
bool ts_18661_3_Floatn_types
std::string get_base_name(const std::string &in, bool strip_suffix)
cleans a filename from path and extension
bool type_to_name(const typet &type, std::string &name, const namespacet &ns) override
Encodes the given type in a language-specific way.
bool linking(symbol_tablet &dest_symbol_table, const symbol_tablet &new_symbol_table, message_handlert &message_handler)
Merges the symbol table new_symbol_table into dest_symbol_table, renaming symbols from new_symbol_tab...
The type of an expression, extends irept.
~ansi_c_languaget() override
bool to_expr(const std::string &code, const std::string &module, exprt &expr, const namespacet &ns) override
Parses the given string into an expression.
Base class for all expressions.
struct configt::ansi_ct ansi_c
void remove_internal_symbols(symbol_tablet &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.
bool from_type(const typet &type, std::string &code, const namespacet &ns) override
Formats the given type in a language-specific way.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
typet & type()
Return the type of the expression.
bool ts_18661_3_Floatn_types
mstreamt & result() const
static std::string type2name(const typet &type, const namespacet &ns, symbol_numbert &symbol_number)
std::string expr2c(const exprt &expr, const namespacet &ns, const expr2c_configurationt &configuration)
virtual void clear() override
void ansi_c_scanner_init()
virtual void set_message_handler(message_handlert &_message_handler)
void ansi_c_internal_additions(std::string &code)
void swap(ansi_c_parse_treet &other)
bool preprocess(std::istream &instream, const std::string &path, std::ostream &outstream) override
ANSI-C preprocessing.
const irep_idt & id() const
bool ansi_c_entry_point(symbol_tablet &symbol_table, message_handlert &message_handler, const c_object_factory_parameterst &object_factory_parameters)
void output(std::ostream &out) const
c_object_factory_parameterst object_factory_params
message_handlert & get_message_handler()
ansi_c_parse_treet parse_tree
ansi_c_parse_treet parse_tree
void show_parse(std::ostream &out) override
bool parse(std::istream &instream, const std::string &path) override
const typecast_exprt & to_typecast_expr(const exprt &expr)
Cast an exprt to a typecast_exprt.
std::set< std::string > extensions() const override
std::unique_ptr< languaget > new_ansi_c_language()
virtual bool parse() override
void modules_provided(std::set< std::string > &modules) override
bool ansi_c_typecheck(ansi_c_parse_treet &ansi_c_parse_tree, symbol_tablet &symbol_table, const std::string &module, message_handlert &message_handler)
bool generate_support_functions(symbol_tablet &symbol_table) override
Create language-specific support functions, such as __CPROVER_start, __CPROVER_initialize and languag...
bool from_expr(const exprt &expr, std::string &code, const namespacet &ns) override
Formats the given expression in a language-specific way.
std::string type2c(const typet &type, const namespacet &ns, const expr2c_configurationt &configuration)
bool typecheck(symbol_tablet &symbol_table, const std::string &module, const bool keep_file_local) override
typecheck without removing specified entries from the symbol table
bool c_preprocess(std::istream &instream, std::ostream &outstream, message_handlert &message_handler)
ANSI-C preprocessing.
void set_file(const irep_idt &file)
void set_line_no(unsigned _line_no)