<> <> DIRECTORY Rope USING[ROPE], SafeStorage USING[Type, nullType], WorldVM USING[World, LocalWorld]; AMTypes: CEDAR DEFINITIONS IMPORTS WorldVM = BEGIN OPEN Rope; <<>> <> Type: TYPE = SafeStorage.Type; nullType: Type = SafeStorage.nullType; TypedVariable: TYPE = REF ANY; TV: TYPE = TypedVariable; Status: TYPE = {mutable, readOnly, const}; Index: TYPE = NAT; --index range for records, enumerations, etc is [1..n] Class: TYPE = { definition, -- e.g. TypeClass[CODE[T]] where T: TYPE = ...-- cardinal, longCardinal, integer, longInteger, real, character, --basic-- atom, rope, list, ref, pointer, longPointer, descriptor, longDescriptor, basePointer, relativePointer, --address-- procedure, signal, error, program, port, --transfer-- enumerated, subrange, union, sequence, record, structure, array, countedZone, uncountedZone, nil, -- e.g. TypeClass[TVType[NIL]] unspecified, process, type, opaque, any, -- e.g. TypeClass[Range[CODE[REF ANY]]] globalFrame, localFrame --frame-- }; <<>> <> Error: ERROR[ reason: ErrorReason, msg: ROPE _ NIL, type: Type _ nullType, -- used with TypeFault, IncompatibleTypes otherType: Type _ nullType -- used with IncompatibleTypes ]; ErrorReason: TYPE = { noSymbols, -- msg has moduleName notImplemented, -- mostly DefaultInitialValue cases incompatibleTypes, -- raised by Assign rangeFault, -- e.g. empty subrange, Apply bounds check notMutable, -- raised by (e.g.) Assign internalTV, -- raised by (e.g.) RefFromTV badName, -- raised by NameToIndex badIndex, -- raised by (e.g.) IndexToType typeFault -- general applicability violation }; <<>> <

