Grammar is the study of rules governing the use of language. The set of rules governing a particular language is also called the grammar of the language; thus, each language can be said to have its own distinct grammar. Grammar is part of the general study of language called linguistics.
Types of grammarA prescriptive grammar presents authoritative norms for a particular language, and tends to deprecate non-standard constructions. Traditional grammars are typically prescriptive. Prescriptive grammars are usually based on the prestige dialects of a speech community, and often specifically condemn certain constructions which are common only among lower socioeconomic groups, such as the use of "ain't" and double negatives in English. Though prescriptive grammars remain common in pedagogy and foreign language teaching, they have fallen out of favor in modern academic linguistics, as they describe only a subset of actual language usage.
A descriptive grammar attempts to describe actual usage, avoiding prescriptive judgments. Descriptive grammars are bound to a particular speech community, and attempt to provide rules for any utterance considered grammatically correct within that community. For example, in many dialects of English, the use of double negatives is very common, though ungrammatical from the point of view of a prescriptive English grammar. A descriptive grammar of a speech community where "I didn't do nothing" is acceptable will treat that sentence as grammatical, and provide rules that account for it. A prescriptive grammar of formal English would rather provide rules for "I didn't do anything."
Traditional grammar is the collection of ideas about grammar that Western societies have received from Greek and Roman sources. Prescriptive grammar is usually formulated in terms of the descriptive concepts inherited from traditional grammar. Modern descriptive grammar aims to correct the errors of traditional grammar, and generalize them, so as to avoid shoehorning all languages to the model of Latin. Nearly all materials used in teaching language, however, are still based on traditional grammar.
A formal grammar is a precisely defined grammar, typically used for computer programming languages
A generative grammar is a formal grammar that can in some sense "generate" the well-formed expressions of a natural language. An entire branch of linguistic theory is based on generative grammars. Generative grammars were popularized by Noam Chomsky. Generative grammar may include Transformational grammar, which is a broad term mostly describing natural language grammars which have been developed in a Chomskian tradition. Transformational grammar is usually synonymous with the slightly more specific transformational-generative grammar (TGG).
Development of grammars