e.g. For the grammar:
n:statement\\ list -> n:statement
n:statement\\ list -> n:statement\\ list n:statement
n:statement -> identifier = n:element + n:element ;
n:element -> identifier
n:element -> number
Associate "identifier" with the Identifier class, and "number" with the Literal class.