-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
assembler_parsert: construct with message handler
This both avoids an object of static lifetime as well as it fixes the (transitive) use of the deprecated messaget() constructor.
- Loading branch information
1 parent
56da874
commit 5bbad53
Showing
11 changed files
with
58 additions
and
39 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 |
---|---|---|
|
@@ -8,11 +8,11 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include "assembler_parser.h" | ||
|
||
assembler_parsert assembler_parser; | ||
|
||
extern char *yyassemblertext; | ||
|
||
int yyassemblererror(const std::string &error) | ||
int yyassemblererror( | ||
assembler_parsert &assembler_parser, | ||
const std::string &error) | ||
{ | ||
assembler_parser.parse_error(error, yyassemblertext); | ||
return 0; | ||
|
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 |
---|---|---|
|
@@ -14,9 +14,9 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include <list> | ||
|
||
int yyassemblerlex(); | ||
int yyassemblererror(const std::string &error); | ||
void assembler_scanner_init(); | ||
class assembler_parsert; | ||
int yyassemblerlex(assembler_parsert &); | ||
int yyassemblererror(assembler_parsert &, const std::string &error); | ||
|
||
class assembler_parsert:public parsert | ||
{ | ||
|
@@ -37,24 +37,22 @@ class assembler_parsert:public parsert | |
instructions.push_back(instructiont()); | ||
} | ||
|
||
assembler_parsert() | ||
explicit assembler_parsert(message_handlert &message_handler) | ||
: parsert(message_handler) | ||
{ | ||
} | ||
|
||
virtual bool parse() | ||
{ | ||
yyassemblerlex(); | ||
yyassemblerlex(*this); | ||
return false; | ||
} | ||
|
||
virtual void clear() | ||
{ | ||
parsert::clear(); | ||
instructions.clear(); | ||
// assembler_scanner_init(); | ||
} | ||
}; | ||
|
||
extern assembler_parsert assembler_parser; | ||
|
||
#endif // CPROVER_ASSEMBLER_ASSEMBLER_PARSER_H |
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
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
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
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
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
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
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
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
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