next up previous
Next: Right-hand-side expressions Up: Syntax Previous: Syntax

Lexical tokens

  The syntax of DATR distinguishes four classes of lexical token: nodes, atoms, variables and reserved symbols. The complete list of reserved symbols is as follows:

    : " < > = == . ' % #
We have already seen the use of the first seven of these. Single quotes can be used to form atoms that would otherwise be ill-formed as such; % is used for end-of-line comments, following the Prolog convention; # is used to introduce declarations and other compiler directives (see Section 3.5, below).

The other classes, nodes, atoms and variables, must be distinct, and distinct from the reserved symbols, but are otherwise arbitrarygif. For this discussion, we have already adopted the convention that both nodes and atoms are simple words, with nodes starting with uppercase letters. We extend this convention to variables, discussed more fully in Section 3.4 below, which we require to start with the character $. And we take white-space (spaces, newlines, tabs, etc.) to delimit lexical tokens but otherwise to be insignificant.


Copyright © Roger Evans, Gerald Gazdar & Bill Keller
Wed Feb 26 12:00:02 GMT 1997