Terminology of Parse::RecDescent
- Grammar consists of a set of rules.
- Each rule starts with an identifier (which corresponds to a
non-terminal), followed by a colon, followed by zero
or more productions, separated by vertical
bars.
- If there is more than one production for a rule, they are alternatives,
and a similar effect can be reached by having several rules starting
with the same identifier.
- Each production consists of zero or more items.
- Items are:
- Subrule: another rule to be matched.
- Token: a literal or a regex to be matched.
This has to match at the beginning of the unparsed part
of the to be parsed string - skipping over any leading whitespace.
This corresponds to the so-called terminals.
- Action: a piece of Perl code to be executed.
- Directive: a special instruction to the parser.
- Comment: a standard Perl comment.
[Prev]
[Next]
[Index]