-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8136 from tautschnig/cleanup/jsil_parsert
jsil_parsert: construct with message handler
- Loading branch information
Showing
5 changed files
with
38 additions
and
32 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
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 |
---|---|---|
|
@@ -10,13 +10,3 @@ Author: Michael Tautschnig, [email protected] | |
/// Jsil Language | ||
|
||
#include "jsil_parser.h" | ||
|
||
jsil_parsert jsil_parser; | ||
|
||
extern char *yyjsiltext; | ||
|
||
int yyjsilerror(const std::string &error) | ||
{ | ||
jsil_parser.parse_error(error, yyjsiltext); | ||
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 |
---|---|---|
|
@@ -16,16 +16,24 @@ Author: Michael Tautschnig, [email protected] | |
|
||
#include "jsil_parse_tree.h" | ||
|
||
int yyjsilparse(); | ||
class jsil_parsert; | ||
int yyjsilparse(jsil_parsert &); | ||
void jsil_scanner_init(jsil_parsert &); | ||
|
||
class jsil_parsert:public parsert | ||
{ | ||
public: | ||
explicit jsil_parsert(message_handlert &message_handler) | ||
: parsert(message_handler) | ||
{ | ||
} | ||
|
||
jsil_parse_treet parse_tree; | ||
|
||
virtual bool parse() override | ||
{ | ||
return yyjsilparse()!=0; | ||
jsil_scanner_init(*this); | ||
return yyjsilparse(*this) != 0; | ||
} | ||
|
||
virtual void clear() override | ||
|
@@ -41,9 +49,4 @@ class jsil_parsert:public parsert | |
std::string string_literal; | ||
}; | ||
|
||
extern jsil_parsert jsil_parser; | ||
|
||
int yyjsilerror(const std::string &error); | ||
void jsil_scanner_init(); | ||
|
||
#endif // CPROVER_JSIL_JSIL_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