Grammarsymbols
Grammarsymbols are the symbols used to define grammars in formal language theory. A grammar G is typically described by a quadruple (N, Σ, P, S), where N is a finite set of nonterminal symbols, Σ is a finite set of terminal symbols, P is a set of production rules, and S is the designated start symbol. Grammarsymbols fall into two main classes: terminals and nonterminals. Terminals are the basic symbols that appear in the strings of the language and cannot be replaced during derivations. Nonterminals are symbols that stand for sequences of terminals and/or other nonterminals and are replaced by the productions in P.
Production rules express how nonterminals can be rewritten as sequences of terminals and nonterminals. A rule
Notation systems such as BNF and EBNF provide conventions for writing grammars using grammarsymbols. In BNF,