The parser invokes the scanner by calling yylex. Contrary to C
parsers, C++ parsers are always pure: there is no point in using the
%define api.pure full directive. Therefore the interface is as follows.
— Method on parser: int yylex (semantic_type* yylval, location_type* yylloc, type1 arg1, ...)
Return the next token. Its type is the return value, its semantic
value and location being yylval and yylloc. Invocations of
‘%lex-param {type1arg1}’ yield additional arguments.