struct cdecl *cdecl_parse_decl(const char *declstr)
{
YY_BUFFER_STATE state;
+ yyscan_t scanner;
struct cdecl *decl;
int rc;
- state = yy_scan_string(declstr);
- rc = yyparse(&decl);
- yy_delete_buffer(state);
+ rc = yylex_init(&scanner);
+ if (rc != 0)
+ return NULL;
+
+ state = yy_scan_string(declstr, scanner);
+ rc = yyparse(scanner, &decl);
+ yy_delete_buffer(state, scanner);
+ yylex_destroy(scanner);
if (rc != 0)
return NULL;