Skip to content
EntityQ373045· pop 36· linked from 874 articles

formal grammar

Sign in to save

structure of a formal language

Wikidata facts

Show 2 more facts
Sources (3)

via Wikidata · CC0

~20 min read

Encyclopedic overview

Example of a simple formal grammar (left) with parsed sentence "the dog ate the bone" (right). Formal grammars consist of a set of non-terminal symbols, terminal symbols, production rules, and a designated start symbol.

A formal grammar is a set of symbols and the production rules for rewriting some of them into every possible string of a formal language over an alphabet. A grammar does not describe the meaning of the strings—only their form.

Excerpted from Wikipedia’s “formal grammar” article, available under the CC BY-SA 4.0 licence.