uuagc 0.9.55 → 0.9.56
raw patch · 18 files changed
+509/−57 lines, 18 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- src-ag/InterfacesRules.lag +451/−0
- src-generated/AbstractSyntax.hs +1/−1
- src-generated/Code.hs +1/−1
- src-generated/CodeSyntax.hs +1/−1
- src-generated/ConcreteSyntax.hs +1/−1
- src-generated/DeclBlocks.hs +1/−1
- src-generated/ErrorMessages.hs +1/−1
- src-generated/ExecutionPlan.hs +1/−1
- src-generated/Expression.hs +1/−1
- src-generated/HsToken.hs +1/−1
- src-generated/Interfaces.hs +1/−1
- src-generated/LOAG/Rep.hs +1/−1
- src-generated/Macro.hs +1/−1
- src-generated/Patterns.hs +1/−1
- src-generated/PrintErrorMessages.hs +41/−41
- src-generated/VisagePatterns.hs +1/−1
- src-generated/VisageSyntax.hs +1/−1
- uuagc.cabal +2/−1
+ src-ag/InterfacesRules.lag view
@@ -0,0 +1,451 @@+\begin{Code}+PRAGMA strictdata+PRAGMA optimize+PRAGMA bangpats+PRAGMA strictwrap++INCLUDE "Interfaces.ag"++imports+{+import Interfaces+import CodeSyntax+import GrammarInfo++import qualified Data.Sequence as Seq+import Data.Sequence(Seq)+import qualified Data.Map as Map+import Data.Map(Map)+import Data.Tree(Tree(Node), Forest)+import Data.Graph(Graph, dfs, edges, buildG, transposeG)+import Data.Maybe (fromJust)+import Data.List (partition,transpose,(\\),nub,findIndex)+import Data.Array ((!),inRange,bounds,assocs)+import Data.Foldable(toList)+}+\end{Code}++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%+\section{Visit sub-sequence-graph}++Visit sub-sequences can be generated from the |Tdp| by a topological+sort. To that end we add vertices to |Tdp|. For each production, for+each child, for each visit to that child, we add a vertex $v$.++We add the following edges:++\begin{enumerate}++ \item From the inherited attributes passed to the visit to $v$,+ because these attributes need to be computed before visiting $v$.++ \item From the synthesized attributes computed by the visit to+ $v$, because a visit to $v$ computes these attributes.++ \item From the previous visit to $v$, because we can only visit+ $c$ for the $i$-th time if we have visited it the $(i-1)$-th time.++\end{enumerate}++Now we can define a visit sub-sequence as a list of vertices:++\begin{Code}+{+type VisitSS = [Vertex]+}+\end{Code}++We define a function that generates the visit-subsequences-graph and a+description of the newly added vertices. We do this using an attribute+grammar. The visit subsequences graph has transposed edges, so we can+use |topSort'|.++\begin{Code}+ATTR IRoot [ tdp : Graph | | ]+SEM IRoot+ | IRoot loc.newedges = toList @inters.newedges+ loc.visitssGraph = let graph = buildG (0,@inters.v-1) es+ es = @newedges ++ edges @lhs.tdp+ in transposeG graph+\end{Code}++As we will need to look up information, we pass |info| down. An+attribute v stores a fresh vertex. We start counting from the hightest+vertex in |tdp|.++\begin{Code}+ATTR Interfaces Interface Segments Segment [ | v : Vertex | ]+ATTR IRoot Interfaces Interface Segments Segment [ info : Info | | ]+SEM IRoot+ | IRoot inters.v = snd (bounds @lhs.tdp) + 1+\end{Code}++The actual generation of edges takes place in |Segment|. We group the+attribute occurrences. |isEqualField| checks are at the same position+(either lhs of the same child).++\begin{Code}+{+gather :: Info -> [Vertex] -> [[Vertex]]+gather info = eqClasses comp+ where comp a b = isEqualField (ruleTable info ! a) (ruleTable info ! b)+}+\end{Code}++When we do this for right-hand side occurrences of the inherited and+syntesized attributes of a |Segment|, we find the new vertices.++\begin{Code}+SEM Segment+ | Segment loc.look : {Vertex -> CRule}+ loc.look = \a -> ruleTable @lhs.info ! a++ loc.occurAs : {(CRule -> Bool) -> [Vertex] -> [Vertex]}+ loc.occurAs = \p us -> [ a | u <- us+ , a <- tdsToTdp @lhs.info ! u+ , p (@look a)]+ loc.groups : {[([Vertex],[Vertex])]}+ loc.groups = let group as = gather @lhs.info (@occurAs isRhs as)+ in map (partition (isInh . @look)) (group (@inh ++ @syn))+ loc.v : {Int}+ loc.v = @lhs.v + length @groups+ loc.newvertices = [@lhs.v .. @loc.v-1]+\end{Code}++A description of the new vertices van be found by looking up the field+of an attribute occurrence++\begin{Code}+ATTR Interfaces Interface Segments Segment+ [ visitDescr : {Map Vertex ChildVisit} | | ]+SEM IRoot+ | IRoot inters.visitDescr = Map.fromList @descr+ATTR Interfaces Interface Segments Segment+ [ | | newedges USE {Seq.><} {Seq.empty} : {Seq Edge }+ descr USE {Seq.><} {Seq.empty} : {Seq (Vertex,ChildVisit)} ]+SEM Segment+ | Segment lhs.descr = Seq.fromList $ zipWith (cv @look @lhs.n) @newvertices @groups {-$-}++{+-- Only non-empty syn will ever be forced, because visits with empty syn are never performed+-- Right hand side synthesized attributes always have a field+cv :: (Vertex -> CRule) -> Int -> Vertex -> ([Vertex],[Vertex]) -> (Vertex,ChildVisit)+cv look n v (inh,syn) = let fld = getField (look (head syn))+ rnt = fromJust (getRhsNt (look (head syn)))+ d = ChildVisit fld rnt n inh syn+ in (v,d)+}+\end{Code}++\begin{Code}+SEM IRoot+ | IRoot loc.descr = toList @inters.descr+\end{Code}++The edges between attributes occurrences and their corresponding+visits can be found as follows:++\begin{Code}+SEM Segment+ | Segment loc.attredges = concat (zipWith ed @newvertices @groups)++{+ed :: Vertex -> ([Vertex], [Vertex]) -> [(Vertex, Vertex)]+ed v (inh,syn) = map (\i -> (i,v)) inh ++ map (\s -> (v,s)) syn+}+\end{Code}++For edges between visits we simpy |zip| the current vertices with the+next ones.++\begin{Code}+ATTR Segment [ nextNewvertices : {[Vertex]} | | newvertices : {[Vertex]} ]+ATTR Segments [ | | newvertices : {[Vertex]} ]+SEM Segments+ | Cons hd.nextNewvertices = @tl.newvertices+ lhs.newvertices = @hd.newvertices+ | Nil lhs.newvertices = []++SEM Segment+ | Segment loc.visitedges = zip @newvertices @lhs.nextNewvertices+ lhs.newedges = Seq.fromList @attredges Seq.>< Seq.fromList @visitedges+\end{Code}++The first visit to a child is passed to the first visit of the parent,+so we add edges for this, too.++\begin{Code}+ATTR Segments Segment [ | | groups : {[([Vertex],[Vertex])]} ]+SEM Segments+ | Cons lhs.groups = @hd.groups+ | Nil lhs.groups = []+SEM Interface+ | Interface seg.v = @lhs.v+ loc.v = @seg.v + length @seg.newvertices+ lhs.v = @loc.v+ loc.firstvisitvertices = [@seg.v .. @v-1]+ loc.newedges = zip @firstvisitvertices @seg.newvertices+ lhs.newedges = @seg.newedges Seq.>< Seq.fromList @newedges++ loc.look : {Vertex -> CRule}+ loc.look = \a -> ruleTable @lhs.info ! a+ loc.descr = zipWith (cv @look (-1)) @firstvisitvertices @seg.groups+ lhs.descr = @seg.descr Seq.>< Seq.fromList @descr+\end{Code}++The visit number can simply be counted++\begin{Code}+ATTR Segments Segment [ n : Int | | ]+SEM Interface+ | Interface seg.n = 0+SEM Segments+ | Cons tl.n = @lhs.n + 1+\end{Code}++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%+\subsection{Visit sub-sequences}++To compute the visit subsequences, we pass the visit-subsequence graph down++\begin{Code}+ATTR Interfaces Interface Segments Segment [ vssGraph : Graph | | ]+SEM IRoot+ | IRoot inters.vssGraph = @visitssGraph+\end{Code}++Each segment computes subsequences for each production of the+nonterminal. We group the occurrences of the synthesized attributes,+and perform a topological sort on it. In the absence of synthesized+attributes, nothing needs to be computed, so the visit subsequence+is empty.++\begin{Code}+SEM Segment+ | Segment loc.synOccur = gather @lhs.info (@occurAs isLhs @syn)+ loc.vss = let hasCode' v | inRange (bounds (ruleTable @lhs.info)) v = getHasCode (ruleTable @lhs.info ! v)+ | otherwise = True+ in if null @syn+ then replicate (length @lhs.cons) []+ else map (filter hasCode' . topSort' @lhs.vssGraph) @synOccur+ATTR Segments Segment [ cons : {[ConstructorIdent]} | | ]+SEM Interface+ | Interface seg.cons = @cons+\end{Code}++We adapt the topological sort to take a list of vertices to start+sorting.++\begin{Code}+{+postorder :: Tree a -> [a]+postorder (Node a ts) = postorderF ts ++ [a]+postorderF :: Forest a -> [a]+postorderF = concatMap postorder+postOrd :: Graph -> [Vertex] -> [Vertex]+postOrd g = postorderF . dfs g+topSort' :: Graph -> [Vertex] -> [Vertex]+topSort' g = postOrd g+}+\end{Code}++This gives us the subsequence required to compute the synthesized+attributes. However, a part of this subsequence has already been+computed in previous visits. We thread this part through. It starts+with all first visits to children.++\begin{Code}+ATTR Interfaces Interface [ prev : {[Vertex]} | | firstvisitvertices USE {++} {[]} : {[Vertex]} ]+SEM IRoot+ | IRoot inters.prev = let terminals = [ v | (v,cr) <- assocs (ruleTable @lhs.info), not (getHasCode cr), isLocal cr ]+ in @inters.firstvisitvertices ++ terminals++ATTR Segments Segment [ | prev : {[Vertex]} | ]+\end{Code}++and we remove this part from the subsequence++\begin{Code}+SEM Segment [ | | visitss : {[VisitSS]} ]+ | Segment loc.visitss' = map (\\ @lhs.prev) @vss+ loc.defined = let defines v = case Map.lookup v @lhs.visitDescr of+ Nothing -> [v]+ Just (ChildVisit _ _ _ inh _) -> v:inh+ in concatMap (concatMap defines) @visitss+ lhs.prev = @lhs.prev ++ @defined+\end{Code}++When more that one attribute is defined in the same rule, this rule is+repeated in the visit subsequence. We do not want this.++\begin{Code}+SEM Segment+ | Segment loc.visitss : {[[Vertex]]}+ loc.visitss = let rem' :: [(Identifier,Identifier,Maybe Type)] -> [Vertex] -> [Vertex]+ rem' _ [] = []+ rem' prev (v:vs)+ | inRange (bounds table) v+ = let cr = table ! v+ addV = case findIndex cmp prev of+ Just _ -> id+ _ -> (v:)+ cmp (fld,attr,tp) = getField cr == fld && getAttr cr == attr && sameNT (getType cr) tp+ sameNT (Just (NT ntA _ _)) (Just (NT ntB _ _)) = ntA == ntB+ sameNT _ _ = False+ def = Map.elems (getDefines cr)+ in addV (rem' (def ++ prev) vs)+ | otherwise = v:rem' prev vs+ table = ruleTable @lhs.info+ in map (rem' []) @visitss'+\end{Code}++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%+\subsection{Intra-visit dependencies}++We ignore terminals, they need to be passed from the first visit up to+where they are needed. Intra-visit dependencies descibe what a visit+needs from its previous visits. The first visit does not have+intra-visit dependencies, because there are no previous visits. We add+an attribute that indicates whether it's the first visit.++\begin{Code}+ATTR Segment Segments [ isFirst : {Bool} | | ]+SEM Interface+ | Interface seg.isFirst = True+SEM Segments+ | Cons tl.isFirst = False+\end{Code}++We declare an attribute intravisit which gives the intra-visit+dependencies. We pass the intravisit of the next visit to this+one.+\begin{Code}+{+type IntraVisit = [Vertex]+}++ATTR Segment [ nextIntravisits : {[IntraVisit]} | | intravisits : {[IntraVisit]} ]+SEM Segments [ | | hdIntravisits : {[IntraVisit]} ]+ | Cons hd.nextIntravisits = @tl.hdIntravisits+ lhs.hdIntravisits = @hd.intravisits+ | Nil lhs.hdIntravisits = repeat []+\end{Code}++The first visit does not have intra-visit dependencies. A later visit+need all attributes that it's subsequence depends on, and the+intra-visit dependecies of the next visit, except for those attributes+that are compted in this visit.++\begin{Code}+ATTR IRoot [ dpr : {[Edge]} | | ]+ATTR Interfaces Interface Segments Segment [ ddp : Graph | | ]+SEM IRoot+ | IRoot inters.ddp = buildG (0,@inters.v-1) (map swap (@lhs.dpr ++ @newedges))++{+swap :: (a,b) -> (b,a)+swap (a,b) = (b,a)+}++ATTR Segments Segment [ fromLhs : {[Vertex]} | | ]+SEM Interface+ | Interface seg.fromLhs = @lhs.prev+SEM Segments+ | Cons hd.fromLhs = @lhs.fromLhs+ tl.fromLhs = []+SEM Segment+ | Segment loc.fromLhs = @occurAs isLhs @inh ++ @lhs.fromLhs+ loc.computed = let computes v = case Map.lookup v @lhs.visitDescr of+ Nothing -> Map.keys (getDefines (ruleTable @lhs.info ! v))+ Just (ChildVisit _ _ _ _ syn) -> v:syn+ in concatMap (concatMap computes) @visitss+ loc.intravisits = zipWith @iv @visitss @lhs.nextIntravisits+ loc.iv = \vs next ->+ let needed = concatMap (@lhs.ddp !) vs+ in nub (needed ++ next) \\ (@fromLhs ++ @computed)+\end{Code}++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%+\subsection{Result}++Our resulting datastructure is:++Now we pass the visit sub-sequences up. In |Interface|, |@seg.visitss|+gives us for each segment, for each production a subsequence. What we+want is for each production, for each visit a subsequence, which is+accomplished by |transpose|. The same is done for intravisits.++\begin{Code}+ATTR Interfaces Interface Segments Segment [ allInters : {CInterfaceMap} | | ]+SEM IRoot+ | IRoot inters.allInters = @inters.inters++ATTR IRoot Interfaces [ | | inters : {CInterfaceMap}+ visits : {CVisitsMap} ]+SEM Interfaces+ | Cons lhs.inters = Map.insert @hd.nt @hd.inter @tl.inters+ lhs.visits = Map.insert @hd.nt @hd.visits @tl.visits+ | Nil lhs.inters = Map.empty+ lhs.visits = Map.empty++SEM Interface [ | | nt : NontermIdent ]+ | Interface lhs.nt = @nt++SEM Interface [ | | inter : CInterface+ visits : {Map ConstructorIdent CVisits} ]+ | Interface lhs.inter = CInterface @seg.segs+ lhs.visits = Map.fromList (zip @cons (transpose @seg.cvisits))++SEM Segments [ | | segs : CSegments+ cvisits USE {:} {[]} : {[[CVisit]]} ] -- For each visit, for each constructor the CVisit+ | Cons lhs.segs = @hd.seg : @tl.segs+ | Nil lhs.segs = []++SEM Segment [ | | seg : CSegment+ cvisits : {[CVisit]} ] -- For this visit, for each constructor the CVisit+ | Segment lhs.seg = -- A fake dependency fixes a type-3 cycle+ if False then undefined @lhs.vssGraph @lhs.visitDescr @lhs.prev else CSegment @inhmap @synmap+ loc.inhmap : {Map Identifier Type}+ loc.synmap : {Map Identifier Type}+ loc.(inhmap,synmap) = let makemap = Map.fromList . map findType+ findType v = getNtaNameType (attrTable @lhs.info ! v)+ in (makemap @inh,makemap @syn)+ lhs.cvisits = let mkVisit vss intra = CVisit @inhmap @synmap (mkSequence vss) (mkSequence intra) True+ mkSequence = map mkRule+ mkRule v = case Map.lookup v @lhs.visitDescr of+ Nothing -> ruleTable @lhs.info ! v+ Just (ChildVisit name nt n _ _) -> ccv name nt n @lhs.allInters+ in zipWith mkVisit @visitss @intravisits++{+ccv :: Identifier -> NontermIdent -> Int -> CInterfaceMap -> CRule+ccv name nt n table+ = CChildVisit name nt n inh syn lst+ where CInterface segs = Map.findWithDefault (error ("InterfacesRules::ccv::interfaces not in table for nt: " ++ show nt)) nt table+ (seg:remain) = drop n segs+ CSegment inh syn = seg+ lst = null remain+}+\end{Code}++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%+\subsection{EDP}++To find a type-3 cycle we need to know the dependencies that the+interfaces generate.++\begin{Code}+ATTR Interfaces Interface Segments Segment [ | | edp USE {Seq.><} {Seq.empty} : {Seq Edge} ]+SEM Segment+ | Segment lhs.edp = Seq.fromList [(i,s) | i <- @inh, s <- @syn]+ Seq.>< Seq.fromList [(s,i) | s <- @syn, i <- @lhs.nextInh ]+SEM IRoot [ | | edp : {[Edge]} ]+ | IRoot lhs.edp = toList @inters.edp+SEM Segment [ nextInh : {[Vertex]} | | inh : {[Vertex]} ]+ | Segment lhs.inh = @inh+SEM Segments [ | | firstInh : {[Vertex]} ]+ | Cons hd.nextInh = @tl.firstInh+ lhs.firstInh = @hd.inh+ | Nil lhs.firstInh = []+\end{Code}+
src-generated/AbstractSyntax.hs view
@@ -1,6 +1,6 @@ --- UUAGC 0.9.53 (src-ag/AbstractSyntax.ag)+-- UUAGC 0.9.56 (src-ag/AbstractSyntax.ag) module AbstractSyntax where {-# LINE 2 "src-ag/AbstractSyntax.ag" #-}
src-generated/Code.hs view
@@ -1,6 +1,6 @@ --- UUAGC 0.9.53 (src-ag/Code.ag)+-- UUAGC 0.9.56 (src-ag/Code.ag) module Code where {-# LINE 2 "src-ag/Code.ag" #-}
src-generated/CodeSyntax.hs view
@@ -1,6 +1,6 @@ --- UUAGC 0.9.53 (src-ag/CodeSyntax.ag)+-- UUAGC 0.9.56 (src-ag/CodeSyntax.ag) module CodeSyntax where {-# LINE 2 "src-ag/CodeSyntax.ag" #-}
src-generated/ConcreteSyntax.hs view
@@ -1,6 +1,6 @@ --- UUAGC 0.9.53 (src-ag/ConcreteSyntax.ag)+-- UUAGC 0.9.56 (src-ag/ConcreteSyntax.ag) module ConcreteSyntax where {-# LINE 2 "src-ag/ConcreteSyntax.ag" #-}
src-generated/DeclBlocks.hs view
@@ -1,6 +1,6 @@ --- UUAGC 0.9.53 (src-ag/DeclBlocks.ag)+-- UUAGC 0.9.56 (src-ag/DeclBlocks.ag) module DeclBlocks where {-# LINE 2 "src-ag/DeclBlocks.ag" #-}
src-generated/ErrorMessages.hs view
@@ -1,6 +1,6 @@ --- UUAGC 0.9.53 (src-ag/ErrorMessages.ag)+-- UUAGC 0.9.56 (src-ag/ErrorMessages.ag) module ErrorMessages where {-# LINE 2 "src-ag/ErrorMessages.ag" #-}
src-generated/ExecutionPlan.hs view
@@ -1,6 +1,6 @@ --- UUAGC 0.9.53 (src-ag/ExecutionPlan.ag)+-- UUAGC 0.9.56 (src-ag/ExecutionPlan.ag) module ExecutionPlan where {-# LINE 2 "src-ag/ExecutionPlan.ag" #-}
src-generated/Expression.hs view
@@ -1,6 +1,6 @@ --- UUAGC 0.9.53 (src-ag/Expression.ag)+-- UUAGC 0.9.56 (src-ag/Expression.ag) module Expression where {-# LINE 2 "src-ag/Expression.ag" #-}
src-generated/HsToken.hs view
@@ -1,6 +1,6 @@ --- UUAGC 0.9.53 (src-ag/HsToken.ag)+-- UUAGC 0.9.56 (src-ag/HsToken.ag) module HsToken where {-# LINE 2 "src-ag/HsToken.ag" #-}
src-generated/Interfaces.hs view
@@ -1,6 +1,6 @@ --- UUAGC 0.9.53 (src-ag/Interfaces.ag)+-- UUAGC 0.9.56 (src-ag/Interfaces.ag) module Interfaces where {-# LINE 2 "src-ag/Interfaces.ag" #-}
src-generated/LOAG/Rep.hs view
@@ -1,6 +1,6 @@ --- UUAGC 0.9.53 (src-ag/LOAG/Rep.ag)+-- UUAGC 0.9.56 (src-ag/LOAG/Rep.ag) module LOAG.Rep where import CommonTypes
src-generated/Macro.hs view
@@ -1,6 +1,6 @@ --- UUAGC 0.9.53 (src-ag/Macro.ag)+-- UUAGC 0.9.56 (src-ag/Macro.ag) module Macro where {-# LINE 4 "src-ag/Macro.ag" #-}
src-generated/Patterns.hs view
@@ -1,6 +1,6 @@ --- UUAGC 0.9.53 (src-ag/Patterns.ag)+-- UUAGC 0.9.56 (src-ag/Patterns.ag) module Patterns where {-# LINE 2 "src-ag/Patterns.ag" #-}
src-generated/PrintErrorMessages.hs view
@@ -260,7 +260,7 @@ help = text "" act = text action_ in ppError (isError _lhsIoptions _me) pos_ mesg pat help act _lhsIverbose- {-# LINE 264 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 264 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule1 #-} rule1 = \ action_ pos_ problem_ -> ParserError pos_ problem_ action_@@ -287,7 +287,7 @@ rule3 = \ ((_lhsIverbose) :: Bool) msg_ pos_ -> {-# LINE 84 "src-ag/PrintErrorMessages.ag" #-} ppError True pos_ (text msg_) (text "") (text "") (text "Correct the syntax of the Haskell code.") _lhsIverbose- {-# LINE 291 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 291 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule4 #-} rule4 = \ msg_ pos_ -> HsParseError pos_ msg_@@ -331,7 +331,7 @@ ,"is considered valid. All other alternatives have been discarded." ] in ppError (isError _lhsIoptions _me) (getPos con_) mesg pat help act _lhsIverbose- {-# LINE 335 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 335 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule7 #-} rule7 = \ con_ nt_ occ1_ -> DupAlt nt_ con_ occ1_@@ -373,7 +373,7 @@ act = wfill [ "The clashing type synonym will be ignored." ] in ppError (isError _lhsIoptions _me) (getPos nt_) mesg pat help act _lhsIverbose- {-# LINE 377 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 377 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule10 #-} rule10 = \ nt_ occ1_ -> DupSynonym nt_ occ1_@@ -414,7 +414,7 @@ act = wfill [ "The clashing nonterminal set will be ignored." ] in ppError (isError _lhsIoptions _me) (getPos name_) mesg pat help act _lhsIverbose- {-# LINE 418 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 418 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule13 #-} rule13 = \ name_ occ1_ -> DupSet name_ occ1_@@ -456,7 +456,7 @@ ,"All others have been discarded. The generated program will probably not run." ] in ppError (isError _lhsIoptions _me) (getPos attr_) mesg pat help act _lhsIverbose- {-# LINE 460 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 460 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule16 #-} rule16 = \ attr_ nt_ occ1_ -> DupInhAttr nt_ attr_ occ1_@@ -498,7 +498,7 @@ ,"All others have been discarded. The generated program will probably not run." ] in ppError (isError _lhsIoptions _me) (getPos attr_) mesg pat help act _lhsIverbose- {-# LINE 502 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 502 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule19 #-} rule19 = \ attr_ nt_ occ1_ -> DupSynAttr nt_ attr_ occ1_@@ -541,7 +541,7 @@ ,"All others have been discarded." ] in ppError (isError _lhsIoptions _me) (getPos name_) mesg pat help act _lhsIverbose- {-# LINE 545 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 545 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule22 #-} rule22 = \ con_ name_ nt_ occ1_ -> DupChild nt_ con_ name_ occ1_@@ -582,7 +582,7 @@ ] act = wfill ["The last rule given is considered valid. All others have been discarded."] in ppError (isError _lhsIoptions _me) (getPos attr_) mesg pat help act _lhsIverbose- {-# LINE 586 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 586 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule25 #-} rule25 = \ attr_ con_ field_ nt_ occ1_ -> DupRule nt_ con_ field_ attr_ occ1_@@ -620,7 +620,7 @@ ] act = wfill ["Compilation cannot continue."] in ppError (isError _lhsIoptions _me) (getPos nm_) mesg pat help act _lhsIverbose- {-# LINE 624 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 624 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule28 #-} rule28 = \ con_ nm_ nt_ -> DupRuleName nt_ con_ nm_@@ -660,7 +660,7 @@ ] act = wfill ["The last typesignature given is considered valid. All others have been discarded."] in ppError (isError _lhsIoptions _me) (getPos attr_) mesg pat help act _lhsIverbose- {-# LINE 664 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 664 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule31 #-} rule31 = \ attr_ con_ nt_ -> DupSig nt_ con_ attr_@@ -694,7 +694,7 @@ ] act = wfill ["Everything regarding the unknown nonterminal has been ignored."] in ppError (isError _lhsIoptions _me) (getPos nt_) mesg pat help act _lhsIverbose- {-# LINE 698 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 698 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule34 #-} rule34 = \ nt_ -> UndefNont nt_@@ -730,7 +730,7 @@ ] act = wfill ["All rules for the unknown alternative have been ignored."] in ppError (isError _lhsIoptions _me) (getPos con_) mesg pat help act _lhsIverbose- {-# LINE 734 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 734 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule37 #-} rule37 = \ con_ nt_ -> UndefAlt nt_ con_@@ -769,7 +769,7 @@ ] act = wfill ["All rules for the unknown field have been ignored."] in ppError (isError _lhsIoptions _me) (getPos name_) mesg pat help act _lhsIverbose- {-# LINE 773 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 773 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule40 #-} rule40 = \ con_ name_ nt_ -> UndefChild nt_ con_ name_@@ -806,7 +806,7 @@ ] act = wfill ["The value of the attribute has been set to undefined."] in ppError (isError _lhsIoptions _me) (getPos attr_) mesg pat help act _lhsIverbose- {-# LINE 810 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 810 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule43 #-} rule43 = \ attr_ con_ field_ nt_ -> MissingRule nt_ con_ field_ attr_@@ -842,7 +842,7 @@ ] act = wfill ["Compilation cannot continue."] in ppError (isError _lhsIoptions _me) (getPos name_) mesg pat help act _lhsIverbose- {-# LINE 846 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 846 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule46 #-} rule46 = \ con_ name_ nt_ -> MissingNamedRule nt_ con_ name_@@ -879,7 +879,7 @@ ] act = wfill ["The rule has been ignored."] in ppError (isError _lhsIoptions _me) (getPos attr_) mesg pat help act _lhsIverbose- {-# LINE 883 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 883 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule49 #-} rule49 = \ attr_ con_ field_ nt_ -> SuperfluousRule nt_ con_ field_ attr_@@ -918,7 +918,7 @@ ] act = wfill ["The generated program will not run."] in ppError (isError _lhsIoptions _me) (getPos var_) mesg pat help act _lhsIverbose- {-# LINE 922 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 922 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule52 #-} rule52 = \ con_ nt_ var_ -> UndefLocal nt_ con_ var_@@ -956,7 +956,7 @@ ] act = wfill ["The generated program probably contains a type error or has undefined variables."] in ppError (isError _lhsIoptions _me) (getPos var_) mesg pat help act _lhsIverbose- {-# LINE 960 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 960 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule55 #-} rule55 = \ con_ nt_ var_ -> ChildAsLocal nt_ con_ var_@@ -999,7 +999,7 @@ ] act = wfill ["The generated program will not run."] in ppError (isError _lhsIoptions _me) (getPos attr_) mesg pat help act _lhsIverbose- {-# LINE 1003 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 1003 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule58 #-} rule58 = \ attr_ con_ field_ isOut_ nt_ -> UndefAttr nt_ con_ field_ attr_ isOut_@@ -1039,7 +1039,7 @@ help = hlist (text "The following attributes are all cyclic: " : map text verts_) act = wfill ["code cannot be generated until the cycle is removed."] in ppError (isError _lhsIoptions _me) pos mesg pat help act False- {-# LINE 1043 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 1043 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule61 #-} rule61 = \ mbCon_ nt_ verts_ -> Cyclic nt_ mbCon_ verts_@@ -1073,7 +1073,7 @@ ] act = wfill ["The nonterminal set", getName name_, "is considered to be empty."] in ppError (isError _lhsIoptions _me) (getPos name_) mesg pat help act _lhsIverbose- {-# LINE 1077 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 1077 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule64 #-} rule64 = \ name_ -> CyclicSet name_@@ -1103,7 +1103,7 @@ help = wfill ["not available."] act = wfill ["unknown"] in ppError (isError _lhsIoptions _me) pos_ mesg_ pat help act False- {-# LINE 1107 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 1107 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule67 #-} rule67 = \ isWarning_ mesg_ pos_ -> CustomError isWarning_ pos_ mesg_@@ -1140,7 +1140,7 @@ act | o_visit_ = text "An unoptimized version was generated. It might hang when run." | otherwise = text "The generated program might hang when run." in ppError (isError _lhsIoptions _me) (getPos (attr_)) mesg pat help act _lhsIverbose- {-# LINE 1144 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 1144 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule70 #-} rule70 = \ attr_ con_ nt_ o_visit_ path_ -> LocalCirc nt_ con_ attr_ o_visit_ path_@@ -1177,7 +1177,7 @@ act | o_visit_ = text "An unoptimized version was generated. It might hang when run." | otherwise = text "The generated program might hang when run." in ppError (isError _lhsIoptions _me) (getPos (attr_)) mesg pat help act _lhsIverbose- {-# LINE 1181 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 1181 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule73 #-} rule73 = \ attr_ con_ nt_ o_visit_ path_ -> InstCirc nt_ con_ attr_ o_visit_ path_@@ -1210,7 +1210,7 @@ act | o_visit_ = text "An unoptimized version was generated. It might hang when run." | otherwise = text "The generated program might hang when run." in ppError (isError _lhsIoptions _me) noPos mesg pat help act _lhsIverbose- {-# LINE 1214 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 1214 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule76 #-} rule76 = \ cyclic_ nt_ o_visit_ -> DirectCirc nt_ o_visit_ cyclic_@@ -1244,7 +1244,7 @@ >-< vlist (map showEdgeLong cyclic_) act = text "An unoptimized version was generated. It might hang when run." in ppError (isError _lhsIoptions _me) noPos mesg pat help act _lhsIverbose- {-# LINE 1248 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 1248 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule79 #-} rule79 = \ cinter_ cyclic_ nt_ -> InducedCirc nt_ cinter_ cyclic_@@ -1283,7 +1283,7 @@ ] act = wfill ["The type signatures of semantic functions are not generated."] in ppError (isError _lhsIoptions _me) (getPos attr_) mesg pat help act _lhsIverbose- {-# LINE 1287 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 1287 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule82 #-} rule82 = \ attr_ con_ nt_ -> MissingTypeSig nt_ con_ attr_@@ -1322,7 +1322,7 @@ ] act = wfill ["It is not possible to proceed without this signature."] in ppError (isError _lhsIoptions _me) (getPos attr_) mesg pat help act _lhsIverbose- {-# LINE 1326 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 1326 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule85 #-} rule85 = \ attr_ con_ nt_ -> MissingInstSig nt_ con_ attr_@@ -1362,7 +1362,7 @@ ] act = wfill ["Unpredicatable sharing of unique numbers may occur."] in ppError (isError _lhsIoptions _me) (getPos attr_) mesg pat help act _lhsIverbose- {-# LINE 1366 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 1366 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule88 #-} rule88 = \ attr_ con_ nt_ -> DupUnique nt_ con_ attr_@@ -1402,7 +1402,7 @@ ] act = wfill ["It is not possible to proceed without this declaration."] in ppError (isError _lhsIoptions _me) (getPos attr_) mesg pat help act _lhsIverbose- {-# LINE 1406 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 1406 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule91 #-} rule91 = \ attr_ nt_ -> MissingUnique nt_ attr_@@ -1442,7 +1442,7 @@ ] act = wfill ["It is not possible to proceed without this declaration."] in ppError (isError _lhsIoptions _me) (getPos attr_) mesg pat help act _lhsIverbose- {-# LINE 1446 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 1446 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule94 #-} rule94 = \ attr_ nt_ -> MissingSyn nt_ attr_@@ -1473,7 +1473,7 @@ help = empty act = text "It is not possible to proceed without fixing this kind error." in ppError (isError _lhsIoptions _me) (getPos child_) mesg pat help act _lhsIverbose- {-# LINE 1477 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 1477 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule97 #-} rule97 = \ child_ from_ to_ vis_ -> IncompatibleVisitKind child_ vis_ from_ to_@@ -1504,7 +1504,7 @@ help = empty act = text "It is not possible to proceed without fixing this kind error." in ppError (isError _lhsIoptions _me) (getPos rule_) mesg pat help act _lhsIverbose- {-# LINE 1508 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 1508 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule100 #-} rule100 = \ kind_ rule_ -> IncompatibleRuleKind rule_ kind_@@ -1535,7 +1535,7 @@ help = empty act = text "It is not possible to proceed without fixing this kind error." in ppError (isError _lhsIoptions _me) (getPos child_) mesg pat help act _lhsIverbose- {-# LINE 1539 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 1539 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule103 #-} rule103 = \ child_ kind_ -> IncompatibleAttachKind child_ kind_@@ -1600,13 +1600,13 @@ rule105 = \ ((_lhsIoptions) :: Options) -> {-# LINE 67 "src-ag/PrintErrorMessages.ag" #-} verbose _lhsIoptions- {-# LINE 1604 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 1604 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule106 #-} {-# LINE 68 "src-ag/PrintErrorMessages.ag" #-} rule106 = \ ((_hdIpp) :: PP_Doc) -> {-# LINE 68 "src-ag/PrintErrorMessages.ag" #-} disp _hdIpp 5000 ""- {-# LINE 1610 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 1610 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule107 #-} {-# LINE 70 "src-ag/PrintErrorMessages.ag" #-} rule107 = \ ((_hdIpp) :: PP_Doc) ((_lhsIdups) :: [String]) _str ((_tlIpp) :: PP_Doc) ->@@ -1614,13 +1614,13 @@ if _str `elem` _lhsIdups then _tlIpp else _hdIpp >-< _tlIpp- {-# LINE 1618 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 1618 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule108 #-} {-# LINE 73 "src-ag/PrintErrorMessages.ag" #-} rule108 = \ ((_lhsIdups) :: [String]) _str -> {-# LINE 73 "src-ag/PrintErrorMessages.ag" #-} _str : _lhsIdups- {-# LINE 1624 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 1624 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule109 #-} rule109 = \ ((_lhsIoptions) :: Options) -> _lhsIoptions@@ -1648,10 +1648,10 @@ rule112 = \ ((_lhsIoptions) :: Options) -> {-# LINE 67 "src-ag/PrintErrorMessages.ag" #-} verbose _lhsIoptions- {-# LINE 1652 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 1652 "src-generated/PrintErrorMessages.hs" #-} {-# INLINE rule113 #-} {-# LINE 74 "src-ag/PrintErrorMessages.ag" #-} rule113 = \ (_ :: ()) -> {-# LINE 74 "src-ag/PrintErrorMessages.ag" #-} text ""- {-# LINE 1658 "src-generated/PrintErrorMessages.hs"#-}+ {-# LINE 1658 "src-generated/PrintErrorMessages.hs" #-}
src-generated/VisagePatterns.hs view
@@ -1,6 +1,6 @@ --- UUAGC 0.9.53 (src-ag/VisagePatterns.ag)+-- UUAGC 0.9.56 (src-ag/VisagePatterns.ag) module VisagePatterns where {-# LINE 2 "src-ag/VisagePatterns.ag" #-}
src-generated/VisageSyntax.hs view
@@ -1,6 +1,6 @@ --- UUAGC 0.9.53 (src-ag/VisageSyntax.ag)+-- UUAGC 0.9.56 (src-ag/VisageSyntax.ag) module VisageSyntax where {-# LINE 2 "src-ag/VisageSyntax.ag" #-}
uuagc.cabal view
@@ -1,7 +1,7 @@ cabal-version: >= 1.10 build-type: Custom name: uuagc-version: 0.9.55+version: 0.9.56 license: BSD3 license-file: LICENSE maintainer: Jeroen Bransen@@ -17,6 +17,7 @@ extra-source-files: README extra-source-files: uuagc_options extra-source-files: src-ag/*.ag+extra-source-files: src-ag/*.lag extra-source-files: src-ag/LOAG/*.ag -- This flag will be set by Setup.hs, use