Improve compatibility with ancient versions of Bison.

Refs #4962