DIRECTORY CD, Rope; CDMakeProcPrivate: CEDAR DEFINITIONS = BEGIN Environment: TYPE = REF EnvironmentRep; EnvironmentRep: TYPE; ExpressionProc: TYPE = PROC [env: Environment, x: REF, probablyReUse: BOOL_FALSE] RETURNS [Rope.ROPE]; RegisterExpressionProc: PROC [for: REF, ep: ExpressionProc, tech: CD.Technology _ NIL]; IncludeDirectory: PROC [env: Environment, module: Rope.ROPE, import: BOOL_TRUE]; LayerIdent: PROC [env: Environment, l: CD.Layer] RETURNS [Rope.ROPE]; GlobalIdent: PROC [env: Environment, whatFor: REF] RETURNS [Rope.ROPE]; RequestGlobalIdent: PROC[env: Environment, proposed: Rope.ROPE, whatFor: REF_NIL] RETURNS [Rope.ROPE]; LocalStatement: PROC[env: Environment, line: Rope.ROPE]; GlobalDeclaration1: PROC[env: Environment, line: Rope.ROPE]; GlobalDeclaration2: PROC[env: Environment, line: Rope.ROPE]; GlobalStatement: PROC[env: Environment, line: Rope.ROPE]; AtomToRope: PROC [env: Environment, a: ATOM] RETURNS [Rope.ROPE]; PosToRope: PROC [pos: CD.Position] RETURNS [Rope.ROPE]; RectToRope: PROC [rect: CD.Rect] RETURNS [Rope.ROPE]; RopeToRope: PROC [Rope.ROPE] RETURNS [Rope.ROPE]; END. ”CDMakeProcPrivate.mesa (module for ChipNDale) Copyright c 1985 by Xerox Corporation. All rights reserved. by Christian Jacobi, May 9, 1985 1:58:40 pm PDT last edited Christian Jacobi, October 8, 1985 2:11:00 pm PDT Private interface to split the tool which generates Cedar programs to generate layout --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. -- For classes defining specific generation of code -- implementing requests of generation of certain pieces of code --env: environment for the code (declarations... might 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 and declarations --The code gets a DIRECTORY entry for the module --import: the code also gets an IMPORT... --Returns a rope with an identifier for this layer --This identifier will be initialized --Returns a rope with an identifier for whatFor --Must not depend on it beeing defined with GlobalDeclaration1, --but either GlobalDeclaration1 or GlobalDeclaration2 has defined the identifier --Nil if not declared in module --Returns an identifier which is unique --If called twice, it returns different identifier's --if whatFor#NIL the identifier can be fetched using GlobalIdent; the caller is responsible --for declaring that ident using either GlobalDeclaration1 or GlobalDeclaration2 -- Introducing declarations and code into the program -- to build up the right environment to fulfil a request --introduces statement for the local procedure --introduces declaration into the module, before the main procedures --introduces declaration into the module, just before the statements --introduces statement for the module --convert procedures --vanilla procedures converting to ropes Κ˜codešœ/™/Kšœ Οmœ1™