Go to the documentation of this file.
34 std::set<std::string> s;
58 std::istream &instream,
59 const std::string &path,
60 std::ostream &outstream)
67 const char *ext=strrchr(path.c_str(),
'.');
68 if(ext!=
nullptr && std::string(ext)==
".ipp")
70 std::ifstream infile(path);
74 while(infile.read(&ch, 1))
84 std::istream &instream,
85 const std::string &path)
93 std::ostringstream o_preprocessed;
100 std::istringstream i_preprocessed(o_preprocessed.str());
123 const std::string &module)
161 out <<
"LINKAGE " << linkage_spec.
linkage().
get(ID_value) <<
":\n";
163 for(
const auto &i : linkage_spec.
items())
176 for(
const auto &i : namespace_spec.
items())
196 out <<
"UNKNOWN: " << item.
pretty() <<
'\n';
201 return util_make_unique<cpp_languaget>();
232 const std::string &code,
241 std::istringstream i_preprocessed(code);
void swap(cpp_parse_treet &cpp_parse_tree)
cpp_parse_treet parse_tree
std::string get_base_name(const std::string &in, bool strip_suffix)
cleans a filename from path and extension
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...
const itemst & items() const
bool generate_support_functions(symbol_tablet &symbol_table) override
Create language-specific support functions, such as __CPROVER_start, __CPROVER_initialize and languag...
The type of an expression, extends irept.
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
cpp_declarationt & get_declaration()
void cpp_internal_additions(std::ostream &out)
void show_parse(std::ostream &out) override
bool preprocess(std::istream &instream, const std::string &path, std::ostream &outstream) override
ANSI-C preprocessing.
Base class for all expressions.
virtual void clear() override
std::string expr2cpp(const exprt &expr, const namespacet &ns)
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.
ansi_c_parsert::modet mode
bool cpp_typecheck(cpp_parse_treet &cpp_parse_tree, symbol_tablet &symbol_table, const std::string &module, message_handlert &message_handler)
const irep_idt & get(const irep_idt &name) const
cpp_linkage_spect & get_linkage_spec()
std::unique_ptr< languaget > new_cpp_language()
bool to_expr(const std::string &code, const std::string &module, exprt &expr, const namespacet &ns) override
Parses the given string into an expression.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
mstreamt & result() const
bool is_linkage_spec() const
std::string type2cpp(const typet &type, const namespacet &ns)
void modules_provided(std::set< std::string > &modules) override
const irep_idt & get_namespace() const
bool get_namespace() const
virtual void set_message_handler(message_handlert &_message_handler)
virtual bool parse() override
bool from_type(const typet &type, std::string &code, const namespacet &ns) override
Formats the given type in a language-specific way.
bool typecheck(symbol_tablet &symbol_table, const std::string &module) override
bool ansi_c_entry_point(symbol_tablet &symbol_table, message_handlert &message_handler, const c_object_factory_parameterst &object_factory_parameters)
bool parse(std::istream &instream, const std::string &path) override
cpp_parse_treet cpp_parse_tree
bool type_to_name(const typet &type, std::string &name, const namespacet &ns) override
Encodes the given type in a language-specific way.
message_handlert & get_message_handler()
std::string cpp_type2name(const typet &type)
void output(std::ostream &out) const
bool is_namespace_spec() const
const itemst & items() const
c_object_factory_parameterst object_factory_params
bool from_expr(const exprt &expr, std::string &code, const namespacet &ns) override
Formats the given expression in a language-specific way.
std::set< std::string > extensions() const override
bool c_preprocess(std::istream &instream, std::ostream &outstream, message_handlert &message_handler)
ANSI-C preprocessing.
cpp_namespace_spect & get_namespace_spec()
void set_file(const irep_idt &file)
~cpp_languaget() override
bool is_declaration() const