context-free grammar
A context-free grammar (CFG) is a formal system used to define the structure of languages, particularly in computer science and linguistics. It consists of a set of rules or productions that describe how symbols can be combined to form valid strings. Each rule specifies how a single non-terminal symbol can be replaced with a combination of terminal and non-terminal symbols.
In a CFG, the rules are applied without considering the surrounding symbols, hence the term "context-free." This allows for the generation of complex structures, such as programming languages and natural languages, while maintaining a clear and systematic approach to syntax.