35 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)
147 for(cpp_parse_treet::itemst::const_iterator it=
163 out <<
"LINKAGE " << linkage_spec.
linkage().
get(
"value")
166 for(cpp_linkage_spect::itemst::const_iterator
167 it=linkage_spec.
items().begin();
168 it!=linkage_spec.
items().end();
182 for(cpp_namespace_spect::itemst::const_iterator
183 it=namespace_spec.
items().begin();
184 it!=namespace_spec.
items().end();
205 out <<
"UNKNOWN: " << item.
pretty() <<
'\n';
241 const std::string &code,
242 const std::string &module,
250 std::istringstream i_preprocessed(code);
bool final(symbol_tablet &symbol_table) override
The type of an expression.
struct configt::ansi_ct ansi_c
virtual void clear() override
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
void swap(cpp_parse_treet &cpp_parse_tree)
~cpp_languaget() override
bool linking(symbol_tablet &dest_symbol_table, symbol_tablet &new_symbol_table, message_handlert &message_handler)
bool cpp_typecheck(cpp_parse_treet &cpp_parse_tree, symbol_tablet &symbol_table, const std::string &module, message_handlert &message_handler)
bool c_preprocess(std::istream &instream, std::ostream &outstream, message_handlert &message_handler)
ANSI-C preprocessing.
bool from_type(const typet &type, std::string &code, const namespacet &ns) override
std::string get_base_name(const std::string &in, bool strip_suffix)
cleans a filename from path and extension
void modules_provided(std::set< std::string > &modules) override
bool is_declaration() const
bool is_namespace_spec() const
cpp_namespace_spect & get_namespace_spec()
cpp_parse_treet cpp_parse_tree
void cpp_internal_additions(std::ostream &out)
void show_parse(std::ostream &out) override
virtual bool parse() override
void set_file(const irep_idt &file)
std::string expr2cpp(const exprt &expr, const namespacet &ns)
bool preprocess(std::istream &instream, const std::string &path, std::ostream &outstream) override
ANSI-C preprocessing.
const irep_idt & get(const irep_namet &name) const
cpp_parse_treet parse_tree
std::string cpp_type2name(const typet &type)
languaget * new_cpp_language()
virtual void set_message_handler(message_handlert &_message_handler)
ansi_c_parsert::modet mode
C++ Language Type Checking.
bool get_namespace() const
bool from_expr(const exprt &expr, std::string &code, const namespacet &ns) override
bool to_expr(const std::string &code, const std::string &module, exprt &expr, const namespacet &ns) override
const itemst & items() const
bool parse(std::istream &instream, const std::string &path) override
message_handlert & get_message_handler()
bool ansi_c_entry_point(symbol_tablet &symbol_table, const std::string &standard_main, message_handlert &message_handler)
std::set< std::string > extensions() const override
const irep_idt & get_namespace() const
std::string type2cpp(const typet &type, const namespacet &ns)
Base class for all expressions.
bool type_to_name(const typet &type, std::string &name, const namespacet &ns) override
cpp_declarationt & get_declaration()
cpp_linkage_spect & get_linkage_spec()
const itemst & items() const
bool typecheck(symbol_tablet &symbol_table, const std::string &module) override
void output(std::ostream &out) const
bool is_linkage_spec() const