By definition, a deferred semantic action is not performed at the same time as the associated reduction. This raises caveats for several Bison features you might use in a semantic action in a GLR parser.
In any semantic action, you can examine
yychar to determine the type of
the lookahead token present at the time of the associated reduction.
After checking that
yychar is not set to
you can then examine
yylloc to determine the
lookahead token's semantic value and location, if any.
In a nondeferred semantic action, you can also modify any of these variables to
influence syntax analysis.
See Lookahead Tokens.
In a deferred semantic action, it's too late to influence syntax analysis.
In this case,
yylloc are set to
shallow copies of the values they had at the time of the associated reduction.
For this reason alone, modifying them is dangerous.
Moreover, the result of modifying them is undefined and subject to change with
future versions of Bison.
For example, if a semantic action might be deferred, you should never write it
yyclearin (see Action Features) or to attempt to free
memory referenced by
Another Bison feature requiring special consideration is
(see Action Features), which you can invoke in a semantic action to
initiate error recovery.
During deterministic GLR operation, the effect of
the same as its effect in a deterministic parser.
In a deferred semantic action, its effect is undefined.
Also, see Default Action for Locations, which
describes a special usage of
YYLLOC_DEFAULT in GLR parsers.