A context-free grammar G is a 4-tuple G = (V, Σ, R, S) where:
Vis a finite set; each elementv ∈ Vis called a variable. Each variable represents a different type of phrase or clause in the sentence.Σis a finite set of terminals, disjoint fromV, which make up the actual content of the sentence. The set of terminals is the alphabet of the language defined by the grammarG.Ris a finite relation in(V × (V ∪ Σ)*). The members ofRare called productions of the grammar (symbolized byP).Sis the start variable, used to represent the whole sentence. It must be an element ofV.