Indexed Grammar Article Index for
Indexed
Website Links For
Grammar
 

Information About

Indexed Grammar




Productions can replace a nonterminal with a string of terminals and nonterminals like in context-free grammars, but also a nonterminal with a nonterminal followed by an index and a nonterminal followed by an index with a nonterminal.

Indices can appear only after a nonterminal or after another index, so every nonterminal can be considered the "owner" of the indices that follow it, which form a stack (indices are added or removed by productions right after the nonterminal).

In practice, stacks of indices can count and remember what rules were applied and in which order. For example, indexed grammars can describe this non context free language: