In
computer science,
terminal and nonterminal symbols are the lexical elements used in specifying the production rules constituting a
formal grammar.
Terminal symbols are the elementary symbols of the
language defined by a formal grammar.
Nonterminal symbols (or
syntactic variables) are replaced by groups of terminal symbols according to the production rules.