Include [ Sirocco ]; SiroccoMethodsA: Module = Begin for Program.export: AbstractProduction [ id.export, decimal.pgm, decimal.version, ImportList, DeclarationList ] let MakeSymbolTable[tree] _ < name, pgm, version, res > where res _ typegraph where tossB _ AssertValueGraphAcyclic[typegraph] where tossA _ AssertTypeGraphAcyclic[typegraph] where typegraph _ BuildTypeGraph[DeclarationList, context] where context _ CreateContext[rib, scope, name, pgm, version] where scope _ BuildItemTable[DeclarationList] where rib _ BuildRIB[ImportList] where name _ TextFromID[id.export] where pgm _ CardFromDecimal[decimal.pgm] where version _ CardFromDecimal[decimal.version] ; for ImportList.empty: AbstractProduction [ ] let BuildRIB[tree] _ EmptyRIB[] ; for ImportList.more: AbstractProduction [ ImportList, Import ] let BuildRIB[tree] _ newrib where newrib _ ScopeConcat[rib, scope] where rib _ BuildRIB[ImportList] where scope _ BuildScope[Import] ; for Import.interface: AbstractProduction [ id.interface, decimal.pgm, decimal.version ] let BuildScope[tree] _ scope where scope _ DiskToTable[interface, pgm, version] where interface _ TextFromID[id.interface] where pgm _ CardFromDecimal[decimal.pgm] where version _ CardFromDecimal[decimal.version] ; for DeclarationList.empty: AbstractProduction [ ] let BuildItemTable[tree] _ EmptyScope[] let BuildTypeGraph[tree, context] _ CreateEmptyTGN[ context ] ; for DeclarationList.more: AbstractProduction [ DeclarationList, Declaration ] let BuildItemTable[tree] _ newscope where newscope _ ItemConcat[scope, item] where scope _ BuildItemTable[DeclarationList] where item _ BuildItem[Declaration] let BuildTypeGraph[tree, context] _ graphB where graphB _ UpdateItem[graphA, name, node, value] where graphA _ BuildTypeGraph[DeclarationList, context] where < name, node, value > _ BuildNamedItem[Declaration, context] ; for Declaration.type: AbstractProduction [id, Type] let BuildItem[tree] _ MakeItem[name, index, ItemKind.type] where index _ SourcePosition[tree] where name _ TextFromID[id] let BuildNamedItem[tree, context] _ < name, node, value > where value _ CreateNullAVN[] where node _ BuildTGN[Type, context] where item _ ItemFromContext[context, name] where name _ TextFromID[id] ; for Declaration.constant: AbstractProduction [id, Type, Constant] let BuildItem[tree] _ MakeItem[key, index, ItemKind.const] where index _ SourcePosition[tree] where key _ TextFromID[id] let BuildNamedItem[tree, context] _ < name, node, value > where value _ BuildAbstractValue[Constant, context] where node _ BuildTGN[Type, context] where name _ TextFromID[id] ; for Type.alias: AbstractProduction [ id ] let BuildTGN[tree, context] _ node where node _ CreateDerefTGN[context, item] where item _ TextFromID[id] ; for Type.import: AbstractProduction [ id.interface, id.item ] let BuildTGN[tree, context] _ node where node _ CreateLinkTGN[context, interface, item] where interface _ TextFromID[id.interface] where item _ TextFromID[id.item] ; for Type.bool: AbstractProduction [ ] let BuildTGN[tree, context] _ node where node _ CreateBaseTypeTGN[BaseTypeKind.bool] ; for Type.card16: AbstractProduction [ ] let BuildTGN[tree, context] _ node where node _ CreateBaseTypeTGN[BaseTypeKind.card16] ; for Type.card32: AbstractProduction [ ] let BuildTGN[tree, context] _ node where node _ CreateBaseTypeTGN[BaseTypeKind.card32] ; for Type.int16: AbstractProduction [ ] let BuildTGN[tree, context] _ node where node _ CreateBaseTypeTGN[BaseTypeKind.int16] ; for Type.int32: AbstractProduction [ ] let BuildTGN[tree, context] _ node where node _ CreateBaseTypeTGN[BaseTypeKind.int32] ; for Type.sink: AbstractProduction [ ] let BuildTGN[tree, context] _ node where node _ CreateBaseTypeTGN[BaseTypeKind.sink] ; for Type.source: AbstractProduction [ ] let BuildTGN[tree, context] _ node where node _ CreateBaseTypeTGN[BaseTypeKind.source] ; for Type.string: AbstractProduction [ ] let BuildTGN[tree, context] _ node where node _ CreateBaseTypeTGN[BaseTypeKind.string] ; for Type.unspec: AbstractProduction [ ] let BuildTGN[tree, context] _ node where node _ CreateBaseTypeTGN[BaseTypeKind.unspec] ; for Type.array: AbstractProduction [ Constant, Type ] let BuildTGN[tree, context] _ node where node _ CreateArrayTGN[length, subtype] where length _ BuildAbstractValue[Constant, context] where subtype _ BuildTGN[Type, context] ; for Type.choice: AbstractProduction [ Type, Union ] let BuildTGN[tree, context] _ node where node _ CreateChoiceTGN[ktype, union] where ktype _ BuildTGN[Type, context] where union _ BuildTGN[Union, context] ; for Type.enum: AbstractProduction [ Enumeration ] let BuildTGN[tree, context] _ node where node _ CreateEnumerationTGN[enum] where enum _ BuildTGN[Enumeration, context] ; for Type.error: AbstractProduction [ FieldList ] let BuildTGN[tree, context] _ node where node _ CreateErrorTGN[fieldlist] where fieldlist _ BuildTGN[FieldList, context] ; for Type.proc: AbstractProduction [ FieldList.arg, FieldList.res, NameList ] let BuildTGN[tree, context] _ node where node _ CreateProcTGN[args, results, errors] where args _ BuildTGN[FieldList.arg, context] where results _ BuildTGN[FieldList.res, context] where errors _ BuildTGN[NameList, context] ; for Type.record: AbstractProduction [ FieldList ] let BuildTGN[tree, context] _ node where node _ CreateRecordTGN[fieldlist] where fieldlist _ BuildTGN[FieldList, context] ; for Type.null: AbstractProduction [ ] let BuildTGN[tree, context] _ node where node _ CreateRecordTGN[empty] where empty _ CreatePrimitiveTGN[Generic.record] ; for Type.seq: AbstractProduction [ Constant, Type ] let BuildTGN[tree, context] _ node where node _ CreateSequenceTGN[maxlength, subtype] where maxlength _ BuildAbstractValue[Constant, context] where subtype _ BuildTGN[Type, context] ; for Constant.deref: AbstractProduction [ id ] let BuildAbstractValue[tree, context] _ value where value _ CreateDerefAVN[context, item] where item _ TextFromID[id] ; for Constant.import: AbstractProduction [ id.interface, id.item ] let BuildAbstractValue[tree, context] _ value where value _ CreateLinkAVN[context, interface, item] where interface _ TextFromID[id.interface] where item _ TextFromID[id.item] ; for Constant.empty: AbstractProduction [ ] let BuildAbstractValue[tree, context] _ value where value _ CreateGroupingAVN[node] where node _ CreateNullAVN[] ; for Constant.false: AbstractProduction [ ] let BuildAbstractValue[tree, context] _ value where value _ CreateLogicalAVN[False[]] ; for Constant.true: AbstractProduction [ ] let BuildAbstractValue[tree, context] _ value where value _ CreateLogicalAVN[True[]] ; for Constant.unbounded: AbstractProduction [ ] let BuildAbstractValue[tree, context] _ value where value _ CreateNumericalAVN[card[65536]] ; for Constant.inverted: AbstractProduction [ Number ] let BuildAbstractValue[tree, context] _ value where value _ CreateNegativeAVN[node] where node _ BuildAbstractValue[Number, context] ; for Constant.number: AbstractProduction [ Number ] let BuildAbstractValue[tree, context] _ value where value _ BuildAbstractValue[Number, context] ; for Constant.string: AbstractProduction [ rope ] let BuildAbstractValue[tree, context] _ value where value _ CreateRopeAVN[text] where text _ GetRopeFromRope[rope] ; for Constant.choice: AbstractProduction [ id, Constant ] let BuildAbstractValue[tree, context] _ value where value _ CreateVariantAVN[tag, node] where tag _ TextFromID[id] where node _ BuildAbstractValue[Constant, context] ; for Constant.constructor: AbstractProduction [ Constructor ] let BuildAbstractValue[tree, context] _ value where value _ CreateConstructorAVN[node] where node _ BuildAbstractValue[Constructor, context] ; for Constant.grouping: AbstractProduction [ Grouping ] let BuildAbstractValue[tree, context] _ value where value _ CreateGroupingAVN[node] where node _ BuildAbstractValue[Grouping, context] ; End; SiroccoMethodsB: Module = Begin for Enumeration.one: AbstractProduction [ id, Constant ] let BuildTGN[tree, context] _ node where node _ CreateFieldListTGN[tag, ordinal] where tag _ TextFromID[id] where ordinal _ BuildAbstractValue[Constant, context] ; for Enumeration.more: AbstractProduction [ Enumeration.value, Enumeration.next ] let BuildTGN[tree, context] _ nodeC where nodeC _ FieldListTGNConcat[nodeA, nodeB] where nodeB _ BuildTGN[Enumeration.next, context] where nodeA _ BuildTGN[Enumeration.value, context] ; for Union.one: AbstractProduction [ NameList, Type ] let BuildTGN[tree, context] _ nodeC where nodeC _ CreateUnionTGN[nodeB, nodeA] where nodeB _ BuildTGN[NameList, context] where nodeA _ BuildTGN[Type, context] ; for Union.more: AbstractProduction [ Union.value, Union.next ] let BuildTGN[tree, context] _ nodeC where nodeC _ UnionTGNConcat[nodeA, nodeB] where nodeB _ BuildTGN[Union.next, context] where nodeA _ BuildTGN[Union.value, context] ; for FieldList.empty: AbstractProduction [ ] let BuildTGN[tree, context] _ nodeA where nodeA _ CreateEmptyFieldTGN[] ; for FieldList.one: AbstractProduction [ NameList, Type ] let BuildTGN[tree, context] _ nodeC where nodeC _ CreateFieldTGN[nodeB, nodeA] where nodeB _ BuildTGN[NameList, context] where nodeA _ BuildTGN[Type, context] ; for FieldList.more: AbstractProduction [ FieldList.value, FieldList.rest ] let BuildTGN[tree, context] _ nodeC where nodeC _ FieldTGNConcat[nodeA, nodeB] where nodeB _ BuildTGN[FieldList.rest, context] where nodeA _ BuildTGN[FieldList.value, context] ; for Grouping.one: AbstractProduction [ Constant ] let BuildAbstractValue[tree, context] _ value where value _ CreateGroupingAVN[nodeA] where nodeA _ BuildAbstractValue[Constant, context] ; for Grouping.more: AbstractProduction [ Constant, Grouping ] let BuildAbstractValue[tree, context] _ nodeC where nodeC _ GroupingAVNConcat[nodeA, nodeB] where nodeB _ BuildAbstractValue[Constant, context] where nodeA _ BuildAbstractValue[Grouping, context] ; for Constructor.one: AbstractProduction [ Binding ] let BuildAbstractValue[tree, context] _ value where value _ CreateConstructorAVN[nodeA] where nodeA _ BuildAbstractValue[Binding, context] ; for Constructor.more: AbstractProduction [ Binding, Constructor ] let BuildAbstractValue[tree, context] _ nodeC where nodeC _ ConstructorAVNConcat[nodeA, nodeB] where nodeB _ BuildAbstractValue[Binding, context] where nodeA _ BuildAbstractValue[Constructor, context] ; for Binding: AbstractProduction [ NameList, Constant ] let BuildAbstractValue[tree, context] _ value where value _ CreateBindingAVN[nodeA, nodeB] where nodeA _ BuildTGN[NameList, context] where nodeB _ BuildAbstractValue[Constant, context] ; for NameList.empty: AbstractProduction [ ] let BuildTGN[tree, context] _ node where node _ CreatePrimitiveTGN[Generic.record] ; for NameList.one: AbstractProduction [ id ] let BuildTGN[tree, context] _ node where node _ CreatePrimitiveTGN[Generic.record] ; for NameList.more: AbstractProduction [ id, NameList ] let BuildTGN[tree, context] _ node where node _ CreatePrimitiveTGN[Generic.record] ; for Number.decimal: AbstractProduction [ decimal ] let BuildAbstractValue[tree, context] _ value where value _ CreateNumericalAVN[card] where card _ CardFromDecimal[decimal] ; for Number.hex: AbstractProduction [ hex ] let BuildAbstractValue[tree, context] _ value where value _ CreateNumericalAVN[card] where card _ CardFromHex[hex] ; for Number.octal: AbstractProduction [ octal ] let BuildAbstractValue[tree, context] _ value where value _ CreateNumericalAVN[card] where card _ CardFromOctal[octal] ; End. SiroccoMethods.ThreeC4 Copyright Σ 1986, 1987 by Xerox Corporation. All rights reserved. Bhargava, August 12, 1986 11: 24: 02 pm PDT Demers, December 29, 1986 8:05:56 pm PST Bill Jackson (bj) August 26, 1987 3:44:43 pm PDT Produce object representation for the Courier Program Program: AbstractType [ MakeSymbolTable ]; Internalize imported Courier Programs ImportList: AbstractType [ BuildRIB ]; Import: AbstractType [ BuildScope ]; Identify Items of "this" program DeclarationList: AbstractType [ BuildItemTable, BuildTypeGraph ]; Declaration: AbstractType [ BuildItem, BuildNamedItem ]; Type: AbstractType [ BuildTGN ]; References Primitives Constructions Constant: AbstractType [ BuildAbstractValue ]; References Primitives Constructions Enumeration: AbstractType [ BuildTGN ]; INVARIANT: Enumeration.value is expanded as Enumeration.one. Union: AbstractType [ BuildTGN ]; INVARIANT: Union.value is expanded as Union.one. FieldList: AbstractType [ BuildTGN ]; -- I want a FIELD type (ajd) INVARIANT: FieldList.value is expanded as FieldList.one. Grouping: AbstractType [ BuildAbstractValue ]; Constructor: AbstractType [ BuildAbstractValue ]; Binding: AbstractType [ BuildAbstractValue ]; NameList: AbstractType [ BuildTGN ]; Number: AbstractType [ BuildAbstractValue ]; Κ•StyleDef‡BeginStyle (cedar) AttachStyle (code30) (set up the fancy tabs) {code clearTabStops 30 mm flushLeft tabStop} StyleRule (code35) (set up the fancy tabs) {code clearTabStops 35 mm flushLeft tabStop} StyleRule (code40) (set up the fancy tabs) {code clearTabStops 40 mm flushLeft tabStop} StyleRule (code45) (set up the fancy tabs) {code clearTabStops 45 mm flushLeft tabStop} StyleRule EndStyle˜code40™KšœA™AK™+K™(K™0K™—KšΠizœ ˜K˜šΟnœœ˜headšΟz5™5LšΠnzŸ#™*šœœI˜ošœ4˜7Kšœ˜Kšœ+˜0Kšœ*˜/K˜Kšœ5˜:K˜Kšœ8˜=Kšœ(˜-Kšœ˜ K˜Kšœ˜"Kšœ#˜(Kšœ+˜0—Kšœ˜——šŸ%™%šŸ&™&šœΟbœœ˜,Kšœ˜Kšœ˜—šœ‘œœ˜>šœ˜Kšœ!˜&Kšœ˜ Kšœ˜ —Kšœ˜——šŸ$™$šœ‘œœ/˜Wšœ˜Kšœ-˜2Kšœ%˜*Kšœ#˜(Kšœ+˜0—Kšœ˜———šŸ ™ šŸA™Ašœ‘œœ˜1Kšœ$˜'Kšœ:˜=Kšœ˜—šœ‘œœ"˜Nšœ ˜#Kšœ#˜(Kšœ(˜-Kšœ˜#—šœ'˜*Kšœ/˜4Kšœ2˜7Kšœ=˜B—Kšœ˜——šŸ8™8šœ‘œœ ˜3šœ7˜:Kšœ˜"Kšœ˜—šœ6˜9Kšœ˜Kšœ˜$Kšœ&˜+Kšœ˜—Kšœ˜—šœ‘œœ˜Ašœ7˜:Kšœ˜"Kšœ˜—šœ6˜9Kšœ.˜3Kšœ˜$Kšœ˜—Kšœ˜———šŸ ™ šŸ ™ šœ‘ œœ˜)šœ˜"Kšœ%˜*Kšœ˜—K˜—šœ‘ œœ˜=šœ˜"Kšœ/˜4Kšœ%˜*Kšœ˜ —K˜——šŸ ™ šœ‘ œœ˜%šœ˜"Kšœ,˜1—Kšœ˜—šœ‘ œœ˜'šœ˜"Kšœ.˜3—Kšœ˜—šœ‘ œœ˜'šœ˜"Kšœ.˜3—Kšœ˜—šœ‘ œœ˜&šœ˜"Kšœ-˜2—K˜—šœ‘ œœ˜&šœ˜"Kšœ-˜2—K˜—šœ‘ œœ˜%šœ˜"Kšœ,˜1—K˜—šœ‘ œœ˜'šœ˜"Kšœ.˜3—K˜—šœ‘ œœ˜'šœ˜"Kšœ.˜3—K˜—šœ‘ œœ˜'šœ˜"Kšœ.˜3—K˜——šŸ ™ šœ‘ œœ˜5šœ˜"Kšœ'˜,Kšœ/˜4Kšœ"˜'—K˜—šœ‘ œœ˜3šœ˜"Kšœ%˜*Kšœ ˜%Kšœ!˜&—K˜—šœ‘ œœ˜1šœ˜"Kšœ"˜'Kšœ&˜+—K˜—šœ‘ œœ˜0šœ˜"Kšœ!˜&Kšœ)˜.—K˜—šœ‘ œœ+˜Lšœ˜"Kšœ,˜1Kšœ(˜-Kšœ+˜0Kšœ%˜*—K˜—šœ‘ œœ˜1šœ˜"Kšœ"˜'Kšœ)˜.—K˜—šœ‘ œœ˜%šœ˜"Kšœ˜#Kšœ+˜0K˜——šœ‘œœ˜3šœ˜"Kšœ-˜2Kšœ2˜7Kšœ"˜'—K˜———šŸ.™.šŸ ™ šœ‘œœ˜-šœ*˜-Kšœ&˜+Kšœ˜—Kšœ˜—šœ‘œœ˜Ašœ*˜-Kšœ0˜5Kšœ%˜*Kšœ˜ —Kšœ˜——šŸ ™ šœ‘œœ˜*šœ*˜-Kšœ ˜%Kšœ˜—Kšœ˜—šœ‘œœ˜*šœ*˜-Kšœ"˜'—Kšœ˜—šœ‘ œœ˜)šœ*˜-Kšœ!˜&—Kšœ˜—šœ‘œœ˜.šœ*˜-Kšœ(˜-—Kšœ˜—šœ‘œœ ˜4šœ*˜-Kšœ ˜%Kšœ+˜0—Kšœ˜—šœ‘œœ ˜2šœ*˜-Kšœ,˜1—Kšœ˜—šœ‘œœ ˜0šœ*˜-Kšœ˜!Kšœ˜"—Kšœ˜——šŸ ™ šœ‘œœ˜8šœ*˜-Kšœ$˜)Kšœ˜Kšœ-˜2—Kšœ˜—šœ‘œœ˜<šœ*˜-Kšœ#˜(Kšœ0˜5—Kšœ˜—šœ‘œœ ˜6šœ*˜-Kšœ ˜%Kšœ-˜2—Kšœ˜———Kšœ˜K˜—šžœœ˜šŸ'™'šœ‘œœ˜8šœ˜"Kšœ(˜-Kšœ˜Kšœ0˜5—K˜—šœ‘œœ(˜PKšœ<™<šœ ˜#Kšœ)˜.Kšœ,˜1Kšœ-˜2—K˜——šŸ!™!šœ‘ œœ˜4šœ ˜#Kšœ%˜*Kšœ$˜)Kšœ ˜%—K˜—šœ‘ œœ˜>Kšœ0™0šœ ˜#Kšœ%˜*Kšœ&˜+Kšœ'˜,—K˜——šŸB™Bšœ‘œœ˜+šœ ˜#Kšœ˜#—K˜—šœ‘ œœ˜8šœ ˜#Kšœ%˜*Kšœ$˜)Kšœ ˜%—K˜—šœ‘œœ$˜JKšœ8™8šœ ˜#Kšœ%˜*Kšœ*˜/Kšœ+˜0—K˜——šŸ.™.šœ‘ œœ ˜1šœ*˜-Kšœ!˜&Kšœ.˜3—Kšœ˜—šœ‘ œœ˜<šœ*˜-Kšœ(˜-Kšœ.˜3Kšœ.˜3—K˜——šŸ1™1šœ‘œœ ˜3šœ*˜-Kšœ$˜)Kšœ-˜2—Kšœ˜—šœ‘œœ˜Ašœ*˜-Kšœ+˜0Kšœ-˜2Kšœ1˜6—K˜——šŸ-™-šœžœœ˜6šœ*˜-Kšœ'˜,Kšœ$˜)Kšœ.˜3—K˜——šŸ$™$šœ‘œœ˜*šœ˜"Kšœ*˜/—K˜—šœ‘ œœ˜+šœ˜"Kšœ*˜/—K˜—šœ‘ œœ˜6šœ˜"Kšœ*˜/—K˜——š Ÿ&™,šœ‘œœ ˜2šœ*˜-Kšœ!˜&Kšœ ˜%—K˜—šœ‘ œœ˜*šœ*˜-Kšœ!˜&Kšœ˜—K˜—šœ‘ œœ ˜.šœ*˜-Kšœ!˜&Kšœ˜!—K˜——K˜Kšœ˜K˜——…—,μ@ό