Generating a list of acceptable tokens before allowing YACC to perform a
default reduction is expensive. A cheaper way (assumimg a fast
implementation of memcpy) is to take a snapshot of YACC's state stack every
time it gets a new token. That way you can generate a list of the expected
tokens from the snapshot and only have to do it when actually needed.