Zebediah Figura (@zfigura) commented about dlls/msado15/filter.l:
+%%
+BOOL recordset_parse_filter(WCHAR *filter, struct recordset *recordset) +{
- char *str;
- parser_param p;
- YY_BUFFER_STATE buffer;
- int len;
- TRACE("(%s)\n", debugstr_w(filter));
- memset(&p, 0, sizeof(parser_param));
- p.recordset = recordset;
- yylex_init(&p.yyscanner);
- yyset_extra(&p, p.yyscanner);
There is also a function yylex_init_extra(), which does both in a single call.
You may consider adding a bit of type safety by specifying the type of the "extra" parameter, as follows:
%option extra-type="parser_param *"
That said, you never currently use the scanner in the lexer itself. (You do retrieve it from the lexer in the parser, but this is unnecessary; see my comments below.) I don't know if you have plans to, but if not, note that it's not actually necessary to set yyextra if you only use it in the parser.
Also, the lexer is never destroyed [i.e. yylex_destroy()].