Your grammar contained a % keyword that yacc did not recognize, most likely due to a misspelling in word.
Correct the spelling of word.