Generierung binärer Bäume

 [Vorheriges Kapitel]  [Vorherige Seite]  [Inhaltsverzeichnis]  [Nächste Seite]  [Nächstes Kapitel]

Expressions.od
DEFINITION Expressions;

   IMPORT Streams;

   CONST
      (* terminal symbols *)
      plusSY = 0;
      minusSY = 1;
      multiplySY = 2;
      divideSY = 3;
      constantSY = 6;
   TYPE
      Symbol = SHORTINT; (* plusSY .. *)

   TYPE
      Tree = POINTER TO TreeRec;
      TreeRec =
         RECORD
            sy: Symbol; (* operator symbol or constantSY *)
            const: INTEGER; (* if sy = constantSY *)
            leftop, rightop: Tree; (* if sy is one of
                                      the operators *)
         END;
      Attribute = Tree;

   PROCEDURE Parse(s: Streams.Stream;
                   VAR at: Attribute) : BOOLEAN;

END Expressions.

 [Vorheriges Kapitel]  [Vorherige Seite]  [Inhaltsverzeichnis]  [Nächste Seite]  [Nächstes Kapitel]
Copyright © 1999 Andreas Borchert, in HTML konvertiert am 29.06.1999