Syntax Tree

 [Previous Chapter]  [Previous Page]  [Contents]  [Next Page]  [Next Chapter]

*The symbols (, ), ., 0, and 1 are so-called terminals. They appear nowhere on the left side of a production rule.
 
*The symbols <list-of-numbers> and <number> are nonterminals as they are used in one of the left hand sides.
 
*A syntax tree shows how a sequence of terminals (in this example: (0 . (1 . ()))) can be derived from our start symbol (in this example: <list-of-numbers>).
 
*The grammar of most programming languages is defined in form of such production rules.
 
*One of the first tasks of a compiler is to find a derivation for the program text which is a sequence of terminals.
 
*If no such derivation can be found, a syntax error occurred.
 

 [Previous Chapter]  [Previous Page]  [Contents]  [Next Page]  [Next Chapter]
Copyright © 2002 Andreas Borchert, converted to HTML on May 02, 2002