Saffron August 31, 1988 Saffron James Rauen August 31, 1988 Why another Cedar compiler? · Demonstrate the viability of Casaba · Principled implementation Easy to maintain Easy to verify · Type theory · Experiments What is Cedar? · CLRM · Mesa manual · The implementation · Religion Saffron · Front end of a compiler · Implements Cedar/Mesa ± Religion · Implemented in Casaba Environment << [Artwork node; type 'Artwork on' to command tool] >> Context Tree · Mimics lexical structure of source program · Each node has a TGN. TGN describes runtime type structure of all the statically linked frames. Parser · Concrete Grammar · Abstract Grammar Context Tree A data structure which mimics the lexical structure of a program · Context Tree · Program Graph What Saffron Does · Type Graph · Context Tree · Program Graph Weird Cedar I a: INT _ b; a: INT = b; b: INT _ a; b: INT = a; a: INT = b; a: INT _ b; b: INT _ a; b: INT = a; Weird Cedar II a: INT _ b; a: INT = b; b: INT _ 3; b: INT = 3; a: INT = b; a: INT _ b; b: INT _ 3; b: INT = 3; Into the Abyss Three Innocuous Features · Sequential processing of declarations · Dependency analysis among named constants with compile-time values · INLINE does not affect the meaning of a program, except maybe to make it illegal Weird Cedar III Foo1: CEDAR PROGRAM = BEGIN Three: PROC RETURNS [INT] = INLINE { RETURN[3] }; a: INT = b; b: INT = Three[]; c: INT _ a; END. Weird Cedar IV Foo: TYPE = INT[0..LAST[Bar]]; Bar: TYPE = INT[FIRST[Foo]..10]; x: INT _ FIRST[Bar]; Out of the Abyss Dependency Graph Nodes for: · Values of named compile-time constants · Bodies of inline procedures · Initialization expressions of types · SIZE, FIRST, LAST properties of types Topological Sort Reject circular dependency graph Slide Title Point of the presentation · Bullet of the presentation, · is a bullet char Indented point Centered point