Recursive grammar
In computer science, a grammar is informally called a recursive grammar if it contains production rules that are recursive, meaning that expanding a non-terminal according to these rules can eventually lead to a string that includes the same non-terminal again.[src] Otherwise it is called a non-recursive grammar.[src] For example, a grammar for a context-free language is left recursive if there exists a non-terminal symbol A that can be put through the production rules to produce a string with A (as the leftmost symbol).[src] All types of grammars in the Chomsky hierarchy can be recursive and it is recursion that allows the production of infinite sets of words.[src]
In computer science, a grammar is informally called a recursive grammar if it contains production rules that are recursive, meaning that expanding a non-terminal according to these rules can eventually lead to a string that includes the same non-terminal again.[src] Otherwise it is called a non-recursive grammar.[src] For example, a grammar for a context-free language is left recursive if there exists a non-terminal symbol A that can be put through the production rules to produce a string with A (as the leftmost symbol).[src] All types of grammars in the Chomsky hierarchy can be recursive and it is recursion that allows the production of infinite sets of words.[src] ==Properties== A non-recursive grammar can produce only a finite language; and each finite language can be produced by a non-recursive grammar.[src] For example, a straight-line grammar produces just a single word.[src] A recursive context-free grammar that contains no useless rules necessarily produces an infinite language.[src] This property forms the basis for an algorithm that can test efficiently whether a context-free grammar produces a finite or infinite language.[src] ==References==[src]
13 sentences · 13 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Recursive grammar." encyclopegia.org, 2025, https://encyclopegia.org/wiki/recursive-grammar. Accessed 29 November 2026.
Chicago
"Recursive grammar." encyclopegia.org. Accessed November 29, 2026. https://encyclopegia.org/wiki/recursive-grammar.
APA
encyclopegia.org. (2025). Recursive grammar. Retrieved November 29, 2026, from https://encyclopegia.org/wiki/recursive-grammar
Accessed November 29, 2026 · CC BY-SA 4.0 · citation page · JSON