I want to match either newline ("\n"), semi-colon (";") or eof as being a valid end of statement. The first two are obvious, e.g.
eos = "\n" | ";";
but I'm not sure how to also match against the eof in the same way.
Is there some way to match against eof? I wondered if empty
would work but I'm not sure how to use it.
Here's a small machine with an action on the end-of-statement terminator or EOF.