DIRECTORY CD, Rope; CDMakeProc: CEDAR DEFINITIONS = BEGIN Environment: TYPE = REF EnvironmentRep; EnvironmentRep: TYPE; GetEnvironmentProp: PROC [env: Environment, key: REF] RETURNS [REF]; PutEnvironmentProp: PROC [env: Environment, key: REF, val: REF]; ObjectExpressionProc: TYPE = PROC [env: Environment, x: REF, probablyReUse: BOOL_FALSE] RETURNS [Rope.ROPE]; RegisterObjectExpressionProc: PROC [for: REF, ep: ObjectExpressionProc, tech: CD.Technology _ NIL]; Identifier: PROC [r: Rope.ROPE] RETURNS [Rope.ROPE]; Capital: PROC [r: Rope.ROPE] RETURNS [Rope.ROPE]; Small: PROC [r: Rope.ROPE] RETURNS [Rope.ROPE]; GetGlobalIdent: PROC [env: Environment, whatFor: REF] RETURNS [Rope.ROPE]; ForceGlobalIdent: PROC [env: Environment, proposed: Rope.ROPE, whatFor: REF_NIL] RETURNS [Rope.ROPE]; MakeLayer: PROC [env: Environment, l: CD.Layer] RETURNS [Rope.ROPE]; MakePreamble: PROC [env: Environment, module: Rope.ROPE, import: BOOL_TRUE]; PlaceStatement: PROC [env: Environment, line: Rope.ROPE]; PlaceDeclarationM1: PROC [env: Environment, line: Rope.ROPE]; PlaceDeclarationM2: PROC [env: Environment, line: Rope.ROPE]; PlaceStatementM: PROC [env: Environment, line: Rope.ROPE]; AtomToRope: PROC [env: Environment, a: ATOM] RETURNS [Rope.ROPE]; RopeToRope: PROC [Rope.ROPE] RETURNS [Rope.ROPE]; PosToRope: PROC [pos: CD.Position] RETURNS [Rope.ROPE]; RectToRope: PROC [rect: CD.Rect] RETURNS [Rope.ROPE]; OrientationToRope: PROC [o: CD.Orientation] RETURNS [Rope.ROPE]; TransformationToRope: PROC [trans: CD.Transformation] RETURNS [Rope.ROPE]; END. CDMakeProc.mesa (module for ChipNDale) Copyright c 1985, 1987 by Xerox Corporation. All rights reserved. Created by Christian Jacobi, May 9, 1985 1:58:40 pm PDT Last edited by: Christian Jacobi, January 5, 1987 8:12:40 pm PST Private interface to split the tool which generates Cedar programs to generate layout -- Environment --the environment represents the unfinished Cedar code to be produced --it is passed through and has all the necessary information about used idendentifiers --already issued declarations and other crap. -- Registrations -- For classes defining specific generation of code -- implementing requests of generation of certain pieces of code --Type for a procedure which returns an expression creating an object --env: environment for the code (good declarations which can be used or included --x: object for which an expression is to be made --probablyReUse: this object migh be needed again and it would be wise to somehow -- make a definition --It is ok to issue a local statement; such a statement would preceed the statement which --contains the returned expression. --register certain Object classes with a procedure how to make an object of this class -- Dealing with identifiers --Makes a valid Cedar identifier --Converts first character to capital --Converts first character to small --well, dealing with local identifiers in the procedure is not yet great --Returns a rope with an identifier for whatFor --Must not depend on it beeing defined with PlaceDeclarationM1; --but either PlaceDeclarationM1 or PlaceDeclarationM2 has defined the identifier --NIL if not declared --Returns a new identifier which is unique; --if whatFor#NIL: GetGlobalIdent will find it -- the caller must place code to declare that ident -- using either PlaceDeclarationM1 or PlaceDeclarationM2 --Returns an identifier for this layer --Places code to initialize identifier globally -- Places declarations and code into the program to be build --Places code to get a DIRECTORY entry for the module package --import: the package is also IMPORTed --places statement into the local procedure --places declaration into the module, before the main procedures --places declaration into the module, just before the statements --places statement into the module --Convert procedures Κρ˜codešœ(™(Kšœ Οmœ7™BKšœ8™8K™@K˜—šΟk ˜ Kšžœ˜ —K˜KšΟn œžœž œ˜ Kšž˜K˜K™UK˜K™K™K˜šœ žœžœ˜'KšœE™EKšœV™VK™-Kšœžœ˜—K™Kš Ÿœžœžœžœžœ˜DKšŸœžœžœžœ˜@K™K™K™K™3K™@K˜šœžœžœžœžœžœžœžœ˜lKšœE™EKšœP™PKšœ1™1KšœQ™QKšœ™KšœY™YKšœ$™$—K˜š Ÿœžœžœ"žœžœ˜cK™V—K˜K˜Kšœ™K˜š Ÿ œžœ žœžœžœŸ˜4K™ —K˜š Ÿœžœ žœžœžœ˜1Kšœ%™%—K˜š Ÿœžœ žœžœžœ˜/KšΟc#™#K˜—K™K™HK˜š Ÿœžœžœžœžœ˜JKšœ/™/Kšœ@™@KšœP™PK™—K˜šŸœžœ#žœ žœžœžœžœ˜eKš ,™,Kš /™/Kš 7™7Kšœ "œ ™<—K˜K˜š Ÿ œžœžœžœžœ˜DKšœ&™&Kšœ/™/K˜—K™Kšœ<™