LupineManager.mesa.
Copyright © 1985 by Xerox Corporation. All rights reserved.
Last edited by BZM on 2-May-82 22:48:33.
Last Edited by: Birrell, September 13, 1983 4:08 pm
Last Edited by: Swinehart, July 3, 1984 1:49:26 pm PDT
Bob Hagmann February 8, 1985 4:58:07 pm PST
DIRECTORY
FS USING [OpenFile, nullOpenFile],
Rope USING [ROPE];
LupineManager: DEFINITIONS = BEGIN
These string definitions are used for easy SDD compatibility.
String: TYPE = Rope.ROPE ← StringNIL;
StringNIL: String = NIL; -- Explicit nonNIL constant needed for INLINEs.
TranslateRemoteInterface is the procedural access to Lupine.
It is not reentrant, and is monitored to enforce serial access.
If interfaceBcdCapability is specified, then it is used in
preference to interfaceBcdFilename. But interfaceBcdFilename
must always be specified for error reporting.
All errors are reported through the errorHandler procedure.
TranslateRemoteInterface: PROCEDURE [
interfaceBcdFilename: String --Truth if capability is null, else just for error messages--,
interfaceBcdCapability: FS.OpenFile ← FS.nullOpenFile,
errorHandler: ErrorHandlerProc,
options: Options,
desiredLineLength: LONG INTEGER ← 82 ];
Options: TYPE = REF OptionsRec;
OptionsRec: TYPE = RECORD [
targetLanguage: Language ← Cedar,
defaultParamPassing: ParamPassingMethod ← Value,
freeServerArguments: BOOLEANTRUE,
inlineServerDispatcherStubs: BOOLEANTRUE,
inlineMarshal: BOOLEANTRUE,
inlinePacketAllocateCount: INT ← 1000,
inlineRopeMarshal: BOOLEANTRUE,
maxHeapAllocations, maxMdsAllocations: LONG INTEGER ← 50,
declareSignals: BOOLEANTRUE,
warnMDSAllocs: BOOLEANTRUE,
importMultiple: BOOLEANTRUE,
noClientModulesOut: INT ← 1];
Language: TYPE = {Cedar, Mesa};
ParamPassingMethod: TYPE = {Var, Value, Result, Handle, InterMds};
ErrorHandlerProc is called so that clients can see and act on each
translation error. The problemCausingText argument usually contains the
the source text in which the error was located (e.g., bad file name,
invalid procedure name, unmarshalable type). Even when problemCausingText
is NIL, however, the generated stub files contain full error descriptions
as comments. If type=abort, abortTranslation is always forced to be TRUE.
The outputFileName and outputFilePosition arguments tell where the error
occurred. For errors found before code generation starts, outputFileName=NIL.
ErrorHandlerProc must behave since a monitor lock is held during the call.
ErrorHandlerProc: TYPE = --INTERNAL-- PROCEDURE [
type: ErrorType,
code: ErrorCode,
codeExplanation: String,
outputFileName: String←StringNIL,
outputFileCharPosition: LONG INTEGER,
problemCausingText: String←StringNIL ]
RETURNS [abortTranslation: BOOLEANFALSE];
ErrorType: TYPE = {abort, error, warning};
ErrorCode: TYPE = {
AnonymousIdentifier,
BadBcdFileFormat, BadBcdFileVersion,
ComputedSequence, ComputedVariant,
EmbeddedRESULT,
EmptyArray,
HandleREF,
ImproperPassingMethod, ImproperReadonlyRESULT, ImproperRESULTResult,
InterfaceVariables,
InvalidHandle,
MdsAllocation,
NoSuchFile,
NotInterfaceModule,
ProbablePointerRecursion,
SequenceInsideVariant,
ShortInterMdsPointers,
TransferParameter,
UnimplementedMarshaling,
Unknown,
UnsupportedTransfers };
END. -- LupineManager.