Today's example constructs a grammar for tracking playing cards in a single deal. We'll say it's poker with one or more players and that each player is being dealt a hand that contains exactly five cards.
The "almost" part is the need to track cards and detect duplicates. We want to check for repeated cards both within each card-hand and between hands.
To start with, here's the basic grammar (no duplicate checks yet):
grammar CardGame {