Include [SaffronAG, SaffronTreeDecls, SaffronBaseDecls]; SaffronMakeType: Module = Begin for Top.modulep: AbstractProduction [ ModuleP ] let DoTop[tree, fileName, env] _ MakeEnvironment [ModuleP, fileName, env] let Explore [tree, fileName, env] _ Explore [ModuleP, fileName, env] ; for ModuleP.impl: AbstractProduction [ Directory, IdentList, Cedar, ProgHead, Checked, Block ] let MakeEnvironment [tree, fileName, env] _ where env _ AddInterfaceToEnvironment [CreateEmptyEnvironment [], "", interface] where interface _ CreateInterfaceFromContextTree [ct, EmptyNameSequence[]] where ct _ EmptyContextTree [ RootContextRib []] let Explore [tree, fileName, env] _ where env _ AddInterfaceToEnvironment [CreateEmptyEnvironment [], "", interface] where interface _ CreateInterfaceFromContextTree [ct, EmptyNameSequence[]] where ct _ EmptyContextTree [ RootContextRib []] ; for ModuleP.def: AbstractProduction [ Directory, IdentList, Cedar, DefHead, DefBody ] let MakeEnvironment [tree, fileName, env] _ where env2 _ AddInterfaceToEnvironment [env1, fileName, interface] where interface _ CreateInterfaceFromContextTree [contextTree, nameSequence] where contextTree _ MakeContextTree [DefBody, contextRib, paintRecords] where contextRib _ FreezeLocalContext [localContext] where paintRecords _ True [] where nameSequence _ MakeNameSequence [IdentList] where _ ProcessDirectoryClause [Directory, rootContext, env] where rootContext _ CreateEmptyContext [RootContextRib []] let Explore [tree, fileName, env] _ where env2 _ AddInterfaceToEnvironment [env1, fileName, interface] where interface _ CreateInterfaceFromContextTree [ct, EmptyNameSequence[]] where ct _ EmptyContextTree [ RootContextRib []] where env1 _ ExploreDirectoryClause [Directory, env] ; for Directory.empty: AbstractProduction [ ] let ProcessDirectoryClause [tree, localContext, env] _ let ExploreDirectoryClause [tree, env] _ FakeDamageEnvironment [env] ; for Directory.more: AbstractProduction [ Directory, IncludeItem ] let ProcessDirectoryClause [tree, localContext, env] _ ProcessDirectoryClause [IncludeItem, ProcessDirectoryClause [Directory, localContext, env]] let ExploreDirectoryClause [tree, env] _ ExploreDirectoryClause [IncludeItem, ExploreDirectoryClause [Directory, env]] ; for IncludeItem.fromp: AbstractProduction [ Id, String, Using ] let ProcessDirectoryClause [tree, localContext, env] _ where localContext3 _ AddArcFromLVTGNToTGN [localContext2, lvTgn, NullAccessVal[], interfaceTgn, NullDefaultVal []] where _ CreateLocallyVisibleTGN [localContext1, Id, NullAccessVal[]] where _ MakeInterfaceTGN [Using, localContext, interface] where _ if IsInterfaceInEnv [env, fileName] then ( where env1 _ FakeDamageEnvironment [env] ) else ( MakeEnvironment [defFile, fileName, env] where defFile _ ModulePVal [ReadDefFile [fileName]] ) where fileName _ RopeFromString [String] let ExploreDirectoryClause [tree, env] _ env2 where _ if IsInterfaceInEnv [env, fileName] then ( where env1 _ FakeDamageEnvironment [env] ) else ( Explore [defFile, fileName, env] where defFile _ ModulePVal [ReadDefFile [fileName]] ) where fileName _ RopeFromString [String] ; for IncludeItem.type: AbstractProduction [ Id, Using ] let ProcessDirectoryClause [tree, localContext, env] _ where localContext3 _ AddArcFromLVTGNToTGN [localContext2, lvTgn, NullAccessVal[], interfaceTgn, NullDefaultVal []] where _ CreateLocallyVisibleTGN [localContext1, Id, NullAccessVal[]] where _ MakeInterfaceTGN [Using, localContext, interface] where _ if IsInterfaceInEnv [env, fileName] then ( where env1 _ FakeDamageEnvironment [env] ) else ( MakeEnvironment [defFile, fileName, env] where defFile _ ModulePVal [ReadDefFile [fileName]] ) where fileName _ RopeFromId [Id] let ExploreDirectoryClause [tree, env] _ env2 where _ if IsInterfaceInEnv [env, fileName] then ( where env1 _ FakeDamageEnvironment [env] ) else ( Explore [defFile, fileName, env] where defFile _ ModulePVal [ReadDefFile [fileName]] ) where fileName _ RopeFromId [Id] ; for IncludeItem.plain: AbstractProduction [ Id, Using ] let ProcessDirectoryClause [tree, localContext, env] _ where localContext3 _ AddArcFromLVTGNToTGN [localContext2, lvTgn, NullAccessVal[], interfaceTgn, NullDefaultVal []] where _ CreateLocallyVisibleTGN [localContext1, Id, NullAccessVal[]] where _ MakeInterfaceTGN [Using, localContext, interface] where _ if IsInterfaceInEnv [env, fileName] then ( where env1 _ FakeDamageEnvironment [env] ) else ( MakeEnvironment [defFile, fileName, env] where defFile _ ModulePVal [ReadDefFile [fileName]] ) where fileName _ RopeFromId [Id] let ExploreDirectoryClause [tree, env] _ env2 where _ if IsInterfaceInEnv [env, fileName] then ( where env1 _ FakeDamageEnvironment [env] ) else ( Explore [defFile, fileName, env] where defFile _ ModulePVal [ReadDefFile [fileName]] ) where fileName _ RopeFromId [Id] ; for IncludeItem.typeandid: AbstractProduction [ Id.local, Id.global, Using ] let ProcessDirectoryClause [tree, localContext, env] _ where localContext3 _ AddArcFromLVTGNToTGN [localContext2, lvTgn, NullAccessVal[], interfaceTgn, NullDefaultVal []] where _ CreateLocallyVisibleTGN [localContext1, Id.local, NullAccessVal[]] where _ MakeInterfaceTGN [Using, localContext, interface] where _ if IsInterfaceInEnv [env, fileName] then ( where env1 _ FakeDamageEnvironment [env] ) else ( MakeEnvironment [defFile, fileName, env] where defFile _ ModulePVal [ReadDefFile [fileName]] ) where fileName _ RopeFromId [Id.local] let ExploreDirectoryClause [tree, env] _ env2 where _ if IsInterfaceInEnv [env, fileName] then ( where env1 _ FakeDamageEnvironment [env] ) else ( Explore [defFile, fileName, env] where defFile _ ModulePVal [ReadDefFile [fileName]] ) where fileName _ RopeFromId [Id.local] ; for Using.restricted: AbstractProduction [ IdList ] let MakeInterfaceTGN [tree, localContext, interface] _ where _ CreateEmptyInterfaceTGN [localContext] ; for Using.nothing: AbstractProduction [ ] let MakeInterfaceTGN [tree, localContext, interface] _ CreateEmptyInterfaceTGN [localContext] ; for Using.unrestricted: AbstractProduction [ ] let MakeInterfaceTGN [tree, localContext, interface] _ CreateInterfaceTGNFromInterface [localContext, interface] ; for DefBody: AbstractProduction [ BindList, DecList ] let MakeContextTree [tree, contextRib, paintRecords] _ MakeBindListContextTreeWithDefBody [BindList, defBodyPTree, contextRib, paintRecords] where defBodyPTree _ DefBodyPTreeVal [tree] let MakeContextTree1 [tree, rib, paintRecords] _ HangContextsFromContextTree [DecList, thisScopeContextTree, newRib, paintRecords] where thisScopeContextTree _ EmptyContextTree [newRib] where newRib _ FreezeLocalContext [thisScopeLocalContext] where thisScopeLocalContext _ UpdateLocalContext [DecList, localContext, paintRecords ] where localContext _ CreateEmptyContext [rib] ; for TypeExp.record: AbstractProduction [ MachineDependent, Monitored, RecList ] let MakeType[tree, localContext, paintRecords] _ where _ CreateRecordTGN [ localContext3, paint, machineDependent, monitored, frozenFieldList] where _ FreezeFieldList [localContext2, fieldList] where _ MakeFieldList [RecList, localContext1, paintRecords] where _ if paintRecords then GetUniquePaint [localContext] else GetUnpaintedPaint [localContext] where machineDependent _ GetBooleanVal [MachineDependent] where monitored _ GetBooleanVal [Monitored] ; for TypeExp.union: AbstractProduction [ Tag, VariantList ] let MakeType[tree, localContext, paintRecords] _ CreateVariantPartTGN [localContext3, variantFlavor, tagTypeTgn1, unionList] where variantFlavor _ MakeVariantFlavor [Tag] where _ if isStarTagType then MakeStarTagType [VariantList, localContext2] else where _ MakeTagType [Tag, localContext1, paintRecords] where _ MakeUnionList [VariantList, localContext, paintRecords] ; for TypeExp.sequence: AbstractProduction [ Packed, Tag, TypeExp ] let MakeType[tree, localContext, paintRecords] _ CreateSequenceTGN [localContext2, packed, GetSequenceTagInfo [Tag], tagTypeTgn, tgn] where packed _ GetBooleanVal [Packed] where x _ if isStarTagType then Error ["Sequence Tag must not be a star"] else True[] where _ MakeTagType [Tag, localContext1, paintRecords] where _ MakeType [TypeExp, localContext, paintRecords] ; for TypeExp.enum: AbstractProduction [ MachineDependent, ElementList ] let MakeType[tree, localContext, paintRecords] _ MakeElementList [ElementList, localContext, machineDependent] where machineDependent _ GetBooleanVal [MachineDependent] ; for TypeExp.ref: AbstractProduction [ ReadOnly, TypeExp ] let MakeType[tree, localContext, paintRecords] _ CreateRefTGN [localContext1, readOnly, referentTgn] where _ MakeType [TypeExp, localContext, paintRecords] where readOnly _ GetBooleanVal [ReadOnly] ; for TypeExp.refany: AbstractProduction [ ReadOnly ] let MakeType[tree, localContext, paintRecords] _ CreateRefTGN [localContext1, readOnly, topTgn] where topTgn _ FindTopTGN [localContext1] where localContext1 _ FakeDamageContext [localContext] where readOnly _ GetBooleanVal [ReadOnly] ; for TypeExp.refunspecified: AbstractProduction [ ] let MakeType[tree, localContext, paintRecords] _ CreateRefTGN [localContext1, readOnly, topTgn] where topTgn _ FindTopTGN [localContext1] where localContext1 _ FakeDamageContext [localContext] where readOnly _ False [] ; for TypeExp.typeid: AbstractProduction [ TypeId ] let MakeType[tree, localContext, paintRecords] _ MakeType [TypeId, localContext, paintRecords] ; for TypeExp.subrange: AbstractProduction [ Subrange ] let MakeType[tree, localContext, paintRecords] _ MakeType[Subrange, localContext, paintRecords] ; for TypeExp.pointer: AbstractProduction [ Ordered, Base, PointerType ] let MakeType[tree, localContext, paintRecords] _ CreatePointerTGN [localContext1, ordered, base, bounds, readOnly, tgn] where ordered _ GetBooleanVal [Ordered] where base _ GetBooleanVal [Base] where _ GetPointerTypeInfo [PointerType, localContext, paintRecords] ; for TypeExp.var: AbstractProduction [ TypeExp ] let MakeType[tree, localContext, paintRecords] _ CreateVarTGN [localContext1, tgn] where _ MakeType [TypeExp, localContext, paintRecords] ; for TypeExp.list: AbstractProduction [ ReadOnly, TypeExp ] let MakeType[tree, localContext, paintRecords] _ CreateListTGN [localContext1, readOnly, itemTgn] where _ MakeType [TypeExp, localContext, paintRecords] where readOnly _ GetBooleanVal [ReadOnly] ; for TypeExp.array: AbstractProduction [ Packed, OptType, TypeExp ] let MakeType[tree, localContext, paintRecords] _ CreateArrayTGN [localContext2, packed, indexTgn, itemTgn] where _ MakeType [TypeExp, localContext1, paintRecords] where _ MakeType [OptType, localContext, paintRecords] where packed _ GetBooleanVal [Packed] ; for TypeExp.descriptor: AbstractProduction [ ReadOnly, TypeExp ] let MakeType[tree, localContext, paintRecords] _ CreateDescriptorTGN [localContext1, readOnly, tgn] where _ MakeType [TypeExp, localContext, paintRecords] where readOnly _ GetBooleanVal [ReadOnly] ; for TypeExp.transfer: AbstractProduction [ Safe, TransferMode, Arguments ] let MakeType[tree, localContext, paintRecords] _ CreateTransferTGN [localContext1, safe, transferMode, fflInput, fflOutput] where _ MakeArgumentLists [Arguments, localContext, paintRecords] where transferMode _ MakeTransferMode [TransferMode] where safe _ GetBooleanVal [Safe] ; for TypeExp.relative: AbstractProduction [ TypeId, TypeExp ] let MakeType[tree, localContext, paintRecords] _ CreateRelativeTGN [localContext2, baseTgn, tgn] where _ MakeType [TypeExp, localContext1, paintRecords] where _ LookupTypeId [TypeId, localContext] ; for TypeExp.zone: AbstractProduction [ Uncounted ] let MakeType[tree, localContext, paintRecords] _ CreateZoneTGN [localContext, GetBooleanVal [Uncounted]] ; for TypeExp.long: AbstractProduction [ TypeExp ] let MakeType[tree, localContext, paintRecords] _ CreateLongTGN [localContext1, tgn] where _ MakeType [TypeExp, localContext, paintRecords] ; for TypeExp.frame: AbstractProduction [ Id ] let MakeType[tree, localContext, paintRecords] _ where localContext1 _ FakeDamageContext [localContext] ; for TypeExp.painted: AbstractProduction [ TypeId, TypeExp ] let MakeType[tree, localContext, paintRecords] _ where n _ FindBottomTGN[c] where c _ FakeDamageContext [localContext] where x _ Error [" Unimplemented Construct"] ; for TypeExp.typeapply: AbstractProduction [ TypeApply ] let MakeType[tree, localContext, paintRecords] _ MakeType [TypeApply, localContext, paintRecords] ; for TypeApply.one: AbstractProduction [ TypeId, Exp ] let MakeType[tree, localContext, paintRecords] _ CreateSpecianatedTGNUsingExp [localContext1, tgn, ExpPTreeVal [Exp]] where _ LookupTypeId [TypeId, localContext] ; for TypeApply.morelengths: AbstractProduction [ TypeApply, Exp ] let MakeType[tree, localContext, paintRecords] _ CreateSpecianatedTGNUsingExp [localContext1, tgn, ExpPTreeVal [Exp]] where _ MakeType [TypeApply, localContext, paintRecords] ; for TypeApply.moreids: AbstractProduction [ TypeApply, Id ] let MakeType[tree, localContext, paintRecords] _ CreateSpecianatedTGNUsingId [localContext1, tgn, Id] where _ MakeType [TypeApply, localContext, paintRecords] ; for TypeId.id: AbstractProduction [ Id ] let MakeType[tree, localContext, paintRecords] _ where localContext1 _ FakeDamageContext [localContext] where tgn _ FindLocallyVisibleTGN [ localContext, Id ] let LookupTypeId [tree, localContext] _ where localContext1 _ FakeDamageContext [localContext] where tgn _ FindLocallyVisibleTGN [ localContext, Id ] ; for TypeId.qualifier: AbstractProduction [ TypeId, Id ] let MakeType[tree, localContext, paintRecords] _ LookupTypeId [tree, localContext] let LookupTypeId [tree, localContext] _ CreateSpecianatedTGNUsingId [localContext1, tgn, Id] where _ LookupTypeId [TypeId, localContext] ; for OptType.absent: AbstractProduction [ ] let MakeType[tree, localContext, paintRecords] _ where localContext1 _ FakeDamageContext [localContext] where tgn _ FindBottomTGN [localContext] ; for OptType.present: AbstractProduction [ TypeExp ] let MakeType[tree, localContext, paintRecords] _ MakeType[TypeExp, localContext, paintRecords] ; for Subrange.named: AbstractProduction [ TypeId, Interval ] let MakeType[tree, localContext, paintRecords] _ CreateSubrangeTGN [localContext1, tgn, bounds] where _ LookupTypeId [TypeId, localContext] where bounds _ GetBoundsVal [Interval] ; for Subrange.unnamed: AbstractProduction [ Interval ] let MakeType[tree, localContext, paintRecords] _ CreateSubrangeTGN [localContext, tgn, bounds] where tgn _ FindBottomTGN [localContext] where bounds _ GetBoundsVal [Interval] ; for Interval.cc: AbstractProduction [ Bounds ] let GetBoundsVal [tree] _ BoundsValFun ["[", GetLowerAndUpper [Bounds], "]"] ; for Interval.co: AbstractProduction [ Bounds ] let GetBoundsVal [tree] _ BoundsValFun ["[", GetLowerAndUpper [Bounds], ")"] ; for Interval.oc: AbstractProduction [ Bounds ] let GetBoundsVal [tree] _ BoundsValFun ["(", GetLowerAndUpper [Bounds], "]"] ; for Interval.oo: AbstractProduction [ Bounds ] let GetBoundsVal [tree] _ BoundsValFun ["(", GetLowerAndUpper [Bounds], ")"] ; for Bounds: AbstractProduction [ Exp.lower, Exp.upper ] let GetLowerAndUpper [tree] _ ; for PointerType.unspecified: AbstractProduction [ OptInterval ] let GetPointerTypeInfo [tree, localContext, paintRecords] _ where bounds _ GetBoundsVal [OptInterval] where readOnly _ False [] where tgn _ FindBottomTGN[localContext1] where localContext1 _ FakeDamageContext [localContext] ; for PointerType.specified: AbstractProduction [ OptInterval, ReadOnly, TypeExp ] let GetPointerTypeInfo [tree, localContext, paintRecords] _ where bounds _ GetBoundsVal [OptInterval] where readOnly _ GetBooleanVal [ReadOnly] where _ MakeType [TypeExp, localContext, paintRecords] ; for OptInterval.absent: AbstractProduction [ ] let GetBoundsVal [tree] _ NullBounds [] ; for OptInterval.present: AbstractProduction [ Interval ] let GetBoundsVal [tree] _ GetBoundsVal [Interval] ; for TransferMode.proc: AbstractProduction [ ] let MakeTransferMode [tree] _ "proc" ; for TransferMode.port: AbstractProduction [ ] let MakeTransferMode [tree] _ "port" ; for TransferMode.signal: AbstractProduction [ ] let MakeTransferMode [tree] _ "signal" ; for TransferMode.error: AbstractProduction [ ] let MakeTransferMode [tree] _ "error" ; for TransferMode.process: AbstractProduction [ ] let MakeTransferMode [tree] _ "process" ; for TransferMode.program: AbstractProduction [ ] let MakeTransferMode [tree] _ "program" ; for Arguments: AbstractProduction [ ParameterList.input, ParameterList.output ] let MakeArgumentLists [tree, localContext, paintRecords] _ where _ FreezeFieldList [MakeFieldList [ParameterList.output, localContext1, paintRecords]] where _ FreezeFieldList [MakeFieldList [ParameterList.input, localContext, paintRecords]] ; for Default.empty: AbstractProduction [ ] let GetDefaultExpVal [tree] _ DefaultExpVal ["", NullExpPTree []] ; for Default.gets: AbstractProduction [ ] let GetDefaultExpVal [tree] _ DefaultExpVal ["_", NullExpPTree []] ; for Default.getsexp: AbstractProduction [ Exp ] let GetDefaultExpVal [tree] _ DefaultExpVal ["_e", ExpPTreeVal [Exp]] ; for Default.getstrash: AbstractProduction [ ] let GetDefaultExpVal [tree] _ DefaultExpVal ["_TRASH", NullExpPTree []] ; for Default.getsexportrash: AbstractProduction [ Exp ] let GetDefaultExpVal [tree] _ DefaultExpVal ["_e|TRASH", ExpPTreeVal [Exp]] ; for Packed.yes: AbstractProduction [ ] let GetBooleanVal [tree] _ True [] ; for Packed.no: AbstractProduction [ ] let GetBooleanVal [tree] _ False [] ; for Monitored.yes: AbstractProduction [ ] let GetBooleanVal [tree] _ True [] ; for Monitored.no: AbstractProduction [ ] let GetBooleanVal [tree] _ False [] ; for MachineDependent.yes: AbstractProduction [ ] let GetBooleanVal [tree] _ True [] ; for MachineDependent.no: AbstractProduction [ ] let GetBooleanVal [tree] _ False [] ; for Ordered.yes: AbstractProduction [ ] let GetBooleanVal [tree] _ True [] ; for Ordered.no: AbstractProduction [ ] let GetBooleanVal [tree] _ False [] ; for Base.yes: AbstractProduction [ ] let GetBooleanVal [tree] _ True [] ; for Base.no: AbstractProduction [ ] let GetBooleanVal [tree] _ False [] ; for Safe.yes: AbstractProduction [ ] let GetBooleanVal [tree] _ True [] ; for Safe.no: AbstractProduction [ ] let GetBooleanVal [tree] _ False [] ; for Safe.empty: AbstractProduction [ ] let GetBooleanVal [tree] _ False [] ; for Uncounted.yes: AbstractProduction [ ] let GetBooleanVal [tree] _ True [] ; for Uncounted.no: AbstractProduction [ ] let GetBooleanVal [tree] _ False [] ; for ReadOnly.yes: AbstractProduction [ ] let GetBooleanVal [tree] _ True [] ; for ReadOnly.no: AbstractProduction [ ] let GetBooleanVal [tree] _ False [] ; End; SaffronMakeFieldList: Module = Begin for RecList.empty: AbstractProduction [ ] let MakeFieldList [tree, localContext, paintRecords ] _ < FakeDamageContext[localContext], CreateEmptyFieldList []> ; for RecList.pairlist: AbstractProduction [ PairList ] let MakeFieldList [tree, localContext, paintRecords] _ where _ AddPairsToFieldList [PairList, localContext, newFieldList, paintRecords] where newFieldList _ CreateEmptyFieldList [] ; for RecList.typelist: AbstractProduction [ TypeList ] let MakeFieldList [tree, localContext, paintRecords] _ where _ AddToFieldList [TypeList, localContext, newFieldList, paintRecords] where newFieldList _ CreateEmptyFieldList [] ; for ParameterList.empty: AbstractProduction [ ] let MakeFieldList [tree, localContext, paintRecords ] _ ; for ParameterList.any: AbstractProduction [ ] let MakeFieldList [tree, localContext, paintRecords] _ ; for ParameterList.pairlist: AbstractProduction [ PairList ] let MakeFieldList [tree, localContext, paintRecords] _ where _ AddPairsToFieldList [PairList, localContext, newFieldList, paintRecords] where newFieldList _ CreateEmptyFieldList [] ; for ParameterList.typelist: AbstractProduction [ TypeList ] let MakeFieldList [tree, localContext, paintRecords] _ where _ AddToFieldList [TypeList, localContext, newFieldList, paintRecords] where newFieldList _ CreateEmptyFieldList [] ; for VariantList.one: AbstractProduction [ VariantItem ] let MakeUnionList [tree, localContext, paintRecords] _ AddVariantsToUnionList [VariantItem, localContext, newUnionList, paintRecords] where newUnionList _ CreateEmptyUnionList [] let AddVariantsToUnionList [tree, localContext, unionList, paintRecords] _ AddVariantsToUnionList [VariantItem, localContext, unionList, paintRecords] let MakeStarTagType [tree, localContext] _ where localContext2 _ AddVariantNamesToEnumTypeTGN [VariantItem, localContext1, tgn] where _ CreateEmptyEnumTypeTGN [localContext, False []] let AddVariantNamesToEnumTypeTGN [tree, localContext, tgn] _ AddVariantNamesToEnumTypeTGN [VariantItem, localContext, tgn] ; for VariantList.more: AbstractProduction [ VariantList, VariantItem ] let MakeUnionList [tree, localContext, paintRecords] _ AddVariantsToUnionList [VariantItem, localContext1, unionList, paintRecords] where _ AddVariantsToUnionList [VariantList, localContext, newUnionList, paintRecords] where newUnionList _ CreateEmptyUnionList [] let AddVariantsToUnionList [tree, localContext, unionList, paintRecords] _ AddVariantsToUnionList [VariantItem, localContext1, unionList1, paintRecords] where _ AddVariantsToUnionList [VariantList, localContext, unionList, paintRecords] let MakeStarTagType [tree, localContext] _ where localContext3 _ AddVariantNamesToEnumTypeTGN [VariantItem, localContext2, tgn] where localContext2 _ AddVariantNamesToEnumTypeTGN [VariantList, localContext1, tgn] where _ CreateEmptyEnumTypeTGN [localContext, False []] let AddVariantNamesToEnumTypeTGN [tree, localContext, tgn] _ AddVariantNamesToEnumTypeTGN [VariantItem, localContext1, tgn] where localContext1 _ AddVariantNamesToEnumTypeTGN [VariantList, localContext, tgn] ; for VariantItem: AbstractProduction [ IdList, RecList ] let AddVariantsToUnionList [tree, localContext, unionList, paintRecords] _ < localContext2, AddNamesToUnionList [IdList, ffl, unionList]> where _ FreezeFieldList [localContext1, fieldList] where _ MakeFieldList [RecList, localContext, paintRecords ] let AddVariantNamesToEnumTypeTGN [tree, localContext, tgn] _ AddVariantNamesToEnumTypeTGN [IdList, localContext, tgn] ; for IdList.one: AbstractProduction [ Id ] let AddNamesToUnionList [tree, ffl, unionList] _ AppendToUnionList [unionList, Id, ffl] let AddVariantNamesToEnumTypeTGN [tree, localContext, tgn] _ AppendElementToEnumTypeTGN [localContext, tgn, Id, NullExpPTree[]] let AddIdsToInterfaceTGN [tree, localContext, interfaceTGN, interface] _ AddTGNToInterfaceTGN [localContext1, interfaceTGN, Id, accessVal, linkTgn] where _ CreateLinkTGN [localContext, entryTgn, interface, Id] where _ LookupInterfaceEntry [interface, Id] ; for IdList.more: AbstractProduction [ Id, IdList ] let AddNamesToUnionList [tree, ffl, unionList] _ AddNamesToUnionList [IdList, ffl, unionList1] where unionList1 _ AppendToUnionList [unionList, Id, ffl] let AddVariantNamesToEnumTypeTGN [tree, localContext, tgn] _ AddVariantNamesToEnumTypeTGN [IdList, localContext1, tgn] where localContext1 _ AppendElementToEnumTypeTGN [localContext, tgn, Id, NullExpPTree[]] let AddIdsToInterfaceTGN [tree, localContext, interfaceTGN, interface] _ AddIdsToInterfaceTGN [IdList, localContext2, interfaceTGN, interface] where localContext2 _ AddTGNToInterfaceTGN [localContext1, interfaceTGN, Id, accessVal, linkTgn] where _ CreateLinkTGN [localContext, entryTgn, interface, Id] where _ LookupInterfaceEntry [interface, Id] ; for Tag.ident: AbstractProduction [ Ident, Access, TagType ] let MakeVariantFlavor [tree] _ VanillaVariantFlavorVal [GetIdentInfo [Ident], GetAccessVal [Access]] let MakeTagType [tree, localContext, paintRecords] _ MakeTagType [TagType, localContext, paintRecords] let GetSequenceTagInfo [tree] _ ; for Tag.computed: AbstractProduction [ TagType ] let MakeVariantFlavor [tree] _ ComputedVariantFlavorConst [] let MakeTagType [tree, localContext, paintRecords] _ MakeTagType [TagType, localContext, paintRecords] let GetSequenceTagInfo [tree] _ ; for Tag.overlaid: AbstractProduction [ TagType ] let MakeVariantFlavor [tree] _ OverlaidVariantFlavorConst [] let MakeTagType [tree, localContext, paintRecords] _ MakeTagType [TagType, localContext, paintRecords] let GetSequenceTagInfo [tree] _ where x _ Error ["Sequences can't be overlaid"] ; for TagType.star: AbstractProduction [ ] let MakeTagType [tree, localContext, paintRecords] _ where localContext1 _ FakeDamageContext [localContext] ; for TagType.typeexp: AbstractProduction [ TypeExp ] let MakeTagType [tree, localContext, paintRecords] _ ; End; SaffronAddToFieldList: Module = Begin for TypeList.many: AbstractProduction [ TypeList.head, TypeList.tail ] let AddToFieldList [tree, localContext, fieldList, paintRecords] _ AddToFieldList [ TypeList.tail, localContext1, fieldList1, paintRecords] where _ AddToFieldList [ TypeList.head, localContext, fieldList, paintRecords] ; for TypeList.one: AbstractProduction [ TypeItem ] let AddToFieldList [tree, localContext, fieldList, paintRecords] _ AddToFieldList [ TypeItem, localContext, fieldList, paintRecords] ; for TypeItem: AbstractProduction [ TypeExp, Default ] let AddToFieldList [tree, localContext, fieldList, paintRecords] _ where fieldList1 _ AppendFieldToFieldList [ fieldList, field] where field _ CreateUnnamedField [tgn, defaultExp] where _ MakeType [TypeExp, localContext, paintRecords] where defaultExp _ GetDefaultExpVal [Default] End; SaffronAddPairsToFieldList: Module = Begin for PairList.many: AbstractProduction [ PairList.head, PairList.tail ] let AddPairsToFieldList [tree, localContext, fieldList, paintRecords] _ AddPairsToFieldList [ PairList.tail, localContext1, fieldList1, paintRecords] where _ AddPairsToFieldList [PairList.head, localContext, fieldList, paintRecords] ; for PairList.one: AbstractProduction [ PairItem ] let AddPairsToFieldList [tree, localContext, fieldList, paintRecords] _ AddPairsToFieldList [PairItem, localContext, fieldList, paintRecords] ; for PairItem: AbstractProduction [ IdentList, Access, TypeExp, Default ] let AddPairsToFieldList [tree, localContext, fieldList, paintRecords] _ < localContext1, AddNamesToFieldList [IdentList, accessVal, tgn, defaultExp, fieldList] > where _ MakeType [TypeExp, localContext, paintRecords] where accessVal _ GetAccessVal [Access] where defaultExp _ GetDefaultExpVal [Default] ; for Access.empty: AbstractProduction [ ] let GetAccessVal [tree] _ AccessValConst ["empty"] ; for Access.public: AbstractProduction [ ] let GetAccessVal [tree] _ AccessValConst ["public"] ; for Access.private: AbstractProduction [ ] let GetAccessVal [tree] _ AccessValConst ["private"] ; End; SaffronAddNamesToFieldList: Module = Begin for IdentList.many: AbstractProduction [ IdentList.head, IdentList.tail ] let AddNamesToFieldList [tree, accessVal, tgn, defaultExp, fieldList] _ AddNamesToFieldList [IdentList.tail, accessVal, tgn, defaultExp, fieldList1] where fieldList1 _ AddNamesToFieldList [IdentList.head, accessVal, tgn, defaultExp, fieldList] let PutNewNamesInLocalContext1[tree, localContext, accessVal]_ PutNewNamesInLocalContext1[IdentList.tail, localContext1, accessVal] where localContext1 _ PutNewNamesInLocalContext1[IdentList.head, localContext, accessVal] let RecAddArcsfromLVTGNtoTGN[tree, localContext, accessVal, tgn, defaultExp]_ RecAddArcsfromLVTGNtoTGN[IdentList.tail, localContext1, accessVal, tgn, defaultExp] where localContext1 _ RecAddArcsfromLVTGNtoTGN[IdentList.head, localContext, accessVal, tgn, defaultExp] let MakeNameSequence [tree] _ AddNamesToSequence [IdentList.head, nameSequence1] where nameSequence1 _ AddNamesToSequence [IdentList.tail, nameSequence] where nameSequence _ EmptyNameSequence [] let AddNamesToSequence [tree, nameSequence] _ AddNamesToSequence [IdentList.head, nameSequence1] where nameSequence1 _ AddNamesToSequence [IdentList.tail, nameSequence] ; for IdentList.one: AbstractProduction [ Ident ] let AddNamesToFieldList [tree, accessVal, tgn, defaultExp, fieldList] _ AddNamesToFieldList [Ident, accessVal, tgn, defaultExp, fieldList] let PutNewNamesInLocalContext1[tree, localContext, accessVal] _ PutNewNamesInLocalContext1[Ident, localContext, accessVal] let RecAddArcsfromLVTGNtoTGN[tree, localContext, accessVal, tgn, defaultExp] _ RecAddArcsfromLVTGNtoTGN[Ident, localContext, accessVal, tgn, defaultExp] let MakeNameSequence [tree] _ AddNamesToSequence [Ident, nameSequence] where nameSequence _ EmptyNameSequence [] let AddNamesToSequence [tree, nameSequence] _ AddNamesToSequence [Ident, nameSequence] ; for Ident.id: AbstractProduction [ Id ] let AddNamesToFieldList [tree, accessVal, tgn, defaultExp, fieldList] _ AppendFieldToFieldList [fieldList, field] where field _ CreateNamedField [Id, NullPosition [], accessVal, tgn, defaultExp] let PutNewNamesInLocalContext1[tree, localContext, accessVal] _ localContext1 where _ CreateLocallyVisibleTGN [localContext, Id, accessVal ] let RecAddArcsfromLVTGNtoTGN[tree, localContext, accessVal, tgn, defaultExp] _ AddArcFromLVTGNToTGN [localContext, lvtgn, accessVal, tgn, defaultExp] where lvtgn _ FindLocallyVisibleTGN [localContext, Id] let GetIdentInfo [tree] _ let AddNamesToSequence [tree, nameSequence] _ InsertNameOnNameSequence [Id, nameSequence] ; for Ident.idposition: AbstractProduction [ Id, Position ] let AddNamesToFieldList [tree, accessVal, tgn, defaultExp, fieldList] _ AppendFieldToFieldList [fieldList, field] where field _ CreateNamedField [Id, GetPositionVal [Position], accessVal, tgn, defaultExp] let PutNewNamesInLocalContext1[tree, localContext, accessVal] _ localContext1 where _ CreateLocallyVisibleTGN [localContext, Id, accessVal ] let RecAddArcsfromLVTGNtoTGN[tree, localContext, accessVal, tgn, defaultExp] _ AddArcFromLVTGNToTGN [localContext, lvtgn, accessVal, tgn, defaultExp] where lvtgn _ FindLocallyVisibleTGN [localContext, Id] let GetIdentInfo [tree] _ let AddNamesToSequence [tree, nameSequence] _ InsertNameOnNameSequence [Id, nameSequence] where x _ Error ["Is Position field valid in a ModuleName list"] ; for Position: AbstractProduction [ Exp, OptBits ] let GetPositionVal [tree] _ PositionValFun [ExpPTreeVal [Exp], boundsVal] where boundsVal _ GetBoundsVal [OptBits] ; for OptBits.absent: AbstractProduction [ ] let GetBoundsVal [tree] _ NullBounds [] ; for OptBits.present: AbstractProduction [ Bounds ] let GetBoundsVal [tree] _ BoundsValFun ["[", GetLowerAndUpper [Bounds], "]"] ; End; SaffronMakeElementList: Module = Begin for ElementList.empty: AbstractProduction [ ] let MakeElementList [tree, localContext, machineDependent] _ CreateEmptyEnumTypeTGN [localContext, machineDependent] ; for ElementList.more: AbstractProduction [ ElementList, Element ] let MakeElementList [tree, localContext, machineDependent] _ where localContext1 _ AppendElementToEnumTypeTGN [localContext2, tgn, elementName, rep] where _ MakeElementList [ElementList, localContext, machineDependent] where _ ElementInfo [Element] End; SaffronElementName: Module = Begin for Element.id: AbstractProduction [ Id ] let ElementInfo [tree] _ ; for Element.idwithrep: AbstractProduction [ Id, Exp ] let ElementInfo [tree] _ ; for Element.anonymousrep: AbstractProduction [ Exp ] let ElementInfo [tree] _ ; for Exp.id: AbstractProduction [ Id ] let IdVal [tree] _ Id ; for Exp.sum: AbstractProduction [ Exp.left, AddOp, Exp.right ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.unarysum: AbstractProduction [ AddOp, Exp ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.product: AbstractProduction [ Exp.left, MultOp, Exp.right ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.or: AbstractProduction [ Exp.left, Exp.right ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.and: AbstractProduction [ Exp.left, Exp.right ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.not: AbstractProduction [ Exp ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.relation: AbstractProduction [ Exp, Relation ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.ifthenelse: AbstractProduction [ Exp.cond, Exp.thenpart, Exp.elsepart ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.select: AbstractProduction [ SelectHead, SelectExpList, Exp.default ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.assign: AbstractProduction [ Exp.lhs, Exp.rhs ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.multiassign: AbstractProduction [ ExpList, Exp ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.num: AbstractProduction [ Num ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.string: AbstractProduction [ String ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.flnum: AbstractProduction [ Flnum ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.char: AbstractProduction [ Char ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.atom: AbstractProduction [ Atom ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.narrow: AbstractProduction [ Exp, OptType, Catch ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.loophole: AbstractProduction [ Exp, OptType ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.apply: AbstractProduction [ Exp.rator, Exp.rand, Catch ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.qualifier: AbstractProduction [ Exp, Qualifier ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.explist: AbstractProduction [ ExpList ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.prefixop: AbstractProduction [ PrefixOp, OrderList ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.val: AbstractProduction [ OrderList ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.all: AbstractProduction [ OrderList ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.new: AbstractProduction [ New, TypeExp, Initialization, Catch ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.cons: AbstractProduction [ Cons, ExpList, Catch ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.listcons: AbstractProduction [ ListCons, ExpList ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.nil: AbstractProduction [ ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.typeop: AbstractProduction [ TypeOp, TypeExp ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.size: AbstractProduction [ TypeExp ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.size2: AbstractProduction [ TypeExp, Exp ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.bits: AbstractProduction [ TypeExp ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.bits2: AbstractProduction [ TypeExp, Exp ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.bytes: AbstractProduction [ TypeExp ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.bytes2: AbstractProduction [ TypeExp, Exp ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.units: AbstractProduction [ TypeExp ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.units2: AbstractProduction [ TypeExp, Exp ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.words: AbstractProduction [ TypeExp ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.words2: AbstractProduction [ TypeExp, Exp ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.istype: AbstractProduction [ Exp, TypeExp ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.address: AbstractProduction [ Exp ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.descriptor: AbstractProduction [ DescList ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.error: AbstractProduction [ ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; for Exp.transfer: AbstractProduction [ TransferOp, Exp ] let IdVal [tree] _ NullId [] where x _ Error ["Expected an Id"]; End; SaffronScope: Module = Begin for Scope: AbstractProduction [ BindList, Catch, OptDecList, StatementList ] let MakeContextTree [tree, rib, paintRecords] _ MakeBindListContextTreeWithScope [BindList, scopePTree, rib, paintRecords] where scopePTree _ ScopePTreeVal [tree] let MakeContextTree1 [tree, rib, paintRecords] _ HangContextsFromContextTree [StatementList, decListContextTree, newRib, paintRecords] where decListContextTree _ HangContextsFromContextTree [OptDecList, thisScopeContextTree, newRib, paintRecords] where thisScopeContextTree _ EmptyContextTree [newRib] where newRib _ FreezeLocalContext [thisScopeLocalContext] where thisScopeLocalContext _ UpdateLocalContext [OptDecList, localContext, paintRecords ] where localContext _ CreateEmptyContext [rib] ; for BindList.empty: AbstractProduction [ ] let MakeBindListContextTreeWithDefBody [tree, defBodyPTree, rib, paintRecords] _ MakeContextTree1 [defBody, rib, paintRecords] where defBody _ DefBodyVal [defBodyPTree] let MakeBindListContextTreeWithScope [tree, scopePTree, rib, paintRecords] _ MakeContextTree1 [scope, rib, paintRecords] where scope _ ScopeVal [scopePTree] let UpdateLocalContext [tree, localContext, paintRecords] _ FakeDamageContext [localContext] ; for BindList.more: AbstractProduction [ BindList, BindItem ] let MakeBindListContextTreeWithDefBody [tree, defBodyPTree, rib, paintRecords] _ AddSubContextTree [EmptyContextTree [rib2], contextTree2] where contextTree2 _ MakeContextTree1[defBody, rib2, paintRecords] where defBody _ DefBodyVal [defBodyPTree] where rib2 _ FreezeLocalContext [bindListsLocalContext] where bindListsLocalContext _ UpdateLocalContext [tree, localContext, paintRecords] where localContext _ CreateEmptyContext [rib] let MakeBindListContextTreeWithScope [tree, scopePTree, rib, paintRecords] _ AddSubContextTree [EmptyContextTree [rib2], contextTree2] where contextTree2 _ MakeContextTree1[scope, rib2, paintRecords] where scope _ ScopeVal [scopePTree] where rib2 _ FreezeLocalContext [bindListsLocalContext] where bindListsLocalContext _ UpdateLocalContext [tree, localContext, paintRecords] where localContext _ CreateEmptyContext [rib] let UpdateLocalContext [tree, localContext, paintRecords] _ UpdateLocalContext [BindItem, localContext1, paintRecords] where localContext1 _ UpdateLocalContext [BindList, localContext, paintRecords] ; for BindItem.named: AbstractProduction [ Id, Exp ] let UpdateLocalContext [tree, localContext, paintRecords] _ RenameInterface [localContext, Id, interfaceTgn] where interfaceTgn _ FindLocallyVisibleTGN [localContext, IdVal [Exp]] ; for BindItem.unnamed: AbstractProduction [ Exp ] let UpdateLocalContext [tree, localContext, paintRecords] _ OpenInterface [localContext, interfaceTgn] where interfaceTgn _ FindLocallyVisibleTGN [localContext, IdVal [Exp]] ; for OptDecList.absent: AbstractProduction [ ] let UpdateLocalContext [tree, localContext, paintRecords] _ FakeDamageContext [localContext] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree]; for OptDecList.present: AbstractProduction [ DecList ] let UpdateLocalContext [tree, localContext, paintRecords] _ FillInLocalContext [DecList, localContext1, paintRecords] where localContext1 _ PutNewNamesInLocalContext [DecList, localContext] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ HangContextsFromContextTree [DecList, contextTree, rib, paintRecords] ; for DecList.many: AbstractProduction [ DecList.head, DecList.tail ] let UpdateLocalContext [tree, localContext, paintRecords] _ FillInLocalContext [tree, localContext1, paintRecords] where localContext1 _ PutNewNamesInLocalContext [tree, localContext] let PutNewNamesInLocalContext [tree, localContext] _ PutNewNamesInLocalContext [DecList.tail, localContext1] where localContext1 _ PutNewNamesInLocalContext [DecList.head, localContext] let FillInLocalContext [tree, localContext, paintRecords] _ FillInLocalContext [DecList.tail, localContext1, paintRecords] where localContext1 _ FillInLocalContext [DecList.head, localContext, paintRecords] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ HangContextsFromContextTree [DecList.tail, contextTree1, rib, paintRecords] where contextTree1 _ HangContextsFromContextTree [DecList.head, contextTree, rib, paintRecords] ; for DecList.one: AbstractProduction [ Declaration ] let UpdateLocalContext [tree, localContext, paintRecords] _ FillInLocalContext [tree, localContext1, paintRecords] where localContext1 _ PutNewNamesInLocalContext [tree, localContext] let PutNewNamesInLocalContext[tree, localContext] _ PutNewNamesInLocalContext[Declaration, localContext] let FillInLocalContext[tree, localContext, paintRecords] _ FillInLocalContext[Declaration, localContext, paintRecords] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ HangContextsFromContextTree [Declaration, contextTree, rib, paintRecords] ; for Declaration.opaquetype: AbstractProduction [ IdentList, Access, OptSize ] let PutNewNamesInLocalContext[tree, localContext] _ PutNewNamesInLocalContext1[IdentList, localContext, GetAccessVal[Access]] let FillInLocalContext[tree, localContext, paintRecords] _ RecAddArcsfromLVTGNtoTGN [IdentList, localContext2, NullAccessVal [], tgn, NullDefaultVal []] where _ CreateOpaqueTGN [localContext1, paint, sizeExp] where _ GetUniquePaint [localContext] where sizeExp _ GetExpVal [OptSize] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree] ; for Declaration.type: AbstractProduction [ IdentList, Access.id, Access.type, TypeExp, Default ] let PutNewNamesInLocalContext[tree, localContext] _ PutNewNamesInLocalContext1[IdentList, localContext, GetAccessVal[Access.id]] let FillInLocalContext[tree, localContext, paintRecords] _ RecAddArcsfromLVTGNtoTGN [IdentList, localContext1, GetAccessVal[Access.type], tgn, defaultExp] where _ MakeType [TypeExp, localContext, paintRecords] where defaultExp _ GetDefaultExpVal [Default] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree] ; for Declaration.value: AbstractProduction [ IdentList, Access, Entry, ReadOnly, TypeExp, Initialization ] let PutNewNamesInLocalContext[tree, localContext] _ FakeDamageContext [localContext] let FillInLocalContext[tree, localContext, paintRecords] _ FakeDamageContext [localContext] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree] ; for OptSize.absent: AbstractProduction [ ] let GetExpVal [tree] _ NullExpPTree [] ; for OptSize.present: AbstractProduction [ Exp ] let GetExpVal [tree] _ ExpPTreeVal [Exp] ; for StatementList.empty: AbstractProduction [ ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree] ; for StatementList.more: AbstractProduction [ StatementList, Statement ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ HangContextsFromContextTree [Statement, contextTree1, rib, paintRecords] where contextTree1 _ HangContextsFromContextTree [StatementList, contextTree, rib, paintRecords] ; for Statement.ifthen: AbstractProduction [ Exp, Statement ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ HangContextsFromContextTree [Statement, contextTree, rib, paintRecords] ; for Statement.ifthenelse: AbstractProduction [ Exp, Statement.thenpart, Statement.elsepart ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ HangContextsFromContextTree [Statement.elsepart, contextTree1, rib, paintRecords] where contextTree1 _ HangContextsFromContextTree [Statement.thenpart, contextTree, rib, paintRecords] ; for Statement.select: AbstractProduction [ SelectHead, SelectStmtList, OptStatement ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree] ; for Statement.exp: AbstractProduction [ Exp ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree] ; for Statement.assign: AbstractProduction [ Exp.lhs, Exp.rhs ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree] ; for Statement.multiassign: AbstractProduction [ ExpList, Exp ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree] ; for Statement.block: AbstractProduction [ Checked, Block ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ HangContextsFromContextTree [Block, contextTree, rib, paintRecords] ; for Statement.loopcontrol: AbstractProduction [ ForClause, DoTest, Scope, DoExit ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree] ; for Statement.exit: AbstractProduction [ ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree] ; for Statement.loop: AbstractProduction [ ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree] ; for Statement.goto: AbstractProduction [ Id ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree] ; for Statement.return: AbstractProduction [ OptArgs ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree] ; for Statement.transfer: AbstractProduction [ Transfer, Exp ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree] ; for Statement.free: AbstractProduction [ Free, Exp, Catch ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree] ; for Statement.wait: AbstractProduction [ Exp ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree] ; for Statement.error: AbstractProduction [ ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree] ; for Statement.stop: AbstractProduction [ ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree] ; for Statement.null: AbstractProduction [ ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree] ; for Statement.resume: AbstractProduction [ OptArgs ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree] ; for Statement.reject: AbstractProduction [ ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree] ; for Statement.continue: AbstractProduction [ ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree] ; for Statement.retry: AbstractProduction [ ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree] ; for Statement.getstate: AbstractProduction [ Exp ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree] ; for Statement.setstate: AbstractProduction [ Exp ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ FakeDamageContextTree [contextTree] ; for Block: AbstractProduction [ Scope, ExitList ] let HangContextsFromContextTree [tree, contextTree, rib, paintRecords] _ AddSubContextTree[contextTree, subContextTree] where subContextTree _ MakeContextTree [Scope, rib, paintRecords] ; End. ¨SaffronMethods.ThreeC4 (July 16, 1987 4:02:51 pm PDT) Copyright Ó 1987 by Xerox Corporation. All rights reserved. Lucy Hederman August 20, 1987 3:49:01 pm PDT Sturgis, July 21, 1987 3:16:17 pm PDT need DoTop to take MakeType of the TypeExp Top ModuleP NOTE : This isn't really doing much.. Also ignoring Cedar, ProgHead, Checked NOTE : ignoring Cedar, DefHead Directory IncludeItem NOTE should check recorded module name against expected : Id NOTE should check recorded module name against expected : Id NOTE should check recorded module name against expected : Id NOTE should check recorded module name against expected : Id.global Using DefBody Make the contextTree for the entire DefBody, nesting the DecList inside the bindlist's context. Make the contextTree for the context nested within the BindList. (note: Freeze will "process" the type graph, looking for cycles etc.) TypeExp then Make up a Tag type by an enumeration of the VariantList types TypeApply TypeId OptType Subrange Interval Bounds PointerType OptInterval TransferMode Arguments Default Packed Monitored MachineDependent Ordered Base Safe ignoring safety default till we have flags. Uncounted ReadOnly RecList ParameterList VariantList VariantItem IdList entryTgn is NIL if the Id is for an entry point rather than a type. Until we know about entry points we can't handle this correctly verify that entryTgn is as intended Tag TagType TypeList TypeItem PairList PairItem Access IdentList Ident Position OptBits ElementList Element Exp Scope Look carefully at this. The syntax does not match the nesting semantics. Make the contextTree for the entire scope, nesting everything else inside the bindlist's context. Make the contextTree for the context nested within the BindList. (process statements here? this will probably require a nested context for newly constructed types, but they can never be circular) (note: Freeze will "process" the type graph, looking for cycles etc.) ignoring Catch in Scope BindList avoids making an unnecessary context tree node avoids making an unnecessary context tree node Semantically the scope creates a subcontext (contextTree2) of the Bindlist. Rib2 is the rib corresponding to the context of Bindlist. BindItem OptDecList DecList Declaration ignoring optsize ignoring value declarations OptSize StatementList Statement can exp change context tree ? can exp change context tree ? ignoring Checked on a block statement Block ignoring ExitList eof... Ê*˜codešœ5™5K™;K™,K™%—K™J˜8K™KšÏn+™+K™šœ˜headšÐnz™codetabšÐizœÏb œŸœ ˜/MšŸœF˜IMšŸœA˜DMšœ˜——šž™šŸ  œŸœ:˜^MšœL™LšŸœ9˜˜AMšœ˜—šŸ  œŸœ˜(MšŸœ?˜BMšœ˜—šŸ œŸœ˜/MšŸœB˜EMšœ˜—šŸ œŸœ˜-MšŸœD˜GMšœ˜—šŸ œŸœ˜6MšŸœH˜KMšœ˜——šž™šŸœ  œŸœ˜&MšŸœ˜"Mšœ˜—šŸœ  œŸœ˜%MšŸœ ˜#Mšœ˜——š¢ ™ šŸœ  œŸœ˜)MšŸœ˜"Mšœ˜—šŸœ  œŸœ˜(MšŸœ ˜#Mšœ˜——š¢™šŸœ œŸœ˜0MšŸœ˜"Mšœ˜—šŸœ œŸœ˜/MšŸœ ˜#Mšœ˜——šž™šŸœ  œŸœ˜'MšŸœ˜"Mšœ˜—šŸœ  œŸœ˜&MšŸœ ˜#Mšœ˜——šž™šŸœ œŸœ˜$MšŸœ˜"Mšœ˜—šŸœ œŸœ˜#MšŸœ ˜#Mšœ˜——šž™šŸœ œŸœ˜$MšŸœ˜"Mšœ˜—šŸœ œŸœ˜#MšŸœ ˜#Mšœ˜—šŸœ  œŸœ˜&MšŸœ ˜#Mšœ˜—M™+—šž ™ šŸœ  œŸœ˜)MšŸœ˜"Mšœ˜—šŸœ  œŸœ˜(MšŸœ ˜#Mšœ˜——šž™šŸœ  œŸœ˜(MšŸœ˜"Mšœ˜—šŸœ  œŸœ˜'MšŸœ ˜#Mšœ˜——K˜K˜—š œ˜$š¢™šŸœ  œŸœ˜*KšŸœq˜tK˜—šŸœ œŸœ ˜6šŸœN˜QKšŸœg˜lKšŸœ'˜,—K˜—šŸœ œŸœ ˜5šŸœN˜QKšŸœa˜fKšŸœ'˜,—K˜——šž ™ šŸ œŸœ˜/KšŸœq˜tMšœ˜—šŸ œŸœ˜-MšŸœn˜qMšœ˜—šŸ œŸœ ˜;šŸœN˜QKšŸœg˜lKšŸœ'˜,—Mšœ˜—šŸ œŸœ ˜;šŸœN˜QKšŸœa˜fKšŸœ'˜,—Mšœ˜——š¢ ™ šŸœ œŸœ˜7šŸœƒ˜†KšŸœ'˜,—KšŸœ”˜—šŸœ<˜?KšŸœO˜TKšŸœG˜L—KšŸœw˜zK˜—šŸ œŸœ˜EšŸœ˜„KšŸœl˜qKšŸœ'˜,—K˜šŸœ–˜™KšŸœj˜o—šŸœ<˜?KšŸœP˜UKšŸœP˜UKšŸœG˜L—šŸœx˜{KšŸœP˜U—KšŸ˜——šž ™ šŸœ œŸœ˜7šŸœ†˜‰KšŸœB˜GKšŸœR˜W—KšŸœr˜uKšœ˜——š¢™šŸœ  œŸœ˜)KšŸœT˜WKšŸœ|˜šŸœE˜HKšœN˜NKšŸœQ˜VK™CK™?KšŸœ=˜B—Kšœ˜—šŸœ  œŸœ˜2šŸœ[˜^Kšœ9˜9—šŸœs˜vKšŸœS˜X—šŸœE˜HKšœG˜GšŸœ˜KšœJ˜J—KšŸœQ˜VKšŸœ=˜BK™#—K˜——š¡™šŸœ  œŸœ˜KšŸœŸœ˜@—šŸ  œŸœ˜3KšŸœŸœ˜@—šŸ  œŸœ ˜CKšŸœŸœ˜@—šŸ œŸœ˜6KšŸœŸœ˜@—šŸ œŸœ˜7KšŸœŸœ˜@—šŸ œŸœ˜'KšŸœŸœ˜@—šŸ  œŸœ˜6KšŸœŸœ˜@—šŸ œŸœ)˜OKšŸœŸœ˜@—šŸ  œŸœ+˜MKšŸœŸœ˜@—šŸ  œŸœ˜7KšŸœŸœ˜@—šŸ œŸœ˜8KšŸœŸœ˜@—šŸ œŸœ˜'KšŸœŸœ˜@—šŸ  œŸœ ˜-KšŸœŸœ˜@—šŸ  œŸœ ˜+KšŸœŸœ˜@—šŸ  œŸœ ˜)KšŸœŸœ˜@—šŸ  œŸœ ˜)KšŸœŸœ˜@—šŸ  œŸœ˜:KšŸœŸœ˜@—šŸ  œŸœ˜5KšŸœŸœ˜@—šŸ  œŸœ˜@KšŸœŸœ˜@—šŸ œŸœ˜8KšŸœŸœ˜@—šŸ  œŸœ ˜/KšŸœŸœ˜@—šŸ  œŸœ˜KšŸœi˜lKšŸ˜—šŸœ œŸœ˜>KšŸœi˜lKšŸ˜—šŸœ œŸœ˜:KšŸœ‰˜ŒKšŸ˜Kšœ%™%—KšŸœ œŸœ%˜Ršœ˜KšŸœi˜lKšŸ˜—K˜šŸœ œŸœ˜*KšŸœi˜lKšŸ˜—šŸœ œŸœ˜*KšŸœi˜lKšŸ˜—šŸœ œŸœ˜-KšŸœi˜lKšŸ˜—šŸœ œŸœ ˜4KšŸœi˜lKšŸ˜—šŸœ œŸœ˜