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