DIRECTORY CardTab USING [Ref], MPTree USING [Link], Rope USING [ROPE], SymTab USING [Ref]; CrankTypes: CEDAR DEFINITIONS ~ BEGIN ROPE: TYPE = Rope.ROPE; Tree: TYPE = REF; -- one of: Attributes: TYPE = LIST OF REF ANY; AttributedNode: TYPE = REF AttributedNodeRep; AttributedNodeRep: TYPE = RECORD [ attributes: Attributes, syntaxNodeName: ATOM, syntaxNode: MPTree.Link ]; Context: TYPE = REF ContextRep; ContextRep: TYPE = RECORD [ parent: Context ฌ NIL, types: TypeGraph, symbols: SymTab.Ref, moduleName: ROPE, -- the name of the containing module fieldListLast: FieldList ฌ NIL, -- for accumulating field lists for DEFINITIONS concreteForOpaque: LIST OF ConcreteForOpaque, exports: LIST OF Export, scopeKind: ScopeKind ฌ local ]; ScopeKind: TYPE = {local, globalDefs, globalImpl}; ConcreteForOpaque: TYPE = RECORD [concrete, opaque: TypeCode]; Export: TYPE = RECORD [interfaceName: ROPE, fieldList: FieldList]; FieldList: TYPE = LIST OF FieldListItem; FieldListItem: TYPE = RECORD [name: ROPE, rangeType: TypeCode, initialValue: Tree ฌ NIL]; VariantList: TYPE = LIST OF VariantListItem; VariantListItem: TYPE = RECORD [value: REF ANY, chooses: FieldList]; TypeGraph: TYPE = REF TypeGraphRep; TypeGraphRep: TYPE = RECORD [n: CARD, tab: CardTab.Ref, interfaceTable: SymTab.Ref, gensym: INT ฌ 0]; TypeCode: TYPE = CARD; nullTypeCode: TypeCode = LAST[CARD]; TypeInfoClass: TYPE = {simple, definition, initial, qualifiedVariant, scalar, reference, descriptor, control, enumerated, subrange, union, sequence, record, array, frame, type, notImplemented}; TypeClass: TYPE = ATOM; -- Could be an enumeration someday. These ATOMs are in ALL CAPS EnumerationItem: TYPE = RECORD [name: ROPE, value: CARD]; Type: TYPE = REF TypeRep; TypeRep: TYPE = RECORD [ typeCode: TypeCode ฌ TypeCode.LAST, ext: REF ฌ NIL, -- for extensions class: TypeClass, v: SELECT infoClass: TypeInfoClass FROM simple => [], definition => [qualifier, shortName: ROPE, groundType: TypeCode], initial => [environmentModule: ROPE, tree: Tree, groundType: TypeCode], qualifiedVariant => [qualifier: ROPE, groundType: TypeCode], scalar => [], reference => [referentType: TypeCode], control => [argumentType, returnType: TypeCode], enumerated => [items: LIST OF EnumerationItem], subrange => [groundType: TypeCode, first, last: REF], union => [tagName: ROPE, tagType: TypeCode, variantList: VariantList], sequence => [limitName: ROPE, domainType, rangeType: TypeCode], record => [fieldList: FieldList], array => [domainType, rangeType: TypeCode], frame => [fieldList: FieldList], type => [value: TypeCode], notImplemented => [] ENDCASE ]; SymbolTableEntry: TYPE = REF SymbolTableEntryRep; SymbolTableEntryRep: TYPE = RECORD [ SELECT tag: * FROM directory => [import, export, share: BOOL ฌ FALSE, from: ROPE, hasUsing: BOOL, using: LIST OF ROPE, interfaceRecordType: REF TypeRep.record], -- an element in the directory other => [typeCode: TypeCode, readonly: BOOL, constantValue: REF, qualifier: ROPE ฌ NIL], ENDCASE ]; END. ฺ CrankTypes.mesa Copyright ำ 1987, 1991 by Xerox Corporation. All rights reserved. Michael Plass, September 7, 1991 9:40 pm PDT LIST OF Tree ATOM ROPE AttributedNode REF MPTree.Node REF MPLeaves.HTNode REF MPLeaves.LTNode This has alternating keys and values, where the keys are always atoms. A context corresponds to a lexical scope of the program For records and structures, the names and types of the fields. The names might be NIL, but if one is, they all are. typeInfoClassForTypeClass: ARRAY TypeClass OF TypeInfoClass = [ definition: definition, cardinal: scalar, longCardinal: scalar, integer: scalar, longInteger: scalar, real: scalar, character: scalar, atom: scalar, rope: scalar, list: reference, ref: reference, pointer: reference, longPointer: reference, descriptor: notImplemented, longDescriptor: notImplemented, basePointer: notImplemented, relativePointer: notImplemented, procedure: control, signal: control, error: control, program: control, port: notImplemented, enumerated: enumerated, subrange: subrange, union: union, sequence: sequence, record: record, structure: record, array: array, countedZone: simple, uncountedZone: simple, simple: simple, unspecified: simple, process: simple, type: type, opaque: simple, any: simple, globalFrame: frame, localFrame: frame ]; This is for hanging a name on a type; follow the groundType to get at the real thing This is for hanging an initial value on a type; follow the groundType to get at the type itself. environmentModule tells the module that the expression tree occured in cardinal is short (at least 16 bits), longCardinal is long (at least 32 bits) The names of the elements; for machine-dependent records, some elements may not be named This is for variant records. ส๗–(cedarcode) style•NewlineDelimiter ™code™Kšœ ฯeœ7™BK™,K™—šฯk ˜ Kšœžœ˜Kšœžœ˜Kšœžœžœ˜Kšœžœ˜—K˜Kšะln œžœž ˜šœž˜K˜šžœžœžœ˜K˜—šœžœžœฯc ˜Kšžœ™ Kšž™Kšž™K™Kšžœ ™Kšžœ™Kšžœ™K™—š œ žœžœžœžœžœ˜#K™FK™—Kšœžœžœ˜-šœžœžœ˜"K˜Kšœžœ˜K˜K˜K˜—Kšœ žœžœ ˜šœ žœžœ˜K™7Kšœžœ˜K˜K˜Kšœ žœ $˜6Kšœžœ /˜OKšœžœžœ˜-Kšœ žœžœ˜K˜K˜K˜—šœ žœ#˜2K˜—šœžœžœ˜>K˜—šœžœžœžœ˜BK˜—Kšœ žœžœžœ˜(š œžœžœžœ,žœ˜YK™tK™—Kšœ žœžœžœ˜,š œžœžœ žœžœ˜DK˜—Kšœ žœžœ˜#š œžœžœžœ8žœ˜eK˜—šœ žœžœ˜K˜—šœžœžœ˜$K˜—šœžœฎ˜มK˜—Kšœ žœžœ @˜Xšœžœ žœ™?K™K™K™K™K™K™ K™K™ K™ K™K™K™K™K™K™K™K™ K™K™K™K™K™K™K™K™ K™K™K™K™ K™K™K™K™K™K™ K™K™ K™K™K™K™—š œžœžœžœ žœ˜9K˜—Kšœžœžœ ˜šœ žœžœ˜Kšœžœ˜#Kšœžœžœ ˜!K˜šœžœž˜'K˜ šœ%žœ˜AK™T—šœžœ$˜GK™จ—Kšœ žœ˜<˜ K™M—K˜&K˜0šœžœžœ˜/K™X—Kšœ0žœ˜5šœžœ/˜FK™—Kšœžœ#˜?K˜!K˜+K˜ K˜K˜Kšž˜—K˜K˜—Kšœžœžœ˜1šœžœžœ˜$šžœž˜Kšœ%žœžœžœ žœ žœžœžœžœ ˜ฌKš œ(žœžœ žœžœ˜YKšž˜—K˜K˜—K˜—K˜K˜Kšžœ˜—…— บ‹