Fix compatibility issue with Bison 3.

Closes #570

(cherry picked from commit 96e973a07fc979028f5e92bc4ccb5f2d9806a609)