Subrules become the fields of ParseTree classes.
You can specify the field name explicitly – if you don't, Nitra will try to automatically form the name from the subrule content.
A subrule name can be explicitly specified in one of the following ways.
=
operator. The rule should be located to the right and the field name – to the left of the operator.If the field name is not explicitly specified, Nitra will try to calculate it automatically. Below is the description of the name calculation algorithm:
?
operator, the subrule name with the added Opt
suffix is used. For example, a field named IdentifierOpt
will be created for the Identifier?
rule.void
and which is not a literal token, then this rule's name is used. If there are more than one such rule, then the name should be manually specified, as calculation becomes impossible. In this case the compiler will return an error.
|