Terminal and nonterminal symbols

A terminal symbol (also called terminal symbols or short terminal ) of a formal grammar is a symbol that individually can not be replaced by a production rule. Thus, a word that consists only of terminal symbols, as a premise (ie left side) of a production rule occur. The set of terminal symbols of the grammar is the alphabet of symbols that make up the words of the languages ​​generated by the grammar. All replaceable symbols are called non-terminal symbols.

Parsing each token is finally compared with a terminal symbol of the grammar, if only the terminal symbol matches the token, the corresponding rule of the grammar can be used.

The terminal symbols of a grammar form the leaves of the syntax trees of all derivable words. Analog form suitable to the terminal symbols token, the leaves of the parse tree.

In theory, terminal symbols are often represented by lowercase letters, in practice, however, other symbols such as punctuation and keywords of programming languages ​​such as FOR, IF, etc. PROGRAM

  • Theory of formal languages
  • Compiler
765579
de