I'm writing a simple pascal parser and have specified some grammar rules like
program_header --> program, id, leftparenthesis ... etc
program --> [500]
id --> [300]
etc
How would I go about if I wanted to display diagnostic messages to the user? Like if someone left out "id", I would display that the next expected token would be "id" when it got "leftparenthesis" instead?