start | find | index | login or register | edit
CFG
by earl, 7728 days ago
Context-Free Grammar

"A context-free grammar is a formal system that describes a language by specifying how any legal text can be derived from a distinguished symbol called the axiom, or sentence symbol. It consists of a set of productions, each of which states that a given symbol can be replaced by a given sequence of symbols."

A CFG consists of four entities: the axiom (sentence non-terminal or "start" non-terminal), a set of non-terminal symbols, a set of terminal symbols and a set of production rules. A context free grammar can therefore be described as the following set:

G = { S, N, T, R }

S ... the non-terminal symbol being the axiom
N ... the set of non-terminal symbols (also called identifiers)
T ... the set of terminal symbols (also called literals)
R ... the set of production rules

BNF/EBNF and Prolog's DCG are examples of CFG specification methods.
powered by vanilla
echo earlZstrainYat|tr ZY @.
earl.strain.at • esa3 • online for 8424 days • c'est un vanilla site