DIRECTORY IO USING [ STREAM ], SiroccoCGDef USING [ BaseTypeKind ], SiroccoPrivate USING [ AbstractValue, CONTEXT, TypeGraphNode ], Rope USING [ ROPE ]; SiroccoPrivateTypes: CEDAR DEFINITIONS ~ { OPEN SiroccoCGDef, SiroccoPrivate; ROPE: TYPE ~ Rope.ROPE; ContextTreeNode: TYPE ~ REF; AVNDumpProc: TYPE ~ PROC [ s: IO.STREAM, value: AbstractValue, n: NAT _ 1 ]; TGNDumpProc: TYPE ~ PROC [ s: IO.STREAM, node: TypeGraphNode, n: NAT _ 1 ]; AVNWalkProc: TYPE ~ PROC [ s: IO.STREAM, value: AbstractValue, context: CONTEXT]; TGNWalkProc: TYPE ~ PROC [ s: IO.STREAM, node: TypeGraphNode, context: CONTEXT ]; TGNKind2: TYPE ~ { bool, card16, card32, int16, int32, sink, source, string, unspec, array, choice, enum, error, proc, record, seq, logical, constructor, grouping, negation, null, number, rope, variant }; TypeConstructorKind: TYPE ~ { array, choice, enum, error, proc, record, seq }; AbstractValueKind: TYPE ~ { constructor, grouping, logical, negation, null, number, rope, variant }; EnvironmentNode: TYPE ~ REF EnvironmentNodeBody; EnvironmentNodeBody: TYPE ~ RECORD [ interfaces: REF ]; InterfaceValNode: TYPE ~ REF InterfaceValNodeBody; InterfaceValNodeBody: TYPE ~ RECORD [ moduleNames: NameSequenceNode, entries: VisibleNames, ct: ContextTreeNode ]; VisibleNames: TYPE ~ REF VisibleNamesBody; VisibleNamesBody: TYPE ~ RECORD [ head: LIST OF VNCell ]; VNCell: TYPE ~ REF VNCellBody; VNCellBody: TYPE ~ RECORD [ id: ROPE, value: REF ANY ]; HackTGN: TYPE ~ REF HackTGNBody; HackTGNBody: TYPE ~ RECORD [ value: TypeGraphNode, next: TypeGraphNode ]; ArrayTGN: TYPE ~ REF ArrayTGNBody; ArrayTGNBody: TYPE ~ RECORD [ length: AbstractValue, itemType: TypeGraphNode ]; BaseTypeTGN: TYPE ~ REF BaseTypeTGNBody; BaseTypeTGNBody: TYPE ~ RECORD [ type: BaseTypeKind ]; ChoiceTGN: TYPE ~ REF ChoiceTGNBody; ChoiceTGNBody: TYPE ~ RECORD [ ktype: TypeGraphNode, union: TypeGraphNode ]; DerefTGN: TYPE ~ REF DerefTGNBody; DerefTGNBody: TYPE ~ RECORD [ item: ROPE, type: TypeGraphNode ]; EnumTGN: TYPE ~ REF EnumTGNBody; EnumTGNBody: TYPE ~ RECORD [ enum: TypeGraphNode ]; ErrorTGN: TYPE ~ REF ErrorTGNBody; ErrorTGNBody: TYPE ~ RECORD [ fieldlist: TypeGraphNode ]; FieldTGN: TYPE ~ REF FieldTGNBody; FieldTGNBody: TYPE ~ RECORD [ namelist: TypeGraphNode, type: TypeGraphNode ]; FieldListTGN: TYPE ~ REF FieldListTGNBody; FieldListTGNBody: TYPE ~ RECORD [ tag: ROPE, ordinal: AbstractValue ]; InterfaceTGN: TYPE ~ REF InterfaceTGNBody; InterfaceTGNBody: TYPE ~ RECORD [ typeNames: VisibleNames ]; LinkTGN: TYPE = REF LinkTGNBody; LinkTGNBody: TYPE = RECORD [ tgn: TypeGraphNode, -- in target module interface: ROPE, -- InterfaceValNode of target module item: ROPE -- name of item in interface ]; NameSequenceNode: TYPE ~ REF NameSequenceNodeBody; NameSequenceNodeBody: TYPE ~ RECORD [ head: LIST OF ROPE ]; ProcTGN: TYPE ~ REF ProcTGNBody; ProcTGNBody: TYPE ~ RECORD [ args: TypeGraphNode, results: TypeGraphNode, errors: TypeGraphNode ]; RecordTGN: TYPE ~ REF RecordTGNBody; RecordTGNBody: TYPE ~ RECORD [ fieldlist: TypeGraphNode ]; SequenceTGN: TYPE ~ REF SequenceTGNBody; SequenceTGNBody: TYPE ~ RECORD [ maxlength: AbstractValue, subtype: TypeGraphNode ]; UnionTGN: TYPE ~ REF UnionTGNBody; UnionTGNBody: TYPE ~ RECORD [ namelist: TypeGraphNode, type: TypeGraphNode ]; HackAVN: TYPE ~ REF HackAVNBody; HackAVNBody: TYPE ~ RECORD [ value: AbstractValue, next: AbstractValue ]; LogicalAVN: TYPE ~ REF LogicalAVNBody; LogicalAVNBody: TYPE ~ RECORD [ value: BOOL ]; NumericalAVN: TYPE ~ REF NumericalAVNBody; NumericalAVNBody: TYPE ~ RECORD [ inverted: BOOL, value: CARD32 ]; RopeAVN: TYPE ~ REF RopeAVNBody; RopeAVNBody: TYPE ~ RECORD [ value: ROPE ]; BindingAVN: TYPE ~ REF BindingAVNBody; BindingAVNBody: TYPE ~ RECORD [ tgn: TypeGraphNode, node: AbstractValue ]; ConstructorAVN: TYPE ~ REF ConstructorAVNBody; ConstructorAVNBody: TYPE ~ RECORD [ node: AbstractValue ]; DerefAVN: TYPE ~ REF DerefAVNBody; DerefAVNBody: TYPE ~ RECORD [ item: ROPE, value: AbstractValue ]; GroupingAVN: TYPE ~ REF GroupingAVNBody; GroupingAVNBody: TYPE ~ RECORD [ node: AbstractValue ]; LinkAVN: TYPE = REF LinkAVNBody; LinkAVNBody: TYPE = RECORD [ interface: ROPE, item: ROPE, avn: AbstractValue ]; VariantAVN: TYPE = REF VariantAVNBody; VariantAVNBody: TYPE = RECORD [ id: ROPE, node: AbstractValue ]; }. ŒSiroccoPrivateTypes.Mesa Copyright Σ 1987 by Xerox Corporation. All rights reserved. Bill Jackson (bj) August 26, 1987 4:08:47 pm PDT Open stuff... TypeGraphNode This is really the union of BaseTypeKind, ConstructorKind & AbstractValueKind Program Program.export [ id.export, decimal.pgm, decimal.version, ImportList, DeclarationList ]; Environment Interfaces Interfaces are not InterfaceTGNs. InterfaceTGNs occur inside type graphs, and point out to other contexts. Interfaces occur outside type graphs (and contexts) and point into contexts. NOTE: We almost had to use proto and frozen interfaces, because we wanted to be able to have more than one module name for an interface. If this were implemented by adding the names one at a time to the interface, this would make the interface a modifiable data structure, which must then be frozen when placed in an environment. However, by using NameSequences (see below), which are built non-destructively, and building the interface directly from a NameSequence and a contextTree, we avoid having malleable interfaces. ImportList.empty [] ; ImportList.more [ ImportList, Import ]; Import.interface [ id.interface, decimal.pgm, decimal.version ]; Locally Visible Names DeclarationList.empty [ ]; DeclarationList.more [ DeclarationList, Declaration ]; Declaration.type [ id, Type ]; Declaration.constant [ id, Type, Constant ]; Very simple for now, just a chained list of ROPEs Hack TGN Enumeration.more [ Enumeration.value, Enumeration.next ]; FieldList.more [ FieldList.value, FieldList.rest ]; Union.more [ Union.value, Union.next ]; assorted body types Array TGN Type.array [ Constant, Type ]; BaseType TGN Type.bool [ ]; Type.card16 [ ]; Type.card32 [ ]; Type.int16 [ ]; Type.int32 [ ]; Type.sink [ ]; Type.source [ ]; Type.string [ ]; Type.unspec [ ]; Choice TGN Type.choice [ Type, Union ]; Deref TGN Type.alias [ id ]; EnumeratedType Nodes Type.enum [ Enumeration ]; Enumeration.one [ id, Constant ]; Error TGN Type.error [ FieldList ]; Field lists and frozen field lists FieldList.empty [ ]; FieldList.one [ NameList, Type ]; Interface TGN LinkTGN Type.import [ id.interface, id.item ]; used to interface between one module and another NameSequence NameList.empty [ ]; NameList.one [ id ]; NameList.more [ id, NameList ]; Proc TGN Type.proc [ FieldList.arg, FieldList.res, NameList ]; Record TGN Type.record [ FieldList ]; Type.null [ ]; Sequence TGN Type.seq [ Constant, Type ]; Union TGN Union.one [ NameList, Type ]; Hack AVN Grouping.more [ Constant, Grouping ]; Constructor.more [ Binding, Constructor ]; AVNs Constant.empty [ ]; Logical AVN Constant.false [ ]; Constant.true [ ]; Numerical AVN Constant.unbounded [ ]; Constant.number [ Number ]; Constant.inverted [ Number ]; Number.decimal [ decimal ]; Number.hex [ hex ]; Number.octal [ octal ]; Rope AVN Constant.string [ rope ]; Binding AVN Binding [ NameList, Constant ]; Constructor AVN Constant.constructor [ Constructor ]; Constructor.one [ Binding ]; Deref AVN Constant.deref [ id ]; Grouping AVN Constant.grouping [ Grouping ]; Grouping.one [ Constant ]; Link AVN Constant.import [ id.interface, id.item ]; Variant AVN Constant.choice [ id, Constant ]; Κ L˜šœ™Icode™