出典:Wikipedia
出典:『Wikipedia』 (2011/06/10 11:26 UTC 版)
A two-level grammar is a formal grammar that is used to generate another formal grammar [1], such as one with an infinite rule set [2]. This is how a Van Wijngaarden grammar was used to specify Algol68 [3]. A context free grammar that defines the rules for a second grammar can yield an effectively infinite set of rules for the derived grammar. This makes such two-level grammars more powerful than a single layer of context free grammar, because generative two-level grammars have actually been shown to be Turing complete.