Skip to content

Commit 32800a3

Browse files
author
Daniel Kroening
committed
use override in some central classes
1 parent 6905e06 commit 32800a3

File tree

8 files changed

+18
-16
lines changed

8 files changed

+18
-16
lines changed

src/ansi-c/ansi_c_parser.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ class ansi_c_parsert:public parsert
3535
{
3636
}
3737

38-
virtual bool parse()
38+
virtual bool parse() override
3939
{
4040
return yyansi_cparse()!=0;
4141
}
4242

43-
virtual void clear()
43+
virtual void clear() override
4444
{
4545
parsert::clear();
4646
parse_tree.clear();

src/cbmc/cbmc_parse_options.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ class cbmc_parse_optionst:
6363
public language_uit
6464
{
6565
public:
66-
virtual int doit();
67-
virtual void help();
66+
virtual int doit() override;
67+
virtual void help() override;
6868

6969
cbmc_parse_optionst(int argc, const char **argv);
7070
cbmc_parse_optionst(

src/cpp/cpp_parser.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class cpp_parsert:public parsert
2626
public:
2727
cpp_parse_treet parse_tree;
2828

29-
virtual bool parse();
29+
virtual bool parse() override;
3030

31-
virtual void clear()
31+
virtual void clear() override
3232
{
3333
parsert::clear();
3434
parse_tree.clear();

src/goto-analyzer/goto_analyzer_parse_options.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ class goto_analyzer_parse_optionst:
4343
public language_uit
4444
{
4545
public:
46-
virtual int doit();
47-
virtual void help();
46+
virtual int doit() override;
47+
virtual void help() override;
4848

4949
goto_analyzer_parse_optionst(int argc, const char **argv);
5050

src/jsil/jsil_parser.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ class jsil_parsert:public parsert
2020
public:
2121
jsil_parse_treet parse_tree;
2222

23-
virtual bool parse()
23+
virtual bool parse() override
2424
{
2525
return yyjsilparse()!=0;
2626
}
2727

28-
virtual void clear()
28+
virtual void clear() override
2929
{
3030
parsert::clear();
3131
parse_tree.clear();

src/json/json_parser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ bool parse_json(
3636
json_parser.in=∈
3737
json_parser.set_message_handler(message_handler);
3838

39-
bool result=yyjsonparse()!=0;
39+
bool result=json_parser.parse();
4040

4141
// save result
4242
if(json_parser.stack.size()==1)

src/json/json_parser.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ class json_parsert:public parsert
2525

2626
inline jsont &top() { return stack.top(); }
2727

28+
virtual bool parse() override
29+
{
30+
return yyjsonparse()!=0;
31+
}
32+
2833
inline void push(const jsont &x)
2934
{
3035
stack.push(x);
@@ -37,7 +42,7 @@ class json_parsert:public parsert
3742
stack.pop();
3843
}
3944

40-
virtual void clear()
45+
virtual void clear() override
4146
{
4247
stack=stackt();
4348
}

src/util/parser.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@ class parsert:public messaget
4848
return true;
4949
}
5050

51-
virtual bool parse()
52-
{
53-
return true;
54-
}
51+
virtual bool parse()=0;
5552

5653
inline bool eof()
5754
{

0 commit comments

Comments
 (0)