context-free grammar
context-free grammar A grammar in which the left-hand side of each production is a single nonterminal, i.e. productions have the form A → α
(read as rewrite A as α), where α is a string of terminals and/or nonterminals. These productions apply irrespective of the context of A. For brevity one writes A → α1 | α2 | .. .. | α n
to indicate the separate productions A → α1, A → α2, .., .., A → αn
As an example, the following generates a simple class of arithmetic expressions typified by (a + b) × c:
E → T | T + E | (E)
T → E | E × T | a | b | c
The BNF notation used in defining the syntax of programming languages is simply a context-free grammar.
Context-free grammars are a class of phrase-structure grammar (PSG). GPSG represents the principal attempt at constructing context-free grammars capable of characterizing the grammars of natural language.
Compare context-sensitive grammar.
(read as rewrite A as α), where α is a string of terminals and/or nonterminals. These productions apply irrespective of the context of A. For brevity one writes A → α1 | α2 | .. .. | α n
to indicate the separate productions A → α1, A → α2, .., .., A → αn
As an example, the following generates a simple class of arithmetic expressions typified by (a + b) × c:
E → T | T + E | (E)
T → E | E × T | a | b | c
The BNF notation used in defining the syntax of programming languages is simply a context-free grammar.
Context-free grammars are a class of phrase-structure grammar (PSG). GPSG represents the principal attempt at constructing context-free grammars capable of characterizing the grammars of natural language.
Compare context-sensitive grammar.
More From encyclopedia.com
Context (linguistics) , Context
Like "text," the word "context" is a metaphor derived from the Latin texere, "to weave." In the fourth century c.e. the Latin noun contextio… Wee Free , Wee Free a member of the minority group nicknamed the Wee Free Kirk which stood apart from the Free Church of Scotland when the majority amalgamated… Achaea , A·chae·an / əˈkēən/ • adj. of or relating to Achaea in ancient Greece. ∎ (esp. in Homeric contexts) Greek. • n. an inhabitant of Achaea. ∎ (esp. in H… sunburst , sunburst.
1. Any collection of rods, normally gilded, representing sunbeams, radiating from a centre. In religious contexts it is common in Baroque a… freeware , freeware •flatware • hardware • glassware •neckwear • headsquare • setsquare •delftware • menswear • shareware •tableware • rainwear • freeware •beac… Elam , Elam
ELAM (Heb. עילם, ' eylam; Elamite halhatamti; Akk. Elamtu), region on the edge of the southwestern part of the Iranian plateau, modern Khuzistan…
You Might Also Like
NEARBY TERMS
context-free grammar