Context-free grammar

A context-free grammar (CFG) is a term used in formal language theory to describe a certain type of formal grammar. A context-free grammar is a set of production rules that describe all possible strings in a given formal language. Production rules are simple replacements. For example, the rule Replaces with . There can be multiple replacement rules for any given value. For example, means that can be replaced with either or . and but not . Rules can also be applied in reverse to check if a string is grammatically correct according to the grammar. and . If we start with the nonterminal symbol to turn into and

Context-free grammar

A context-free grammar (CFG) is a term used in formal language theory to describe a certain type of formal grammar. A context-free grammar is a set of production rules that describe all possible strings in a given formal language. Production rules are simple replacements. For example, the rule Replaces with . There can be multiple replacement rules for any given value. For example, means that can be replaced with either or . and but not . Rules can also be applied in reverse to check if a string is grammatically correct according to the grammar. and . If we start with the nonterminal symbol to turn into and