Closure
Closure in ABNF grammars.
A rule's definiens may reference (i.e. ``call'') other rules.
Those rules may in turn call further rules,
and so on until a ``closed'' set of rules is reached.
When grammars are modularly defined, a grammar may not be closed,
but after the modules are composed into one grammar for parsing,
the resulting grammar should be closed.
When composing grammars, sometimes only a portion of a grammar is selected,
consisting of a subset of its rules (perhaps called by other grammars)
along with their closure.
Subtopics
- Calc-trans-rules-of-names
- Calculate the rules from a list of rules
that transitively define names in a list of rule names,
collecting them into an accumulator (list of rules).
- Rules-of-name
- Separate from some rules the ones that define a rule name.
- Rulelist-unused-rules
- Rule names that are defined in a list of rules
but not used anywhere in those rules.
- Trans-rules-of-names
- Find the rules from a list of rules
that transitively define the names in a list of rule names.
- Rulelist-called-rules
- Rule names that occur in (the definientia of) a list of rules.
- Rulelist-defined-rules
- Rule names that are defined in a list of rules.
- Rulelist-closedp
- A rule list is closed iff it defines all the rules that it calls.
- Rule-called-rules
- Rule names that occur in (the definiens of) a rule.
- Element-called-rules
- Rule names that occur in an element.
- Concatenation-called-rules
- Rule names that occur in a concatenation.
- Alternation-called-rules
- Rule names that occur in an alternation.
- Repetition-called-rules
- Rule names that occur in a repetition.