Lably
Skip to content

Context-free language

Formal language generated by context-free grammar

  • 5 min read
  • 3 chapters

Related on Lably

Through Context-free grammar, Matrix multiplication and Big O notation

Context-free languages have many applications in programming languages, in particular, most arithmetic expressions are generated by context-free grammars.

Background

Context-free grammar

Different context-free grammars can generate the same context-free language. Intrinsic properties of the language can be distinguished from extrinsic properties of a particular grammar by comparing multiple grammars that describe the language.

Automata

The set of all context-free languages is identical to the set of languages accepted by pushdown automata, which makes these languages amenable to parsing. Further, for a given CFG, there is a direct way to produce a pushdown automaton for the grammar (and thereby the corresponding language), though going the other way (producing a grammar given an automaton) is not as direct.

Sign in to keep reading

2 more chapters are free with a Lably account.

More in Computing and communication