The primary difference with respect to a pull parser is that the parser
method push_parse is invoked repeatedly to parse each token. This
function is available if either the "%define api.push-pull push" or "%define
api.push-pull both" declaration is used (see api.push-pull). The Location and Position
parameters are available only if location tracking is active.

The value returned by the push_parse method is one of the following
four constants: YYABORT, YYACCEPT, YYERROR, or
YYPUSH_MORE. This new value, YYPUSH_MORE, may be returned if
more input is required to finish parsing the grammar.

If api.push-pull is declared as both, then the generated parser class
will also implement the parse method. This method’s body is a loop
that repeatedly invokes the scanner and then passes the values obtained from
the scanner to the push_parse method.

There is one additional complication. Technically, the push parser does not
need to know about the scanner (i.e. an object implementing the
YYParser.Lexer interface), but it does need access to the
yyerror method. Currently, the yyerror method is defined in
the YYParser.Lexer interface. Hence, an implementation of that
interface is still required in order to provide an implementation of
yyerror. The current approach (and subject to change) is to require
the YYParser constructor to be given an object implementing the
YYParser.Lexer interface. This object need only implement the
yyerror method; the other methods can be stubbed since they will
never be invoked. The simplest way to do this is to add a trivial scanner
implementation to your grammar file using whatever implementation of
yyerror is desired. The following code sample shows a simple way to
accomplish this.