DIRECTORY CardTab, IntCodeDefs, IO, Rope; C2CAccess: CEDAR DEFINITIONS = BEGIN InputParameters: TYPE = RECORD [ moduleName: Rope.ROPE, versionStamp: Rope.ROPE, fileName: Rope.ROPE ¬ NIL, commentLines: LIST OF Rope.ROPE ¬ NIL, root: IntCodeDefs.Node, names: CardTab.Ref, labels: CardTab.Ref, outputStream: IO.STREAM, lineNumberStream: IO.STREAM, reportStream: IO.STREAM ¬ NIL, getErrorStream: PROC [] RETURNS [IO.STREAM], namesStream: IO.STREAM ¬ NIL, supportReferenceCounting: BOOL ¬ FALSE, extraShortAndUgly: BOOL ¬ FALSE, generateSourceMacros: BOOL ¬ TRUE, generateDBXStyleSourceMacros: BOOL ¬ FALSE, generateLineNumberStream: BOOL ¬ FALSE, supportInlineFloatingPoint: BOOL ¬ FALSE, lineTerminationChar: CHAR ¬ '\n, destroyRoot: BOOL ¬ TRUE, debuggingCode: BOOL ¬ FALSE, debuggingMode: BOOL ¬ TRUE ]; params: --PRIVATE-- C2CAccess.InputParameters; CallC2C: PROC [parameters: InputParameters] RETURNS [ok: BOOL, synopsis: Rope.ROPE]; ExcludeReEntry: PROC [inner: PROC[]]; ImSorryC2CIsNotReEntrant: ERROR; END. ’ C2CAccess.mesa Copyright Σ 1990, 1991, 1993 by Xerox Corporation. All rights reserved. Christian Jacobi, October 4, 1990 10:59:22 am PDT Christian Jacobi, January 25, 1993 7:13 pm PST This definition exports an entrypoint into C2C. It is the external view of C2C's access. It does not depend on C2C internal features, so it wont need recompilation on internal C2C improvements. However, it lays bare an elaborate dependency on options; it will be recompiled whenever those need change. We do NOT really try to minimize recompilations of C2C's inner parts however. It assumes that there is a separate module (or two) which plugs into mimosa and calls C2C. The internal part of C2C therefore does not need to know how it is plugged into Mimosa. However, of course the inner of C2C has to know the definitions for IntCode anyway. C2C is non re-entrant. This has been decided so after long thought for the benefit of being able to use global variables. If C2C is used on multiple targets, target specific behaviour has to be brought in with the binder. While the author really believes in re-entrancy and dynamic specification of targets, C2C is much too heavily used to make all users pay for the rarely used flexibility. This type describes the input parameters of C2C. It is a type of its own so it can be copied and made available internally with a single statement and won't need further maintenance on chances -- --Used to generate start up sequence --Used for obvious reasons --File is not accessed by C2C but name is documented in C file --Will be included into the C code as comments --Lines do not need to have the form of comments --Root of the code graph --C2C may do irreversible changes to the node tree --Lookup for names for named variables --Lookup for names for procedures --Stream for the generated C code. --C2C will not close the stream. --Stream for the generated line number information. --C2C will not close the stream. --Stream for rare progress messages (The little dots). --C2C will not close the stream. --Output stream requested on demand only, as normally there are no errors. --Procedure called only once, even if multiple errors are written. --Caller is adviced to not really use the generated C code when an error stream has been requested. --C2C will not close the stream. --Option for input of external definition for names; normally NIL --Option whether runtime calls for reference counting ought to be made --Option to save bytes in C file... --Option whether floatingpoint ought to be generated inline --Typically one of lf or cr... --Whether the root node tree ought to be destroyed to help the garbage collector --If debuggingCode is TRUE, more debugging info is included into the generated code --If not in debugging mode, C2C tries to catch errors and make nice messages A copy of the parameters of CallC2C when C2C was called. Private for the inside of C2C; clients, please don't touch. Valid only within C2CAccess's re-entry lock. This is the way C2C can be invoked. Caller is responsible for guarante that there is a SINGLE process calling into C2C; he is supposed to do so by using CallC2C only from an inner proc of ExcludeReentry. This procedure must be used to make sure C2C is only called in a non reentrant way. May raise ImSorryC2CIsNotReEntrant. Design rationale. A separate procedure ExcludeReEntry is used, so Mimosa does have the option where to exclude reentrancy at its own disgression. Κo–(cedarcode) style•NewlineDelimiter ™šœ™Icodešœ Οeœ=™HKšœ1™1K™.K™K™YK™K™§K™K™ŠK™K™~K™K™fK™K™«—K˜šΟk ˜ Kšœžœ˜—K˜KšΟn œžœž œ˜Kšž˜K˜šœžœžœ˜ K™ΑK™šœžœ˜K™$—šœžœ˜K™—šœžœžœ˜Kšœ?™?—š œžœžœžœžœ˜&Kšœ/™/Kšœ0™0—šœ˜Kšœ™Kšœ2™2—šœ˜Kšœ&™&—šœ˜Kšœ!™!—šœžœžœ˜Kšœ"™"Kšœ ™ —šœžœžœ˜Kšœ3™3Kšœ ™ —šœžœžœžœ˜Kšœ6™6Kšœ ™ —š œžœžœžœžœ˜,KšœJ™JKšœC™CK™dK™!—šœ žœžœžœ˜KšœA™A—šœžœžœ˜'KšœF™F—šœžœžœ˜ Kšœ#™#—Kšœžœžœ˜"Kšœžœžœ˜+Kšœžœžœ˜'šœžœžœ˜)Kšœ;™;—šœžœ˜ Kšœ™—šœ žœžœ˜KšœP™P—šœžœžœ˜K™S—šœžœž˜KšœL™L—K˜—K˜impšœΟc œ˜.Lšœ8™8L™;Lšœ-™-L™—š Ÿœžœžœžœžœ˜TK™$KšœuŸœŸœ™©—K˜šŸœžœ žœ˜%Lšœx™xKšŸœžœ˜ K˜Kšœ(Ÿœ^™”—K˜Lšžœ˜L˜—…—ό