> <<>> <> Size: PROC[type: Type, length: CARDINAL _ 0--sequence only: number of elements--] RETURNS[words: CARDINAL--max for unions--]; DefaultInitialValue: PROC[type: Type] RETURNS[TypedVariable]; IndexToDefaultInitialValue: PROC[type: Type--record, structure--, index: Index] RETURNS[TypedVariable]; TypeClass: PROC[type: Type] RETURNS[Class]; UnderClass: PROC[type: Type] RETURNS[Class] = INLINE {RETURN[TypeClass[UnderType[type]]]}; <> IsPainted: PROC[type: Type] RETURNS[BOOL]; <<>> <> TVType: PROC[tv: TypedVariable] RETURNS[Type]; TVStatus: PROC[tv: TypedVariable] RETURNS[Status]; TVSize: PROC[tv: TypedVariable] RETURNS[words: INT]; <<>> <> GetEmptyTV: PROC RETURNS[TypedVariable]; <<>> <<>> <> <> New: PROC[ type: Type, status: Status _ mutable, world: WorldVM.World _ WorldVM.LocalWorld[], tag: TV _ NIL ] RETURNS[TypedVariable]; Copy: PROC[tv: TypedVariable] RETURNS[TypedVariable]; Assign: PROC[lhs, rhs: TypedVariable]; AssignNew: PUBLIC PROC[lhs, rhs: TypedVariable]; <<>> <> TVEq: PROC[tv1, tv2: TypedVariable] RETURNS [BOOL]; TVEqual: PROC[tv1, tv2: TypedVariable] RETURNS [BOOL]; <<>> <> NComponents: PROC[type: Type--record, structure--] RETURNS[Index]; VariableType: PROC[type: Type--record, structure--] RETURNS[v: Type, c: Class--union, sequence, or nil--]; <> IndexToTV: PROC[tv: TypedVariable--record, structure--, index: Index] RETURNS[TypedVariable]; <> IndexToType: PROC[type: Type--record, structure, union--, index: Index] RETURNS[Type]; NameToIndex: PROC[type: Type--record, structure, union, enumerated--, name: ROPE] RETURNS[CARDINAL]; <> IndexToName: PROC[type: Type--record, structure, union, enumerated--, index: CARDINAL] RETURNS[ROPE]; <> TVToType: PROC[tv: TypedVariable--type--] RETURNS[Type]; TVToName: PROC[tv: TypedVariable] RETURNS[ans: ROPE]; Tag: PROC[tv: TypedVariable--union--] RETURNS[TypedVariable--enumerated--]; Variant: PROC[tv: TypedVariable--union--] RETURNS[TypedVariable--record--]; IsOverlaid: PROC[type: Type--union--] RETURNS[BOOL]; <> IsMachineDependent: PROC[type: Type] RETURNS[BOOL]; <> Domain: PROC[type: Type--array, sequence, transfer, union--] RETURNS[Type]; Range: PROC[type: Type] RETURNS[Type]; IsPacked: PROC[type: Type--array, sequence--] RETURNS[BOOL]; IsComputed: PROC[type: Type--union, sequence--] RETURNS[BOOL]; Apply: PROC[mapper: TypedVariable--array, sequence--, arg: TypedVariable] RETURNS[TypedVariable]; <<>> <> Length: PROC[tv: TypedVariable--sequence, rope--] RETURNS[INT]; Fetch: PROC[tv: TypedVariable--rope--, index: INT] RETURNS[CHAR]; Referent: PROC[ tv: TypedVariable--ref, list, pointer, longPointer, relativePointer--, base: TypedVariable _ NIL--non-nil only if ref is a relativePointer. UNSAFE ] RETURNS[TypedVariable]; <. NIL -> NIL. ConcreteRef is implemented only for REFANY's that are really ATOM, LIST or ROPE guys (Error[reason: notImplemented] is raised otherwise)>> ConcreteRef: PROC[tv: TypedVariable--ref any--] RETURNS[TypedVariable]; ReferentStatus: PROC[type: Type--address (not basePointer, atom)--] RETURNS[Status]; IsRefAny: PROC[type: Type--ref--] RETURNS[BOOL]; IsInterface: PROC[type: Type--record--] RETURNS[BOOL]; IsAtom: PROC[tv: TypedVariable--ref any--] RETURNS[BOOL]; IsRope: PROC[tv: TypedVariable--ref any--] RETURNS[BOOL]; IsNil: PROC[tv: TypedVariable--address--] RETURNS[BOOL]; IsOrdered: PROC[type: Type--basePointer, relativePointer--] RETURNS[BOOL]; PropertyList: PROC[tv: TypedVariable--atom--] RETURNS[TypedVariable--list, nil--]; <> Coerce: PROC[tv: TypedVariable, targetType: Type] RETURNS[TypedVariable]; <> TypeToName: PROC[ type: Type--definition--, moduleName: REF ROPE _ NIL, fileName: REF ROPE _ NIL ] RETURNS[ROPE]; <> Ground: PROC[type: Type--definition, subrange--] RETURNS[Type]; <> GroundStar: PUBLIC PROC[type: Type--definition, subrange--] RETURNS[Type]; <> UnderType: PUBLIC PROC[type: Type--definition--] RETURNS[Type]; InRange: PROC[type: Type--subrange--, groundTV: TypedVariable] RETURNS[BOOL]; First: PROC[type: Type--enumerated, subrange, basic--] RETURNS[TypedVariable]; Last: PROC[type: Type--enumerated, subrange, basic--] RETURNS[TypedVariable]; <> Next: PROC[tv: TypedVariable--enumerated, subrange, basic--] RETURNS[TypedVariable]; NValues: PROC[type: Type--enumerated--] RETURNS[INT]; <> Value: PROC[type: Type--enumerated--, index: CARDINAL] RETURNS[TypedVariable]; <> StaticParent: PROC[tv: TypedVariable--procedure--] RETURNS[TypedVariable--procedure--]; <> <> Locals: PROC[tv: TypedVariable--localFrame--] RETURNS[TypedVariable--record--]; <> EnclosingBody: PROC[tv: TypedVariable--localFrame--] RETURNS[TypedVariable--localFrame--]; Argument: PROC[tv: TypedVariable--local or catch frame--, index: Index] RETURNS[TypedVariable]; Result: PROC[tv: TypedVariable--local or catch frame--, index: Index] RETURNS[TypedVariable]; Procedure: PROC[tv: TypedVariable--localFrame--] RETURNS[TypedVariable--procedure--]; Signal: PROC[tv: TypedVariable--catch frame--] RETURNS[TypedVariable--signal descriptor--]; DynamicParent: PROC[tv: TypedVariable--localFrame--] RETURNS[TypedVariable--localFrame--]; GlobalParent: PROC[tv: TypedVariable--transfer or local frame--] RETURNS[TypedVariable--globalFrame--]; Globals: PROC[tv: TypedVariable--globalFrame--] RETURNS[TypedVariable--record--]; END.