The parser generator is accessed by the macro
, described below:
The name to be used for the parsing function. The remainder of the macro form specifies the reduction rules and semantic actions for the grammar.
The rules specified in a
form are of two types,
, described below.
Each normal rule corresponds to one production of the grammar to be parsed:
is the left-hand side of the grammar production and the list of grammar symbols defines the right-hand side of the production. (The right-hand side may be empty.) The list of forms specifies the semantic action to be taken when the reduction is made by the parser. These forms may contain references to the variables
$1 ... $n
is the length of the right hand side of the production. When the reduction is done, these variables are bound to the semantic values corresponding to the grammar symbols of the rule.