Test.Cedar
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Bill Jackson (bj) April 14, 1987 1:45:07 pm PDT
Usage: type "Saffron < Test.Cedar" at the command tool ...
the output should be:
No Syntax Errors Detected.
LOCAL CONTEXT
v: value[[type: 5 data: var]]
T: type[0]
u: value[[type: 1 data: simple[0]]]
R: type[1]
Q: type[2]
TYPE GRAPH
0: size: 3 node: [paint: - bounds: - init: - struct: record[named[[x, 3], [y, 3], [z, 4]]]]
1: size: 1 node: [paint: 1 bounds: - init: - struct: enum[a, b, c]]
2: size: 1 node: [paint: 1 bounds: - init: - struct: enum[a, b, c]]
3: size: 1 node: [paint: 1 bounds: [0..1] init: - struct: enum[a, b, c]]
4: size: 1 node: [paint: - bounds: - init: - struct: ref[0]]
5: size: 3 node: [paint: - bounds: - init: - struct: record[unnamed[0]]]
A "-" in an en entry in the typegraph means "undefined". This illustrates just about everything my program can do. It checks for some errors relevant to this part of the language. Size calculations are performed. If there are any types with "infinite" size, an error is reported, although the position information given is quite useless.
BEGIN
T: TYPE = RECORD [x, y: R[u..c), z: REF T];
v: RECORD [T];
R: TYPE = {a, b, c};
u: R = a;
Q: TYPE = R;
END