-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Daniel Kroening
committed
Dec 15, 2016
1 parent
b0f420c
commit 3d9eba2
Showing
3 changed files
with
68 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,56 +21,56 @@ Author: Daniel Kroening, [email protected] | |
class ansi_c_languaget:public languaget | ||
{ | ||
public: | ||
virtual bool preprocess( | ||
bool preprocess( | ||
std::istream &instream, | ||
const std::string &path, | ||
std::ostream &outstream); | ||
std::ostream &outstream) override; | ||
|
||
virtual bool parse( | ||
bool parse( | ||
std::istream &instream, | ||
const std::string &path); | ||
const std::string &path) override; | ||
|
||
virtual bool typecheck( | ||
bool typecheck( | ||
symbol_tablet &symbol_table, | ||
const std::string &module); | ||
const std::string &module) override; | ||
|
||
virtual bool final( | ||
symbol_tablet &symbol_table); | ||
bool final( | ||
symbol_tablet &symbol_table) override; | ||
|
||
virtual void show_parse(std::ostream &out); | ||
void show_parse(std::ostream &out) override; | ||
|
||
virtual ~ansi_c_languaget(); | ||
~ansi_c_languaget() override; | ||
ansi_c_languaget() { } | ||
|
||
virtual bool from_expr( | ||
bool from_expr( | ||
const exprt &expr, | ||
std::string &code, | ||
const namespacet &ns); | ||
const namespacet &ns) override; | ||
|
||
virtual bool from_type( | ||
bool from_type( | ||
const typet &type, | ||
std::string &code, | ||
const namespacet &ns); | ||
const namespacet &ns) override; | ||
|
||
virtual bool type_to_name( | ||
bool type_to_name( | ||
const typet &type, | ||
std::string &name, | ||
const namespacet &ns); | ||
const namespacet &ns) override; | ||
|
||
virtual bool to_expr( | ||
bool to_expr( | ||
const std::string &code, | ||
const std::string &module, | ||
exprt &expr, | ||
const namespacet &ns); | ||
const namespacet &ns) override; | ||
|
||
virtual languaget *new_language() | ||
languaget *new_language() override | ||
{ return new ansi_c_languaget; } | ||
|
||
virtual std::string id() const { return "C"; } | ||
virtual std::string description() const { return "ANSI-C 99"; } | ||
virtual std::set<std::string> extensions() const; | ||
std::string id() const override { return "C"; } | ||
std::string description() const override { return "ANSI-C 99"; } | ||
std::set<std::string> extensions() const override; | ||
|
||
virtual void modules_provided(std::set<std::string> &modules); | ||
void modules_provided(std::set<std::string> &modules) override; | ||
|
||
protected: | ||
ansi_c_parse_treet parse_tree; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,74 +21,74 @@ Author: Daniel Kroening, [email protected] | |
class cpp_languaget:public languaget | ||
{ | ||
public: | ||
virtual bool preprocess( | ||
bool preprocess( | ||
std::istream &instream, | ||
const std::string &path, | ||
std::ostream &outstream); | ||
std::ostream &outstream) override; | ||
|
||
virtual bool parse( | ||
bool parse( | ||
std::istream &instream, | ||
const std::string &path); | ||
const std::string &path) override; | ||
|
||
virtual bool typecheck( | ||
bool typecheck( | ||
symbol_tablet &symbol_table, | ||
const std::string &module); | ||
const std::string &module) override; | ||
|
||
bool merge_symbol_table( | ||
symbol_tablet &dest, | ||
symbol_tablet &src, | ||
const std::string &module, | ||
class replace_symbolt &replace_symbol) const; | ||
|
||
virtual bool final( | ||
symbol_tablet &symbol_table); | ||
bool final( | ||
symbol_tablet &symbol_table) override; | ||
|
||
virtual void show_parse(std::ostream &out); | ||
void show_parse(std::ostream &out) override; | ||
|
||
// constructor, destructor | ||
virtual ~cpp_languaget(); | ||
~cpp_languaget() override; | ||
cpp_languaget() { } | ||
|
||
// conversion from expression into string | ||
virtual bool from_expr( | ||
bool from_expr( | ||
const exprt &expr, | ||
std::string &code, | ||
const namespacet &ns); | ||
const namespacet &ns) override; | ||
|
||
// conversion from type into string | ||
virtual bool from_type( | ||
bool from_type( | ||
const typet &type, | ||
std::string &code, | ||
const namespacet &ns); | ||
const namespacet &ns) override; | ||
|
||
virtual bool type_to_name( | ||
bool type_to_name( | ||
const typet &type, | ||
std::string &name, | ||
const namespacet &ns); | ||
const namespacet &ns) override; | ||
|
||
// conversion from string into expression | ||
virtual bool to_expr( | ||
bool to_expr( | ||
const std::string &code, | ||
const std::string &module, | ||
exprt &expr, | ||
const namespacet &ns); | ||
const namespacet &ns) override; | ||
|
||
virtual languaget *new_language() | ||
languaget *new_language() override | ||
{ return new cpp_languaget; } | ||
|
||
virtual std::string id() const { return "cpp"; } | ||
virtual std::string description() const { return "C++"; } | ||
virtual std::set<std::string> extensions() const; | ||
std::string id() const override { return "cpp"; } | ||
std::string description() const override { return "C++"; } | ||
std::set<std::string> extensions() const override; | ||
|
||
virtual void modules_provided(std::set<std::string> &modules); | ||
void modules_provided(std::set<std::string> &modules) override; | ||
|
||
protected: | ||
cpp_parse_treet cpp_parse_tree; | ||
std::string parse_path; | ||
|
||
void show_parse(std::ostream &out, const cpp_itemt &item); | ||
|
||
virtual std::string main_symbol() | ||
std::string main_symbol() | ||
{ | ||
return "main"; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,51 +16,51 @@ Author: Daniel Kroening, [email protected] | |
class java_bytecode_languaget:public languaget | ||
{ | ||
public: | ||
virtual bool preprocess( | ||
bool preprocess( | ||
std::istream &instream, | ||
const std::string &path, | ||
std::ostream &outstream); | ||
std::ostream &outstream) override; | ||
|
||
virtual bool parse( | ||
bool parse( | ||
std::istream &instream, | ||
const std::string &path); | ||
const std::string &path) override; | ||
|
||
virtual bool typecheck( | ||
bool typecheck( | ||
symbol_tablet &context, | ||
const std::string &module); | ||
const std::string &module) override; | ||
|
||
virtual bool final( | ||
symbol_tablet &context); | ||
bool final( | ||
symbol_tablet &context) override; | ||
|
||
virtual void show_parse(std::ostream &out); | ||
void show_parse(std::ostream &out) override; | ||
|
||
virtual ~java_bytecode_languaget(); | ||
~java_bytecode_languaget() override; | ||
java_bytecode_languaget() { } | ||
|
||
virtual bool from_expr( | ||
bool from_expr( | ||
const exprt &expr, | ||
std::string &code, | ||
const namespacet &ns); | ||
const namespacet &ns) override; | ||
|
||
virtual bool from_type( | ||
bool from_type( | ||
const typet &type, | ||
std::string &code, | ||
const namespacet &ns); | ||
const namespacet &ns) override; | ||
|
||
virtual bool to_expr( | ||
bool to_expr( | ||
const std::string &code, | ||
const std::string &module, | ||
exprt &expr, | ||
const namespacet &ns); | ||
const namespacet &ns) override; | ||
|
||
virtual languaget *new_language() | ||
languaget *new_language() override | ||
{ return new java_bytecode_languaget; } | ||
|
||
virtual std::string id() const { return "java"; } | ||
virtual std::string description() const { return "Java Bytecode"; } | ||
virtual std::set<std::string> extensions() const; | ||
std::string id() const override { return "java"; } | ||
std::string description() const override { return "Java Bytecode"; } | ||
std::set<std::string> extensions() const override; | ||
|
||
virtual void modules_provided(std::set<std::string> &modules); | ||
void modules_provided(std::set<std::string> &modules) override; | ||
|
||
protected: | ||
irep_idt main_class; | ||
|