Grammer A grammar is a set of production rules for strings in a formal language. The rules describe how to form strings from the language's alphabet that are valid according to the language's syntax. Chomsky hierarchy (Classification of grammar)