úÎ!}¤rJŁ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘.Heterogeneous Lists for AAG, inspired on HList(c) Juan García Garland, 2018 LGPLjpgarcia@fing.edu.uy experimentalPOSIXNone&',-.1=>?@ACHUVX˘AspectAGa polykinded heteogeneous listAspectAGKHMember' is a test membership function. But looking up in a list of LabelsAspectAGsHMember is a test membership function. Since we are in Haskell the value level function computes with the evidence AspectAG-Heterogeneous lists are implemented as a GADTAspectAG(No other functionality is needed for AAG   22Safe&',-./1=>?@ACHSUVXghk'AspectAG˙Œsince now we implement ChAttsRec as a generic record, this allows us to recover pattern matching pattern EmptyCh :: ChAttsRec prd '[] pattern EmptyCh = EmptyRec pattern ConsCh :: (LabelSet ( '( 'Chi ch prd nt, v) ': xs)) => TaggedChAttr prd ( 'Chi ch prd nt) v -> ChAttsRec prd xs -> ChAttsRec prd ( '( 'Chi ch prd nt,v) ': xs) pattern ConsCh h t = ConsRec h tAttributions tagged by a childAspectAG index typeAspectAGoperations for the childrendatatype implementationAspectAG˙Pattern Synonyms pattern EmptyAtt :: Attribution '[] pattern EmptyAtt = EmptyRec pattern ConsAtt :: LabelSet ( '(att, val) ': atts) => Attribute att val -> Attribution atts -> Attribution ( '(att,val) ': atts) pattern ConsAtt att atts = ConsRec att atts AttributeAspectAG index typeAspectAGEAttribution | An attribution is a record constructed from attributesdatatype implementationAspectAG index type AspectAGRecordsdatatype definition/AspectAG%Apretty constructor for an attribute 0AspectAG Extending1AspectAGEmpty3AspectAG&Pretty constructor for tagging a child4AspectAGPretty constructors5AspectAGemptyŁAspectAGType level show utilities¤AspectAG field typeĽAspectAGtype level utilitiesŚAspectAG field type§AspectAGType level Show utilities¨AspectAG Field type# !"#$%&'()*+,-./012345678#)*'(%&#$!". -,/012+345678/40227344288+Main module, First-class attribute grammars1(c) Juan García-Garland, Marcos Viera, 2019, 2020GPLjpgarcia@fing.edu.uy experimentalPOSIXNone&',-.=>?@ACDHSUVXhkdŠAspectAGto copy at many childrenŞAspectAGuseŤAspectAG%combine a rule with an aspect (inner)ŹAspectAG'combine a rule with an aspect (wrapper);AspectAGAspects, tagged with context. @ is a record instance having productions as labels, containing A s as fields.>AspectAG?Rules with context (used to print domain specific type errors).AAspectAG‘Rules are a function from the input family to the output family, with an extra arity to make them composable. They are indexed by a production.­AspectAG!In each node of the grammar, the Faml contains a single attribution for the parent, and a collection (Record) of attributions for the children:ŽAspectAGgetterŻAspectAGgetter°AspectAGgetter (extracts a )EAspectAGœRecall that Aspects are mappings from productions to rules. They have a record-like interface to build them. This is the constructor for the empty Aspect.FAspectAGËcombination of two Aspects. It merges them. When both aspects have rules for a given production, in the resulting Aspect the rule at that field is the combination of the rules for the arguments (with P).GAspectAG(|traceAspect| adds context to an aspect.IAspectAGThe "cons" for ; s. It adds a A rule to a ;‰. If there is no rule for that production in the argument it is a record extension. If the production is there, the rules are combined.JAspectAGAn operator, alias for I<. It combines a rule with an aspect, to build a bigger one.KAspectAGUnicode version of I or J (\triangleleft)LAspectAG7The other way, combines an aspect with a rule. It is a ąped I.MAspectAGUnicode operator for L or `flip extAspect`.NAspectAG Operator for F. It takes two ;$s to build the combination of both.OAspectAGUnicode operator for F or N . (\bowtie)PAspectAGŹGiven two rules for a given (the same) production, it combines them. Note that the production equality is visible in the context, not sintactically. This is a use of the ˛ pattern.QAspectAG:Singleton Aspect. Wraps a rule to build an Aspect from it.RAspectAG The function RQ adds the definition of a synthesized attribute. It takes an attribute label attC representing the name of the new attribute; a production label °C representing the production where the rule is defined; a value t'y to be assigned to this attribute, given a context and an input family. It updates the output constructed thus far.SAspectAGAs R, the function SQ adds the definition of a synthesized attribute. It takes an attribute label attF representing the name of the new attribute; a production label °C representing the production where the rule is defined; a value t'˙h to be assigned to this attribute, given a context and an input family. It updates the output constructed thus far. This function captures the monadic behaviour of the family updating. For instance, the following definition specifies a rule for an attribute `att_size :: Label (Att "size" Int)` at the prduction `p_cons :: Label (Prd "cons" (NT Listv))`. The value is computed from the very same attribute value at a child `ch_tail :: Chi "tail" (Prd "cons" (NT List ) (Left NT))` ~foo = syndefM att_size p_cons $ do sizeatchi <- at ch_tail att_size return (sizeatchi + 1) TAspectAGThis is simply an alias for SUAspectAGThis is simply an alias for Y_AspectAG'Defines a rule to compute an attribute att in the production °+, by applying an operator to the values of att# in each non terminal in the list nts.aAspectAGa rule to copy one attribute att! from the parent to the children Žgł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍ !"#$%&'()*/0123489:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a<A>?@RSTVWUXYZ[CDPEQIFJKLMNO;<='(!"#$%&)*82/3401]:\B^GHa_9`J3K3L3M3N4O4Î6Boilerplate generation(c) Juan García GarlandGPLjpgarcia@fing.edu.uy experimentalPOSIXNone&',-.=>?@ACHSUVXkq |AspectAGclassƒAspectAG-makes a type level lit (Symbol) from a String„AspectAGMTH function to define a typed attribute label given a name and a quoted type…AspectAG/for completness, to have a name as the next one†AspectAG-TH function to define a polymorphic attribute‡AspectAG'multiple monomorphic attributes at onceˆAspectAGadd a non terminal symbolŒAspectAGonly prod symbolAspectAG ProductionsAspectAG keeps nt infožAspectAG1like |mkCon| in semantic functions, builds a case'|}€~‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘'ƒ„…†‡ˆ‰Š‚}€~‹ŒŽ|‘’“”•–—˜™š›œžŸ Ą˘Ď      !"#$%&''(()*+,--!$./0123456789:;;<==>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśľˇľ¸ľšľşľťľźľ˝ľžľżľŔľŔľÁľÂľĂľÄľĹľĆľĆľÇľÇľČľČÉĘËĚÍÎ'AspectAG-0.6.0.0-HGtyfrIc4oR6D8lFhlBZ5WLanguage.Grammars.AspectAG Language.Grammars.AspectAG.HList*Language.Grammars.AspectAG.RecordInstancesLanguage.Grammars.AspectAG.TH'poly-rec-0.6.0.0-6AXKCfH6piSLvg3vkE7KzvData.GenRec.LabelLabelKListKNilKConsHMember' HMemberRes'hMember'HMember HMemberReshMemberHListHNilHCons.:Îľ.:.eL $fHMembert: $fHMembert[] $fHMember'kt:$fHMember'kt[]AspectPrdReco TaggedChAttrChiReco ChAttsRec AttributeAttReco AttributionTaggedRecoRecordTNTChildChiProdPrdAtt prdFromChi=.*.emptyAtt#..=.*emptyChunTaggedChAttr labelChAttr.# emptyAspectCatCAspectmkAspectCRulemkRuleRulesem_Lit emptyRuleemptyRuleAtPrd emptyAspect comAspect traceAspect traceRule extAspect.+:◃.:+.▹.:+:⋈extsingAspsyndefsyndefMsyninhsynmodsynmodMinhdefinhdefMinhmodinhmodMlhster knitAspectuseemptyAspectForProds copyAtChi $fSemLita$fMapCtxAsp[]ctxctx'$fMapCtxAsp:ctxctx'$fRequireOpComRActx$fRequireOpComRA'ctx$fRequireOpComRA'ctx0$fRequireOpComRActx0$fRequireOpComAspctx$fRequireOpComAspctx0$fRequireOpComRA'ctx1$fAtTYPEAttLhsAttReaderT$fAtChildAttChiAttReaderT$fKn:prd $fKn[]prod $fEmpties:prd$fEmpties[]prd$fUseattprdntsa:$fUseprdattntsa[]$fUse'Trueattprdntsa:$fUse'Falseattprdntsa:$fUseattprdntsa:0 $fEmptyAspectSameShapek(,,,):es2$fEmptyAspectSameShapekm[]es2$fEmptyAspect::ctx$fEmptyAspect[][]ctx$fCopyAtChiListatt[][]ctxProdsSymTHTerNonTerPoly NonTerminalTerminalstr2SymattLabelattMonoattPoly attLabelsaddNont addNTLabel addNTTypeaddChiaddPrd addPrdLabel addPrdTypeaddProd getInstances showInstances addInstancetypeList nameToSymbolnameToSymbolBaseisNTNamecloseNT isInstanceOfmkConmkBangPmkBangPRgetTList getTListNTmkClausetoSemReccloseNTs mkSemFunc mkSemFuncsD:R:ShowRecRecoD:R:WrapFieldTYPETYPERecovD:R:ShowRecAttRecoD:R:WrapFieldTYPETYPEAttRecovD:R:ShowRecChiRecoD:R:WrapFieldTYPE[]ChiRecov CopyAtChiListUseOpComRA'OpComRAFamchiparprdbaseGHC.Baseflip+requirements-0.6.0.0-3GDe0CVDY4NL4LK4HT1zjmData.Type.RequireRequire Data.GenRec.*.lookupupdate# untagField.=. emptyGenRecRecEmptyRecConsRecTagField WrapFieldUnWrapCmpShowRec ShowFieldOpLookupOpUpdateOpExtend proxyToLabel labelFromTypefstLabelsndLabel.+.