1616
1717#include " statement_list_parse_tree.h"
1818
19+ class statement_list_parsert ;
1920// / Defined in statement_list_y.tab.cpp. Main function for the parse process
2021// / generated by bison, performs all necessary steps to fill the parse tree.
21- int yystatement_listparse ();
22+ int yystatement_listparse (statement_list_parsert & );
2223
2324// / Responsible for starting the parse process and to translate the result into
2425// / a statement_list_parse_treet. This parser works by using the expression
@@ -34,6 +35,12 @@ int yystatement_listparse();
3435class statement_list_parsert : public parsert
3536{
3637public:
38+ // / Constructor
39+ explicit statement_list_parsert (message_handlert &message_handler)
40+ : parsert(message_handler)
41+ {
42+ }
43+
3744 // / Starts the parsing process and saves the result inside of this instance's
3845 // / parse tree.
3946 // / \return False if successful.
@@ -71,9 +78,6 @@ class statement_list_parsert : public parsert
7178 statement_list_parse_treet parse_tree;
7279};
7380
74- // / Instance of the parser, used by other modules.
75- extern statement_list_parsert statement_list_parser;
76-
7781// / Forwards any errors that are encountered during the parse process. This
7882// / function gets called by the generated files of flex and bison.
7983// / \param error: Error message.
@@ -82,6 +86,6 @@ int yystatement_listerror(const std::string &error);
8286
8387// / Defined in scanner.l. This function initialises the scanner by setting
8488// / debug flags (if present) and its initial state.
85- void statement_list_scanner_init ();
89+ void statement_list_scanner_init (statement_list_parsert & );
8690
8791#endif // CPROVER_STATEMENT_LIST_STATEMENT_LIST_PARSER_H
0 commit comments