If the token on the left side of a production is called grammar or is tagged with a following dollar sign, it is taken to be the grammar token , or goal token for the grammar. The names on the left side of a production may be preceded by a type cast indicating the data type of the semantic value of the named tokens. A grammar rule is a sequence of rule elements joined by commas. The rule elements may be character sets , keywords , token names , virtual productions, or immediate actions . Braces indicate a choice among the listed rules.
Brackets indicate an optional choice.
The ellipsis represents unlimited repetition. In either case they are preceded by an equal sign. Short form procedures may not continue onto another line. Reduction procedures may access the semantic values of tokens in the grammar rule to which they are attached. To each token whose value is needed append a colon and the variable name used for the token value in the reduction procedure.