@@ -71,17 +71,16 @@ bool ansi_c_languaget::parse(
71
71
ansi_c_internal_additions (code, config.ansi_c .ts_18661_3_Floatn_types );
72
72
std::istringstream codestr (code);
73
73
74
- ansi_c_parser. clear () ;
74
+ ansi_c_parsert ansi_c_parser{message_handler} ;
75
75
ansi_c_parser.set_file (ID_built_in);
76
76
ansi_c_parser.in =&codestr;
77
- ansi_c_parser.log .set_message_handler (message_handler);
78
77
ansi_c_parser.for_has_scope =config.ansi_c .for_has_scope ;
79
78
ansi_c_parser.ts_18661_3_Floatn_types =config.ansi_c .ts_18661_3_Floatn_types ;
80
79
ansi_c_parser.cpp98 =false ; // it's not C++
81
80
ansi_c_parser.cpp11 =false ; // it's not C++
82
81
ansi_c_parser.mode =config.ansi_c .mode ;
83
82
84
- ansi_c_scanner_init ();
83
+ ansi_c_scanner_init (ansi_c_parser );
85
84
86
85
bool result=ansi_c_parser.parse ();
87
86
@@ -90,7 +89,7 @@ bool ansi_c_languaget::parse(
90
89
ansi_c_parser.set_line_no (0 );
91
90
ansi_c_parser.set_file (path);
92
91
ansi_c_parser.in =&i_preprocessed;
93
- ansi_c_scanner_init ();
92
+ ansi_c_scanner_init (ansi_c_parser );
94
93
result=ansi_c_parser.parse ();
95
94
}
96
95
@@ -197,13 +196,12 @@ bool ansi_c_languaget::to_expr(
197
196
198
197
// parsing
199
198
200
- ansi_c_parser. clear () ;
199
+ ansi_c_parsert ansi_c_parser{message_handler} ;
201
200
ansi_c_parser.set_file (irep_idt ());
202
201
ansi_c_parser.in =&i_preprocessed;
203
- ansi_c_parser.log .set_message_handler (message_handler);
204
202
ansi_c_parser.mode =config.ansi_c .mode ;
205
203
ansi_c_parser.ts_18661_3_Floatn_types =config.ansi_c .ts_18661_3_Floatn_types ;
206
- ansi_c_scanner_init ();
204
+ ansi_c_scanner_init (ansi_c_parser );
207
205
208
206
bool result=ansi_c_parser.parse ();
209
207
0 commit comments