Languages defined mathematically by an alphabet (symbols/letters) and a grammar consisting of terminal and non-terminal symbols with production rules; the language is the set of words generated by the rules. Foundational concept of theoretical computer science that underpins regular expressions, parsing, and the Chomsky hierarchy.