<<>> <> <> <> <<>> 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.