Skip to content

Commit 3d9eba2

Browse files
author
Daniel Kroening
committed
use override for languaget classes
1 parent b0f420c commit 3d9eba2

File tree

3 files changed

+68
-68
lines changed

3 files changed

+68
-68
lines changed

src/ansi-c/ansi_c_language.h

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,56 +21,56 @@ Author: Daniel Kroening, [email protected]
2121
class ansi_c_languaget:public languaget
2222
{
2323
public:
24-
virtual bool preprocess(
24+
bool preprocess(
2525
std::istream &instream,
2626
const std::string &path,
27-
std::ostream &outstream);
27+
std::ostream &outstream) override;
2828

29-
virtual bool parse(
29+
bool parse(
3030
std::istream &instream,
31-
const std::string &path);
31+
const std::string &path) override;
3232

33-
virtual bool typecheck(
33+
bool typecheck(
3434
symbol_tablet &symbol_table,
35-
const std::string &module);
35+
const std::string &module) override;
3636

37-
virtual bool final(
38-
symbol_tablet &symbol_table);
37+
bool final(
38+
symbol_tablet &symbol_table) override;
3939

40-
virtual void show_parse(std::ostream &out);
40+
void show_parse(std::ostream &out) override;
4141

42-
virtual ~ansi_c_languaget();
42+
~ansi_c_languaget() override;
4343
ansi_c_languaget() { }
4444

45-
virtual bool from_expr(
45+
bool from_expr(
4646
const exprt &expr,
4747
std::string &code,
48-
const namespacet &ns);
48+
const namespacet &ns) override;
4949

50-
virtual bool from_type(
50+
bool from_type(
5151
const typet &type,
5252
std::string &code,
53-
const namespacet &ns);
53+
const namespacet &ns) override;
5454

55-
virtual bool type_to_name(
55+
bool type_to_name(
5656
const typet &type,
5757
std::string &name,
58-
const namespacet &ns);
58+
const namespacet &ns) override;
5959

60-
virtual bool to_expr(
60+
bool to_expr(
6161
const std::string &code,
6262
const std::string &module,
6363
exprt &expr,
64-
const namespacet &ns);
64+
const namespacet &ns) override;
6565

66-
virtual languaget *new_language()
66+
languaget *new_language() override
6767
{ return new ansi_c_languaget; }
6868

69-
virtual std::string id() const { return "C"; }
70-
virtual std::string description() const { return "ANSI-C 99"; }
71-
virtual std::set<std::string> extensions() const;
69+
std::string id() const override { return "C"; }
70+
std::string description() const override { return "ANSI-C 99"; }
71+
std::set<std::string> extensions() const override;
7272

73-
virtual void modules_provided(std::set<std::string> &modules);
73+
void modules_provided(std::set<std::string> &modules) override;
7474

7575
protected:
7676
ansi_c_parse_treet parse_tree;

src/cpp/cpp_language.h

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,74 +21,74 @@ Author: Daniel Kroening, [email protected]
2121
class cpp_languaget:public languaget
2222
{
2323
public:
24-
virtual bool preprocess(
24+
bool preprocess(
2525
std::istream &instream,
2626
const std::string &path,
27-
std::ostream &outstream);
27+
std::ostream &outstream) override;
2828

29-
virtual bool parse(
29+
bool parse(
3030
std::istream &instream,
31-
const std::string &path);
31+
const std::string &path) override;
3232

33-
virtual bool typecheck(
33+
bool typecheck(
3434
symbol_tablet &symbol_table,
35-
const std::string &module);
35+
const std::string &module) override;
3636

3737
bool merge_symbol_table(
3838
symbol_tablet &dest,
3939
symbol_tablet &src,
4040
const std::string &module,
4141
class replace_symbolt &replace_symbol) const;
4242

43-
virtual bool final(
44-
symbol_tablet &symbol_table);
43+
bool final(
44+
symbol_tablet &symbol_table) override;
4545

46-
virtual void show_parse(std::ostream &out);
46+
void show_parse(std::ostream &out) override;
4747

4848
// constructor, destructor
49-
virtual ~cpp_languaget();
49+
~cpp_languaget() override;
5050
cpp_languaget() { }
5151

5252
// conversion from expression into string
53-
virtual bool from_expr(
53+
bool from_expr(
5454
const exprt &expr,
5555
std::string &code,
56-
const namespacet &ns);
56+
const namespacet &ns) override;
5757

5858
// conversion from type into string
59-
virtual bool from_type(
59+
bool from_type(
6060
const typet &type,
6161
std::string &code,
62-
const namespacet &ns);
62+
const namespacet &ns) override;
6363

64-
virtual bool type_to_name(
64+
bool type_to_name(
6565
const typet &type,
6666
std::string &name,
67-
const namespacet &ns);
67+
const namespacet &ns) override;
6868

6969
// conversion from string into expression
70-
virtual bool to_expr(
70+
bool to_expr(
7171
const std::string &code,
7272
const std::string &module,
7373
exprt &expr,
74-
const namespacet &ns);
74+
const namespacet &ns) override;
7575

76-
virtual languaget *new_language()
76+
languaget *new_language() override
7777
{ return new cpp_languaget; }
7878

79-
virtual std::string id() const { return "cpp"; }
80-
virtual std::string description() const { return "C++"; }
81-
virtual std::set<std::string> extensions() const;
79+
std::string id() const override { return "cpp"; }
80+
std::string description() const override { return "C++"; }
81+
std::set<std::string> extensions() const override;
8282

83-
virtual void modules_provided(std::set<std::string> &modules);
83+
void modules_provided(std::set<std::string> &modules) override;
8484

8585
protected:
8686
cpp_parse_treet cpp_parse_tree;
8787
std::string parse_path;
8888

8989
void show_parse(std::ostream &out, const cpp_itemt &item);
9090

91-
virtual std::string main_symbol()
91+
std::string main_symbol()
9292
{
9393
return "main";
9494
}

src/java_bytecode/java_bytecode_language.h

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,51 +16,51 @@ Author: Daniel Kroening, [email protected]
1616
class java_bytecode_languaget:public languaget
1717
{
1818
public:
19-
virtual bool preprocess(
19+
bool preprocess(
2020
std::istream &instream,
2121
const std::string &path,
22-
std::ostream &outstream);
22+
std::ostream &outstream) override;
2323

24-
virtual bool parse(
24+
bool parse(
2525
std::istream &instream,
26-
const std::string &path);
26+
const std::string &path) override;
2727

28-
virtual bool typecheck(
28+
bool typecheck(
2929
symbol_tablet &context,
30-
const std::string &module);
30+
const std::string &module) override;
3131

32-
virtual bool final(
33-
symbol_tablet &context);
32+
bool final(
33+
symbol_tablet &context) override;
3434

35-
virtual void show_parse(std::ostream &out);
35+
void show_parse(std::ostream &out) override;
3636

37-
virtual ~java_bytecode_languaget();
37+
~java_bytecode_languaget() override;
3838
java_bytecode_languaget() { }
3939

40-
virtual bool from_expr(
40+
bool from_expr(
4141
const exprt &expr,
4242
std::string &code,
43-
const namespacet &ns);
43+
const namespacet &ns) override;
4444

45-
virtual bool from_type(
45+
bool from_type(
4646
const typet &type,
4747
std::string &code,
48-
const namespacet &ns);
48+
const namespacet &ns) override;
4949

50-
virtual bool to_expr(
50+
bool to_expr(
5151
const std::string &code,
5252
const std::string &module,
5353
exprt &expr,
54-
const namespacet &ns);
54+
const namespacet &ns) override;
5555

56-
virtual languaget *new_language()
56+
languaget *new_language() override
5757
{ return new java_bytecode_languaget; }
5858

59-
virtual std::string id() const { return "java"; }
60-
virtual std::string description() const { return "Java Bytecode"; }
61-
virtual std::set<std::string> extensions() const;
59+
std::string id() const override { return "java"; }
60+
std::string description() const override { return "Java Bytecode"; }
61+
std::set<std::string> extensions() const override;
6262

63-
virtual void modules_provided(std::set<std::string> &modules);
63+
void modules_provided(std::set<std::string> &modules) override;
6464

6565
protected:
6666
irep_idt main_class;

0 commit comments

Comments
 (0)