A context-free grammar can enforce several matched counts by nesting their dependencies. For example,
generates the context-free language . Applying the first recursive production rule times places zeros at both ends. Applying the second recursive production rule times places ones before the inner block and further zeros after it. Thus
Every terminal grammar derivation has this form, because it must switch from to exactly once. The nesting is useful: the final block records the sum of two independently chosen counts without requiring a context-sensitive grammar.
The language
is context-free. The grammar
nests the dependency around the dependency.

Articles by others on the same topic (0)

There are currently no matching articles.