For one simple task, I wanted to use YACC (at once - bison and others, please do not offer it, I have a higher roof for YACC microgrammatics, but I don’t feel like learning a new one).
Stumbled onto such a thing - you need a list of items, something like
item ; item ; item Elementary -
list : list ';' item | item But I wanted to process the list, in which the last semicolon may be, but something in the brain pereklinilo, I can not figure out how to resolve both that and the other.
list : list ';' item | item | item ';' allows the presence of an empty element - two semicolons in a row. Again, not perfect :)
For my decision this is not a fundamental question, it will come down to me, but I feel like a fool :) There must be something in the style of “like I didn’t talk myself,” but what? ..